diff --git a/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/entity/AxolotlController.java b/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/entity/AxolotlController.java index e55db0d71..0e1765c71 100644 --- a/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/entity/AxolotlController.java +++ b/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/entity/AxolotlController.java @@ -17,6 +17,8 @@ import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; @@ -24,8 +26,11 @@ import net.minecraft.world.entity.ai.navigation.GroundPathNavigation; import net.minecraft.world.entity.ai.navigation.PathNavigation; import net.minecraft.world.entity.animal.axolotl.Axolotl; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.vehicle.AbstractMinecart; import net.minecraft.world.entity.vehicle.Boat; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; @@ -163,6 +168,17 @@ public boolean isLeashed() { return false; // shouldLeash } + @Override + public InteractionResult mobInteract(Player entityhuman, InteractionHand enumhand) { + if (npc == null || !npc.isProtected()) + return super.mobInteract(entityhuman, enumhand); + ItemStack itemstack = entityhuman.getItemInHand(enumhand); + if (itemstack.getItem() == Items.BUCKET) { + return InteractionResult.FAIL; + } + return super.mobInteract(entityhuman, enumhand); + } + @Override public boolean onClimbable() { if (npc == null || !npc.isFlyable()) {