Help with TNT Run plugin.

Discussion in 'Plugin Development' started by Pr07o7yp3, Sep 26, 2013.

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

    Pr07o7yp3

    Hi there,
    I'm writing TNT Run plugin.
    We already made an arena and I'm almost done with the plugin but I have a little problem.

    I decided to make a short video to explain the problem. Please check it and if you can and want help me. :) Ty.


    BTW, my code:
    Code:java
    1. final Block downBlock = event.getTo().getBlock().getRelative(BlockFace.DOWN);
    2. if (downBlock.getType() == Material.SAND || downBlock.getType() == Material.GRAVEL)
    3. {
    4. getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
    5. @Override
    6. public void run() {
    7. if (downBlock.getType() != Material.AIR)
    8. {
    9. World tntWorld = getServer().getWorld(TNTRun_World);
    10. Block blockTNT = tntWorld.getBlockAt(downBlock.getX(), downBlock.getY() - 1, downBlock.getZ());
    11. tntWorld.playEffect(blockTNT.getLocation(), Effect.SMOKE, 4);
    12. downBlock.setType(Material.AIR);
    13. blockTNT.setType(Material.AIR);
    14. }
    15. }
    16. }, 10L);
    17. }
     
  2. Offline

    ZeusAllMighty11 Retired Staff

    You should do a proximity check, so when the player jumps from a specific height, and lands, the nearest affected blocks according to the player's exact location (to the hundredths of the double), and compare to nearest block.
     
  3. Offline

    amhokies

    Could you do the same thing without jumping down a level? Like, just getting really lucky and stopping on the edge a block so that it doesn't fall?
     
  4. Offline

    Pr07o7yp3

    Can you help me with any code? I know what I have to do but my math is bad. :s
     
  5. Offline

    amhokies

    I think personally, what I would do would be to start removing blocks around the player if they stand still for a certain period of time.
     
  6. Offline

    Pr07o7yp3

    I think I fixed it. :)
     
  7. Offline

    oasis9

    Sorry about the necropost, but could you post your solution code? I'm stuck on this.
     
  8. Offline

    Forge_User_45064837 Retired Staff

  9. Offline

    oasis9

    bwfcwalshy Thanks! Pr07o7yp3 Could you please post your solution? I think I'm almost there but I'd like to see what you did out of curiosity. Thanks in advance!
     
  10. Offline

    Anrza

    I don't have the actual solution, but I'd personally use some kind of anti-camp, so if they haven't moved significantly far for a few seconds, it sets a random velocity to them.
     
  11. Offline

    Pr07o7yp3

    I just check while player is staying afk on a place, then i remove some blocks around him. :)
     
Thread Status:
Not open for further replies.

Share This Page