magic-sorting-system icon indicating copy to clipboard operation
magic-sorting-system copied to clipboard

Option to target frames with named items

Open omwah opened this issue 4 years ago • 2 comments

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.

omwah avatar Jun 17 '20 03:06 omwah

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!

p-hennessy avatar Aug 08 '20 08:08 p-hennessy

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

isaaclepes avatar Oct 06 '20 00:10 isaaclepes