Advertisement
Guest User

Untitled

a guest
Jul 21st, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. public class PlayerEggDamage extends LivingEntityDamage {
  2.  
  3. public PlayerEggDamage(FileConfiguration fileConfiguration) {
  4. super(fileConfiguration);
  5. }
  6.  
  7. @Nonnull
  8. @Override
  9. public String getIconName() {
  10. return "player-egg-damage";
  11. }
  12.  
  13. @Nonnull
  14. @Override
  15. public String getCauseName() {
  16. return "Egg Damage";
  17. }
  18.  
  19. @Override
  20. public boolean isApplicable(EntityDamageByEntityEvent event) {
  21. Entity initialEntity = event.getDamager();
  22. Pair<Entity, Entity> attackerVictim = Events.getFightingEntities(event);
  23. Entity attacker = attackerVictim.getKey();
  24. return attacker != null && attacker instanceof Player && initialEntity instanceof Egg;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement