ServerEvents.commandRegistry(event => {
    const { commands: Commands, arguments: Arguments} = event

    event.register(
        Commands.literal("toggle_heroes")
                    .executes(ctx => {

						let player = ctx.source.player
						let username = player.getGameProfile().getName();
                        let server = ctx.source.getServer()
                        let position = ctx.source.getPosition()
                        let dimension = ctx.source.getLevel().getDimension()
                        

                        server.runCommandSilent(`execute as ${username} at @s run scoreboard players add @s Heroes.Toggle.Hud 1`)
                        server.runCommandSilent(`execute as ${username} at @s run scoreboard players set @s[scores={Heroes.Toggle.Hud=2..}] Heroes.Toggle.Hud 0`)

                    return 1
                })
    )
})