r/MinecraftCommands • • 3d ago

Help | Java 1.21.11 Confirm Command Execution

Post image

This message keeps popping up whenever I try to run a certain command, is there any way I can remove it?

77 Upvotes

13 comments sorted by

39

u/Graphite-Grave 3d ago

You’re probably running the command via book or sign right?

A /trigger setup can get around the conformation request.

8

u/Atroniouss 3d ago

Yeah I'm using the command via book as an interactable text, can you show an example of a trigger setup, kind of forgot it

2

u/Graphite-Grave 2d ago

Chat
/scoreboard objectives add tp_lobby trigger

Book command
/trigger tp_lobby

Repeating cb
/scoreboard players enable @a tp_lobby

Chain unconditional
/execute as @a[scores={tp_lobby=1..}] in minecraft:overworld run tp @s 0 0 0

Chain conditional
/scoreboard players set @a tp_player 0

1

u/Vengeance138 Command Experienced 2d ago

Without writing out a full example you are pretty much doing a check with a trigger command, for example you have a command either in an mcfunction or command block checking a value, so the command the book would be is trigger warden_attack set 1, and then you would have an execute running

execute if @ a score warden_attack matches 1 ... then whatever command you want it to do, you are pretty much using the trigger commands to change score values and then reference them in commands to only run if it meets a certain value.

Hopefully that makes a bit more sense

3

u/asdfhhkll 2d ago edited 2d ago

If you don't mind having to install a mod, you can download the NoCC fabric mod. That's what I personally use since it's very convenient and bypasses all that trigger chain bs that mojang did. It requires a fabric loader though

1

u/Atroniouss 2d ago

I do play mainly on fabric with mods so I'll give it a shot

1

u/Atroniouss 2d ago

It worked, thanks!

8

u/ShortDude55 2d ago

I really don't understand why this warning exists.

Bad actors won't wait for a player interaction to ruin your world

13

u/Ericristian_bros Command Experienced 2d ago

I really don't understand why this warning exists.

This has been exploited in the past to ruin servers of unaware owners.

A player with creative mode can't use commands, command blocks or the console. But they can acces saved hotbar and take a custom book from there and tell the admin to click the book text, if the warning didn't exist, they would get full admin permissions, but because of the warning, the player will see the command they are trying to run.

I sincerely think it should be toggleable from the client or only show the warning for some command, since it is helpful for us, map makers

6

u/asdfhhkll 2d ago

This decision is still stupid from Mojang. They should have made it toggleable in the options and show this warning when you try to switch this off so that server admins get notified and map makers can use run_command

3

u/PolarBearMaster_ 2d ago
  1. At first you'd set up a trigger scoreboard:
    ex: `/scoreboard objectives add TriggerName trigger`

  2. You'll get the actual trigger itself by doing a command block setup:
    Repeating Command Block(Always Active): `execute as @|a if score @|s TriggerName matches 1 run { Whatever code you want }
    Chain Command Block: `execute as @|a if score @|s TriggerName matches 1 run scoreboard players set @|s TriggerName 0`

  3. To run the code you'd do the command: `/trigger TriggerName`

Now you can make a command(or multiple) run without confirmation or admin requirements.

(I had to put | between the selectors because reddit formats the text. just remove the pipes later)

-Have Fun Command Blocking!
-If you have any questions, ask them, and i'll answer them to the best of my abilities :)

2

u/DimasDSF 2d ago

Woah, just seeing this made me happy about deciding to learn java modding back in the day instead of powering through the commands system nonsense (specifically backed tf out after seeing scoreboards instead of variables and advancements instead of events).

Mojang really made this system using the same "there have to be downsides to everything" idea, this stuff makes sense for in-game mechanics (like for example being unable to place redstone on the walls makes you work around the limitation and figuring out a solution is fun) but not for content creation where it already is challenging and time consuming.