danik159

Untitled

Jul 11th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. @EventHandler
  2. public void OnThrow(PlayerEggThrowEvent e) {
  3. Player player = e.getPlayer();
  4. if(player.getItemInHand().getType().equals(Material.EGG)) {
  5. if(player.getItemInHand().getItemMeta() != 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. }
Advertisement
Add Comment
Please, Sign In to add comment