@EventHandler public void EntityShootBow(EntityShootBowEvent e) { ItemStack bow = e.getBow(); // Player p = (Player)e.getEntityType(); // Player p = (Player) e.getEntity(); Player p = (Player) ((Projectile) e).getShooter(); User u = UserManager.getUser(p); if (!(e.getEntity() instanceof Player)) { return; } u.addStrzaly(1); u.save(); if (bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK)) { if (bow.containsEnchantment(Enchantment.DURABILITY)) { bow.removeEnchantment(Enchantment.DURABILITY); } if (bow.getDurability() < 339) { bow.setDurability((short)338); } } }