▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/Marker Command Engine
Marker Command Engine

Marker Command Engine

A macro-free vanilla command execution engine designed for Minecraft 1.20.1 and below. Built with command block logic for maximum compatibility, predictability, and security.

Оцените первым
194
1

Marker Command Engine - Macro-free Command Framework

License: MIT


A trusted command runtime/dependency framework for datapacks. Not designed as a sandbox. Use only with trusted packs and operators.


Marker Command Engine is a lightweight command execution engine for Minecraft datapacks. It runs commands stored in NBT storage using a marker entity + command block technique, with full LanternLoad integration for reliable load ordering.

Features

  • Execute commands stored in storage mce:cmd
  • No macros required — compatible with Minecraft 1.19.3+
  • Low performance impact
  • Clean public API (mce:api/*) — internal functions are private
  • Batch & Queue system
  • MCE-managed scheduler (replaces /schedule, preserves entity context)
  • Per-player cooldown system — macro-free, scoreboard-based
  • Run at fixed world coordinates — execute commands from any integer coordinate
  • Announce system — title, subtitle, and actionbar in a single call
  • Structured log system — write/show/clear with severity levels
  • Version query API — check MCE version from storage at runtime
  • LanternLoad integrated — other packs can depend on MCE with guaranteed load order
  • Versioned API (load.status score for dependency checks)

Requirements

  • Minecraft 1.19.3+ (pack_format 10+)
  • mce:api/cooldown/check requires 1.20.2+ (return command)
  • LanternLoad is bundled — no separate installation needed

Installation

  1. Download the latest release zip.
  2. Place the marker-command-engine folder into your world's datapacks/ folder.
  3. Run /reload.
  4. You should see [MCE] Marker Command Engine v2.2.0 loaded! in chat.

Usage

Run a Command

data modify storage mce:cmd Command set value "say Hello World!"
function mce:api/run/cmd

Run as Entity

# Tag the target entity first
tag @a[name=Steve,limit=1] add mce.executor

# Set the command and call
data modify storage mce:cmd Command set value "execute as @a[tag=mce.executor] run say I am Steve!"
function mce:api/run/as
# mce.executor tag is removed automatically

Run at Coordinates

# Execute a command from a fixed world position
data modify storage mce:cmd Command set value "say Hello from coords!"
data modify storage mce:cmd AtX set value 0
data modify storage mce:cmd AtY set value 64
data modify storage mce:cmd AtZ set value 0
function mce:api/run/at

All three coordinates (AtX, AtY, AtZ) must be set before calling. Values are integers.

Queue

data modify storage mce:cmd Command set value "say First!"
function mce:api/queue/add
data modify storage mce:cmd Command set value "say Second!"
function mce:api/queue/add
function mce:api/queue/run

Batch

data modify storage mce:batch commands set value ["say One","say Two","say Three"]
function mce:api/batch/run

Schedule

# Replaces /schedule
data modify storage mce:cmd Command set value "say Delayed!"
data modify storage mce:cmd Delay set value 40
function mce:api/schedule/run

Cooldown

# Set a 5-second (100 tick) cooldown on @s
data modify storage mce:cd Ticks set value 100
function mce:api/cooldown/set

# Check before running a command (requires 1.20.2+)
execute as @s if function mce:api/cooldown/check run function ns:your/action

# Get remaining ticks
execute as @s run function mce:api/cooldown/get
# Result -> mce:output Cooldown.remaining

# Clear cooldown immediately
function mce:api/cooldown/clear

Announce

# Send title, subtitle, and/or actionbar in a single call.
# All three keys are optional — omit any to skip that slot.
data modify storage mce:announce Title set value "Welcome!"
data modify storage mce:announce Subtitle set value "Enjoy your stay."
data modify storage mce:announce Actionbar set value "Server online"
function mce:api/util/announce

With custom timing (call before announce):

# Presets: fast (5/30/5), normal (10/70/20), slow (20/100/20), instant (0/40/0)
data modify storage mce:announce_times Preset set value "fast"
function mce:api/util/announce_times

data modify storage mce:announce Title set value "Go!"
function mce:api/util/announce

Log

# Write an entry using level shorthands (recommended)
data modify storage mce:log_write msg set value "Player joined the arena."
function mce:api/log/info   # severity 0 — white

data modify storage mce:log_write msg set value "Cooldown nearly expired."
function mce:api/log/warn   # severity 1 — yellow

data modify storage mce:log_write msg set value "Command failed."
function mce:api/log/error  # severity 2 — red

# Or set lvl manually and call write
data modify storage mce:log_write msg set value "Custom entry."
data modify storage mce:log_write lvl set value 1
function mce:api/log/write

# Show all entries to @s (colored by level)
function mce:api/log/show

# Clear all entries
function mce:api/log/clear

The log holds the last 64 entries. Older entries are dropped automatically. Each entry is stored as {n: <int>, lvl: <0|1|2>, msg: "<string>"}.

Version

# Prints version to chat and writes to storage.
function mce:api/util/version
# mce:output Version.string  -> "2.2.0"
# mce:output Version.numeric -> 2002000

Help

function mce:api/util/help

Public API

Only mce:api/* functions are part of the public API. All mce:core/* functions are private and may change without notice.

mce:api/run/

FunctionDescription
mce:api/run/cmdExecute command from mce:cmd Command immediately
mce:api/run/asExecute as tagged entities (mce.executor tag + mce:cmd Command)
mce:api/run/atExecute command from fixed coordinates (mce:cmd AtX/AtY/AtZ)

mce:api/queue/

FunctionDescription
mce:api/queue/addAdd mce:cmd Command to queue
mce:api/queue/runStart executing the queue (one command per 3 ticks)
mce:api/queue/clearClear queue without executing

mce:api/schedule/

FunctionDescription
mce:api/schedule/runSchedule command after mce:cmd Delay ticks (minimum: 1)
mce:api/schedule/clearCancel all pending scheduled jobs

mce:api/batch/

FunctionDescription
mce:api/batch/runAdd mce:batch commands list to queue and run
mce:api/batch/clearClear batch staging area without queuing

mce:api/cooldown/

FunctionMin VersionDescription
mce:api/cooldown/set1.19.3+Set cooldown ticks for @s from mce:cd Ticks
mce:api/cooldown/check1.20.2+Returns 1 if @s is ready, 0 if on cooldown
mce:api/cooldown/clear1.19.3+Clear cooldown for @s immediately
mce:api/cooldown/get1.19.3+Write remaining ticks to mce:output Cooldown.remaining

mce:api/log/

FunctionDescription
mce:api/log/writeAppend entry from mce:log_write {msg, lvl}
mce:api/log/infoShorthand: write with lvl=0 (INFO)
mce:api/log/warnShorthand: write with lvl=1 (WARN)
mce:api/log/errorShorthand: write with lvl=2 (ERROR)
mce:api/log/showPrint all entries to @s (colored by level)
mce:api/log/clearClear all entries and reset counter

mce:api/util/

FunctionDescription
mce:api/util/announceSend title/subtitle/actionbar from mce:announce storage
mce:api/util/announce_timesSet title timing preset from mce:announce_times Preset
mce:api/util/versionPrint MCE version and write to mce:output Version
mce:api/util/cancelAbort active command execution (does not affect queue)
mce:api/util/debug_toggleToggle debug output on/off
mce:api/util/helpPrint usage in chat
mce:api/util/broadcastSend message to all players from mce:broadcast {Msg, Prefix}
mce:api/util/error_clearReset mce:error state and counter

mce:api/util/log and mce:api/util/log_clear are deprecated — use mce:api/log/* instead.


Depending on MCE (LanternLoad)

To make your pack load after MCE, add your load function to #load:post_load and verify the version score:

// data/yourpack/tags/function/post_load.json
{
    "values": ["yourpack:load"]
}
# yourpack:load
# Require MCE v2.2.0+ (score format: major*1000000 + minor*1000 + patch)
execute unless score mce load.status matches 2002000.. run tellraw @a {"text":"[YourPack] ERROR: MCE v2.2.0+ required!","color":"red"}
execute unless score mce load.status matches 2002000.. run return 0

# Your init here...

Technical Details

  • Marker tag: mce.cmd
  • Command block position: 0 -64 0
  • Reset delay: 3 ticks after execution
  • Queue interval: 3 ticks between commands
  • Version score: mce load.status = 2002000 (v2.2.0)

Storage Reference

StorageKeyTypeDescription
mce:cmdCommandStringCommand to execute
mce:cmdDelayIntDelay in ticks for schedule/run (min: 1)
mce:cmdAtXIntX coordinate for run/at
mce:cmdAtYIntY coordinate for run/at
mce:cmdAtZIntZ coordinate for run/at
mce:cdTicksIntCooldown duration in ticks for cooldown/set
mce:queuecommandsListPending queue commands
mce:batchcommandsListBatch staging area
mce:schedulejobsListScheduled job list
mce:configmce.debugByteDebug mode flag (1b = on)
mce:configmce.versionStringMCE version string
mce:announceTitleStringTitle text for util/announce
mce:announceSubtitleStringSubtitle text for util/announce
mce:announceActionbarStringActionbar text for util/announce
mce:announce_timesPresetStringTiming preset: fast normal slow instant
mce:log_writemsgStringMessage to write (input for log/write)
mce:log_writelvlIntSeverity level: 0=INFO 1=WARN 2=ERROR
mce:logentriesListLog entries: {n, lvl, msg} (max 64)
mce:broadcastMsgStringMessage text for util/broadcast
mce:broadcastPrefixStringOptional prefix for util/broadcast
mce:outputCooldown.readyByte1b if @s is ready, 0b if on cooldown
mce:outputCooldown.remainingIntRemaining cooldown ticks
mce:outputVersion.stringStringMCE version string (e.g. "2.2.0")
mce:outputVersion.numericIntMCE version as int (e.g. 2002000)
mce:errorLastStringLast error message
mce:errorCodeStringLast error code (e.g. ERR_NO_CMD)
mce:errorCountIntTotal error count since load

Scoreboard Reference

ObjectiveDescription
mce.queueQueue state and error counter
mce.tickInternal tick counters
mce.compatCompat system flags
mce.cdPer-player cooldown (remaining ticks, 0 = ready)
mce.logLog entry counter and size tracking

Note: mce:cmd Executor is no longer used. Tag your target entity with mce.executor before calling mce:api/run/as.


Changelog

v2.2.0

  • Added mce:api/log/write — structured log entries {n, lvl, msg}, 64-entry cap
  • Added mce:api/log/info / log/warn / log/error — level shorthands
  • Added mce:api/log/show — level-colored tellraw output, macro-free
  • Added mce:api/log/clear — clears entries and resets counter
  • Added mce:api/util/error_clear — resets error state and counter
  • Added missing function tags for api/run/at, api/util/announce, announce_times, version, api/multi/run
  • Deprecated mce:api/util/log and util/log_clear (compat wrappers kept)
  • Added mce.log scoreboard objective

v2.1.0

  • Added mce:api/multi/run — execute title, subtitle, actionbar, message, and commands in a single call
  • Added mce:api/util/broadcast — send a message to all players from storage
  • Added mce:api/util/log — append command string to in-memory audit log

v2.0.0

  • Added mce:api/run/at — execute commands from fixed world coordinates
  • Added mce:api/util/announce — send title, subtitle, actionbar in one call
  • Added mce:api/util/announce_times — configure title timing via presets
  • Added mce:api/util/version — query MCE version at runtime
  • Updated mce:api/util/help with all new APIs
  • Bumped LanternLoad version score to 2000000

v1.1.0

  • Initial public release

License

MIT License — free to use, modify, and distribute.

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

24w46a26.1.x1.21.x1.20.x1.19.x1.18.x

Платформы

Поддерживаемые окружения

Клиент и сервер

Ссылки

Создатели

Детали

Лицензия:
Опубликован:1 месяц назад
Обновлён:3 недели назад
Главная