Parkour Plugin

Discussion in 'Plugin Development' started by SmokedPotatoMC, May 21, 2015.

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

    SmokedPotatoMC

    I was wondering if anyone would know how to make a plugin that allows players to warp to the start of a checkpoint using a slime ball, and how to make walking over certain areas make a new checkpoint. Just a brief idea on how I could do this. Thank you.
     
  2. Offline

    GeekWithAChick

    I think it would be the easiest to place pressureplates as checkpoints.
     
  3. Offline

    Jomens235

    @SmokedPotatoMC PlayerMoveEvent to check if they step onto a certain type of block and set it as their checkpoint (HashMap probably), as for the slime ball PlayerInteractEvent to see if they right click a slime ball then tp them wherever
     
  4. Online

    timtower Administrator Administrator Moderator

    Moved to plugin development.
     
  5. Offline

    Corndogoz

    uh, you could have it when you are at certain coords that are maby set in the config
     
  6. Offline

    SmokedPotatoMC

    Sounds complicated. What would be one actual line of code I could use?
     
  7. Offline

    Zombie_Striker

    @SmokedPotatoMC
    • Create a method that uses PlayerInteractEvent
    • If the ItemInHand.getType() is equal to SlimeBall or SlimeBlock
    • Create an int x, int y, and int z that are the location of the start of parkore
    • player#teleport(x,y,z)//the one acutal line of code
    If you meant to do this in one line of code, then you can't do it.
     
    Last edited: May 24, 2015
  8. Offline

    Jomens235

    @SmokedPotatoMC
    Code:
    @EventHandler
    public void onInteract(PlayerInteractEvent event) {
    Player player = (Player) event.getPlayer();
    if (player.getItemInHand().equals(Material.SLIME_BALL) && event.getAction().equals(Action.RIGHT_CLICK_AIR)) {
    player.teleport(getConfig().getInt("plugin.x"));
    player.teleport(getConfig().getInt("plugin.y"));
    player.teleport(getConfig().getInt("plugin.z"));
    }
    }
    And of course have a command or something to set the location. It *should* work but I haven't tried it or anything. I also don't know if getting the location from a config would be the best, but, whatever
     
Thread Status:
Not open for further replies.

Share This Page