Solved Need Help with this plugin i'm trying to make Pls help

Discussion in 'Plugin Development' started by Wristz, Sep 10, 2016.

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

    Wristz

    I am trying to make it to where, when a player joins the game who has the perm (guitest.use), they will recive a stick named "&cGui" (It must have colors)..

    This is where i've gotten so far.. (I'm new to java and this will be my second plugin. The first was very simple)..

    http://pastebin.com/H9LjzeSZ

    Thanks in advanced.
     
    Last edited: Sep 10, 2016
  2. Offline

    timtower Administrator Administrator Moderator

    Moved to plugin development.
    @Wristz You are trying to have methods in methods, that is impossible in Java.
    Please also use http://pastebin.com or code blocks for code instead of screenshots.
     
  3. Offline

    BeastyBoo


    You set it so when he joins the player "0" out of them item. Replace it with 1.
    And you dont need to "player" variables. Its okey with only 1 so keep either the "player" or "p2"

    And why do you put that line in after you check if he dont has the permission. You should replace it with either return; or pje.setCancelled(true);
     
  4. Offline

    Wristz

    Ok, Thanks. But it still will not let me rename the item..
     
  5. Offline

    BeastyBoo

    Maybe if you put the ItemStack outside the eventhandler and change it to public. Then simply call on it whne you want it added.

    Btw, maybe check if the player has the itemstack in their inventory from before might be clever. So they dont get many of the same items when they relog.
     
  6. Offline

    Zombie_Striker

    @Wristz
    Please post updated code. Your previous code should not have been able to compile.

    If you still have the "ItemStack(Material.STICK).displayname("&cGui")" line, then you will need to create the itemstack before adding the item.
     
  7. Offline

    Wristz

    Thank you man.
     
  8. Offline

    Zombie_Striker

    @Wristz
    If your problem has been solved, mark this thread as solved.
     
Thread Status:
Not open for further replies.

Share This Page