danik159

Untitled

Jul 11th, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. public void OnThrow(PlayerEggThrowEvent e) {
  2. Player player = e.getPlayer();
  3. if (player.getInventory().getItemInMainHand().getType() == (Material.EGG)) {
  4. if (player.getInventory().getItemInMainHand().getItemMeta() != null) {
  5. if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName() != Null) {
  6. if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals("Cow Egg")) {
  7. player.getWorld().spawnEntity(e.getEgg().getLocation(), EntityType.COW);
  8. } if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals("Egg")) {
  9.  
  10. }
  11. }
  12. }
  13.  
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment