jhuckaby / magic-sorting-system

A data pack for Minecraft 1.13, 1.14 and 1.15 (Java) for automatically sorting every item in the game.
39 stars 15 forks source link

Request: disable a frame #26

Open Galaxarum opened 4 years ago

Galaxarum commented 4 years ago

Can you add a way to disable a frame, ie place it horizontal or rotate the item inside?

jhuckaby commented 4 years ago

Great idea, thanks! I'll see if this is possible, when I do the update for 1.16.

captncraig commented 4 years ago

Another possibility might be to disable if a frame has a named item. Not sure if the nbt selector gives enough info to allow that?

Then I could have a row of chests with the input hoppers / frames up top, but still have frames in the user-facing area to show what is inside. I could just name the items I put on the user-facing side to indicate what is inside the chests.

isaaclepes commented 3 years ago

Checking the rotation would require nbt checks, which are a source of lag. Do a less-often check for the rotation and set a tag, then check for the tag in subsequent commands. I modified it to tag frames when a specially named item is inserted. This function uses tag:! to not re-run on frames that are already tagged. I needed multiple tags for my purposes, so if the targetshulker function is fired it will remove other tags and add the correct tag.

example: 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

targetshulker.mchfunction: tag @s add sss_shulker_target tag @s remove sss_sort_target tag @s remove sss_smelt_target tag @s remove sss_smoker_target tag @s remove sss_furnace_target tag @s remove sss_smelt_fuel tag @s remove sss_smoker_fuel tag @s remove sss_furnace_fuel