Command ‐ Custom Data - DerFrZocker/Custom-Ore-Generator GitHub Wiki

Command Custom Data

The COMMAND custom data allows you to set a command that will be executed when a generated command block is activated. This is useful for creating automated actions within your world.

  • Name: COMMAND
  • Type: String
  • Applicable Materials:
    • Minecraft 1.13+: COMMAND_BLOCK, CHAIN_COMMAND_BLOCK, REPEATING_COMMAND_BLOCK
    • Minecraft 1.9+: COMMAND, COMMAND_REPEATING, COMMAND_CHAIN
    • Older versions: COMMAND

Usage

To set the COMMAND custom data, you provide the command string as the value. The command should be a valid Minecraft command, typically starting with /.

Example

To set a generated command block to broadcast a message:

/oregen set customdata my_command_ore COMMAND "/say Hello from Custom Ore Generator!"

To set a generated command block to give a player an item:

/oregen set customdata my_item_command_ore COMMAND "/give @p diamond 1"