Make fireball shooter immune

Discussion in 'Plugin Development' started by QuadroRTX8000, Jun 24, 2022.

  1. Offline


    In my plugin I have some weapons that shoot fireballs, and I need the shooter to be immune to their own fireballs. I've tried setting up a metadata, but it didn't work. I'm not sure if I either set it up wrong, or if it doesn't work that way(probably the former). I don't really know too much about how metadata works, so if someone could explain, as everywhere else uses some really complicated nms stuff or something, but I just need to add some metadata to a fireball.
  2. Offline


    It's pretty simple. Create a HashMap that stores the fireball UUID and a list of player UUIDs (or a single UUID). When the fireball is shot register it in the hashmap along with who should be invincible, then check for damage causes in Events and cancel if it's the fireball hitting someone who shouldn't be damaged.

Share This Page