How to give item?

Discussion in 'Plugin Development' started by JifiGamingYT, Oct 18, 2015.

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

    JifiGamingYT

    Already did debug messages

    Explain it. I have. I want to give an item to the player that heads was clicked on.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  2. Offline

    Scimiguy

    @JifiGamingYT
    You can use the edit button to extend your posts, please don't double post.

    If you have done debugging, then tell us what your results were

    Does the code even get to your switch statement at all?

    Also, put an amount in your ItemStacks
    new ItemStack(item, amount);
     
  3. Offline

    JifiGamingYT

    Before this line:
    Code:
    Player lol = Bukkit.getServer().getPlayer(((SkullMeta) item.getItemMeta()).getOwner());
    YES
    After this line:
    Code:
    Player lol = Bukkit.getServer().getPlayer(((SkullMeta) item.getItemMeta()).getOwner());
    NO
     
  4. Offline

    Scimiguy

    @JifiGamingYT
    So if you put System.out.println(lol.getName()); after that line, what comes up?
     
  5. Offline

    JifiGamingYT

    nothing.
     
  6. Offline

    Scimiguy

    @JifiGamingYT
    So what is your random right before that line then?
     
  7. @JifiGamingYT I'm not spoonfeeding at all but this is what you need to do.

    Check the item clicked
    If the item is a head get the player
    Make a random or something and pick an item
    Send them that item.

    It's a very simple plugin, if you have any issues please tahg me with your code, what isn't working and errors if you have any.
     
  8. Offline

    JifiGamingYT

    I know what do i do, i just don't know how to do it.
     
  9. @JifiGamingYT I just told you how. And as I said, I won't spoonfeed.

     
  10. Offline

    Scimiguy

    @JifiGamingYT
    If you're unwilling to try it yourself and learn, you could always make a plugin request and see if someone will do it for you
     
  11. Offline

    DoggyCode™

    If you really don't know how to do it:
    Use isSimilar() to compare ItemStacks.
    I see you have already worked with Random and cases
    Send item with Player#.getInventory().addItem(ItemStack#);
     
  12. Offline

    mcdorli

    Read my signature.
     
  13. Offline

    JifiGamingYT

    Nobody gives me help when i need it ;-;
     
  14. Offline

    Scimiguy

    @JifiGamingYT
    Mostly because you seem to brush off any help we give
     
  15. @JifiGamingYT
    It's because you don't know how to do the simplest of things in java. I think 99% of the people here want you to go deeper into java, because you got a clear awnser from @bwfcwalshy but you lack the knowledge of java to understand it.
     
  16. Offline

    JifiGamingYT

    The plugin development form has people that know what to do, but just don't know what code to write. If you just say do this, we know to do that, we just don't know how. I don't know how you can get an actual answer without spoonfeeding. We need help, and you guys don't give it.
     
  17. @JifiGamingYT
    The problem with spoonfeeding is that OP doesn't learn anything. People often give snippets of code to help people out, but spoonfeeding is just giving a whole sack of code that does everything for them without them knowing what it does. IMO the bukkit forums should be more of a forum that actually helps with actual Bukkit API stuff like how to do certain bukkit-related stuff instead of asking simplish java questions. You recieved dozens of clear explanations of what you have to do but you just don't want to listen. And even if you do, you have no idea how to do it, which proves that you lack java knowledge.
     
  18. Offline

    JifiGamingYT

    not even snippets of code. Why don't you give at least pseudo code?
     
  19. @JifiGamingYT
    And if that's not what you want, could you explain again?
     
  20. Offline

    JifiGamingYT

    ... I already know i need to do that, i just don't know how...
     
  21. Offline

    Scimiguy

    @JifiGamingYT
    Re read through the posts people have already made then

    This has already been explained to you

    Like mega said,if you are having trouble, pick one of those parts that isnt working, show us your code, and we will help you fix it from there
    We arent going to write your code for you
     
Thread Status:
Not open for further replies.

Share This Page