So I made a menu following a youtube video and it uses a chest in a minecart for the display. After the last update it stopped working and I have tried everything to get it working again but can't seem to do it. The issue is that whenever a certain item is in the player's hand it should run a function that spawns a chest in a minecart on wich the player clicks to open the menu. The spawning of the chest in a minecart is what stopped working. It is ran once everytime the item is taken into the hand of the player, but doesn't spawn the minecart. Whenever the function is ran seperately when the item is in the hand of the player however, it does spawn the minecart. Attached is the code used for the detecting and spawning of the minecart. Does it have something to do with from where the function is ran or is it something else?
#custom menu stopped working after update
1 messages · Page 1 of 1 (latest)
It's probably because the question was phrased badly
If you could highlight the key issue then please do
Wel it's like I said, the functions work whenever I manually activate them, but don't work whenever they're called from the other functions
How are they being called?
Well from within the other function, which is called whenever I have an item in my hand.
But the funny thing is, I've tried rerouting them via @s to see if it would run like that but it didn't
as well as that, I have some markers in my code for debugging purposes and both markers (the first one is in my tp funtion and the other one in open) run via me (Whenever they are ran I see the message with my username in front of in in chat)
Only the summon command doesn't seem to work because the other parts of the script that handle score, work just fine.
The issue as well only emerged after the update and I didn't have it before.
And like I said whenever I run the function via chat (so via me), it works for some reason, it just doesn't when called from the script
What I mean is show the commands
I just type /function in the chat and the functions are listed in the images attached. The command I run manually and is giving me issues is the open.mcfunction command.
...
You have been telling me that when you run the functions in chat, they work properly, but when you run them from other functions, they do not.
In order to help you, I need to see how those functions are being run in those other functions. I'm not sure how I can be any more clear than that
Well the functions are in the images attached. All functions originate from the tick.mcfunction function which runs every tick and or runs close.mcfunction or runs teleport.mcfunction and teleport in turn runs open.mcfunction. I believe change.mcfunction is pretty much irrelevant for the issue. The names of the functions are displayed at the top of each screenshot in the locationadress.
Hope this clears things up
The tick function runs as the server. @s means "the thing executing this command", which would be the server since you haven't executed as/at anything else yet. If you want these commands/functions to run as players, your tick function should be one line that is execute as @a at @s run function world_of_wizards:player_tick, and then move the commands you currently have in your tick function to a new player_tick functions