Solved Drop item with custom nbt

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

IsaacGamerMC

New Member
Aug 31, 2020
6
0
1
24
The dropped item's lore works, but the NBT didn't work, can someone tell me how to fix it?


Script:
on death:
victim is wither
chance of 100%:
drop diamond helmet named "&6Death's Helmet" with lore "&6&lLEGENDARY HELMET" at event-location
add "{AttributeModifiers:[{AttributeName:""generic.armor"",Amount:5,Slot:head,Name:""generic.armor"",UUID:[I;-12213,29947,174646,-59894]},{AttributeName:""generic.armor_toughness"",Amount:2,Slot:head,Name:""generic.armor_toughness"",UUID:[I;-12213,30047,174646,-60094]},{AttributeName:""generic.movement_speed"",Amount:0.03,Slot:head,Name:""generic.movement_speed"",UUID:[I;-12213,30147,174646,-60294]},{AttributeName:""generic.max_health"",Amount:5,Slot:head,Name:""generic.max_health"",UUID:[I;-12213,30247,174646,-60494]},Enchantments:[{id:emoji_stuck_out_tongue:rotection,lvl:10}],HideFlags:3}" to nbt of last spawned entity
 
maybe smt like

Code:
on death:
  victim is wither
  chance of 100%:
    set {_helmet} to diamond helmet named "&6Death's Helmet" with lore "&6&lLEGENDARY HELMET"
    add "{AttributeModifiers:[{AttributeName:""generic.armor"",Amount:5,Slot:head,Name:""generic.armor"",UUID:[I;-12213,29947,174646,-59894]},{AttributeName:""generic.armor_toughness"",Amount:2,Slot:head,Name:""generic.armor_toughness"",UUID:[I;-12213,30047,174646,-60094]},{AttributeName:""generic.movement_speed"",Amount:0.03,Slot:head,Name:""generic.movement_speed"",UUID:[I;-12213,30147,174646,-60294]},{AttributeName:""generic.max_health"",Amount:5,Slot:head,Name:""generic.max_health"",UUID:[I;-12213,30247,174646,-60494]},Enchantments:[{id:emoji_stuck_out_tongue:rotection,lvl:10}],HideFlags:3}" to {_helmet}
    drop {_helmet} at event-location
 
the attributes still doesn't work :emoji_frowning:
[doublepost=1644066540,1644052630][/doublepost]nvm I solved it myself