#Check inv doesnt work.

1 messages · Page 1 of 1 (latest)

rapid vault
#
execute store success score button_pressed temp run clear @s comparator[minecraft:custom_data~{Button:"AI"}] 1

execute if score button_pressed temp matches 1 run function guipack:gui/function/ai

execute store success score button_pressed temp run clear @s arrow[minecraft:custom_data~{Button:"arrowmenu"}] 1

execute if score button_pressed temp matches 1 run function guipack:gui/function/arrow

execute store success score button_pressed temp run clear @s armor_stand[minecraft:custom_data~{Button:"Reset Trap"}] 1

execute if score button_pressed temp matches 1 run function guipack:gui/function/trap

so uhh this doesnt work but when I use that in another datapack it works (where the only change is switch guipack -> trapessentials)
It gets executed though but when i have this special arrow nothing happens.

rapid vault
#

1.21.11 Java though!

rugged surge
#

What are you trying to do?

rapid vault
#

Im trying to make a chest minecart GUI

rugged surge
#

Oooh and you're trying to check if the player clicks a button?

rapid vault
#

Yes!

#

If i add a say check it runs every tick while the minecarts is open (as it should)

#

nothing wrong with the function files as 'say ai' doesnt work either

rugged surge
#

The player cursor slot doesn't (fully) work when you're in creative so you'd have to move the arrow into your inventory

rapid vault
#

I am shift clicking it

#

And it doesnt work in survival too

#

The wierdest part is that i copied everything from my other datapack where everything works (namespace is the only thing ive changed)

rugged surge
#

I'm having a bit to little context here, can you show the commands that fill the buttons into the GUI?

rapid vault
#
# fill_gui.mcfunction
data merge entity @e[type=chest_minecart,sort=nearest,limit=1] {Items:[]}

item replace entity @e[type=chest_minecart,sort=nearest,limit=1] container.11 with minecraft:comparator[custom_data={Button:"AI"}]

item replace entity @e[type=chest_minecart,sort=nearest,limit=1] container.13 with minecraft:arrow[custom_data={Button:"arrowmenu"}]

item replace entity @e[type=chest_minecart,sort=nearest,limit=1] container.15 with minecraft:armor_stand[custom_data={Button:"Reset Trap"}]
rugged surge
#

Also what do you imply with "nothing happens" does the item not get cleared at all or does the function not run

rapid vault
#

Neither

#

Doesnt get cleared and function doenst run

#

but check_inv runs soo

#
# temp_tick.mcfunction
execute at @e[type=chest_minecart,limit=1,sort=nearest] as @a[distance=..15] run function guipack:gui/check_inv

execute if entity @e[type=chest_minecart,limit=1,sort=nearest] run schedule function guipack:gui/temp_tick 1t replace
#

Incase you need to know what triggers check_inv

rugged surge
#

thanks

rapid vault
#

Temp_tick gets called when i open che chest minecart with the advancement'

rugged surge
#

does the scoreboard button_pressed exist?

rapid vault
#

Oh my god im dumb

#

temp didnt exist

#

Thank you for your time and sorry for wasting it!

rugged surge
#

no problem :P