1.14.4 Prevent from an active conduit to give its effects

Discussion in 'Spigot Plugin Development' started by 1Mangomaster1, Mar 19, 2020.

  1. I'd like to make it so only certain players will get certain effects in a specific area, I can just give them these effects easily, but the one effect I wanted was the conduit effect. I can easily just give them the effect but I only want players with specific... permission to receive this effect. I know how to do that, but my problem is, that I also want to have an active conduit ONLY as an addition to the look of the build. If this conduit is there, it means EVERYONE will get conduit power from it which is something I do not want. My question is:

    How can you make it so conduit will NOT give its effects to anybody, but also remain active?

    I appreciate all the comments :D
     
  2. Using the EntityPotionEffectEvent event you can cancel it and also figure out that a conduit gave it using getCause(). Is that what you were looking for?
     
    • Agree Agree x 1

  3. That would be awesome, thanks!
    just one thing, can I detect which specific conduit that was? If I want only 1 conduit to act as an accessory and if somebody on survival actually manages to make a conduit it showed word for them properly.
     
  4. Doesn't look like you can sadly, but good thing Conduits are tile entities, which means you don't have to look through every block (which would be terrible for performance). You should be able use getTileEntities() on the nearby chunks and filter for conduits.
     
  5. Ok, thank you very much :) I'll try that
     
    • Friendly Friendly x 1