Solved Fill Portal with delay

Discussion in 'Plugin Development' started by Serilum, Dec 24, 2012.

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

    Serilum

    Hello, so in my server players seem to have issues with "blocked" netherportals. Other players have patched up the other end so players can't get out since they are ´warping´. But because minecraft has made it so that you have to leave the portal first before warping again you are stuck. You cannot write any commands and you cannot break blocks.

    Now what I've come up with is this:

    Code:JAVA
    1. @EventHandler
    2. public void onNetherBlock (PlayerInteractEvent event) {
    3. if(event.getClickedBlock().getType() == Material.PORTAL && event.getAction()==Action.LEFT_CLICK_BLOCK) {
    4. event.getClickedBlock().breakNaturally();
    5. return;
    6. }
    7. }


    Which obviously destroys the portal when clicked on. Now what my idea was, was that the portal came back with a delay. I'm not sure if this is possible, but it would be something like getting the location of the block and creating 6 "portal blocks" above that.

    Does anyone have an idea on how to do this?
    Appreciate the responses!
     
  2. Offline

    fireblast709

    Get the first obsidian block below the portal block (so looping, which would cost you at most 3 times a getRelative() call). Then just create fire there?
     
  3. Offline

    Serilum

    Ofcourse, thank you!
     
Thread Status:
Not open for further replies.

Share This Page