Custom Player Drops (Custom Items)

Discussion in 'Archived: Plugin Requests' started by Brady_, May 4, 2013.

  1. Offline

    Brady_

    Looking for a plugin that will drop a ghast tear on player death (by another player), but with a custom name depending on the player who died. So for example-

    Player Bob kills Player Sally
    Player Sally drops a ghast tear but it is named "Sally's Tears".

    Is this a possibility?
     
  2. Offline

    Mig_B

    Yes, it is possible. Let me look into the JavaDocs for something like that.


    EDIT: Found it, the PlayerDropItemEvent should do the trick, and do you want him to drop all of his inventory with it?
     
  3. Offline

    Zarius

    OtherDrops should be able to do this, example (goes at the bottom of the otherdrops-drops.yml file):

    PHP:
      PLAYER:
        - 
    drop"GHAST_TEAR~%p's Tears"
    (note: this will drop the players normal inventory and an additional item, being the ghast tear)
     
  4. Offline

    Brady_

    Thanks! Not working though, sadly. Console tells me "Error: unknown material (ghasttear~pstears)."

    This is what's in my otherdrops-drops.yml-
    PHP:
      PLAYER:
        - 
    drop"GHAST_TEAR~%p's Tears"
          
    quantity1
          chance
    100
    Any idea what could be wrong?
     
  5. Offline

    Zarius

    Brady_ - ah, sorry - depends on the version you're using, that should work in the latest beta but try "GHAST_TEAR@!~%p's Tears" instead.
     
  6. Offline

    Brady_

    So close! It drops a ghast tear with the name of the attacking player, not the victem. I tried changing the "p" to a "v" but when I did that is just says "'s tears" now, with no name.
     
  7. Offline

    Zarius

    Ah sorry, yes, should be %v (for victim) - I'll test this personally tonight.
     
  8. Offline

    Brady_

    Yeah, I tired the v but the tear's don't end up getting named with the player's name. I set the debug messages to extreme and here's what I got. Highlighted the part I think might(?) be relevant-
    [​IMG]

    (Edited out the name of the person who helped me test, just in case he doesn't want his mc name out there.)
     
  9. Offline

    Brady_

    So, OtherDrops isn't working for this.

    Does anyone else know of a way I can do this? Preferably in a stand-alone plugin, as I don't need all the listeners that OtherDrops comes with.
     
  10. Offline

    Zarius

    Sorry, was rather busy then forgot about your request. It should work fine, will try it out tonight.

    In regards to the listeners, none of them are actually registered (ie. that code doesn't run) unless you use them in the config.

    Found the issue - I hadn't actually enabled victim names with item displayname variables. Fixed this is the latest dev build (#80, link to CI on BukkitDev page here). Tested with:

    PHP:
      PLAYER:
      - 
    drop"GHAST_TEAR~%v's Tears"
    And works now. (Note: OtherDrops version should be 2.8b.536)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016

Share This Page