Solved Getting the player who caused a creeper to explode

Discussion in 'Spigot Plugin Development' started by nokoa, Jun 11, 2016.

  1. Hi there,

    I am trying to prevent creepers from exploding if they are next to players who are spectators (not the gamemode).
    So I basically need to get the player who caused the creeper to explode, I know I can probably do it by getting the closest player to the creeper, but I was wondering if there was some other more efficient method to do that.
     
  2. Creepers do not explode to players in spectate gamemode. If you are trying to prevent a creeper from triggering on players not in spectate mode you need to look into EntityTargetEvent. Cancelling this event will prevent creepers from even fusing up. ;)
     
    • Agree Agree x 1
  3. Thank you very much that works!