Need Event when Enderdragon spawns

Discussion in 'Plugin Development' started by Erumeldor, Apr 26, 2017.

Thread Status:
Not open for further replies.
  1. Hi guys,

    I'm just working on some stuff handling the spawning of the enderdragon.

    My problem is the following:
    I want to prevent the Enderdragon vom spawning with the crystals. So I need the event, which triggers the whole regeneration stuff etc., and of course the enderdragon spawning.

    When I just get and cancel the "EntitySpawnEvent", everything will be done except for the spawning itself. Even the boss-bar is there. That's not what I want to do.

    Do you understand my question?
    I hope anyone has an idea :)

    PS: if you want to see anything (Code, whatever), just let me know.

    Thanks!
     
  2. Offline

    Horsey

    Maybe kill the dragon instead of cancelling the spawn event?
     
  3. That's not the point.
    The problem is, that since 1.9(?) when you place the 4 crystals the regeneration of the obsidian towers, the light effect, and at the end the enderdragon appears.

    I want to stop the whole thing for defined times (like a delay after the old dragon dies).

    Is there really no event for that? I searched the whole JavaDoc from Bukkit for that event, and couldn't find something..
    Did I just missed something?
     
  4. Offline

    Horsey

    You would have to use the PlayerInteractEvent and then check whether the player is placing the endcrystal on the return portal.
     
  5. @Horsey
    Yeah, that will be the solution if there is no other possibility.

    I will check if there is any other event for that. If anyone has an idea left, please tell me :)
     
  6. Offline

    Horsey

    I think it would be pretty simple with the player interact event, you would just need to check the height of the bedrock, to make sure it's not on 0 or whatever the height of the nether ceiling is, then you know they are placing it on the return portal
     
Thread Status:
Not open for further replies.

Share This Page