ServerEvents.commandRegistry(event => {

  event.register(
    event.commands.literal("infspin")
      .executes(ctx => {

        const player = ctx.source.player

        if (player) {
          // This runs the function AS the player
          player.runCommandSilent("function ninjago:infspin")
        }

        return 1
      })
  )

})