WeaponMechanics / MechanicsMain

A New Age of Weapons in Minecraft.
https://www.spigotmc.org/resources/WeaponMechanics.99913/
MIT License
80 stars 27 forks source link

I Found That setCancelled Cannot Be Used When Calling the WeaponEquipEvent Event Through the API #398

Closed Kugana closed 6 months ago

Kugana commented 7 months ago

Description

Can the method e.setCancelled(Boolean) be added to WeaponEquipEvent? Because I have discovered that setting the item content in events related to WeaponShootEvent will trigger WeaponEquipEvent

Configuration

public void onequip(WeaponEquipEvent e){
  if(somthiing){
e.setCancelled(true);
return;
      }
  }

Payment (optional)

CJCrafter commented 6 months ago

You can try to implement it! Good luck!

Sorry to sound rude... but it is impossible to add. You'll notice that WeaponEquipEvent works even when a dispenser equips the item into your hand. To understand why it is impossible, try to understand how we implemented the equipment event in the first place.