magic-sorting-system
magic-sorting-system copied to clipboard
Option to target frames with named items
Add option to configuration that when enabled will allow items in the item frame to be named a certain name for those frames to be target. This is a way to ensure that items are sorted only to the intended item frames. Requires naming the item in the frame, not the frame itself. I couldn't find a way to target a named item frame.
Looked into this as well; item frames don't seem to expose a name attribute on it's NBT data; not sure why, maybe its a bug in the game? Either way this method works well!
I re-wrote a lot of this datapack to create a version customized for my server. My tagger function checks for named item in frame and sets tags. I used command_block to restrict usage to operators, but the item should not matter. You can even omit the id: part. No reason you can't use the same check for a teleport command.
execute as @e[type=minecraft:item_frame,tag=!sss_shulker_target,nbt={Item:{id:"minecraft:command_block",tag:{display:{Name:'{"text":"Shulker Target"}'}}}}] run function sss:targetshulker execute as @e[type=minecraft:item_frame,tag=!sss_sort_target,nbt={Item:{id:"minecraft:command_block",tag:{display:{Name:'{"text":"Sort Target"}'}}}}] run function sss:targetsort execute as @e[type=minecraft:item_frame,tag=!sss_furnace_target,nbt={Item:{id:"minecraft:command_block",tag:{display:{Name:'{"text":"Furnace Target"}'}}}}] run function sss:targetfurnace execute as @e[type=minecraft:item_frame,tag=!sss_smelt_target,nbt={Item:{id:"minecraft:command_block",tag:{display:{Name:'{"text":"Smelt Target"}'}}}}] run function sss:targetsmelt execute as @e[type=minecraft:item_frame,tag=!sss_smoker_target,nbt={Item:{id:"minecraft:command_block",tag:{display:{Name:'{"text":"Smoker Target"}'}}}}] run function sss:targetsmoker execute as @e[type=minecraft:item_frame,tag=!sss_furnace_fuel,nbt={Item:{id:"minecraft:command_block",tag:{display:{Name:'{"text":"Furnace Fuel"}'}}}}] run function sss:targetfuelfurnace execute as @e[type=minecraft:item_frame,tag=!sss_smelt_fuel,nbt={Item:{id:"minecraft:command_block",tag:{display:{Name:'{"text":"Smelt Fuel"}'}}}}] run function sss:targetfuelsmelt execute as @e[type=minecraft:item_frame,tag=!sss_smoker_fuel,nbt={Item:{id:"minecraft:command_block",tag:{display:{Name:'{"text":"Smoker Fuel"}'}}}}] run function sss:targetfuelsmoker