custom menu stopped working after update
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?