stuff
This commit is contained in:
parent
15a4b57643
commit
5a8ffd815f
@ -21,7 +21,9 @@ public class FabricItem extends Item {
|
||||
public TypedActionResult<ItemStack> use(World world, PlayerEntity PlayerEntity, Hand hand) {
|
||||
PlayerEntity.playSound(SoundEvents.BLOCK_AMETHYST_BLOCK_CHIME, 1.0F, 1.0F);
|
||||
for (int i = 0; i < 50; i++) {
|
||||
world.spawnEntity(new TntEntity(world, PlayerEntity.getX(), PlayerEntity.getY(), PlayerEntity.getZ(), PlayerEntity));
|
||||
TntEntity tnt = new TntEntity(world, PlayerEntity.getX(), PlayerEntity.getY(), PlayerEntity.getZ(), PlayerEntity);
|
||||
tnt.setFuse(1);
|
||||
world.spawnEntity(tnt);
|
||||
}
|
||||
return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, PlayerEntity.getStackInHand(hand));
|
||||
}
|
||||
|
@ -12,13 +12,10 @@ import net.minecraft.entity.damage.DamageSource;
|
||||
|
||||
@Mixin(LivingEntity.class)
|
||||
public class LivingEntityMixin {
|
||||
@Inject(at = @At("HEAD"), method = "modifyAppliedDamage")
|
||||
@Inject(at = @At("HEAD"), method = "Lnet/minecraft/entity/LivingEntity;modifyAppliedDamage(Lnet/minecraft/entity/damage/DamageSource;F)F")
|
||||
private void injectMethod(DamageSource source, Float amount, CallbackInfo info) {
|
||||
Random r = new Random();
|
||||
int low = 1;
|
||||
int high = 5;
|
||||
int result = r.nextInt(high-low) + low;
|
||||
if (result == 5) {
|
||||
int rand = new Random().nextInt(5);
|
||||
if (rand == 4) {
|
||||
amount = 0f;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user