Download World Start Commands and Global Gamerules — Minecraft Mods — MetaMods

World Start Commands and Global Gamerules

Active

Downloads

0

Last update

6 months ago

Versions

1.19 — 1.21.5
Server
Forge
Neoforge
Game mechanics
Control
Utils

World Start Commands and Global Gamerules

This mod provides the ability to execute arbitrary commands when creating new worlds. It was originally developed for setting global game rules that apply to all worlds but also supports any other commands.

Main Features

On first game launch, the mod creates a WSCommands.json file in the config folder with the following structure:

{
  "Repeat": false,
  "DedicatedMode": false,
  "1": "[command1]",
  "2": "[command2]",
  "3": "[command3]"
}

Commands are executed sequentially every time a new world is loaded. Command numbers must be consecutive without gaps.

Configuration Example

{
  "Repeat": false,
  "DedicatedMode": false,
  "1": "effect give @a minecraft:resistance",
  "2": "gamerule keepInventory true",
  "3": "gamerule doInsomnia false",
  "4": "give @r minecraft:diamond"
}

In this example, the resistance effect is first given to all players, then keepInventory and doInsomnia rules are set, and finally a diamond is given to a random player.

Execution Settings

  • Repeat: if set to true, commands will execute every time the world is loaded
  • DedicatedMode: in true mode, commands execute for every player upon first joining the world

Useful Commands

  • /wsc [target] forcerun — immediately executes commands
  • /wsc [target] reset — resets execution for the current world
  • /wsc null — dummy command

Troubleshooting

If commands don't execute during world creation, use /wsc forcerun (requires OP permissions). Red error messages typically indicate a missing comma in the configuration.

For issues with game rules, verify proper capitalization - Minecraft is case-sensitive (e.g., keepInventory, not keepinventory).

When copying commands from command blocks, remember to escape JSON special characters.

The mod also creates a WSCommands.toml file in the config folder with main configuration information.

Project members
sheepsquadace

sheepsquadace

acewins

acewins

Developer

Created: 1 Oct 2024

ID: 59885