Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. public void createPet(Player p, EntityType pets) {
  2.  
  3. Entity pet = p.getWorld().spawnEntity(getPetLoc(p), pets);
  4.  
  5. if(pet instanceof Animals){
  6.  
  7. ((Animals) pet).setBaby();
  8. ((Animals) pet).setAI(false);
  9. ((Animals) pet).setCanPickupItems(false);
  10. ((Animals) pet).setCollidable(false);
  11. pet.setSilent(true);
  12.  
  13. }
  14.  
  15. if(pet instanceof Monster){
  16.  
  17. ((Ageable) pet).setBaby();
  18. ((Monster) pet).setAI(false);
  19. ((Monster) pet).setCanPickupItems(false);
  20. ((Monster) pet).setCollidable(false);
  21. pet.setSilent(true);
  22.  
  23. }
  24.  
  25. if(pet instanceof ArmorStand){
  26.  
  27. ((ArmorStand) pet).setArms(false);
  28. ((ArmorStand) pet).setBasePlate(false);
  29. ((ArmorStand) pet).setSmall(true);
  30. ((ArmorStand) pet).setCanPickupItems(false);
  31. ((ArmorStand) pet).setCollidable(false);
  32. ((ArmorStand) pet).setVisible(true);
  33.  
  34. }
  35.  
  36. pet.setInvulnerable(true);
  37. pet.setGravity(false);
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement