This forces me into using a specific item though. I actually want it to be an emerald. But I can't just have every emerald dropped become lightning bolts obviously. It has to be a specific emerald that you buy from a custom villager trade.
Pretty sure you can. If I do that same give command and change the uuids it will give me two separate dirts that don't stack on each other. I'm not sure what I'm doin wrong.
I don't think you can use uuids with dropped items.
You'll need to specify the tag-types for UUIDLeast/Most, which is type 'long'. As well, the dataTags do not start within the "tag" tag like the /give and /clear commands do; it starts within the root of the entity. You'll have to follow the NBT data for item entities, in which their item data is stored within the "Item" compound. Fixed command:
Right now, I have two commands running on a clock.
scoreboard players add @e[type=Item] lightningItem 1 {AttributeModifiers:[{UUIDLeast:110,UUIDMost:110}]}
execute @e[score_lightningItem_min=20] ~ ~ ~ summon LightningBolt ~ ~ ~
So after a second has passed, an item that has the UUID of 110 should summon a bolt of lightning and be destroyed.
However, when I use the command /give @p dirt 1 0 {AttributeModifiers:[{UUIDLeast:110,UUIDMost:110}]} and drop that item, no lightning.
This forces me into using a specific item though. I actually want it to be an emerald. But I can't just have every emerald dropped become lightning bolts obviously. It has to be a specific emerald that you buy from a custom villager trade.
You'll need to specify the tag-types for UUIDLeast/Most, which is type 'long'. As well, the dataTags do not start within the "tag" tag like the /give and /clear commands do; it starts within the root of the entity. You'll have to follow the NBT data for item entities, in which their item data is stored within the "Item" compound. Fixed command:
As a side-note: abir, can you use 'code' bbcode instead of 'pre'? For some reason, 'pre' breaks quotation capabilities.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/