Skip to content
Skills Library
Programming · Building & coding

minecraft-commands-scripting

/minecraft-commands-scripting

Write and debug Minecraft Java 26.x and 1.21.x commands, selectors, execute chains, scoreboards, NBT, and RCON scripts. Use for command-only work; use minecraft-datapack for complete datapack structures.

Licence
MIT
Last repository change
12.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
7
Scripts
1
HTML comments
0
URLs in SKILL.md
7
Deprecation

No signals detected. Repository changed on 12.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/examples/rcon-backup-warning.sh

What it does and when to use it

Write and debug Minecraft Java 26.x and 1.21.x commands, selectors, execute chains, scoreboards, NBT, and RCON scripts. Use for command-only work; use minecraft-datapack for complete datapack structures.

Original author description

Write and debug Minecraft Java 26.x and 1.21.x commands, selectors, execute chains, scoreboards, NBT, and RCON scripts. Use for command-only work; use minecraft-datapack for complete datapack structures.

How it works

  1. Command Syntax Conventions
  2. Bundled References And Examples
  3. Command reference
  4. RCON Scripting
  5. Common Scripting Patterns
  6. References
Original SKILL.md headings · 156 lines, 642 words
SKILL.md preview
---
name: minecraft-commands-scripting
description: "Write and debug Minecraft Java 26.x and 1.21.x commands, selectors, execute chains, scoreboards, NBT, and RCON scripts. Use for command-only work; use minecraft-datapack for complete datapack structures."
---

# Minecraft Commands & Scripting Skill

Before editing, inspect the exact Minecraft version and execution context
(chat, function, command block, or RCON). Keep the requested scope and use only
the relevant examples. Check current release notes for version-sensitive syntax.
In [26.3](https://www.minecraft.net/en-us/article/minecraft-java-edition-26-3),
`/item replace` maps source slots to destinations once; use `/item fill` to
repeat items or `/item override` to clear unmatched slots.

## Command Syntax Conventions

- `<required>` — required argument
- `[optional]` — optional argument
- `(a|b|c)` — choose one
- `...` — repeating / multiple
- Coordinates: `~` = relative offset, `^` = local (look-direction)

### Routing Boundaries
- `Use when`: the task is raw command chains, scoreboards, selector logic, or RCON command scripting.
- `Do not use when`: creating or editing full datapack structures and registries (`minecraft-datapack`).
- `Do not use when`: behavior depends on Java plugin or mod code (`minecraft-plugin-dev`/`minecraft-modding`).

## Bundled References And Examples

- Execute cheat sheet: `references/execute-cheat-sheet.md`
- Selector cheat sheet: `references/selector-cheat-sheet.md`
- Example scripts: `scripts/examples/arena-countdown.mcfunction`, `scripts/examples/stopwatch-podium.mcfunction`, `scripts/examples/rcon-backup-warning.sh` (one-time setup commands are called out in comments when needed)

Use the cheat sheets when you need fast command recall without scanning this whole
skill file. Copy and adapt the example scripts as needed.

---

## Command reference

Use [references/command-reference.md](references/command-reference.md) for the
relevant command family. It includes version boundaries for item components,
attributes, text events, gamerules, and 26.x world clocks. Do not run example
blocks as a batch; each demonstrates a separate operation.

## RCON Scripting

Connect to a Minecraft server remotely using RCON (enable in `server.properties`):

```properties
# server.properties
enable-rcon=true
rcon.password=your_password
rcon.port=25575
```

RCON is unencrypted. Keep the port bound to a trusted private network, VPN, or
localhost, and inject the password through a protected secret rather than a
command-line argument.

### Bash RCON script (using `mcrcon`)
```bash
#!/usr/bin/env bash
set -euo pipefail

: "${MCRCON_PASS:?inject MCRCON_PASS from a protected secret}"
export MCRCON_HOST="${MCRCON_HOST:-127.0.0.1}"
export MCRCON_PORT="${MCRCON_PORT:-25575}"

restore_saves() {
    mcrcon "save-on" >/dev/null || true
}
trap restore_saves EXIT INT TERM

# Send command
mcrcon "say Server backup starting in 5 minutes"
sleep 300
mcrcon "save-off"
mcrcon "save-all flush"

# Backup world
rsync -av /path/to/server/world/ /backups/world_$(date +%Y%m%d_%H%M%S)/

mcrcon "save-on"
trap - EXIT INT TERM
mcrcon "say Backup complete!"
```

### Python RCON
```python
import os

from mcrcon import MCRcon

with MCRcon("localhost", os.environ["MCRCON_PASS"], port=25575) as mcr:
    response = mcr.command("list")
    print(response)
    # "There are 3 of a max of 20 players online: Steve, Alex, Notch"
    
    players = response.split(": ")[1].split(", ") if ": " in response else []
    print(f"Online players: {players}")
```

---

## Common Scripting Patterns

### First-join setup (load and tick functions)
```mcfunction
# load.mcfunction: create the objective
scoreboard objectives add initialized dummy

# tick.mcfunction: detect players who have not been initialized
execute as @a unless score @s initialized matches 1 run function mypack:on_first_join

# on_first_join.mcfunction
scoreboard players set @s initialized 1
give @s minecraft:stone_sword
give @s minecraft:bread 16
tellraw @s {"text":"Welcome! Here's a starter kit.","color":"green"}
```

### Death counter + respawn
```mcfunction
# tick.mcfunction — check deaths
execute as @a[scores={deaths=1..}] run function mypack:on_death

# on_death.mcfunction (separate file)
scoreboard players reset @s deaths
scoreboard players add @s total_deaths 1
```

### Proximity detection
```mcfunction
# Check if any player is within 5 blocks of a location
execute if entity @a[x=10,y=64,z=10,distance=..5] run function mypack:player_nearby
```

### Math tricks (no fractions in scoreboards)
```mcfunction
# Multiply @s.value by 1.5 using integer math (×3 then /2)
scoreboard players operation @s result = @s value
scoreboard players operation @s result *= #three constants
scoreboard players operation @s result /= #two constants
# Set #two and #three on load:
# scoreboard players set #two constants 2
# scoreboard players set #three constants 3
```

---

## References

- Minecraft Wiki — Commands: https://minecraft.wiki/w/Commands
- Minecraft Wiki — Target selectors: https://minecraft.wiki/w/Target_selectors
- Minecraft Wiki — NBT format: https://minecraft.wiki/w/NBT_format
- Minecraft Wiki — Raw JSON text: https://minecraft.wiki/w/Raw_JSON_text_format
- Minecraft Wiki — Scoreboard: https://minecraft.wiki/w/Scoreboard
- Execute command wiki: https://minecraft.wiki/w/Commands/execute
Files in this package (7)
  • SKILL.md 5 KB
  • references/command-reference.md 16 KB
  • references/execute-cheat-sheet.md 1 KB
  • references/selector-cheat-sheet.md 1 KB
  • scripts/examples/arena-countdown.mcfunction 1 KB
  • scripts/examples/rcon-backup-warning.sh 1 KB
  • scripts/examples/stopwatch-podium.mcfunction 1 KB

Versions

RepositoryScoreLicence
This page · Jahrome907/minecraft-agent-skills100MIT
Jahrome907/minecraft-agent-skills100MIT

Identical content appears in 3 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 1720eee59add (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100minecraft-datapack
    Create, edit, and debug vanilla Minecraft 26.x and 1.21.x datapacks, including functions, advancements, recipes, loot tables, predicates, tags, and pack metadata. Use when the deliverable is a datapack file tree without Java or loader APIs.
  • 95mcbe-command-blocks
    设计、编写与调试 Minecraft 基岩版(MCBE / Bedrock Edition,网易中国版 1.21.130)命令与命令方块链。覆盖基岩版指令语法、execute 子命令、目标选择器、dummy 计分板状态机、impulse/repeat/chain 命令方块、条件链、tick 延迟、C-tick 红石时序、BDX 打包、命令计算模型/数学/N 叉树、数据化 RPG(属性/伤害/T显)、FMBE/MBE 显示实体(playanimation +…
  • 95minecraft-admin
    Operate, update, and troubleshoot a self-hosted Minecraft Java server (Paper, Spigot, Purpur; Fabric and Forge aware) from an AI agent. Use when an operator asks to restart a Minecraft server safely, see who is online, run RCON or console commands, install, update or remove…
  • 85minecraft-java-launcher
    实现或维护 Minecraft Java 版启动器(下载、安装、登录、启动),以及给实例装模组(Modrinth API / CurseForge 网页,含加载器类型匹配)。当需要写或改启动器的下载/启动链路、排查"文件都在却起不来""缺库缺资源""Java 版本不对""离线账号日志 401",或按 Fabric / Forge / NeoForge 类型给实例加模组时使用。附三份实现文档;本技能不含代码,且禁止寻找或调用其它启动器。
  • 100minecraft-world-generation
    Create and debug Minecraft 26.x and legacy 1.21.x world generation for datapacks, NeoForge, or Fabric, including biomes, dimensions, features, structures, and biome modifiers. Use for worldgen data or registration, not general gameplay systems.
  • 100minecraft-mod-developer
    Develop, extend, debug, and verify Minecraft mods in an existing project by discovering the exact loader and Minecraft version first, then implementing the needed Java, data, assets, UI, networking, and build checks. Use for Forge, NeoForge, Fabric, and related mod work where…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.