PlayerDropItemEvent Help

Discussion in 'Plugin Development' started by shadow5353, May 15, 2014.

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

    shadow5353

    Hello,

    I have tried several ways to try make it possible that players can't drop a specify item with a custom name.

    Thanks for reading :D
     
  2. Offline

    rfsantos1996

    @on PlayerDropItem

    if item.getMeta().hasDisplayName() && displayname.equals ignore case (<your display name>) && item.getType() == <your material>

    I recommend you using lore, lore isn't editable by players
     
  3. Offline

    AoH_Ruthless

    rfsantos1996
    Metadata is better if you don't need it to be visible to players and you want an easy time.
     
  4. Offline

    rfsantos1996

    I don't know how to use Metadata, do you have a nice/simple tutorial? I never needed it
     
  5. Offline

    AoH_Ruthless

    rfsantos1996
    I'm sorry, I shouldn't have even said that. MetaData is used for players and other entities mostly, which is what I thought the OP wanted. But, items do not have the metadata values like players do. My apologies.

    Metadata is actually quite effective though:
    Not quite a tutorial but: https://forums.bukkit.org/threads/how-to-use-player-setmetadata.141105/
    Pretty old but: https://forums.bukkit.org/threads/metadata-q-a-i-wrote-the-metadata-api-ama.68447/
    I personally don't like the plugin tutorial on MetaData, but here you go: http://wiki.bukkit.org/Plugin_Tutorial#Why_to_use_Metadata
     
  6. Offline

    rfsantos1996

    Thanks, I wanted to know that... Still, very few tutorials, isn't it? Just wikipedia's and 1-2 from developers... :confused:

    Well, thank you (;

    For OP I think the best way would to with lore editing anyway...
     
Thread Status:
Not open for further replies.

Share This Page