Dragons Don't Destroy Blocks

Discussion in 'Archived: Plugin Requests' started by codename_B, Sep 3, 2012.

  1. Offline

    codename_B

    Rather, they simply can't pass through.

    I know notch was too lazy to do this, but after seeing that you can make fireballs destroy blocks in the same way dragons do (yay meteors) I figured it might be fun to have a way for dragons to NOT horrifically ruin your terrain.

    If no-one does this, I'll do it myself eventually, I'm just a little busy atm :3
     
  2. Offline

    WarmakerT

    Too busy to make a 10 lines plugin(or less)?
     
  3. Offline

    RingOfStorms

    Wait.. did codename_B just ask for someone else to make a simple plugin for him O_O... something is going on here!
     
  4. Offline

    Njol

    I challenge you to do this "easy" plugin with 10 lines =P
     
  5. Offline

    RingOfStorms

    Ok let me do this in a few minutes

    Code:
    public class main extends JavaPlugin implements Listener{
    @Override
    public void onEnable() {
    getServer().getPluginManager().registerEvents(this, this);
    }
    @EventHandler
    public void dr (EntityExplodeEvent e) {
    if(e.getEntity() instanceof EnderDragon) {
    e.setCancelled(true);
    }}}
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  6. Offline

    Reptar_

    You can do this with Skript in under 4 lines.
     
  7. Offline

    Njol

    But the dragon still flies through the blocks ;)
     
    DrAgonmoray likes this.
  8. Offline

    RingOfStorms

    Eh well I'm working on homework right now ;P so I can't multitask that much brain power to this lawl. Maybe later if no one else does it.
     
  9. Offline

    CTRL

    WorldGuard flags?
     
  10. Offline

    RingOfStorms

    wut? O_O
     
  11. I'll try to do this!!! I should have it done sometime tomorrow when I am back from school!
     
  12. Offline

    CTRL

    /rg flag <region> enderdragon-block-damage deny
     
  13. Offline

    turqmelon

     
  14. Offline

    WarmakerT

    If a dragon runs through a block, cancel the event and move him to the opposite position.
     
  15. Offline

    RingOfStorms

    I still plan on doing this in 10 lines, I'm still working on homework (I took about a 4 hours break cleaning the house x.x) so I'll get to it sooner or later.
     
  16. Offline

    codename_B

    I was thinking more of rewriting the move method of the dragon to give them the ability to "nest" on blocks.
    See the tutorial on overriding mob behaviour.
     
  17. Offline

    bobacadodl

    Well, you can't exactly do that in 10 lines, can you?
     
  18. Offline

    codename_B

    No, I never said do it in 10 lines. I just said do it.
     
  19. Offline

    RingOfStorms

    Njol challenged use to do it in ten lines that's all.
     
  20. Offline

    bobacadodl

    Oops :p
     
  21. Offline

    the_merciless

    Without an entityMoveEvent this has got to be alot harder that it sounds.
    I remeber a plugin in which you could ride a dragon to a set location, maybe its worth looking that up and checking out the code. Im sure the dragon would avoid mountains and stuff in the way.

    EDIT: here it is http://dev.bukkit.org/server-mods/dragontravel/

    Since the player is riding the dragon maybe they used the player move event. im just guessing
     
  22. Offline

    RingOfStorms

    Read their plugin, those are pre-defined paths set by the users.
     
  23. Offline

    -_Husky_-

    Last edited by a moderator: May 28, 2016
  24. Offline

    np98765

    Awww. :( You need to give this amateur codename_b some help, and you failed!

    Seems like this is harder than everyone thought. ;)
     
  25. Offline

    -_Husky_-

    Theres no entitymoveevent, so i had to work off playermoveevent, then check if there was a dragon nearby the player, then if its location was null, if it was teleport it to the players y coord. Seemed to turn out all the cows went flying when an enderdragon came near!
     
    np98765 likes this.
  26. Offline

    np98765

    Dragons like to eat cows. Cows don't like dragons. Cows flee when dragons come near.
     
    MrBluebear3 and -_Husky_- like this.
  27. Offline

    RingOfStorms

    Well I guess I'll go at this again before I start today's homework ^^ darn school...
     
  28. Offline

    WarmakerT

    Code:
    getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    public void Run(){
    for(World world : getServer().getWorlds()){
    for(Entity entity : world.getEntities()){
    if(entity.getType().equals(EntityType.EnderDragon){
    if(entity.getBlock().getType().equals(Material.AIR) == false){
    event.setCancelled(true);
    }
    }
    }
    }
    }
    }, 0L, 1L)
     
  29. Offline

    -_Husky_-

    that was my original idea.

    Download : https://dl.dropbox.com/u/51143191/Dragon.jar

    Source : https://github.com/Husky--/DragonBlock

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  30. Offline

    RingOfStorms

Share This Page