Advertisement
Guest User

Untitled

a guest
Feb 11th, 2020
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. public class KillSpit extends JavaPlugin {
  2.     @Override
  3.     public void onLoad() {
  4.         try {
  5.             MinecraftKey key = IRegistry.ENTITY_TYPE.getKey(EntityTypes.LLAMA_SPIT);
  6.             Field aZ = EntityTypes.class.getDeclaredField("aZ");
  7.             aZ.setAccessible(true);
  8.             aZ.set(EntityTypes.LLAMA_SPIT, (EntityTypes.b) CustomSpit::new);
  9.             IRegistry.ENTITY_TYPE.a(IRegistry.ENTITY_TYPE.a(EntityTypes.LLAMA_SPIT), key, EntityTypes.LLAMA_SPIT);
  10.             getLogger().warning("REPLACED LLAMA SPIT!");
  11.         } catch (IllegalAccessException | NoSuchFieldException e) {
  12.             getLogger().severe("COULD NOT REPLACE LLAMA SPIT!");
  13.             e.printStackTrace();
  14.         }
  15.     }
  16.  
  17.     public static class CustomSpit extends EntityLlamaSpit {
  18.         public CustomSpit(EntityTypes<? extends EntityLlamaSpit> entitytypes, World world) {
  19.             super(entitytypes, world);
  20.         }
  21.  
  22.         public CustomSpit(World world, EntityLlama entityllama) {
  23.             super(world, entityllama);
  24.         }
  25.  
  26.         @Override
  27.         public void tick() {
  28.             die();
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement