### Performance Monitoring Commands Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Commands for starting and stopping performance monitoring in the game. Useful for debugging and optimizing game performance. ```APIDOC ## /perf ### Description Manages performance monitoring. Use `/perf start` to begin monitoring and `/perf stop` to end it. ### Method N/A (Command-line interface) ### Endpoint N/A (Command-line interface) ### Parameters #### Path Parameters - **start** (minecraft:literal) - Required - Starts performance monitoring. - **stop** (minecraft:literal) - Required - Stops performance monitoring. ### Request Example ```json { "command": "/perf start" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating whether performance monitoring was started or stopped. #### Response Example ```json { "message": "Performance monitoring started." } ``` ``` -------------------------------- ### Minecraft Command Argument Parsing for Storage Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This snippet defines the argument structure for specifying storage within Minecraft commands. It uses brigadier:integer for start and end indices and minecraft:nbt_path for path resolution, indicating the executable nature of the command. ```json { "type": "literal", "children": { "storage": { "type": "literal", "children": { "source": { "type": "argument", "children": { "sourcePath": { "type": "argument", "children": { "start": { "type": "argument", "children": { "end": { "type": "argument", "executable": true, "parser": "brigadier:integer" } }, "executable": true, "parser": "brigadier:integer" } }, "executable": true, "parser": "minecraft:nbt_path" } } } } } } } ``` -------------------------------- ### Configure Entity NBT Path Parsing (Minecraft 1.21) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This configuration defines the parsing of NBT paths for entities, including specifying the entity and the path to its NBT data. It utilizes `minecraft:entity` and `minecraft:nbt_path` parsers, along with integer arguments for start and end indices. ```json { "type": "literal", "children": { "entity": { "type": "literal", "children": { "source": { "type": "argument", "children": { "sourcePath": { "type": "argument", "children": { "start": { "type": "argument", "children": { "end": { "type": "argument", "executable": true, "parser": "brigadier:integer" } }, "executable": true, "parser": "brigadier:integer" } }, "executable": true, "parser": "minecraft:nbt_path" } }, "executable": true, "parser": "minecraft:entity", "properties": { "type": "entities", "amount": "single" } } } } } } ``` -------------------------------- ### Minecraft Return Command Structure (1.21) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Details the 'return' command, which can be used to return a value or fail. It includes 'fail' (literal, executable), 'run' (literal), and 'value' (argument, executable, using brigadier:integer parser). ```json { "return": { "type": "literal", "children": { "fail": { "type": "literal", "executable": true }, "run": { "type": "literal" }, "value": { "type": "argument", "executable": true, "parser": "brigadier:integer" } } } } ``` -------------------------------- ### Help Command API Source: https://api.spyglassmc.com/mcje/versions/1.21/commands The 'help' command provides information about available commands in the game. ```APIDOC ## GET /execute/help ### Description Provides information about available commands. ### Method GET ### Endpoint /execute/help ### Parameters #### Query Parameters - **command** (string) - Optional - The name of the command to get help for. If not provided, lists all commands. ### Request Example ``` GET /execute/help?command=give ``` ### Response #### Success Response (200) - **help_text** (string) - The help information for the requested command or a list of commands. #### Response Example ```json { "help_text": "Gives items to players. Usage: /give [count]" } ``` ``` -------------------------------- ### GET /websites/api_spyglassmc_mcje_versions_1_21 Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This endpoint provides access to Minecraft commands related to item manipulation, entity targeting, and loot tables. ```APIDOC ## GET /websites/api_spyglassmc_mcje_versions_1_21 ### Description This endpoint provides access to Minecraft commands, including functionalities for item manipulation, entity targeting, and loot tables. It allows for programmatic interaction with various game mechanics. ### Method GET ### Endpoint /websites/api_spyglassmc_mcje_versions_1_21 ### Parameters #### Query Parameters - **command** (string) - Required - The specific Minecraft command to execute. ### Request Example ```json { "command": "/give @p diamond 1" } ``` ### Response #### Success Response (200) - **output** (string) - The output of the executed Minecraft command. #### Response Example ```json { "output": "Gave 1 diamond to PlayerName" } ``` ``` -------------------------------- ### Execute Blocks Command Structure (Minecraft API) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Defines the structure for the 'execute blocks' command, specifying argument types for start, end, and destination positions. It utilizes the 'minecraft:block_pos' parser for block coordinates. ```json { "type": "literal", "children": { "start": { "type": "argument", "children": { "end": { "type": "argument", "children": { "destination": { "type": "argument", "children": { "all": { "type": "literal", "executable": true, "redirect": [ "execute" ] }, "masked": { "type": "literal", "executable": true, "redirect": [ "execute" ] } }, "parser": "minecraft:block_pos" } }, "parser": "minecraft:block_pos" } }, "parser": "minecraft:block_pos" } } } ``` -------------------------------- ### Publish Command Configuration in Minecraft 1.21 API Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This snippet illustrates the configuration for the 'publish' command. It includes arguments for allowing commands and setting the game mode, with specific parsers like 'brigadier:bool' and 'minecraft:gamemode'. The 'port' argument uses 'brigadier:integer' with defined min/max values. ```json { "publish": { "type": "literal", "children": { "allowCommands": { "type": "argument", "children": { "gamemode": { "type": "argument", "children": { "port": { "type": "argument", "executable": true, "parser": "brigadier:integer", "properties": { "max": 65535, "min": 0 } } }, "executable": true, "parser": "minecraft:gamemode" } }, "executable": true, "parser": "brigadier:bool" } }, "executable": true } } ``` -------------------------------- ### Execute Command Structure Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This section details the structure of the 'execute' command in Minecraft JE 1.21, including its various subcommands for executing actions based on conditions or targets. ```APIDOC ## EXECUTE Command ### Description Executes a command at a specific location, with specific entities as the executor, or under specific conditions. ### Method N/A (Command-line interface) ### Endpoint N/A (In-game command) ### Parameters #### Subcommands: - **blocks**: Executes a command based on block positions. - **start** (minecraft:block_pos) - Required - The starting block position. - **end** (minecraft:block_pos) - Required - The ending block position. - **destination** (minecraft:block_pos) - Required - The destination block position. - **all**: Executes if all blocks match. - **masked**: Executes if all non-masked blocks match. - **data**: Executes a command based on data manipulation. - **block**: - **sourcePos** (minecraft:block_pos) - Required - The position of the block to read data from. - **path** (minecraft:nbt_path) - Required - The NBT path to the data within the block. - **entity**: - **source** (minecraft:entity) - Required - The entity to read data from. - **path** (minecraft:nbt_path) - Required - The NBT path to the data within the entity. - **storage**: - **source** (minecraft:resource_location) - Required - The resource location of the storage to read data from. - **path** (minecraft:nbt_path) - Required - The NBT path to the data within the storage. - **dimension**: - **dimension** (minecraft:dimension) - Required - The dimension to execute the command in. - **entity**: - **entities** (minecraft:entity) - Required - The entity or entities to execute the command as. - **function**: - **name** (minecraft:function) - Required - The name of the function to execute. - **items**: - (Further details for 'items' subcommand are not provided in the input.) ### Request Example ``` execute blocks all run say Hello execute data block run say Data execute dimension run say In another dimension execute entity @a run say Everyone execute function run say Function called ``` ### Response #### Success Response (0) - (Command execution result, typically 0 for success) #### Response Example (No specific response body for command execution, output is usually in chat or logs.) ``` -------------------------------- ### Parse Minecraft Block Position Arguments Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Defines the parsing of block positions in Minecraft 1.21. It utilizes 'minecraft:block_pos' for position data and 'brigadier:integer' for start and end coordinates, often used for ranges. ```json { "type": "argument", "children": { "sourcePos": { "type": "argument", "children": { "sourcePath": { "type": "argument", "children": { "start": { "type": "argument", "children": { "end": { "type": "argument", "executable": true, "parser": "brigadier:integer" } }, "executable": true, "parser": "brigadier:integer" } }, "executable": true, "parser": "minecraft:nbt_path" } }, "executable": true, "parser": "minecraft:block_pos" } } } ``` -------------------------------- ### Entity Attribute Modification Commands (Minecraft) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Defines commands for modifying entity attributes, including setting, getting, and applying modifiers. It uses brigadier parsers for double values and Minecraft-specific parsers for resources and entities. ```minecraft_commands attribute modifier ... ``` -------------------------------- ### Place Structure Command Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Places a world generation structure at a specific block position. Requires the structure's resource key. ```APIDOC ## /place structure ### Description Places a specified world generation structure at the given coordinates. ### Method N/A (Command-line interface) ### Endpoint N/A (Command-line interface) ### Parameters #### Path Parameters - **structure** (minecraft:resource_key) - Required - The resource key of the structure to place (e.g., `minecraft:worldgen/structure`). - **pos** (minecraft:block_pos) - Required - The block position where the structure will be placed. ### Request Example ```json { "structure": "minecraft:village", "pos": {"x": 200, "y": 70, "z": -300} } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message that the structure was placed. #### Response Example ```json { "message": "Placed structure 'minecraft:village' at (200, 70, -300)." } ``` ``` -------------------------------- ### Minecraft Schedule Command Structure (1.21) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Outlines the 'schedule' command, used for scheduling functions. It includes 'clear' and 'function' subcommands, with 'clear' taking a 'brigadier:string' for the function name. ```json { "schedule": { "type": "literal", "children": { "clear": { "type": "literal", "children": { "function": { "type": "argument", "executable": true, "parser": "brigadier:string", "properties": { "type": "greedy" } } } }, "function": { "type": "literal", "children": { "function": { "type": "argument", "children": { "sequence": { "type": "argument", "executable": true, "parser": "minecraft:resource_location" } }, "executable": true, "parser": "minecraft:int_range" } }, "executable": true, "parser": "minecraft:resource_location" } } } } ``` -------------------------------- ### Configure Storage Resource Location Parsing (Minecraft 1.21) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This configuration defines how to parse a storage resource location, including its path. It utilizes the `minecraft:resource_location` parser and expects an argument for the source path. ```json { "type": "literal", "children": { "source": { "type": "argument", "children": { "sourcePath": { "type": "argument", "executable": true, "parser": "minecraft:nbt_path" } }, "executable": true, "parser": "minecraft:resource_location" } } } ``` -------------------------------- ### Give Command API Source: https://api.spyglassmc.com/mcje/versions/1.21/commands The 'give' command allows players to receive items in their inventory. This API documentation outlines its structure and parameters. ```APIDOC ## POST /execute/give ### Description Grants items to specified players. ### Method POST ### Endpoint /execute/give ### Parameters #### Request Body - **targets** (minecraft:entity) - Required - The player(s) to receive the items. - **item** (minecraft:item_stack) - Required - The item to give. - **count** (integer) - Required - The number of items to give. Minimum value is 1. ### Request Example ```json { "targets": "@p", "item": "minecraft:diamond", "count": 64 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the items were given. #### Response Example ```json { "message": "Gave 64 diamond to @p" } ``` ``` -------------------------------- ### Execute Command Structure Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Details the structure of the 'execute' command, including its various subcommands, arguments, and parsers. ```APIDOC ## GET /execute ### Description This endpoint provides details on the structure and usage of the 'execute' command in Minecraft JE 1.21. It outlines the available subcommands, argument types, parsers, and redirection paths. ### Method GET ### Endpoint /execute ### Parameters #### Query Parameters - **command_structure** (string) - Optional - A query parameter to specify which part of the command structure to retrieve. (e.g., 'execute.run', 'execute.as.target.path.byte.scale') ### Request Example ``` GET /execute?command_structure=execute.as.target.path.byte.scale ``` ### Response #### Success Response (200) - **type** (string) - The type of the command node (e.g., 'literal', 'argument'). - **parser** (string) - The parser associated with the argument node (e.g., 'brigadier:double', 'minecraft:nbt_path'). - **redirect** (array) - An array of strings indicating where this node redirects to (e.g., ['execute']). - **children** (object) - An object containing child nodes for this command node. #### Response Example ```json { "type": "argument", "parser": "brigadier:double", "redirect": [ "execute" ] } ``` ``` -------------------------------- ### Execute Command with Time Arguments Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This snippet demonstrates how to execute a command that accepts time-based arguments, such as fade-in, stay, and fade-out durations for screen effects. It utilizes the 'minecraft:time' parser for time values. ```json { "type": "argument", "children": { "stay": { "type": "argument", "children": { "fadeOut": { "type": "argument", "executable": true, "parser": "minecraft:time", "properties": { "min": 0 } } }, "parser": "minecraft:time", "properties": { "min": 0 } } }, "parser": "minecraft:time", "properties": { "min": 0 } } ``` -------------------------------- ### Whitelist Command Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Manages the server's whitelist, allowing to add or list players. ```APIDOC ## POST /whitelist ### Description Manages the server's whitelist. Players can be added to the whitelist, or the current whitelist can be listed. ### Method POST ### Endpoint /whitelist ### Parameters #### Request Body - **action** (string) - Required - The action to perform ('add' or 'list'). - **targets** (array of strings) - Optional - A list of player names to add to the whitelist (required if action is 'add'). ### Request Example (Add Player) ```json { "action": "add", "targets": ["PlayerToAdd"] } ``` ### Request Example (List Whitelist) ```json { "action": "list" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation or informational message. - **players** (array of strings) - Optional - A list of whitelisted players (returned if action is 'list'). #### Response Example (Add Player) ```json { "message": "Player PlayerToAdd has been added to the whitelist." } ``` #### Response Example (List Whitelist) ```json { "message": "Current whitelist:", "players": ["Player1", "Player2", "PlayerToAdd"] } ``` ``` -------------------------------- ### Minecraft Recipe Command Structure (1.21) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Defines the structure for the 'recipe' command, including 'give' and 'take' subcommands. It specifies entity selectors for targets and the 'minecraft:resource_location' parser for recipes. ```json { "recipe": { "type": "literal", "children": { "give": { "type": "literal", "children": { "targets": { "type": "argument", "children": { "*": { "type": "literal", "executable": true }, "recipe": { "type": "argument", "executable": true, "parser": "minecraft:resource_location" } }, "parser": "minecraft:entity", "properties": { "type": "players", "amount": "multiple" } } } }, "take": { "type": "literal", "children": { "targets": { "type": "argument", "children": { "*": { "type": "literal", "executable": true }, "recipe": { "type": "argument", "executable": true, "parser": "minecraft:resource_location" } }, "parser": "minecraft:entity", "properties": { "type": "players", "amount": "multiple" } } } } } } } ``` -------------------------------- ### Command Argument Parsers Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This section details the various argument parsers available in the Minecraft JE 1.21 command system, such as block positions, entities, and NBT paths. ```APIDOC ## Command Argument Parsers ### Description This documentation outlines the structure and parsers for commands in Minecraft Java Edition version 1.21. It covers arguments for block positions, entities, storage, and string-based commands. ### Method N/A (This describes command structure, not an HTTP endpoint) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ## Argument Types and Parsers: - **`minecraft:block_pos`**: Parses a block position. - **`minecraft:entity`**: Parses entity selectors. - Properties: - `type`: "entities" - `amount`: "single" - **`minecraft:nbt_path`**: Parses an NBT path. - **`minecraft:resource_location`**: Parses a resource location. - **`brigadier:integer`**: Parses an integer. ## Command Structure Examples: ### Entity Argument ```json { "type": "argument", "children": { "sourcePath": { "type": "argument", "executable": true, "parser": "minecraft:nbt_path" } }, "executable": true, "parser": "minecraft:entity", "properties": { "type": "entities", "amount": "single" } } ``` ### String Argument with Block Position ```json { "type": "literal", "children": { "block": { "type": "literal", "children": { "sourcePos": { "type": "argument", "children": { "sourcePath": { "type": "argument", "children": { "start": { "type": "argument", "children": { "end": { "type": "argument", "executable": true, "parser": "brigadier:integer" } }, "executable": true, "parser": "brigadier:integer" } }, "executable": true, "parser": "minecraft:nbt_path" } }, "executable": true, "parser": "minecraft:block_pos" } } } } } ``` ### String Argument with Entity Selector ```json { "type": "literal", "children": { "entity": { "type": "literal", "children": { "source": { "type": "argument", "children": { "sourcePath": { "type": "argument", "children": { "start": { "type": "argument", "children": { "end": { "type": "argument", "executable": true, ``` -------------------------------- ### Whitelist Add Command Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This snippet shows the command structure for adding players to the server whitelist. It uses the 'minecraft:game_profile' parser to identify the target player(s). ```json { "type": "literal", "children": { "add": { "type": "literal", "children": { "targets": { "type": "argument", "executable": true, "parser": "minecraft:game_profile" } } }, "list": { "type": "literal", "executable": true } } } ``` -------------------------------- ### Define Music Command Structure (JSON) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This JSON structure defines the 'music' command, specifying its arguments and executable properties. It includes nested arguments for targets, position (vec3), volume, pitch, and minimum volume, utilizing Brigadier parsers for float and entity types. ```json { "type": "literal", "children": { "targets": { "type": "argument", "children": { "pos": { "type": "argument", "children": { "volume": { "type": "argument", "children": { "pitch": { "type": "argument", "children": { "minVolume": { "type": "argument", "executable": true, "parser": "brigadier:float", "properties": { "max": 1.0, "min": 0.0 } } }, "executable": true, "parser": "brigadier:float", "properties": { "max": 2.0, "min": 0.0 } } }, "executable": true, "parser": "brigadier:float", "properties": { "min": 0.0 } } }, "executable": true, "parser": "minecraft:vec3" } }, "executable": true, "parser": "minecraft:entity", "properties": { "type": "players", "amount": "multiple" } } }, "executable": true } ``` -------------------------------- ### Storage Command Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This section details the 'storage' command, used for managing NBT data within Minecraft. It allows specifying a source path for data operations. ```APIDOC ## GET /storage ### Description Retrieves or manipulates data from a specified NBT source. ### Method GET (or relevant command execution method) ### Endpoint `/storage` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **source** (minecraft:resource_location) - Required - The resource location of the NBT data source. - **sourcePath** (minecraft:nbt_path) - Required - The path within the NBT data to access. ### Request Example ```json { "command": "/data get storage " } ``` ### Response #### Success Response (200) - **data** (any) - The NBT data retrieved from the specified path. #### Response Example ```json { "data": { "some_key": "some_value" } } ``` ``` -------------------------------- ### Place Feature Command Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Places a configured world generation feature at a specific block position. Requires the feature's resource key. ```APIDOC ## /place feature ### Description Places a specified world generation feature at the given coordinates. ### Method N/A (Command-line interface) ### Endpoint N/A (Command-line interface) ### Parameters #### Path Parameters - **feature** (minecraft:resource_key) - Required - The resource key of the feature to place (e.g., `minecraft:worldgen/configured_feature`). - **pos** (minecraft:block_pos) - Required - The block position where the feature will be placed. ### Request Example ```json { "feature": "minecraft:trees_birch", "pos": {"x": 50, "y": 70, "z": -100} } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message that the feature was placed. #### Response Example ```json { "message": "Placed feature 'minecraft:trees_birch' at (50, 70, -100)." } ``` ``` -------------------------------- ### Clone Command Structure Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Details the structure and options available for the /clone command in Minecraft JE 1.21, including different modes like replace, masked, and filtered. ```APIDOC ## /clone command ### Description Allows players to copy blocks from one location to another within the game world. Supports various modes for handling existing blocks at the destination. ### Method Not Applicable (Command-based) ### Endpoint Not Applicable (Command-based) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` /clone [mode] ``` ### Response #### Success Response (200) Command execution success message. #### Response Example ``` Copied 10 blocks from ... to ... ``` ### Command Structure Details #### `from` (Source Area) - **x1, y1, z1**: Coordinates of the first corner of the source area. - **x2, y2, z2**: Coordinates of the opposite corner of the source area. #### `to` (Destination) - **x, y, z**: Coordinates of the destination corner. #### `mode` (Optional) Specifies how to handle blocks at the destination. - **replace**: Overwrites all blocks in the destination area with blocks from the source area. This is the default mode. - **force**: Similar to normal replace, but may have different behavior in specific edge cases or future updates. - **move**: Moves the blocks from the source to the destination, replacing blocks at the destination and clearing the source area. - **normal**: Standard replacement behavior. - **masked**: Replaces blocks in the destination area only if they are not air. Non-air blocks in the source will replace air blocks in the destination. - **force**: Similar to normal masked, but may have different behavior in specific edge cases or future updates. - **move**: Moves the blocks from the source to the destination, replacing air blocks at the destination and clearing the source area. - **normal**: Standard masked behavior. - **filtered [filter]**: Replaces blocks in the destination area only if they match the specified `filter` predicate. Air blocks in the source will not replace blocks in the destination unless the filter allows it. - **force**: Similar to normal filtered, but may have different behavior in specific edge cases or future updates. - **move**: Moves the blocks from the source to the destination, replacing blocks matching the filter at the destination and clearing the source area. - **normal**: Standard filtered behavior. - **filter**: A block predicate that defines which blocks should be considered for cloning. ``` -------------------------------- ### Execute Command - Item Predicate Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Enables command execution based on item predicates, using the `minecraft:item_predicate` parser. ```APIDOC ## GET /execute/item_predicate ### Description This endpoint facilitates command execution contingent on an item predicate. It leverages the `minecraft:item_predicate` parser to define the item criteria. ### Method GET ### Endpoint /execute/item_predicate ### Parameters #### Query Parameters - **item_predicate** (minecraft:item_predicate) - Required - The predicate defining the item requirements for execution. ### Request Example ```json { "command": "execute if item @p item_predicate=my_predicate run say Item found!" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the command was processed. #### Response Example ```json { "message": "Command executed successfully." } ``` ``` -------------------------------- ### Minecraft Command Argument Parsing (Brigadier) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Demonstrates the use of Brigadier parsers for various numeric types like double, float, int, long, and short. These are often used in command arguments that require specific numerical inputs and can redirect to 'execute' commands. ```json { "parser": "brigadier:double", "redirect": [ "execute" ] } ``` ```json { "type": "argument", "parser": "brigadier:double", "redirect": [ "execute" ] } ``` -------------------------------- ### Minecraft Say Command Structure (1.21) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Defines the 'say' command, used for broadcasting messages in chat. It takes a 'minecraft:message' argument, which is executable. ```json { "say": { "type": "literal", "children": { "message": { "type": "argument", "executable": true, "parser": "minecraft:message" } } } } ``` -------------------------------- ### Storage Command Structure Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Details the structure for commands involving storage, including NBT paths and argument types. ```APIDOC ## GET /websites/api_spyglassmc_mcje_versions_1_21/storage ### Description This endpoint provides details on the command structure for interacting with storage in Minecraft JE 1.21. It includes arguments for NBT paths and related integer arguments for specifying ranges. ### Method GET ### Endpoint /websites/api_spyglassmc_mcje_versions_1_21/storage ### Parameters #### Query Parameters - **path** (string) - Optional - The specific path within the storage command structure to query. ### Response #### Success Response (200) - **type** (string) - The type of the command node (e.g., 'literal', 'argument'). - **children** (object) - Contains child nodes for further command structure. - **executable** (boolean) - Indicates if the command node is executable. #### Response Example ```json { "type": "literal", "children": { "source": { "type": "argument", "children": { "sourcePath": { "type": "argument", "children": { "start": { "type": "argument", "children": { "end": { "type": "argument", "executable": true, "parser": "brigadier:integer" } }, "executable": true, "parser": "brigadier:integer" } }, "executable": true, "parser": "minecraft:nbt_path" } }, "executable": true } } } ``` ``` -------------------------------- ### Execute Command with Component Argument Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This snippet shows how to execute a command that takes a 'minecraft:component' as an argument, typically used for custom titles or chat messages. The 'minecraft:component' parser handles complex text formatting. ```json { "type": "argument", "executable": true, "parser": "minecraft:component" } ``` -------------------------------- ### Minecraft Save Commands (1.21) Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Documents the 'save-all', 'save-off', and 'save-on' commands for managing world saves. 'save-all' has an optional 'flush' subcommand. ```json { "save-all": { "type": "literal", "children": { "flush": { "type": "literal", "executable": true } }, "executable": true }, "save-off": { "type": "literal", "executable": true }, "save-on": { "type": "literal", "executable": true } } ``` -------------------------------- ### Execute Command - Block Manipulation Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This section details the 'execute block' command, which allows for the manipulation of blocks within the game. It supports specifying target positions and NBT paths for precise control. ```APIDOC ## POST /execute/block ### Description Allows for the manipulation of blocks within the game world. Supports specifying target positions and NBT paths for precise control. ### Method POST ### Endpoint /execute/block ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **targetPos** (minecraft:block_pos) - Required - The position of the block to manipulate. - **path** (minecraft:nbt_path) - Required - The NBT path to the data within the block. - **scale** (brigadier:double) - Optional - A scaling factor for numerical NBT values. ### Request Example ```json { "targetPos": { "x": 10, "y": 64, "z": 20 }, "path": "data.my_tag", "scale": 1.5 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Minecraft Command Structure: 'replace' Argument Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This snippet illustrates the 'replace' argument within a Minecraft command structure. It indicates that this argument is executable and can have further nested children, suggesting complex command chaining or conditional logic. ```json { "type": "literal", "children": { "force": { "type": "literal", "executable": true }, "move": { "type": "literal", "executable": true }, "normal": { "type": "literal", "executable": true } }, "executable": true } ``` -------------------------------- ### Execute Command API Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This section details the structure and usage of the execute command, which allows for conditional execution of other commands based on various criteria. ```APIDOC ## POST /execute ### Description Executes a command based on specified conditions or targets. ### Method POST ### Endpoint `/execute` ### Parameters #### Request Body - **command** (string) - Required - The command to execute. - **condition** (object) - Optional - Conditions under which the command should be executed. - **type** (string) - Required - The type of condition (e.g., 'entity_present', 'score_equals'). - **parameters** (object) - Required - Parameters specific to the condition type. ### Request Example ```json { "command": "say Hello World", "condition": { "type": "entity_present", "parameters": { "entity_type": "player" } } } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the command execution was successful. - **message** (string) - A message detailing the result of the command execution. #### Response Example ```json { "success": true, "message": "Command executed successfully." } ``` ``` -------------------------------- ### Publish Command Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Manages the publishing of game states, including options for command execution and gamemode settings. ```APIDOC ## POST /publish ### Description This endpoint handles the publishing of game-related information. It allows for the configuration of whether commands are allowed and the specific gamemode to be published, along with a port number. ### Method POST ### Endpoint /publish ### Parameters #### Query Parameters - **allowCommands** (brigadier:bool) - Required - Whether commands are allowed. - **gamemode** (minecraft:gamemode) - Required - The gamemode to be published. - **port** (brigadier:integer) - Required - The port number for publishing. ### Request Example ```json { "allowCommands": true, "gamemode": "survival", "port": 25565 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the command execution. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Bossbar Command Structure Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Details the structure of the 'bossbar' command, including its arguments and parsers. ```APIDOC ## GET /bossbar ### Description This endpoint describes the structure of the 'bossbar' command in Minecraft JE 1.21, focusing on how bossbar IDs are handled and parsed. ### Method GET ### Endpoint /bossbar ### Parameters #### Query Parameters - **command_structure** (string) - Optional - A query parameter to specify which part of the command structure to retrieve. (e.g., 'bossbar.id') ### Request Example ``` GET /bossbar?command_structure=bossbar.id ``` ### Response #### Success Response (200) - **type** (string) - The type of the command node ('literal'). - **children** (object) - An object containing child nodes for this command node. - **id** (object) - Represents the bossbar ID. - **type** (string) - The type of the node ('argument'). - **parser** (string) - The parser for the bossbar ID ('minecraft:resource_location'). #### Response Example ```json { "type": "literal", "children": { "id": { "type": "argument", "parser": "minecraft:resource_location" } } } ``` ``` -------------------------------- ### Execute Command - Entity Targeting Source: https://api.spyglassmc.com/mcje/versions/1.21/commands This section covers the 'execute entity' command, which enables targeting and manipulating entities within the game. It supports various selectors for specifying entities. ```APIDOC ## POST /execute/entity ### Description Targets and manipulates entities within the game. Supports various selectors for specifying entities. ### Method POST ### Endpoint /execute/entity ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **target** (string) - Required - The entity selector (e.g., '@a', '@e[type=zombie]'). - **command** (string) - Required - The command to execute on the selected entities. ### Request Example ```json { "target": "@a[distance=..10]", "command": "say Hello nearby players!" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Minecraft Command: Mine Block Position Arguments Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Defines the structure for specifying block positions when simulating mining. It includes arguments for mainhand, offhand, and a tool with an item stack parser. ```minecraft_command mine [mainhand: literal] [offhand: literal] [tool: minecraft:item_stack] ``` -------------------------------- ### Execute Command - Loot Predicate Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Allows command execution based on loot predicates, utilizing the `minecraft:loot_predicate` parser. ```APIDOC ## GET /execute/loot_predicate ### Description This endpoint permits command execution based on loot predicates. It employs the `minecraft:loot_predicate` parser to specify the loot criteria. ### Method GET ### Endpoint /execute/loot_predicate ### Parameters #### Query Parameters - **loot_predicate** (minecraft:loot_predicate) - Required - The predicate defining the loot requirements for execution. ### Request Example ```json { "command": "execute if loot spawn ~ ~ ~ loot_table:my_loot_table loot_predicate=my_predicate" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the command was processed. #### Response Example ```json { "message": "Command executed successfully." } ``` ``` -------------------------------- ### Minecraft NBT Path and Resource Location Argument Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Defines the 'storage' argument type, which utilizes a 'literal' type and expects a 'resource_location' parser for its 'source' child. It also includes a nested 'sourcePath' argument parsed as 'minecraft:nbt_path'. This is used for specifying NBT data locations. ```json { "storage": { "type": "literal", "children": { "source": { "type": "argument", "children": { "sourcePath": { "type": "argument", "executable": true, "parser": "minecraft:nbt_path" } }, "executable": true, "parser": "minecraft:resource_location" } } } } ``` -------------------------------- ### Music Command API Source: https://api.spyglassmc.com/mcje/versions/1.21/commands Provides functionality to play music or sounds at specific locations and with adjustable parameters. ```APIDOC ## POST /music ### Description Plays music or sounds for specified targets at a given position with volume and pitch controls. ### Method POST ### Endpoint `/music` ### Parameters #### Request Body - **targets** (string) - Required - The entity or player selector for whom the music will play. - **pos** (string) - Required - The Minecraft vector3 coordinate (e.g., `~ ~ ~`). - **volume** (float) - Required - The volume of the music, between 0.0 and 1.0. - **pitch** (float) - Required - The pitch of the music, between 0.0 and 2.0. - **minVolume** (float) - Optional - The minimum volume, between 0.0 and 1.0. ### Request Example ```json { "targets": "@a", "pos": "~ ~ ~", "volume": 0.8, "pitch": 1.0, "minVolume": 0.5 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the music playback command. #### Response Example ```json { "status": "Music command processed." } ``` ```