Possible to... Mobs from spawners won't drop xp?

Discussion in 'Plugin Development' started by JabberJay, May 2, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    Hi, I made a plugin for my server to change how much xp mobs drop, but to prevent people from using xp grinders, is there a way to prevent mobs which were spawned from spawners to not drop xp? Thanks in advance, this is a big problem of mine considering that my server uses xp as its currency, thanks.
  2. Offline


    Use ExpirenceDropEvent
  3. Offline


    BajanAmerican Can you link me to the event? I can't seem to find it in the bukkit api docs, thanks.

    Or if anyone has any ideas I would greatly appreciate it :3

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 1, 2016
  4. Offline


    I've seen someone asking this before, they did it this way:

    Listen to CreatureSpawnEvent, then if it's equal to SpawnReason.SPAWNER (link)
    Make a List/Array with the monster UUID, then listen to monster kill event.
    If the killed mob his UUID is on the List/Array set .setDroppedExp to 0.
  5. Offline


    Alternatively, you could use entity metadata. That way you wouldn't have to keep a list anywhere and could simply check each mob for your metadata. Assign it when they spawn and check it when they die.
Thread Status:
Not open for further replies.

Share This Page