#Custom Command

8 messages · Page 1 of 1 (latest)

deep tulipBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

sinful mesa
cerulean coyote
# sinful mesa

Send the code file it self, i cant help but
Itll help others

sinful mesa
#

Here's what it tells in minecraft (litteraly in english "unknown command or incomplete, see the error bellow")

#
    const { commands: Commands, arguments: Arguments } = event

    event.register(Commands.literal('set_starbattleon') // The name of the command
        .requires(s => s.hasPermission(2)) // Check if the player has operator privileges
        .then(Commands.argument('target', Arguments.PLAYER.create(event)))
        .executes(c => set_starbattle(Arguments.PLAYER.getResult(c, 'target'))) 
    )

    let set_starbattle = (player) => {
        console.log("Player Logged");
        return 1;
      }
})```
#

It also seems that it recognize the player argument

sinful mesa
#

Ok i fixed it but now for some reason it wont set persistent data for my player can't we do that in the command ?

#
        console.log("Player Logged");
        player.persistentData.InStarBattle = true;
        console.log(player.persistentData.InStarBattle);
        return 1;
      }```