07-script-api

Rules for choosing Minecraft Bedrock’s stable or beta scripting APIs and setting up behavior-pack scripts. It also covers when players must enable beta features in the game.

In plain words
What is it for?
Creating JavaScript scripts, script-based interfaces, behavior-pack manifests, and event handlers for Minecraft Bedrock Add-Ons.
Why use it?
Prevents Java Edition guidance, unsupported experimental settings, and beta code being used by mistake. It keeps pack files and version choices aligned with the target game version.

Cursor rule for Codex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/guguzea/mc-ai-coding-assistant-tool/07-script-api
Clone the repo
git clone --depth 1 https://github.com/guguzea/MC-AI-Coding-Assistant-Tool

Made for: Codex.

Per session 475 This file is loaded in full into every session.
When invoked 475 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00475 $0.00475
Opus 5 $0.00237 $0.00237
Sonnet 5 $0.00095 $0.00095
Haiku 4.5 $0.00047 $0.00047

Measured 2d ago against content hash 2e1f996745e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

07-script-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

bedrock/.agents/rules/07-script-api.mdc · 31 lines

What it actually says

07 — Script API 与实验开关

默认 stable @minecraft/server。用户点名 Beta 才允许。

Decision Flow(禁止一刀切)

→ 未点名 Beta → 只生成 stable;不写 Beta 事件
→ 点名 @minecraft/server-beta 或 Beta 事件
    → 允许生成;回复必须写「须在世界设置打开 Beta APIs」
    → pack:dependencies 声明 beta 模块
    → 需要 eval → capabilities 写法**未核实**(Learn pack-manifest 无 `script_eval`)
    → 禁止 experimentalGameplay、禁止虚构 worldgen/experimental.json
→ min_engine_version < 约 1.19.80:对照该引擎归档,不要倒灌现行 capabilities
→ ≥ 1.19.80:世界实验开关**未核实**(勿写死 `level.dat experiments.gametest`);pack 不能替玩家打开
→ UI → 只用 stable @minecraft/server-ui(stable/script-server-ui)

已核实约束

  • BP manifest:modulestype: scriptlanguage: javascriptentry(scaffold:scripts/main.js);dependenciesmodule_name: "@minecraft/server"
  • 版本号读 data/bedrock-docs-status.jsonscriptApiStable(不要写死旧 1.x)。docsStatus.stale 不是拒绝令。
  • 事件概述:stable/world-after-eventsstable/system-after-events。类/模块:stable/script-serverstable/script-api-intro
  • 库 Skill:knowledge/libs/bedrock-only/mc-script-servermc-script-ui。禁止把 CCA/Trinkets/GeckoLib 当基岩教程。

滞后:search_bedrock_docs 的 docsStatus.stale 不是拒绝令。

文档

stable/script-api-introstable/script-serverstable/world-after-eventsstable/system-after-eventsstable/script-server-uistable/experimental-features-toggle

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 31 lines · 475 tokens per session scan A 2e1f996745e1

Subscribe to this mod's changes

07-script-api is a cursor rule published in the GitHub repository guguzea/MC-AI-Coding-Assistant-Tool (13 stars, last pushed 3d ago), licensed MIT. It adds 475 tokens to every session, about $0.0024 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.