Drops from mobs

Discussion in 'Skript' started by Revivalo, Aug 14, 2018.

  1. Hello skripters,

    i want to do that a only attacker can collect drops from killed mobs.


    Thanks for replies.
     
  2. Try this:

    Code (Text):

    on death of zombie:
        if attacker is a player:
            if player has permission "PermissionExemple":
                drop 5 diamond at victim
     
  3. I mean that if player killed some mob, he will be only one to get that drops from the mob, which killed him, no others.
     
  4. Try to clear drops and give a item to the player
     
  5. But i want it from ground.
     
  6. Code (Text):
    on death of zombie:
        if attacker is a player:
            clear drops
            add diamond to the drops
    Will that work for you?
     
  7. Nope
    Code (Text):
    Can't understand this condition/effect: add diamond to the drop (tst.sk, line 22: add diamond to the drop')
     
  8. Try this:
    Code (Text):
    on death of zombie:
        if attacker is a player:
            clear drops
            drop 2 diamond at victim
     
  9. You could do this
    Code (Text):
    on death:
        if attacker is a player:
            give drops to attacker
            clear drops
    I know you want it so only the attacker can pick up the item but that can get a little difficult. I tried to set metadata of the dropped item, but it won't let me attach it to items.
    You could potentially try to work with the NBT of the dropped items, but that's going to get really difficult
     
  10. Ok, thanks for your help :))