1.12.2 Ender Dragon Block Collision

Discussion in 'Spigot Plugin Development' started by SeanTMG, Apr 4, 2020.

  1. Basically,

    I need to make an Ender Dragon stay within a specific Area/Region, but there's virtually no information online about how to do this or people doing this in the past. At this point I don't care if I have to make a completely custom Dragon AI I just want to get this done. I have a kind of inside area where the dragon should spawn yet it just flies through the walls and leaves anyway (like it should, but I don't want it to). I've tried checking if the Dragon is inside a border and then teleporting it back if it's outside but it just tries to fly out in the same way again in an endless loop. Does anyone have any idea how to do this?

    Thank you!
     
  2. As far as I am aware, to make an Ender Dragon stay within a region (I assume you would want it to be as natural looking as possible) you would have to make a custom entity where the pathfinding can only stay within a defined region and if close to border redirects back towards the center. Making custom entities with custom pathfinding a whole other tutorial.

    This looks like exactly what you would need (although Ender Dragon pathfinding would take a bit more tweaking since it is large and flies):
    https://www.spigotmc.org/threads/tutorial-creating-custom-entities-with-pathfindergoals.18519/

    Hope this helps.
     
  3. This is what I thought too, but I read somewhere that custom pathfinders don't work with the Dragon.