#Is it possible to run a command as an op, but sent from a player?

7 messages · Page 1 of 1 (latest)

dull hollow
#

Was trying to make an item that could run the /respawningstructures respawnClosestStructure from the Respawning Structures mod, but unfortunately that one has no way to set a location. It just grabs the nearest structure to the player that used the command, and since the player isn't an op, nothing happens.
Running it with event.runCommand also doesn't work, since there's no player for it to get the location of.

So I was wondering if there was any way to run a command via player.runCommand, but have it be run as an op?

undone acornBOT
#

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

steady garnet
#

You can use event.player.server.runCommandSilent

gaunt citrus
#

vanilla execute as <player> <command> might work

dull hollow
#

event.player.server.runCommandSilent worked to run it as op, but ended up just running the command at 0,0.

In case anyone else is looking for this kind of thing, the command that ended up working fully was this:

player.server.runCommandSilent("execute at "+player.getUuid()+" run respawningstructures respawnClosestStructure")
gaunt citrus
#

FYI sending a message in a ticket will reopen it