"Unstuck"

Discussion in 'Plugin Development' started by mattrick, Oct 13, 2013.

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

    mattrick

    Here is yet another one of my simple questions. Anyway! I am making a sorta grappling hook plugin and was wondering if there was a method or short code to remove player from the inside of a block, kinda like an unstuck command, but call it after the player is teleported. I took a look at WorldEdit's code and it appears to over complicate things that I don't need.
     
  2. Offline

    Plo124

    mattrick16 Perhaps check if they are in a block, and then check the area in a 2x2 radius if there is air, and if so, teleport them there, if not, go up 1, and try again.
     
  3. Offline

    Mathias Eklund

    onCommand unstock launch player in the air.
     
  4. Offline

    mattrick


    Hmm...that will probably work :) Is there a method for that?

    I kinda wanted to do it automatically and seamlessly.
     
  5. Offline

    sgavster

    Check if the block they TP to is air
    Code:java
    1. if(/**get the TP location*/.getBlock().getType() != Material.AIR) {
    2. player.teleport(new Location(player.getWorld(), /**get the old tp location*/.getX(), /**get the old tp location*/.getY() + /**some number*/, /**get the old tp location*/.getZ());
    3. }
    4. //UNTESTED!
     
Thread Status:
Not open for further replies.

Share This Page