SpongeForge Version: 1.12.2-2838-7.2.1
Minecraft Version: 12.2.2
I have a function called server:new_player :
give @s minecraft:apple
say gave apple to player
In game I have a command block placed with the following command:
execute @p ~ ~ ~ function server:new_player
What I expect this to do is to run this function for the player that activates the command block (by redstone, don’t know if this matters), and ultimately gives the player an apple and say that the player received the apple.
What actually happens is weird. The /say command will work fine, but the /give command does nothing. Looking at the command block’s previous output it says:
Executed 2 command(s) from function 'server:new_player'
Based on this behavior I’m assuming if a command fails in a function, execution continues to the next command. Whats weird though is if I run the command block’s command in the chat, then it works perfectly.
Wouldn’t the command block select the nearest player, execute at the that player’s location (the triple tilde should represent the player’s location right?), then pass that player into the function as the (@s) target selector?
I have tried using the minecraft:
alias for the commands but nothing changes. I also used /which
to see if theres any conflicts. I’ve also loaded up a single player world and done the exact same thing and it works, so I’m assuming its a Sponge related problem.
I’m fairly new to command blocks so I might be missing something obvious.