{Easy} Help Finishing Plugin.

Discussion in 'Archived: Plugin Requests' started by KidFuras, Nov 3, 2014.

Thread Status:
Not open for further replies.
  1. Hello The plugin i want is called RandomTp it allows new players to receive a compass on their first join which when you right click shows nether particles and teleports you to a random place on the map that is inside the world border i have recently found a thread were someone started this and was wondering if you lovely people can help me finish. Here is the command i wold like /getcompass
     
  2. Online

    timtower Administrator Administrator Moderator

    KidFuras What the code does: show a message on command. Not even giving the item.
    Starting from scratch might even be faster.
     
  3. timtower Thing is i didnt write this code as i said i found it i dont know how to write code.. which is hwy i am here xD
     
  4. Online

    timtower Administrator Administrator Moderator

    KidFuras Then please remove the code as we generally don't need any of it.
     
  5. timtower ok can you work on this or?
     
  6. Online

    timtower Administrator Administrator Moderator

    I don't like the request so no.
     
    Skionz likes this.
  7. Offline

    XgXXSnipz

  8. XgXXSnipz Thank you is there an eta?, and can you make it so they only get the compass on first join permission node can be randomtp.get for getting a compass
     
  9. Offline

    XgXXSnipz

    KidFuras so they only get the compass once?
     
  10. XgXXSnipz Seems so.

    EDIT: It looks like he wants it to give it them when they do /getcompass
     
  11. Offline

    XgXXSnipz

    bwfcwalshy ah ok, and KidFuras "Help me finish" do you already have pre-existing code?
     
  12. XgXXSnipz Someone was making him one but it wasn't finished.
     
  13. Offline

    XgXXSnipz

  14. I didnt the code was eraesed becuase it was wrong but yes once when they first join
     
  15. Offline

    WizardDoesMC

    You need to learn how to use PlayerEvent which can be found here i guess http://wiki.bukkit.org/Portal:Developers

    As for the randomtp code here is it:

    int randomX = (int) (Math.random() * 1000);
    int randomZ = (int) (Math.random() * 1000);
    int randomY = player.getWorld().getHighestBlockYAt(randomX, randomZ);

    Location newLocation = new Location(player.getWorld(), randomX, randomY, randomZ);
    player.teleport(newLocation);
    player.sendMessage(ChatColor.BLUE + "You Have Been Teleported Away!");

    And for the command to get a compass:

    public boolean onCommand(CommandSender theSender, Command cmd, String commandLabel, String[] args)
    {

    Player p = (Player) theSender;

    if(commandLabel.equalsIgnoreCase("getcompass")
    {
    (Inside here copy and paste the code below)
    }
    }

    ( Don't forget to press Ctrl + A then Ctrl + i to fix the annotations )

    Inside the { copy and paste this code it in <3
    }

    p.getInventory.add(new ItemStack(Material.COMPASS, 1));


    As for the particle effect im not really sure with that since it is something else than bukkit but this is the code for you <3
     
  16. Offline

    XgXXSnipz

Thread Status:
Not open for further replies.

Share This Page