I am using a mod with the custom map I am making. The mod adds some commands, but they are far from perfect. For example, the command syntax goes like this:
/modcommand foo <PlayerName> DoThis
In a command block I put
/modcommand foo feldspar15523 DoThis
And everything works as expected. However, if I do this:
/modcommand foo @p DoThis
The mod thinks that the player's name is literally @p
. My idea was to make it so that when I trigger the block, it first makes another Command Block that has the name of the nearest player in it in the right place. Here is what I need in pseudocode:
/setblock ~ ~+5 ~ minecraft:chain_command_block 1 replace {Command:"/modcommand foo "+ @p +" DoThis"}