Kind of, you forgot the important part: the item component :pFirst one: /replaceitem entity [player] slot.inventory/slot.hotbar [slotid]
/replaceitem entity @s slot.weapon.mainhand 0 cookie 64 0 {"minecraft:item_lock":{"mode":"minecraft:keep_on_death"}}
Nice!/structure load [name of structure] xyz 180_degrees
Uh few things here as well:Third: tells a (filler) JSON message to a random person
(2 people excluded meanie, has the tag named "good_luck", a certain score which wasnt specified, undead players[?], are rotated 20°-70° south, within a radius of 10 blocks to where the command is being executed)
- It tells the json message to all players, not a random person
- It tells the name of all players with the tag 'good_luck'
- Then a space
- And then the score of two random members of the undead family (which are skeletons, zombies, phantoms, etc.) that are rotated 20° to 70° with a minimum radius of 5 blocks and a maximum radius of 10 blocks