diff --git a/src/main/java/net/Indyuce/mmoitems/listener/DisableInteractions.java b/src/main/java/net/Indyuce/mmoitems/listener/DisableInteractions.java index ae97d95f..2eb57957 100644 --- a/src/main/java/net/Indyuce/mmoitems/listener/DisableInteractions.java +++ b/src/main/java/net/Indyuce/mmoitems/listener/DisableInteractions.java @@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.enchantment.EnchantItemEvent; import org.bukkit.event.entity.EntityShootBowEvent; +import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.event.inventory.CraftItemEvent; import org.bukkit.event.inventory.FurnaceSmeltEvent; import org.bukkit.event.inventory.InventoryClickEvent; @@ -153,4 +154,16 @@ public class DisableInteractions implements Listener { } return -1; } + + @EventHandler + public void projectileLaunchCheck(ProjectileLaunchEvent event) { + if(!(event.getEntity().getShooter() instanceof Player)) + return; + + Player player = (Player) event.getEntity().getShooter(); + NBTItem item = NBTItem.get(player.getInventory().getItemInMainHand()); + + if(item.getBoolean("MMOITEMS_DISABLE_INTERACTION")) + return; + } } \ No newline at end of file