MapperPlugin 文档
为创作者提供更多元素和功能。该插件旨在扩展功能并增强灵活性。它基于作者在探索和学习过程中的经验,致力于为用户提供更多创意选择和优化工具。
版本 1.4.4-fabric+1.21
更新日志
功能
本模块主要提供命令实现。
注意:对于某些命令,如果执行者不是玩家对象,则需要使用 `execute` 更改执行者。
考虑到地图创作者的使用场景,所有命令仅需 2 级权限。
游戏规则
实体伤害间隔 mobDamageInvulnerable(默认 true)
如果更改此游戏规则,实体将不再具有伤害无敌时间。
玩家伤害间隔 playerDamageInvulnerable(默认 true)
如果更改此游戏规则,玩家将不再具有伤害无敌时间。
显示实体类 DisplayEntity 的 Pitch 值不再受原版限制([-90F,90F]),你可以随意更改!
命令 /data 现在可以合并玩家数据
玩家属性
多重跳跃能力 mapperplugin:player.multi_jump(默认 1.0,最小 1.0,最大 6.0)
玩家的多重跳跃能力。如果更改此选项,仅对整数类型生效。
NBT 标签
玩家的鼠标输入将被监控并存储在其自身的 NBT 中(只读)。
示例:
{Options: {attack:0, use:0, space:0, sneak:0}}
整数类型表示:0 按键未按下 1 按键按下 2 按键按住 3 按键释放
#示例命令
execute as @a[nbt={Options:{attack:2,use:3}}] run say Press and hold the attack key and release the use key
对于 WitherEntity(凋灵实体)
附加 NBT 复合体 BossbarVisible,用于更改凋灵实体是否显示 Boss 血条(默认 true)
DataComponent 物品组件
新增物品组件 mapperplugin:attack_event mapperplugin:use_event
#当手持物品攻击实体时,执行函数 tutorial:attack
give @s minecraft:diamond[mapperplugin:attack_event:{function:"tutorial:attack"}]
#当主手使用物品时,执行函数 tutorial:use
give @s minecraft:diamond[mapperplugin:use_event:{function:"tutorial:use"}]
#当副手使用物品时,执行函数 tutorial:use
give @s minecraft:diamond[mapperplugin:use_event:{function:"tutorial:use", main_hand:false}]
自定义粒子
此粒子 mapperplugin:abstract_custom_particle 是自定义粒子的模板,允许你为粒子设置多个属性。
通过此粒子,你可以自由配置粒子的颜色变化、缩放、光照、重力影响、生命周期等参数。
{
name: "minecraft:end_rod", // 粒子名称 (默认 "minecraft:end_rod")
from_color: [0.5f, 0.0f, 0.0f, 1.0f], // 起始颜色 (RGBA 格式) (默认 [1.0f, 1.0f, 1.0f, 1.0f])
to_color: [0.3f, 1.0f, 1.0f, 1.0f], // 结束颜色 (RGBA 格式) (默认 [1.0f, 1.0f, 1.0f, 1.0f])
scale: 1.0, // 粒子缩放比例 (0.01 ~ 10.0) (默认 1.0f)
light_sky: 15, // 粒子对天空的光照强度 (0 ~ 15) (默认 15)
light_block: 15, // 粒子对方块的光照强度 (0 ~ 15) (默认 15)
gravity: 0.1, // 粒子受重力影响的程度 (-1.0 ~ 1.0) (默认 0.0f)
life_time: 60, // 生命周期 (0~200 tick) (默认 60)
min_life_time: 20 // 最短生命周期 (0~40 tick) (默认 20)
}
#示例命令
particle mapperplugin:abstract_custom_particle{name:"minecraft:end_rod",from_color:[0.5f,0.0f,0.0f,1.0f],to_color:[0.3f,1.0f,1.0f,1.0f],scale:0.6,light_sky:15,light_block:15,gravity:0.1,life_time:60,min_life_time:20} ~ ~ ~ 0 0 0 0.1 500 normal
模组配置界面
此界面用于配置客户端的某些内容。
-渲染末地传送门光束
-更改最大粒子数量
-更改粒子数量上限
-声音监听器接收源
-Cef 浏览器接收来自 MC 发送的 JS 的最大等待时间(需要 MCEF 库)
mp:camera
此指令实现自定义相机功能。
用法:
mp:camera set <Pos> <Rotation> <EnableMoveX> <EnableMoveY> <EnableMoveZ> <EnableMoveYaw> <EnableMovePitch> <Duration> <Easing>
<Pos: x y z>:玩家相机的坐标位置
<Rotation: Yaw Pitch>:玩家相机的方向
<EnableMoveX: boolean>:是否允许相机沿 x 轴移动
<EnableMoveY: boolean>:是否允许相机沿 y 轴移动
<EnableMoveZ: boolean>:是否允许相机沿 z 轴移动
<EnableMoveYaw: boolean>:是否允许相机水平移动(偏航角/yaw)
<EnableMovePitch: boolean>:是否允许相机垂直移动(俯仰角/pitch)
<Duration: float>:从玩家视角到相机目标位置的移动动画持续时间(秒)
<Easing: easing>:滑动类型。
easing (滑动类型)
├── linear (线性)
│ └── 描述:匀速滑动,速率无变化
│
├── ease_in (缓入)
│ └── 描述:开始缓慢,逐渐加速
│
├── ease_out (缓出)
│ └── 描述:开始快速,逐渐减速
│
└── ease_in_out (缓入缓出)
└── 描述:开始和结束缓慢,中间移动较快
#示例命令(以玩家为执行者)
mp:camera set ~ ~ ~-6 0 0 true false false false false 1.2 ease_in_out
#示例命令(非玩家为执行者)
execute as @p run mp:camera set 0 0 -6 0 0 true true false false false 0.6 linear
用法:
mp:camera option raycast <Distance: float>
mp:camera option restrict <FirstPos: x y z> <SecendPos: x y z>
mp:camera option zoom <Zoom: float> <Duration: float> <Easing: easing>
mp:camera option lock_rotation <LockYaw: boolean> <LockPitch: boolean>
mp:camera option shake <Intensity: float> <Duration: float> <ShakeType: shake_type>
mp:camera option roll <Roll: float> <Duration: float> <Easing: easing>
mp:camera option fov_effect_scale <FovEffectScale: float>
mp:camera option normalize
raycast <Distance: float>:摄像机射线距离,使用此选项前需先使用 set 设置摄像机
restrict <FirstPos: x y z> <SecendPos: x y z>:摄像机活动的受限范围,使用此选项前需先使用 set 设置摄像机
zoom <Zoom: float> <Duration: float> <Easing: easing>:摄像机缩放比例(0.1~16.0)、动画时长和缓动类型(参考 camera set <Easing>)
lock_rotation <LockYaw: boolean> <LockPitch: boolean>:锁定玩家视角,默认为 (true true)
shake <Intensity: float> <Duration: float> <ShakeType: shake_type>:摄像机震动的强度、时长和类型
roll <Roll: float> <Duration: float> <Easing: easing>:摄像机翻滚角度、动画时长和缓动类型(参考 camera set <Easing>)
normalize:将摄像机目标实体的朝向归一化[-180,180)
offset <Pos: x y z>:摄像机的相对偏移量,使用此选项前需先使用 set 设置摄像机(测试中)
fov_eeffect_scale <FovEffectScale: float>:摄像机视野效果缩放
shake_type (震动类型)
├── positional (位置)
│ └── Description: 在空间中震动摄像机的位置,导致摄像机位置发生变化。
│
└── rotational (方向)
└── Description: 震动摄像机的方向,导致摄像机视角或旋转发生变化。
#示例命令(以玩家为执行者)
mp:camera option raycast 4
mp:camera option restrict ~-5 ~-5 ~-5 ~5 ~5 ~5
mp:camera option zoom 2 ease_out
mp:camera option lock_rotation false true
mp:camera option shake 1 5 postional
mp:camera option fov_effect_scale 1.0
mp:camera normalize
如果需要重置,请输入
# 重置摄像机的 set 配置
mp:camera set
# 重置所有摄像机 option 配置
mp:camera option
# 重置摄像机的射线距离
mp:camera option raycast
# 重置摄像机的限制范围(默认:无)
mp:camera option restrict
# 重置摄像机的缩放比例
mp:camera option zoom
# 重置玩家锁定的视角方向
mp:camera option lock_rotation
# 清除玩家的摄像机震动效果
mp:camera option shake
# 重置摄像机的翻滚
mp:camera option roll
# 重置所有摄像机配置
mp:camera
mp:chatclear
此命令用于清除玩家聊天栏历史记录(等同于按 F3 + D)。
用法:
mp:chatclear
mp:gui
此命令用于打开自定义界面(浏览器)。
注意:调用此功能需要安装依赖库模组
MCEF ,否则无法使用(不会影响其他游戏的正常打开和其他功能的正常使用)
用法:
mp:gui create <URL> [<offsetX> <offsetY> <Force> <isBlur>]
mp:gui send (direct | filename <FileName>) (<jsString: string> | <jsFunctionName: string> <Storage: storage>)
create <URL: string>:传入 URL,协议可以是 http:// https:// file:/// mc://(mc:// 表示导航至 .minecraft 文件夹作为根目录)
create <offsetX: value>:(可选)设置窗口大小时水平预留的位置大小
create <offsetY: value>:(可选)设置窗口大小时垂直预留的位置大小
value (单位)
├── (无,将自动转换为绝对值)
├── px (绝对值)
└── v (比例)
create <Force: boolean>:(可选)是否禁用 Esc 键关闭界面(默认 false),并提供一个关闭按钮(右上角)
create <isBlur: boolean>:(可选)是否禁用 Esc 键使背景界面模糊(默认 false)
send <jsString: string>:向正在打开自定义 GUI(浏览器)的玩家传递需要执行的 JS 代码
send direct:直接传递
send (<jsString: string> | <jsFunctionName: string> <Storage: storage>):向正在打开自定义 GUI(浏览器)的玩家传递需要执行的 JS 代码,或者通过存储中传入的 JS 方法名来执行
#示例命令(以玩家为执行者)
mp:gui create 'https://www.bing.com' 0px 10v false true
#示例命令(非玩家为执行者)
execute as @p run mp:gui create 'mc:///logs/' 2 10px true false
# 向所有打开了名为 demo.html 的网页文件的玩家发送 JS
execute as @a run mp:gui send filename 'demo.html' document.write('<h1>Hello JS!</h1>');
# 向名为 'storageMethod' 的方法发送 Storage demo:test 并运行
mp:gui send direct storageMethod demo:test
#JS
function storageMethod(nbt) {
console.log(nbt);
}
面向 GUI 开发者
此功能基于 JCEF 浏览器 Chrome 内核。如果您想自定义 GUI,需要具备一定的基础 HTML 知识。
JS 接口:
// 正确实现
// 关闭 GUI
window.cefQuery({
request: "closeGUI",
persistent: false,
});
// 调用 Minecraft 命令
function queryMinecraftCommand(str) {
window.cefQuery({
"request": "command:" + str,
"persistent": false
});
// 获取在线玩家列表
window.cefQuery({
request: "playerList",
persistent: false,
onSuccess: function (response) {
console.log(response)
}
});
}
// 请勿使用此操作!
// 错误示例,这将导致无限循环并占用网络通信
const cmd = 'mp:gui send direct queeryMinecraftCommand();';
function queryMinecraftCommand() {
window.cefQuery({
"request": "command:" + cmd,
"persistent": false
});
}
queryMinecraftCommand();
如果客户端在调用 GUI 时无法响应 JS 请求,请尝试输入 /mp:reconfig_cef 命令以重新配置。
mp:kick
此指令用于踢出玩家,类似于 kick 指令,但它提供文本支持并允许使用任何选择器,包括 CommandBlock、Server、Host 等。
用法:
mp:kick <Reason>
<Reason: text>:(可选)踢出的原因
#示例命令
mp:kick ["\u00a7cyee~"]
mp:motion
此指令允许修改实体的 Motion 值。
用法:
mp:motion (set | append) <vecX> <vecY> <vecZ> [<IsLocal>] [<ConsiderAxisY>]
(set | append):修改运动类型(设置/追加)
<vecX: double>:x 轴向量值
<vecY: double>:y 轴向量值
<vecZ: double>:z 轴向量值
<IsLocal: boolean>:是否使用局部坐标
<ConsiderAxisY: boolean>:是否受 Y 轴参数影响
#示例命令
mp:motion 0 0 2 true true
mp:pathfinder
此命令用于路径寻址导航,需要配合 Loop call(循环调用)使用。
用法:
mp:pathfinder <PathStart> <PathNode>
<PathStart: x y z>:传入一个坐标点,支持 ~ 和 ^(不推荐)
<PathNode: list<x y z>>:传入一个或多个坐标点
#示例命令
execute as @p run mp:pathfinder ~ ~ ~ ~ ~2 ~5
execute as @p run mp:pathfinder ~ 10 ~ ~5 ~14 ~ ~-8 12 ~9 ~1 ~ ~4
mp:perspective
此命令用于修改玩家的视角,等同于按 F5(默认按键)进行切换。
用法:
mp:perspective <Type>
<Type: perspective_type>:传入视角类型
perspective_type (视角类型)
├── FIRST_PERSON (第一人称)
├── THIRD_PERSON_BACK (第三人称 - 后方)
└── THIRD_PERSON_FRONT (第三人称 - 前方)
#示例命令
execute as @p run mp:perspective THIRD_PERSON_FRONT
mp:pose
此命令用于修改实体的动作,可能会发生奇怪的事情。
用法:
mp:pose <Pose>
<Pose: pose>:动作类型,请注意不保证玩家能有效地执行该动作
pose (动作类型)
├── standing (站立)
├── fall_flying (坠落/飞行)
├── sleeping (睡觉)
├── swimming (游泳)
├── spin_attack (旋转攻击)
├── crouching (潜行)
├── long_jumping (长跳)
├── dying (死亡)
├── croaking (鸣叫)
├── using_tongue (使用舌头)
├── sitting (坐下)
├── roaring (咆哮)
├── sniffing (嗅探)
├── emerging (浮现)
├── digging (挖掘)
├── sliding (滑行)
├── shooting (射击)
├── inhaling (吸入)
#示例命令
mp:pose swimming
mp:shader
此命令允许更改玩家渲染的 后处理着色器 shaders/post,并允许叠加(最多 10 个,如果超过 10 个,之前的着色器将被清除)
用法:
mp:shader add <Path: path>
mp:shader clear [<Path: path>]
mp:shader uniform (add | remove | set) <Path: path> <Uniform: string> <Value: float>
<Path: path>:传入有效的着色器路径,文件要求为 JSON 文件
uniform (add | remove | set) <Uniform: string> <Value: float>:添加/减少/设置目标着色器的 Uniform 值(可自定义 Uniform)
如果在 clear [<Path: path>] 中未传入 <Path: path>,则表示重置所有已加载的后处理着色器
#示例命令
mp:shader add minecraft:creeper
mp:shader clear rain_g:wasted
mp:shader uniform test:demo CustomUniform 0.2
mp:particle
此命令用于绘制线段和椭球体(当前版本 1.1.9),注意!不要在不确定情况下一次性频繁生成大规模粒子,这会导致客户端无法响应需求甚至崩溃!
用法:
mp:particle <Particle> lines <Pos> <YawAxis> <PitchAxis> <ZAxis> <ExtraSpeed> <Offset> <Space> <Duration> <PosList>
mp:particle <Particle> sphere <Pos> <YawAxis> <PitchAxis> <ZAxis> <ExtraSpeed> <RadiusX> <RadiusY> <RadiusZ> <Space> <Duration> <MotionStyle>
mp:particle <Particle> arc <Pos> <YawAxis> <PitchAxis> <ZAxis> <ExtraSpeed> <Radius> <Angle> <Space> <Duration> <MotionStyle>
<Particle: particle>:传入粒子类型和效果
<YawAxis: x>:传入偏航角(Y 轴偏转)
<PitchAxis: y>:传入俯仰角(X 轴偏转)
<ZAxis: float>:传入 Z 轴偏转角
<ExtraSpeed>:额外的粒子速度(局部定位),受方向影响
<Space: float>:每个粒子之间的间距
<Duration: long>:完成绘制所需的动画持续时间,单位为毫秒(1000 为 1 秒,但遵循客户端线程)(如果时间过短,建议设置为 0 以减少性能损耗)
lines <Offset: float>:粒子间的随机偏移量
lines <PosList: list<x y z>>:绘制线段类型的坐标点,支持多个坐标点
[sphere | arc] <Pos: x y z>:球体/弧线中心点
[sphere | arc] <MotionStyle: motion_style>:生成图案时使用的运动动画类型
sphere <RadiusX: float>:椭球体的 X 轴半径
sphere <RadiusY: float>:椭球体的 Y 轴半径大小
sphere <RadiusZ: float>:椭球体的 Z 轴半径大小
arc <Radius: float>:弧线半径大小
arc <Angle: float>:弧线角度(0~360)
motion_style (运动动画类型)
├── none (无)
├── shrink (收缩生成)
├── sphere (扩散生成)
├── incomplete_shrink (无序收缩生成)
└── incomplete_sphere (无序扩散生成)
注意:偏视线段图案的旋转轴位于执行位置。如果需要调整,可以使用 execute [positioned | at] 等命令。
# 示例命令
# 生成五角星
execute as @p positioned ~ ~3 ~ run mp:particle minecraft:end_rod lines 0 0 0 0.0 0 0.0 0 0.1 1000 ~ ~3 ~-3 ~ ~3 ~3 ~ ~ ~-1.8 ~ ~5 ~ ~ ~ ~1.8 ~ ~3 ~-3
# 生成爆炸球形形状
execute as @p positioned ~ ~3 ~ run mp:particle minecraft:end_rod sphere ~ ~ ~ 0 0 0 0.0 0 0.0 5 5 5 0.4 1000 incomplete_spread
# 生成扩散环形
execute as @p at @s run mp:particle minecraft:end_rod sphere ~ ~ ~ 0 0 0 0.0 0 0.0 15 0 15 0.1 0 spread
# 生成向前移动的线段,速度和方向基于执行位置
execute as @a rotated as @s run mp:particle minecraft:end_rod lines ~ ~ 0.0 0.0 0.0 0.4 0 0.1 0 ~ ~1 ~ ~ ~1 ~3
# 生成爆发式球形形状,速度和方向基于执行位置
execute as @a positioned ~ ~2 ~ rotated as @s run mp:particle minecraft:end_rod sphere ~ ~ ~ ~ ~ 0 0.0 0.0 0.6 2 2 2 0.2 2000 incomplete_spread
# 生成向前移动的弧形,速度和方向基于执行位置
execute as @a at @s run mp:particle minecraft:end_rod arc ~ ~ ~ ~ ~ -45 0.0 0.0 0.7 2 180 0.1 0 none
mp:mapgenerator
此命令用于将图片转换为地图图片。
用法:
mp:mapgenerator create <Url> <Width> <Height> <Mode>
<Url: string>:传入的图片 URL 路径,支持本地文件(玩家执行器的本地文件)、HTTP 等。
<Width: int>:裁剪图片时的宽度数值(1~16)
<Height: int>:裁剪图片时的高度数值(1~16)
<Mode: mode>:渲染模式,不同的生成模式会有不同的结果
mode (渲染模式)
├── minecraft_common (使用 Minecraft 原生渲染地图)
│ └── 描述:可能会丢失图片的原始颜色
│
├── minecraft_grayscale (使用 Minecraft 原生渲染灰度地图)
│ └── 描述:牺牲更多颜色以换取更高的准确性
│
└── mod_fix_compress (牺牲分辨率以换取更高的颜色准确性)
└── 描述:仅在安装 MapperPlugin 时正常工作
# 示例命令
# 在系统 D: 盘中生成 2x1(2张图片),使用 MINECRAFT_COMMON 模式,从 test.png 文件生成
mp:mapgeneractor create "file:///D:/test.png" 2 1 minecraft_common
# 在线生成 3x3(9张图片),使用 MOD_FIX_COMPRESS 模式,从 abc.jpg 文件生成
mp:mapgeneractor create "https://url.example.com/abc.jpg" 3 3 mod_fix_compress
mp:stats
(测试版)此命令用于更新玩家状态。
用法:
mp:stats <Stats>
<Stats: stats>:状态类型
# 示例命令
mp:stats jump
mp:input
此命令用于控制玩家操作权限和控制。
用法:
mp:input permission <Permission: permission> (disabled | enabled)
mp:input cooldown <CooldownTarget: cooldown_target> <MaxCooldown: int>
mp:input operate <Operate: operate>
permission <Permission: permission>:权限类型。
permission (权限类型)
├── all (全部)
│ ├── movement (移动)
│ │ ├── lateral_move (横向移动)
│ │ │ ├── move_forward (前进)
│ │ │ ├── move_backward (后退)
│ │ │ ├── move_left (左移)
│ │ │ └── move_right (右移)
│ │ ├── jump (跳跃)
│ │ └── sneak (潜行)
│ ├── rotation (旋转)
│ │ ├── rotation_horizontal (水平旋转)
│ │ └── rotation_vertical (垂直旋转)
│ ├── mouse (鼠标)
│ │ ├── mouse_attack (鼠标攻击)
│ │ ├── mouse_use (鼠标使用)
│ │ └── mouse_pick_item (鼠标拾取物品)
│ ├── perspective (视角)
│ ├── smooth_camera (平滑摄像机)
│ ├── hotbar_keys (快捷栏按键)
│ ├── social_interaction (社交互动)
│ ├── inventory (背包)
│ ├── advancement (进度)
│ ├── swap_hand (切换手)
│ ├── drop_item (丢弃物品)
│ └── chat (聊天)
permission <State: state>:状态
cooldown <CooldownTarget: cooldown_target>:冷却目标
cooldown (冷却目标)
├── attack (攻击 [实体])
├── use (放置/交互)
├── space (空格键)
└── all (全部)
cooldown <MaxCooldown: int>:最大冷却时间(0~10000秒)(独立计算)
operate <Operate: operate>:执行操作
# 示例命令
mp:input permission movement disabled
mp:input cooldown attack 10
重置:只需填入所需的参数,或者
mp:input
mp:aimassist
此命令用于改变辅助瞄准功能。
注意:启用后,攻击/破坏键 将被监听为 放置/使用键。
用法:
mp:aimassist <YawAngle> <PitchAngle> <MaxDistance> <TargetMode> [<FocusTime>]
<YawAngle: float>:指定偏航角(5.0~180.0)
<PitchAngle: float>:指定俯仰角(5.0~90.0)
<MaxDistance: float>:指定最大距离(1.0~16.0)
<TargetMode: target_mode>:指定瞄准模式(优先级)angle(角度优先)distance(距离优先)
target_mode (瞄准模式)
├── angle (角度优先)
└── distance (距离优先)
[FocusTime: long]:(可选)当相机锁定视角时,玩家受到辅助瞄准标记影响的时长(默认 0L,0~2000L 毫秒)
mp:aimassist 20 20 5 distance
重置(关闭)辅助瞄准:
mp:aimassist
mp:hotbar
此命令用于设置玩家选中的快捷栏列。
用法:
mp:hotbar <SelectedItem> <IsLock>
<SelectedItem: int>:选中的快捷栏列(1~9)
<IsLock: boolean>:是否锁定(锁定后,玩家无法更改快捷栏列)
# 示例命令
mp:hotbar 1 true
重置方法
mp:hotbar
mp:target
此命令用于标记实体或寻路导航。
注意:某些实体具有独特的机制,对于特定的生物群系标记器可能无法长期生效,例如 Piglin Hoglin。
用法:
mp:target <Executor> entity <Target> [force]
mp:target <Executor> navigation (<EntityTarget> | <BlockPos>) <MaxTimeouts>
<Executor: entity>:执行者,必须为 MobEntity 类
entity <Target: entity>:标记实体、目标
entity [force]:(可选)强制标记,直到目标不再存在
navigation (<EntityTarget: entity> | <BlockPos: x y z>):导航到达终点位置,可以是实体或坐标。
navigation <MaxTimeouts: int>:导航的最大有效时间(0~600 tick),超时后导航将停止
#示例命令
mp:target @n[type=zombie] entity @n[type=pig] force
mp:target @n[type=!player] navigation @s ~ ~ ~ 100
重置方法
#注意:如果目标是玩家,由执行者重置目标可能无效。
mp:target <Executor> entity
mp:target <Executor> navigation
mp:animate
此命令用于播放玩家动画。
此功能依赖于库(您无需再次安装)PlayerAnimator,当前导入版本为:player-animation-lib-fabric-2.0.0+1.21.1,作者 KosmX
动画数据文件将在数据包中加载,路径为 data/<namespace>/animations/。
用法:
mp:animate play <Animation> <Interrupted>
mp:animate stop
play <Animation: path>:播放动画数据文件的资源定位符
play <Interrupted>:在播放动作时,玩家移动是否会中断动画(默认为 false)
stop:停止播放动画
#示例命令
#假设存在数据包模板 data/namespace/animations/waving.json
mp:animate play namespace:waving
mp:hud
此命令用于自定义 HUD 的绘制。
此模组提供了通过 JSON 文件自定义 HUD 绘制的功能(如何编写自定义数据文件将在后面介绍)。您只需将准备好的文件放置在相应位置,然后调用即可。
HUD 数据文件将在数据包 data/<namespace>/hud/ 中加载。
用法:
mp:hud add <Path>
mp:hud clear [<Path>]
mp:hud send <Path> <Argument>
add <Path: path>:要加载的 HUD 配置文件。
clear [<Path: path]>:要清除的 HUD 文件。如果未指定,则清除所有已加载的 HUD 配置文件。
send <Path: path> <Argument: nbt>:发送给目标 HUD 的信息(参考 function ... with)。
#示例命令
#假设存在数据包模板 data/namespace/hud/abc.json
mp:hud add namespace:abc
以下是如何自定义 HUD 文件的方法:
// 这是一个 HUD 文件,整个内容为 LayerDraw
{
"name": "Example HUD", // 文件名,必填
"version": "1.2.1", // 文件版本,必填
"component": [ // 包含一个或多个渲染层组件,必填
LayerDrawComponent1...,
LayerDrawComponent2...,
LayerDrawComponent3...,
LayerDrawComponent4...,
...
],
"resource": [ // 包含一个或多个纹理资源,渲染时将使用预设资源,可选
TextureResource1...,
TextureResource2...,
TextureResource3...,
TextureResource4...,
...
],
"replacement": { // 初始化时可更改的默认文本,例如 $(key1) 在初始化后显示为 value1
"key1": "value1",
"key2": "value2",
"key3": "value3",
"name": "@s" // 如果可更改的文本是 @s,则返回玩家的原始名称
}
}
// 纹理资源数据格式,整个内容为 TextureResource
{
"id": "BLACK", // 纹理资源 ID,必填
"path": [ // 纹理资源位置。如果存在多个,将根据数组大小和记分板追踪器提供的分数返回相应的纹理,必填
"minecraft:hud/heart/withered_hardcore_half",
"minecraft:hud/heart/withered_hardcore_full"
],
"width": 11, // 纹理宽度,必填
"height": 11, // 纹理高度,必填
"offsetX": -1, // 纹理边框宽度增量,必填
"offsetY": -1, // 纹理边框高度增量,必填
"sprite": true // 是否为精灵类型。如果为 false,需要提供完整的纹理资源路径,默认为 false,可选
}
{
"id": "COIN",
"path": "minecraft:textures/item/emerald.png", // 非精灵类型,返回的纹理资源路径为包含文件名的完整路径
"width": 10,
"height": 10,
"offsetX": -1,
"offsetY": -1
}
// 渲染层组件数据格式,整个内容为 LayerDrawComponent
{
"style": { // 组件样式设置,必填
"position": "TOP_LEFT", // 组件的基础渲染位置,必须是以下选项之一:(TOP_LEFT TOP_CENTER TOP_RIGHT CENTER_LEFT CENTER CENTER_RIGHT BOTTOM_LEFT BOTTOM_CENTER BOTTOM_RIGHT)
"offsetX": 2, // 宽度方向的位置偏移量,需为整数,可选
"offsetY": 3, // 高度方向的位置偏移量,需为整数,可选
"background": 491300000, // 组件背景颜色,输入 rgba 十进制数值,可选,默认为透明 (0)
"scale": 1.0, // 组件的整体渲染缩放比例,可选
"opacity": 1.0 // 组件可见度的不透明度,可选
},
"context": [ // 包含一个或多个绘制部分,各部分功能不同,必填
PartContext1...,
PartContext2...,
PartContext3...,
PartContext4...,
...
],
"animation": { // 组件动画帧配置,可选
"0": { // 第 0 刻(tick)的动画关键帧
"pos": [0, 0], // 偏移量,x 轴和 y 轴,可选
"scale": 1.0, // 缩放因子,可选
"opacity": 1.0, // 不透明度,可选
"easing": "EASE_OUT" // 缓动类型,可选(默认 LINEAR)
},
"50": {
"pos": [50, 0],
"scale": 2.0,
"opacity": 0.5,
"easing": "LINEAR"
},
"100": {
"pos": [50, 30],
"scale": 5.0,
"opacity": 1.0,
"easing": "EASE_IN"
},
"200": {
"pos": [0, 0],
"scale": 0.5,
"easing": "LINEAR"
},
"loop": true // 循环播放动画,可选,默认 false
}
}
// 绘制部分数据格式,每种类型有不同的写法,整个内容为 PartContext
{
"type": "text", // 绘制类型,必须是以下选项之一:(text player_head fetters item progress)
"value": [ // 绘制部分包含的值,必填
{"text":"$(name)"}, // 与 Minecraft 原版文本组件一致,其中 $(key) 为可变文本,@s 代表玩家自身
{"text":"","color":"#FFDD50","objective":"coin"} // 如果需要显示分数,可以在原版文本组件中简写,例如 "score": {"objective":"coin"} 可以直接写成 {"objective":"coin"}
],
"sort": "FOLLOW", // 绘制部分的排序方式,必须是以下选项之一:(FOLLOW WRAP),可选,默认为 FOLLOW
"shadow": true // 是否启用阴影文本,可选,默认 false
}
{
"type": "player_head",
"value": {
"player": "Steve", // 要绘制的头像所属玩家,可以是玩家 ID、玩家 UUID,可以使用变量文本 $(key),如果找不到对应值则返回默认皮肤头像,必填
"size": 24, // 头像绘制大小,表示宽度和高度,必填
"playerHat": true // 是否渲染玩家的帽子部分,可选
},
"sort": "FOLLOW"
}
{
"type": "fetters", // 根据记分板追踪器的值重复绘制纹理
"value": {
"id": "HEALTH", // 纹理资源 ID
"objective": "heart", // 记分板对象。如果未提供值,则获取记分板值,默认为 0,(objective 或 value) 二者必须至少有一个
"value": 14, // 记分板追踪器的固定值。如果存在此键,则优先返回此值而不是记分板对象,(objective 或 value) 二者必须至少有一个
"container": { // 绘制纹理前的容器,容器内的纹理将先被绘制,可选
"id": "HEALTH_BACKGROUND", // 容器纹理资源 ID
"value": 6 // 同上,用于记分板追踪器,返回结果
}
}
}
{
"type": "item", // 绘制物品部分
"value": {
"item": "#selected", // 物品目标,需要是玩家背包中的槽位(如 hotbar.1)或 #selected(主手物品),否则返回空,必填
"count": { // 物品数量,基于记分板追踪器提供的值返回数量
"objective": "coin"
},
"custom_model_data": 0 // 物品的自定义模型数据,可选
},
"sort": "FOLLOW"
}
```json
{
"type": "progress", // 绘制进度条部分
"value": {
"width": 240, // 进度条总长度,必填
"height": 8, // 进度条总宽度,必填
"value": { // 当前进度条值,由计分板返回,必填
"objective": "coin"
},
"max_value": { // 进度条最大值,由计分板返回,必填
"value": 100
},
"progress": { // 进度条纹理设置,必填
"current": "minecraft:textures/gui/sprites/boss_bar/purple_progress.png", // 当前值进度条,可以是纹理路径或十六进制颜色,必填
"alter": "minecraft:textures/gui/sprites/boss_bar/red_progress.png", // 进度条变化效果,可以是纹理路径或十六进制颜色,可选
"background": "minecraft:textures/gui/sprites/boss_bar/purple_background.png" // 进度条背景,可以是纹理路径或十六进制颜色,必填
},
"transition": { // 过渡动画配置,必填
"delay": 3500, // 动画持续时间(毫秒,1s=1000ms),必填
"easing": "EASE_OUT", // 缓动函数类型,参考上方说明,必填
"vertical": false // 进度条是否为垂直方向(默认为 false),可选
}
},
"sort": "WRAP"
}
mp:testfor
用于检测或返回特定函数。
用法:
mp:testfor raycast <Entity: entity> entity <MaxDistance: int> [as target] run <Command: command>]
mp:testfor raycast <Entity: entity> block <MaxDistance: int> [at (pos | block_pos)] run <Command: command>
mp:testfor raycast <Entity: entity> miss <MaxDistance: int> [at target] run <Command: command>
mp:testfor distance <Entity: entity> entity <Target: entity>
mp:testfor distance <Entity: entity> pos <Pos: x y z>
raycast:检测实体射线
raycast <Entity: entity>:发射射线的实体
raycast (entity | block | miss):射线目标类型,分别为实体、方块和未命中
raycast <MaxDistance: int>:射线检测的最大范围(0~64)
[as target run <Command: command>]:如果射线检测成功,命令将以(原点 | 目标)作为执行者执行
[at (pos | block_pos) run <Command: command>]:如果射线检测成功,命令将以(坐标位置 | 方块位置)作为执行位置执行
[at target run <Command: command>]:如果射线检测成功,命令将以(原点 | 目标)作为执行位置执行
distance:返回实体与位置之间的距离
distance <Entity: entity>:距离中心点
distance entity <Target: entity>:目标实体,返回实体间的距离
distance pos <Pos: x y z>:目标位置,返回实体与位置之间的距离
collision <Entity: entity>:检测碰撞实体
collosion <Facing: facing>:与方块碰撞的方向
facing (Facing)
├── all
│ ├── horizontal
│ │ ├── east
│ │ └── south
│ │ ├── west
│ │ └── north
│ ├── vertical
│ │ ├── top
│ │ └── ground
collision block <BlockState: block_state>:指定目标方块
collision blocks:指定所有目标方块
collision run <Command: command>:如果检测成功,命令将以方块目标作为执行位置执行
#示例命令
#如果射线在16格范围内击中目标,则目标执行 say Hello 命令
mp:testfor raycast @s entity 16 as target run say Hello
#返回最近玩家实体与最近其他实体之间的距离,并将其存储到存储 test:distance 的 result 键中
execute store result storage test:distance result int 1 run mp:testfor distance @p entity @n[type=!player]
mp:player
此命令用于修改与玩家相关的内容
用法:
mp:player skin set <Skin: string>
mp:player skin reset
mp:player name set <Name string>
mp:player name reset
skin set <Skin: string>:设置玩家皮肤的外观
skin reset:重置为原始皮肤外观
name set <Name: string>:设置玩家显示名称的外观
name reset:重置为原始名称
#示例命令
mp:player skin set Steve
mp:player name set Pig
mp:mouse
此命令用于实现鼠标相关功能
用法:
mp:mouse cursor (default | lock | unlock)
mp:mouse icon (set <Image: path> [<OffsetX: float> <OffsetY: float> <Scale: int>] | reset)
mp:mouse event (left_click | middle_click | right_click) [as target | at (pos | block_pos) | facing (target | pos | block_pos)] run <Command: string>
cursor (default | lock | unlock):设置是否显示鼠标光标(默认显示)(lock 锁定隐藏,unlock 解锁显示)
icon set <Image: path> [<OffsetX: float> <OffsetY: float> <Scale: int>]:设置鼠标图标,设置图标的 XY 偏移量和大小 '[1~4]'(可选)
icon reset:重置鼠标图标
event (left_click | middle_click | right_click) run <Command: string>:当鼠标点击(左/中/右)时触发执行的命令
event (...) [as target | at (pos | block_pos) | facing (target | pos | block_pos)] run <Command: string>:执行命令时携带(执行者/位置(pos/block pos)/朝向(target/pos/block pos))
#示例命令
#解锁鼠标光标
mp:mouse cursor unlock
#将鼠标图标设置为金苹果并放大两倍
mp:mouse icon set minecraft:textures/item/golden_apple.png 0 0 2
#当鼠标右键点击实体时,将执行 /say hello!
mp:mouse event right_click as target run say hello!
#当鼠标左键触碰方块时,将破坏该方块
mp:mouse event left_click at block_pos run setblock ~ ~ ~ air destroy
mp:rotate
此方法与原版 Minecraft 1.21.2 类似
mp:sound
此命令类似于 /playsound,但提供了更多选项
用法:
mp:sound <Sound: path> <SoundCategory: sound_category> static [<Volume: float>] [<Pitch: float>] [<Repeat: boolean>] [<RepeatDelay: int>]
mp:sound <Sound: path> <SoundCategory: sound_category> stereo <Pos: x y z> <UseDistance: boolean> [<Volume: float>] [<Pitch: float>] [<Repeat: boolean>] [<RepeatDelay: int>]
<Sound: path>:指定要播放的声音事件,与原版相同
<SoundCategory: sound_category>:指定播放声音所属的类别,对应游戏中“音乐和声音”选项中的类别设置,与原版相同
static:指定以静态声音形式播放,例如游戏中的背景音乐
stereo <Pos: x y z> <UseDistance: boolean>:指定以立体声形式播放,例如音符盒,需要填写坐标以及是否受距离音量衰减影响(注意:音频需支持立体声,否则与静态声音无异)
[<Volume: float>] [<Pitch: float>] [<Repeat: boolean>] [<RepeatDelay: int>]:播放声音时的音量(默认 1.0F)、音高大小(默认 1.0F)、是否重复播放(默认 false)以及重复之间的间隔(默认 0)
mp:schedule
此指令提供了比原版 schedule 命令更强大的调度能力。它允许附加命令执行源,并使用命令方块以实现更高效的任務执行。
此外,它还支持持久化数据,这些数据不会因游戏周期更新而消失。
用法:
mp:schedule <Name: string> <Time: int> (append | replace | loop) <CommandBlock: command_block>
<Name: string>:计划任务的名称。要清除任务,请使用 /schedule clear mapperplugin:<Name>。
<Time: int>:延迟时间(以刻为单位)。
(append | replace | loop):指定如何处理现有计划:
append:添加新计划。
replace:替换现有计划。
loop:无限重复该计划。
<CommandBlock: command_block>:命令方块参数。
#命令方块格式
#命令使用 `{}` 和 `;` 组合:
execute as @n[type=minecraft:pig] run mp:schedule demo 10t append { say 1; say 2; }
这将在 10 刻后执行 'say 1' 和 'say 2',其中 @n[type=minecraft:pig] 为执行者。
#你也可以在命令块内嵌套多个命令块,例如:
mp:schedule demo 10t append { say 1; say 2; mp:schedule demo1 10t append { say 3; say 4; mp:schedule demo2 10t append { say 5; say 6; }; }; say happy;}
#执行顺序:
#---10t---
say 1
say 2
say happy
#---20t---
say 3
say 4
#---30t---
say 5
say 6
#命令块内的换行不需要 \ 符号(仅限命令块内部):
demo.mcfunction
tellraw @a ["begin"]
mp:schedule demo 10t append {
say 1;
say 2;
mp:schedule demo1 10t append {
say 3;
say 4;
};
}
tellraw @a ["middle \
"]
tellraw @a ["end"]
#重要提示:除非正确闭合,否则避免在命令块内使用特殊字符 {、} 或 ;。
#无效示例:
mp:schedule error 10t append {
say >>{ DEMO;
say this;that;
};
#错误:
?未闭合的括号:say >>{ DEMO
?未知命令:that
使用原版 schedule clear 命令配合 mapperplugin:<Name> 标识符:
#假设你已执行以下命令:
mp:schedule demo_loop 10t loop {say 1;}
#要清除循环计划:
schedule clear mapperplugin:demo_loop
2025/05/15 - 版本 1.4.4
- 修复了在执行
LOOP 任务计划时 mp:schedule 可在时间为 0 时执行的问题
- 增强了任务执行期间
mp:schedule 命令的反馈
- 完善了文档缺失部分(
mp:camera、mp:gui、mp:testfor)
2025/05/11 - 版本 1.4.3
- 添加了
mp:schedule 指令,提供超越原版行为的增强调度功能
- 增强了
<Command: command> 参数的解析和建议功能
2025/04/21 - 版本 1.4.2
- 修复了
mp:mouse event ... as target 无法选择屏幕上半部分实体的问题
- 修复了
mp:input 与某些模组之间的兼容性问题
- 更新了
mp:rotate 的语法文档(/rotate <target> <yaw> <pitch>)
2025/04/15 - 版本 1.4.1
- 添加了
mp:camera fov_effect_scale 以修改视野效果
- 修改了
mp:motion 命令树结构,新增了 set 和 append 子命令
- 修改了
mp:sound 参数阈值 - 将 Volume(音量)和 Pitch(音调)的范围从 [0.5f, 1.5f] 更改为 [0.0f, 2.0f]
- 修复了因
Path 参数错误导致的 mp:shader 无效问题
- 移除了开发过程中遗留的调试代码
2025/04/10 - 版本 1.4.0
- 新增
mp:mouse,提供光标功能。
- 新增
mp:sound,与原版 /playsound 相比进行了更多的参数调整。
- 新增
mp:camera normalize,用于标准化摄像机实体的朝向。
- 新增
mp:camera option offset,用于偏移摄像机位置(测试中)。
- 新增
mp:rotate,功能类似于新版 /rotate。
- 新增
mp:input permission,包含 PLAYER_LIST 和 SPRINT。
- 新增与
mp:input operate 相关的选项。
- 新增
mp:hud send,其中 PlayerHeadPart 现在支持可修改的文本 $(key)。
- 将
mp:testfor raycast 的最大距离从 64 修改为 128,并移除了冗余的命令树。
- 修改
mp:shader,优化了 Path 参数的输入并提供建议。
- 修复了
mp:camera 和 mp:particle 在输入时会自动修正参数的问题。
- 修复了在空气中下落时无法进行二段跳的问题。
2025/03/26 - Version 1.3.3
- 修复了在使用
mc:// 协议指定路径时,MacOS 用户下 mp:gui 无法正常工作的issue。
- 修复了在特定情况下移动时
mp:camera 导致坐标偏移的问题。
2025/03/15 - Version 1.3.2
- 新增
mp:shader uniform 功能,用于传递 uniform 值。
- 新增
mp:player,用于修改与玩家相关的内容。
2025/03/01 1.2.3
- 修复了使用命令关闭玩家界面时
mp:gui 的小问题。
- 新增了
mp:gui 命令部分,现在可以通过 server storage 传递 JavaScript 函数,并新增了 JS 接口 playerList。
- 新增
mp:testfor,用于检测或返回某些功能。
- 如果 MCEF 初始化存在问题,游戏初始化后将弹出一条警告消息。
- 在模组配置界面中新增了两个选项。
2025/02/17 1.2.2
更正了文档中的错误并补充了一些缺失的信息
- 新增物品组件
mapperplugin:attack_event mapperplugin:use_event
- 修复了自定义 HUD 文件中可选填充可能导致错误的问题,
ItemPart 添加了自定义物品模型数据,并修复了 LayerDrawComponent animation 的问题
- 修复了
mp:animate 无法停止动画的问题
- 修复了
mp:pose 服务端和客户端不同步的问题
- 修复了 GameRule
playerDamageInvulnerable 更改无效的问题
- 简化了粒子
mapperplugin:abstract_custom_particle 的参数要求,现在有了默认值
- 修改了重编码
mp:particle sphere 的图形生成算法
- 移除了
mp:nbt,从而使 /data 可以合并玩家数据
- 移除了
mp:ride,从而使 /ride 允许骑乘玩家(但在取消骑乘时仍存在不同步的问题)
2025/01/30 1.2.1
- 新增
mp:hud,向玩家渲染自定义 HUD 并以数据包形式存储
- 优化了自定义 GUI 的渲染
2024/12/23 1.2.0
如果玩家重新进入世界,服务器更改的所有客户端相关配置将被重置(例如 mp:camera)。
- 新增
mp: animation,允许播放玩家动画,支持 GeckoLib、EmoteCraft 和 Minecraft BE Animation 动画解析
- 添加客户端命令
mp:reconfig_cef 以重新配置 Cef
- 将
mp:shader 所需的 <Path> 更改为更标准的格式
2024/12/09 1.1.9
优化了相关的网络通信逻辑和文档描述
- 修改了
NBT Options 的键名并添加了 sneak
- 补充了
mp:aimassist 参数 FocusTime(0~2000L ms),用于 mp:camera 标记瞄准时的聚焦时间(影响玩家的移动轨迹)
- 新增了
mp:gui send 用于传递和执行 JS,改变了原有的命令树结构
- 新模块
mp:camera roll 用于修改摄像机翻滚角度
- 新的模块配置界面,需要安装
ModMenu
删除了一些代码逻辑
2024/11/27 1.1.8
修复了未安装 MCEF 时警告消息始终出现的漏洞。
- 新模块
mp:target 用于标记实体或执行寻路导航
2024/11/22 1.1.7
- 新增
mapperplugin:abstract_custom_particle 粒子,用于自定义粒子模板。
- 新增
mp:hotbar,用于控制玩家的快捷栏状态。
重写了 mp:input 输入权限逻辑
修复了一些 bug
2024/11/09 1.1.6
- 新增
mp:camera option shake,用于设置摄像机震动效果。
mp:camera option zoom 的 set 新增了新的参数要求 easing。
- 新增
mp:input,用于控制玩家操作权限等。
- 新增
mp:aimassist,用于改变辅助瞄准功能。
2024/10/13 1.1.5
为 mp:motion 指令新增了参数要求。
补充了更全面的命令提示和反馈。
- 新增
mp:mapgenerator 命令用于生成地图图像。
- 新增
mp:stats 命令用于更新玩家状态 JUMP
2024/10/12 1.1.4
修复了未安装 MCEF (Minecraft Chromium Embedded Framework) 前置模组时客户端崩溃且无法启动的问题。
?优化了一些代码内容。
- 新增
mp:camera option lock_rotation,用于锁定玩家的视角方向。
- 显示实体类
DisplayEntity 的新增 Pitch 值不再受原版([-90F,90F])的限制。
2024/10/06 1.1.3
- 新增
mp:particle,用于绘制线段、椭球体等。
删除了一些代码
2024/10/01 1.1.2
- 玩家属性
mapperplugin:player.multi_jump 用于改变二段跳能力(默认 1.0,低于 1.0 时无效,返回整数,最大值为 6.0),替代原来的 mapperplugin:generic.double_jump。
自定义 GUI 渲染逻辑已优化,现在使用 JS接口 时不再需要先初始化。
2024/09/27 1.1.1
- 新增 mp:camera,提供更多选项和功能
- 游戏规则
mobDamageInvulnerable 更改生物实体是否启用伤害间隔(默认 true)(不适用于玩家)
playerDamageInvulnerable 更改玩家实体是否启用伤害间隔(默认 true)(适用于玩家)
2024/09/08 1.1.0
除了原有的 ride 功能外,此命令还允许玩家成为骑手。
此命令用于自定义客户端渲染屏幕的 shader。
- 新增游戏规则
mobDamageInvulnerable
用于修改实体是否具有伤害无敌间隔。
- 暂定(未完成)添加玩家属性
mapperplugin:generic.double_jump
用于改变玩家的多重跳跃能力。
现在大多数命令都将拥有命令执行反馈 sendFeedBack()。
2024/08/30 1.0.9
camera
gui
- 修复了在启用时因
.getRender() 问题导致游戏崩溃的小概率事件
other
2024/08/27 1.0.8
pathfinder
camera
- 修复了由于玩家朝向和相机朝向不同而导致选择点不同的错误。
gui
- 在执行请求时已执行安全检查。现在可以不安装依赖库,但这会导致 gui 无法使用,但不会导致游戏崩溃。
MapperPlugin documentation
Provide more elements and functions for creators. The plugin is designed to extend functionality and enhance flexibility. It is based on the author's experience and exploration in the learning process, and is committed to providing users with more creative choices and optimization tools.
Version 1.4.4-fabric+1.21
Changlog
Function
This module mainly provides commands to implement.
Note: For some commands, if the executor is not a player object, you need to use execute to change the executor.
Considering that it is used by map creators, all commands only require level 2 permissions.
Game Rules
Entity damage interval mobDamageInvulnerable (default true)
If this game rule is changed, entities will no longer have a damage invulnerability interval.
Player damage interval playerDamageInvulnerable (default true)
If this game rule is changed, players will no longer have a damage invincibility interval.
The Pitch value of the display entity class DisplayEntity is no longer restricted by the original version ([-90F,90F]), you can change it at will!
Command /data can merge player data now
Player attribute
Multi-hop capability mapperplugin:player.multi_jump (default 1.0, minimum 1.0, maximum 6.0)
The player's multi-jump ability. If this option is changed, it will only take effect for integer types.
NBT tag
The player's mouse input will be monitored and stored in the own NBT (read-only).
example:
{Options: {attack:0, use:0, space:0, sneak:0}}
Int type represents: 0 key not pressed 1 key pressed 2 key held down 3 key released
#Example Command
execute as @a[nbt={Options:{attack:2,use:3}}] run say Press and hold the attack key and release the use key
For WitherEntity
Addon NBT Compound BossbarVisible ,Used to change whether the Wither entity displays the bossbar (default true)
DataComponent Item component
New Item component mapperplugin:attack_event mapperplugin:use_event
#When attacking entities with handheld objects, function tutorial:attack will be executed
give @s minecraft:diamond[mapperplugin:attack_event:{function:"tutorial:attack"}]
#When the main hand uses an item, function tutorial:use will be executed
give @s minecraft:diamond[mapperplugin:use_event:{function:"tutorial:use"}]
#When the off hand uses an item, function tutorial:use will be executed
give @s minecraft:diamond[mapperplugin:use_event:{function:"tutorial:use", main_hand:false}]
Custom particles
This particle mapperplugin:abstract_custom_particle is a template for custom particles that allows you to set multiple properties for the particles.
Through this particle, you can freely configure the particle's color change, scaling, lighting, gravity influence, life cycle and other parameters.
{
name: "minecraft:end_rod", // particle name (default "minecraft:end_rod")
from_color: [0.5f, 0.0f, 0.0f, 1.0f], // start color (RGBA format) (default [1.0f, 1.0f, 1.0f, 1.0f])
to_color: [0.3f, 1.0f, 1.0f, 1.0f], // end color (RGBA format) (default [1.0f, 1.0f, 1.0f, 1.0f])
scale: 1.0, // particle scaling ratio (0.01 ~ 10.0) (default 1.0f)
light_sky: 15, // particle's illumination intensity on the sky (0 ~ 15) (default 15)
light_block: 15, // particle to cube illumination intensity (0 ~ 15) (default 15)
gravity: 0.1, // the degree of gravitational influence of particles (-1.0 ~ 1.0) (default 0.0f)
life_time: 60, // lifecycle (0~200 tick) (default 60)
min_life_time: 20 // minimum lifecycle (0~40 tick) (default 20)
}
#Example Command
particle mapperplugin:abstract_custom_particle{name:"minecraft:end_rod",from_color:[0.5f,0.0f,0.0f,1.0f],to_color:[0.3f,1.0f,1.0f,1.0f],scale:0.6,light_sky:15,light_block:15,gravity:0.1,life_time:60,min_life_time:20} ~ ~ ~ 0 0 0 0.1 500 normal
Mod configuration interface
This interface is used to configure certain contents of the client.
-Rendered end warp gate beam
-Change the maximum number of particles
-Change the upper limit of particle count
-Sound listener receiving source
-The maximum waiting time for Cef browser to receive JS sent from MC (requires MCEF library)
mp:camera
This directive implements custom camera functionality.
usage:
mp:camera set <Pos> <Rotation> <EnableMoveX> <EnableMoveY> <EnableMoveZ> <EnableMoveYaw> <EnableMovePitch> <Duration> <Easing>
<Pos: x y z>: The coordinate position of the player's camera
<Rotation: Yaw Pitch>: The direction of the player's camera
<EnableMoveX: boolean>: Whether to allow the camera to move along the x-axis
<EnableMoveY: boolean>: Whether to allow the camera to move along the y-axis
<EnableMoveZ: boolean>: Whether to allow the camera to move along the z-axis
<EnableMoveYaw: boolean>: Whether to allow the camera to move horizontally (yaw)
<EnableMovePitch: boolean>: Whether to allow the camera to move vertically (pitch)
<Duration: float>: Movement animation duration from player perspective to camera target position (seconds)
<Easing: easing>: Slide type.
easing (Sliding Type)
├── linear (Linear)
│ └── Description: Constant speed sliding, with no change in rate
│
├── ease_in (Ease In)
│ └── Description: Starts slow and gradually accelerates
│
├── ease_out (Ease Out)
│ └── Description: Starts fast and gradually decelerates
│
└── ease_in_out (Ease In Out)
└── Description: Starts and ends slow, with faster movement in the middle
#Example Command(player as a executor)
mp:camera set ~ ~ ~-6 0 0 true false false false false 1.2 ease_in_out
#Example Command(non player as a executor)
execute as @p run mp:camera set 0 0 -6 0 0 true true false false false 0.6 linear
usage:
mp:camera option raycast <Distance: float>
mp:camera option restrict <FirstPos: x y z> <SecendPos: x y z>
mp:camera option zoom <Zoom: float> <Duration: float> <Easing: easing>
mp:camera option lock_rotation <LockYaw: boolean> <LockPitch: boolean>
mp:camera option shake <Intensity: float> <Duration: float> <ShakeType: shake_type>
mp:camera option roll <Roll: float> <Duration: float> <Easing: easing>
mp:camera option fov_effect_scale <FovEffectScale: float>
mp:camera option normalize
raycast <Distance: float>: Camera ray distance, use requires camera set
restrict <FirstPos: x y z> <SecendPos: x y z>: The scope of activity that the camera is constrained to use requires the use of the camera set
zoom <Zoom: float> <Duration: float> <Easing: easing>: Camera zoom ratio (0.1~16.0), animation duration and sliding type (refer to camera set <Easing>)
lock_rotation <LockYaw: boolean> <LockPitch: boolean>: The player's perspective is locked, default (true true)
shake <Intensity: float> <Duration: float> <ShakeType: shake_type>: The intensity, duration and type of camera shake
roll <Roll: float> <Duration: float> <Easing: easing>: Camera roll angle, animation duration and sliding type (refer to camera set <Easing>)
normalize: Normalize the orientation of the camera target entity[-180,180)
offset <Pos: x y z>: Relative offset of camera, use requires camera set (testing)
fov_eeffect_scale <FovEffectScale: float>: Camera's fov view effect
shake_type (Shake Type)
├── positional (Position)
│ └── Description: Shakes the camera's position in space, causing changes to the camera's location.
│
└── rotational (Orientation)
└── Description: Shakes the camera's orientation, causing changes to the camera's viewpoint or rotation.
#Example Command(player as a executor)
mp:camera option raycast 4
mp:camera option restrict ~-5 ~-5 ~-5 ~5 ~5 ~5
mp:camera option zoom 2 ease_out
mp:camera option lock_rotation false true
mp:camera option shake 1 5 postional
mp:camera option fov_effect_scale 1.0
mp:camera normalize
If a reset is required, enter
# Reset the camera's set configuration
mp:camera set
# Reset all camera option configurations
mp:camera option
# Reset the camera's raycast distance
mp:camera option raycast
# Reset the camera's constraint range (default: none)
mp:camera option restrict
# Reset the camera's zoom ratio
mp:camera option zoom
# Reset the player's locked viewpoint orientation
mp:camera option lock_rotation
# Clear the player's camera shake effect
mp:camera option shake
# Reset the camera's roll
mp:camera option roll
# Reset all camera configurations
mp:camera
mp:chatclear
This command is used to clear the player chat bar history (equivalent to F3 + D).
usage:
mp:chatclear
mp:gui
This command is used to open a custom interface (browser).
Note: Calling this function requires the installation of dependent library modules
MCEF , otherwise it cannot be used (it will not affect the normal opening of other games and the use of other functions)
usage:
mp:gui create <URL> [<offsetX> <offsetY> <Force> <isBlur>]
mp:gui send (direct | filename <FileName>) (<jsString: string> | <jsFunctionName: string> <Storage: storage>)
create <URL: string>: Pass in the URL, the protocol can be http:// https:// file:/// mc:// (mc:// represents navigating to the .minecraft folder as the root directory)
create <offsetX: value>: (Optional) Horizontal reserved position size when setting window size
create <offsetY: value>: (Optional) Vertical reserved position size when setting window size
value (Unit)
├── (None, will be automatically converted to absolute value)
├── px (Absolute Value)
└── v (Proportional)
create <Force: boolean>: (Optional) Whether to disable Esc to close the interface (default false) and provide a close button (upper right corner)
create <isBlur: boolean>: (Optional) Whether to disable Esc to blur the background interface (default false)
send <jsString: string>: Pass the JS that needs to be executed to the player who is opening the custom GUI (browser)
send direct: Pass directly
send (<jsString: string> | <jsFunctionName: string> <Storage: storage>): Pass the JS that needs to be executed to the player who is in the custom GUI (browser) open, or execute it in the JS method name passed in through storage
#Example Command(player as a executor)
mp:gui create 'https://www.bing.com' 0px 10v false true
#Example Command(non player as a executor)
execute as @p run mp:gui create 'mc:///logs/' 2 10px true false
# Send JS to all players who have the webpage file named demo.html open
execute as @a run mp:gui send filename 'demo.html' document.write('<h1>Hello JS!</h1>');
#Send Storage demo:test to named 'storageMethod' method then run
mp:gui send direct storageMethod demo:test
#JS
function storageMethod(nbt) {
console.log(nbt);
}
For GUI developers
This function is based on the JCEF browser Chrome kernel. If you want to customize the GUI, you need certain basic knowledge of HTML.
JS interface:
// Correct implementation
// Close the GUI
window.cefQuery({
request: "closeGUI",
persistent: false,
});
// Call Minecraft command
function queryMinecraftCommand(str) {
window.cefQuery({
"request": "command:" + str,
"persistent": false
});
//Get a list of online players
window.cefQuery({
request: "playerList",
persistent: false,
onSuccess: function (response) {
console.log(response)
}
});
}
// Please do not use this operation!
// Incorrect example, it will cause an infinite loop and occupy network communication
const cmd = 'mp:gui send direct queeryMinecraftCommand();';
function queryMinecraftCommand() {
window.cefQuery({
"request": "command:" + cmd,
"persistent": false
});
}
queryMinecraftCommand();
If the client cannot respond to JS requests when calling the GUI, try entering the /mp: reconfig_cef command to reconfigure.
mp:kick
This directive is used to kick players, similar to the kick directive, but it provides a Text and allows any selector call, including CommandBlock Server Host, etc.
usage:
mp:kick <Reason>
<Reason: text>: (optional) Reason for kicking
#Example Command
mp:kick ["\u00a7cyee~"]
mp:motion
This directive allows modifying a creature's Motion value.
usage:
mp:motion (set | append) <vecX> <vecY> <vecZ> [<IsLocal>] [<ConsiderAxisY>]
(set | append): Modify motion type (set/append)
<vecX: double>: x-axis vector value
<vecY: double>: y-axis vector value
<vecZ: double>: z-axis vector value
<IsLocal: boolean>: Whether to use local coordinates
<ConsiderAxisY: boolean>: Whether it is affected by Y-axis parameters
#Example Command
mp:motion 0 0 2 true true
mp:pathfinder
This command is used for pathfinding navigation and requires the use of Loop call
usage:
mp:pathfinder <PathStart> <PathNode>
<PathStart: x y z>: Pass in a coordinate point, support ~ and ^ (not recommended)
<PathNode: list<x y z>>: Pass in one or more coordinate points
#Example Command
execute as @p run mp:pathfinder ~ ~ ~ ~ ~2 ~5
execute as @p run mp:pathfinder ~ 10 ~ ~5 ~14 ~ ~-8 12 ~9 ~1 ~ ~4
mp:perspective
This command is used to modify the player's perspective, equivalent to F5 (default button) to switch.
usage:
mp:perspective <Type>
<Type: perspective_type>: Incoming perspective type
perspective_type (View Type)
├── FIRST_PERSON (First Person)
├── THIRD_PERSON_BACK (Third Person - Behind)
└── THIRD_PERSON_FRONT (Third Person - Front)
#Example Command
execute as @p run mp:perspective THIRD_PERSON_FRONT
mp:pose
This command is used to modify the action of a creature, and strange things may happen.
usage:
mp:pose <Pose>
<Pose: pose>: Action type, note that there is no guarantee that the player can effectively perform the action
pose (Action Type)
├── standing (Standing)
├── fall_flying (Falling/Flying)
├── sleeping (Sleeping)
├── swimming (Swimming)
├── spin_attack (Spin Attack)
├── crouching (Crouching)
├── long_jumping (Long Jump)
├── dying (Dying)
├── croaking (Croaking)
├── using_tongue (Using Tongue)
├── sitting (Sitting)
├── roaring (Roaring)
├── sniffing (Sniffing)
├── emerging (Emerging)
├── digging (Digging)
├── sliding (Sliding)
├── shooting (Shooting)
├── inhaling (Inhaling)
#Example Command
mp:pose swimming
mp:shader
This command allows changing the Post Shader shaders/post rendered by the player, and allows overlaying (up to 10, if more than 10, the previous shader will be cleared)
usage:
mp:shader add <Path: path>
mp:shader clear [<Path: path>]
mp:shader uniform (add | remove | set) <Path: path> <Uniform: string> <Value: float>
<Path: path>: Pass in a valid shader path, and the file requirement is the JSON file
uniform (add | remove | set) <Uniform: string> <Value: float>: Add/reduce/set the Uniform value of the target shader (customizable Uniform)
If <Path: path> is not passed in clear [<Path: path>], it means resetting all loaded post-shaders
#Example Command
mp:shader add minecraft:creeper
mp:shader clear rain_g:wasted
mp:shader uniform test:demo CustomUniform 0.2
mp:particle
This command is used to draw line segments and ellipsoids (current version 1.1.9), attention! Do not generate large-scale particles frequently at one time under uncertain circumstances, as this will cause the client to be unable to respond to demands or even crash!
usage:
mp:particle <Particle> lines <Pos> <YawAxis> <PitchAxis> <ZAxis> <ExtraSpeed> <Offset> <Space> <Duration> <PosList>
mp:particle <Particle> sphere <Pos> <YawAxis> <PitchAxis> <ZAxis> <ExtraSpeed> <RadiusX> <RadiusY> <RadiusZ> <Space> <Duration> <MotionStyle>
mp:particle <Particle> arc <Pos> <YawAxis> <PitchAxis> <ZAxis> <ExtraSpeed> <Radius> <Angle> <Space> <Duration> <MotionStyle>
<Particle: particle>: Pass in particle type and effect
<YawAxis: x>: Pass in Yaw deflection angle (Y-axis deflection)
<YawAxis: y>: Incoming Pitch deflection angle (X-axis deflection)
<ZAxis: float>: Pass in Z deflection angle (Z axis deflection)
<ExtraSpeed>: Additional particle speed (local positioning), affected by orientation
<Space: float>: The space between each particle
<Duration: long>: The animation duration required to complete the painting, in milliseconds (1000 is 1 second, but it follows the client thread) (if the time is too short, it is recommended to set 0 to reduce performance loss)
lines <Offset: float>: Random offset between particles
lines <PosList: list<x y z>>: Coordinate points of drawing line segment type, supports multiple coordinate points
[sphere | arc] <Pos: x y z>: Sphere/arc center point
[sphere | arc] <MotionStyle: motion_style>: The type of movement animation used when generating patterns
sphere <RadiusX: float>: X-axis radius of ellipsoid
sphere <RadiusY: float>: Y-axis radius size of the ellipsoid
sphere <RadiusZ: float>: Z-axis radius size of ellipsoid
arc <Radius: float>: arc radius size
arc <Angle: float>: Arc angle (0~360)
motion_style (Movement Animation Type)
├── none (None)
├── shrink (Shrink Generation)
├── sphere (Diffuse Generation)
├── incomplete_shrink (Unordered Shrink Generation)
└── incomplete_sphere (Unordered Diffuse Generation)
Note: The rotation axis of the deflection lines pattern is at the execution position. If adjustment is needed, execute [positioned | at], etc. can be used.
# Example Command
# Generate a pentagram
execute as @p positioned ~ ~3 ~ run mp:particle minecraft:end_rod lines 0 0 0 0.0 0 0.0 0 0.1 1000 ~ ~3 ~-3 ~ ~3 ~3 ~ ~ ~-1.8 ~ ~5 ~ ~ ~ ~1.8 ~ ~3 ~-3
# Generate an explosive spherical shape
execute as @p positioned ~ ~3 ~ run mp:particle minecraft:end_rod sphere ~ ~ ~ 0 0 0 0.0 0 0.0 5 5 5 0.4 1000 incomplete_spread
# Generate a diffusive ring
execute as @p at @s run mp:particle minecraft:end_rod sphere ~ ~ ~ 0 0 0 0.0 0 0.0 15 0 15 0.1 0 spread
# Generate a forward-moving line segment, with speed and direction based on execution position
execute as @a rotated as @s run mp:particle minecraft:end_rod lines ~ ~ 0.0 0.0 0.0 0.4 0 0.1 0 ~ ~1 ~ ~ ~1 ~3
# Generate an eruptive spherical shape, with speed and direction based on execution position
execute as @a positioned ~ ~2 ~ rotated as @s run mp:particle minecraft:end_rod sphere ~ ~ ~ ~ ~ 0 0.0 0.0 0.6 2 2 2 0.2 2000 incomplete_spread
# Generate a forward-moving arc, with speed and direction based on execution position
execute as @a at @s run mp:particle minecraft:end_rod arc ~ ~ ~ ~ ~ -45 0.0 0.0 0.7 2 180 0.1 0 none
mp:mapgenerator
This command is used to convert images into map images.
usage:
mp:mapgenerator create <Url> <Width> <Height> <Mode>
<Url: string>: Incoming image url path, supports local files (local files of player executors), HTTP, etc.
<Width: int>: The width number (1~16) when cropping the image
<Height: int>: The number of heights when cropping pictures (1~16)
<Mode: mode>: rendering mode, different generation modes will have different results
mode (Rendering Mode)
├── minecraft_common (Use Minecraft Native Rendering Map)
│ └── Description: May lose the original colors of the image
│
├── minecraft_grayscale (Use Minecraft Native Rendering Grayscale Map)
│ └── Description: Sacrifices more color for higher accuracy
│
└── mod_fix_compress (Sacrifices Resolution for Higher Color Accuracy)
└── Description: Only works properly when MapperPlugin is installed
# Example Command
# Generate a 2x1 (2 images) in the system's D: drive, using the MINECRAFT_COMMON mode, from test.png file
mp:mapgeneractor create "file:///D:/test.png" 2 1 minecraft_common
# Generate a 3x3 (9 images) online, using the MOD_FIX_COMPRESS mode, from abc.jpg file
mp:mapgeneractor create "https://url.example.com/abc.jpg" 3 3 mod_fix_compress
mp:stats
(Testing) This command is used to update the player status.
usage:
mp:stats <Stats>
<Stats: stats>: status type
#Example Command
mp:stats jump
mp:input
This command is used to control player operation permissions and controls.
usage:
mp:input permission <Permission: permission> (disabled | enabled)
mp:input cooldown <CooldownTarget: cooldown_target> <MaxCooldown: int>
mp:input operate <Operate: operate>
permission <Permission: permission>: Permission type.
permission (Permission Types)
├── all (All)
│ ├── movement (Movement)
│ │ ├── lateral_move (Lateral Movement)
│ │ │ ├── move_forward (Move Forward)
│ │ │ ├── move_backward (Move Backward)
│ │ │ ├── move_left (Move Left)
│ │ │ └── move_right (Move Right)
│ │ ├── jump (Jump)
│ │ └── sneak (Sneak)
│ ├── rotation (Rotation)
│ │ ├── rotation_horizontal (Horizontal Rotation)
│ │ └── rotation_vertical (Vertical Rotation)
│ ├── mouse (Mouse)
│ │ ├── mouse_attack (Mouse Attack)
│ │ ├── mouse_use (Mouse Use)
│ │ └── mouse_pick_item (Mouse Pick Item)
│ ├── perspective (Perspective)
│ ├── smooth_camera (Smooth Camera)
│ ├── hotbar_keys (Hotbar Keys)
│ ├── social_interaction (Social Interaction)
│ ├── inventory (Inventory)
│ ├── advancement (Advancement)
│ ├── swap_hand (Swap Hand)
│ ├── drop_item (Drop Item)
│ └── chat (Chat)
permission <State: state>: Status
cooldown <CooldownTarget: cooldown_target>: Cooling target
cooldown (Cooldown Targets)
├── attack (Attack [Entity])
├── use (Place/Interact)
├── space (Spacebar)
└── all (All)
cooldown <MaxCooldown: int>: Maximum cooling time (0~10000s) (independent)
operate <Operate: operate>: perform operations
#Example Command
mp:input permission movement disabled
mp:input cooldown attack 10
Reset: Just fill in the blanks with the required parameters, or
mp:input
mp:aimassist
This command is used to change the aiming assist function.
Note: When enabled, Attack/Break Key will be listened to Place/Use Key.
usage:
mp:aimassist <YawAngle> <PitchAngle> <MaxDistance> <TargetMode> [<FocusTime>]
<YawAngle: float>: Specify Yaw angle (5.0~180.0)
<PitchAngle: float>: Specify the pitch angle (5.0~90.0)
<MaxDistance: float>: Specify the maximum distance (1.0~16.0)
<TargetMode: target_mode>: Specify aiming mode (priority) angle (angle priority) distance (distance priority)
target_mode (Aiming Mode)
├── angle (Angle Priority)
└── distance (Distance Priority)
[FocusTime: long]: (Optional) The length of time the player is subject to the auxiliary aiming mark when the camera locks the perspective (default 0L, 0~2000L milliseconds)
mp:aimassist 20 20 5 distance
Reset (turn off) aim assist:
mp:aimassist
mp:hotbar
This command is used to set the slot column selected by the player.
usage:
mp:hotbar <SelectedItem> <IsLock>
<SelectedItem: int>: Selected slot column (1~9)
<IsLock: boolean>: Whether to lock (after locking, players cannot change the slot column)
#Example Command
mp:hotbar 1 true
Reset method
mp:hotbar
mp:target
This command is used to mark entities or pathfinding navigation.
Note: Some entities have unique mechanisms that will not work long-term for certain biomarkers, such as Piglin Hoglin.
usage:
mp:target <Executor> entity <Target> [force]
mp:target <Executor> navigation (<EntityTarget> | <BlockPos>) <MaxTimeouts>
<Executor: entity>: Executor, required to be MobEntity class
entity <Target: entity>: mark entity, target
entity [force]: (optional) Force marking until target no longer exists
navigation (<EntityTarget: entity> | <BlockPos: x y z>): Navigation reaches the end position, which can be an entity or a coordinate.
navigation <MaxTimeouts: int>: The maximum validity time of navigation (0~600 tick), navigation will stop when timeout
#Example Command
mp:target @n[type=zombie] entity @n[type=pig] force
mp:target @n[type=!player] navigation @s ~ ~ ~ 100
Reset method
# Note: If the target is a player, resetting the target by the executor may not be effective.
mp:target <Executor> entity
mp:target <Executor> navigation
mp:animate
This command is used to play player animations.
This feature depends on the library(you don't need to install it again) PlayerAnimator, currently imported version:player-animation-lib-fabric-2.0.0+1.21.1, Author KosmX
The animation data file will be loaded in the data-packs. data/<namespace>/animations/.
usage:
mp:animate play <Animation> <Interrupted>
mp:animate stop
play <Animation: path>: The resource location for playing animation data files
play <Interrupted>: Will player movement interrupt animation when playing actions (default false)
stop: Stop playing animation
#Example Command
#Assuming there is a data-pack templete data/namespace/animations/waving.json
mp:animate play namespace:waving
mp:hud
This command is used to customize the drawing of HUD.
This mod provides the ability to customize the drawing of HUD through JSON files (how to write custom data files will be introduced later). You only need to place the prepared files in the corresponding location and then call them.
HUD data files will be loaded in the data pack data/<namespace>/hud/.
Usage:
mp:hud add <Path>
mp:hud clear [<Path>]
mp:hud send <Path> <Argument>
add <Path: path>: The HUD configuration file to be loaded.
clear [<Path: path>]: The HUD file to be cleared. If not specified, all loaded HUD configuration files will be cleared.
send <Path: path> <Argument: nbt>: The information to be sent to the target HUD (refer to function ... with).
#Example command
#Assuming there is a data pack templete data/namespace/hud/abc.json
mp:hud add namespace:abc
Below is how to customize the HUD file:
// This contains an HUD file, the entire content is LayerDraw
{
"name": "Example HUD", // File name, required
"version": "1.2.1", // File version, required
"component": [ // Contains one or more rendering layer components, required
LayerDrawComponent1...,
LayerDrawComponent2...,
LayerDrawComponent3...,
LayerDrawComponent4...,
...
],
"resource": [ // Contains one or more texture resources, preset resources will be used during rendering, optional
TextureResource1...,
TextureResource2...,
TextureResource3...,
TextureResource4...,
...
],
"replacement": { // Default text that can be changed during initialization, such as $(key1) being displayed as value1 after initialization
"key1": "value1",
"key2": "value2",
"key3": "value3",
"name": "@s" // If the changeable text is @s, the player's original name is returned
}
}
// Texture resource data format, the entire content is TextureResource
{
"id": "BLACK", // Texture resource ID, required
"path": [ // Texture resource location. If multiple exist, the corresponding texture will be returned based on the array size and the score provided by the score tracker, required
"minecraft:hud/heart/withered_hardcore_half",
"minecraft:hud/heart/withered_hardcore_full"
],
"width": 11, // Texture width, required
"height": 11, // Texture height, required
"offsetX": -1, // Texture border width increment, required
"offsetY": -1, // Texture border height increment, required
"sprite": true // Whether it is a sprite type. If false, the complete texture resource path needs to be provided, default is false, optional
}
{
"id": "COIN",
"path": "minecraft:textures/item/emerald.png", // Not a sprite type, the returned texture resource path is the complete path with the file name
"width": 10,
"height": 10,
"offsetX": -1,
"offsetY": -1
}
// Rendering layer component data format, the entire content is LayerDrawComponent
{
"style": { // Component style settings, required
"position": "TOP_LEFT", // Basic rendering position of the component, must be one of these options: (TOP_LEFT TOP_CENTER TOP_RIGHT CENTER_LEFT CENTER CENTER_RIGHT BOTTOM_LEFT BOTTOM_CENTER BOTTOM_RIGHT)
"offsetX": 2, // Width position offset, needs to be an integer, optional
"offsetY": 3, // Height position offset, needs to be an integer, optional
"background": 491300000, // Component background color, input rgba decimal number, optional, default is transparent (0)
"scale": 1.0, // Overall rendering magnification of the component, optional
"opacity": 1.0 // Component visibility opacity, optional
},
"context": [ // Contains one or more drawing parts, each with different functions, required
PartContext1...,
PartContext2...,
PartContext3...,
PartContext4...,
...
],
"animation": { // Component animation frame configuration, optional
"0": { // Animation keyframe at the 0th tick
"pos": [0, 0], // Offset, x-axis and y-axis, optional
"scale": 1.0, // Scaling factor, optional
"opacity": 1.0, // Opacity, optional
"easing": "EASE_OUT" // Sliding type, optional (default LINEAR)
},
"50": {
"pos": [50, 0],
"scale": 2.0,
"opacity": 0.5,
"easing": "LINEAR"
},
"100": {
"pos": [50, 30],
"scale": 5.0,
"opacity": 1.0,
"easing": "EASE_IN"
},
"200": {
"pos": [0, 0],
"scale": 0.5,
"easing": "LINEAR"
},
"loop": true // Loop play animation, optional, default false
}
}
// Drawing part data format, each type has different writing methods, the entire content is PartContext
{
"type": "text", // Drawing type, must be one of these options: (text player_head fetters item progress)
"value": [ // Values contained in the drawing part, required
{"text":"$(name)"}, // Consistent with Minecraft's original text component, where $(key) is changeable text, @s represents the player themselves
{"text":"","color":"#FFDD50","objective":"coin"} // If you need to display a score, you can abbreviate it in the original text component, such as "score": {"objective":"coin"} can be directly written as {"objective":"coin"}
],
"sort": "FOLLOW", // Drawing part sorting method, must be one of these options: (FOLLOW WRAP), optional, default is FOLLOW
"shadow": true //Whether to enable shadow text, optional, default false
}
{
"type": "player_head",
"value": {
"player": "Steve", // Player whose avatar is to be drawn, can be player ID, player UUID, you can use the variable text $(key), and if the corresponding value cannot be found, return the default skin avatar, required
"size": 24, // Avatar drawing size, representing width and height, required
"playerHat": true // Whether to render the player's hat part, optional
},
"sort": "FOLLOW"
}
{
"type": "fetters", // Repeat drawing texture based on the value of the score tracker
"value": {
"id": "HEALTH", // Texture resource ID
"objective": "heart", // Scoreboard object of the score tracker. If no value is given, the scoreboard value is obtained, default is 0, must have one of (objective or value)
"value": 14, // Fixed value of the score tracker. If this key exists, this value is returned first instead of the scoreboard object, must have one of (objective or value)
"container": { // Container before drawing the texture, the texture inside the container will be drawn first, optional
"id": "HEALTH_BACKGROUND", // Container texture resource ID
"value": 6 // Same as above, for the score tracker, returns the result
}
}
}
{
"type": "item", // Drawing item part
"value": {
"item": "#selected", // Item target, needs to be a slot in the player's inventory (such as hotbar.1) or #selected (main hand item), otherwise returns empty, required
"count": { // Item count, returns the count based on the value provided by the score tracker
"objective": "coin"
},
"custom_model_data": 0 //Custom model data for item(s), optional
},
"sort": "FOLLOW"
}
{
"type": "progress", // Drawing progress bar part
"value": {
"width": 240, // Total length of the progress bar, required
"height": 8, // Total width of the progress bar, required
"value": { // Current progress bar value, returned by the score tracker, required
"objective": "coin"
},
"max_value": { // Maximum value of the progress bar, returned by the score tracker, required
"value": 100
},
"progress": { // Progress bar texture settings, required
"current": "minecraft:textures/gui/sprites/boss_bar/purple_progress.png", // Current value progress bar, can be texture location or decimal color, required
"alter": "minecraft:textures/gui/sprites/boss_bar/red_progress.png", // Progress bar change, can be texture location or decimal color, optional
"background": "minecraft:textures/gui/sprites/boss_bar/purple_background.png" // Progress bar background, can be texture location or decimal color, required
},
"transition": { // Transition animation configuration, required
"delay": 3500, // Animation duration (milliseconds, 1s=1000ms), required
"easing": "EASE_OUT", // Sliding function type, refer to above, required
"vertical": false // Whether the progress bar is vertical (default is false), optional
}
},
"sort": "WRAP"
}
mp:testfor
Used to detect or return certain functions.
用法:
mp:testfor raycast <Entity: entity> entity <MaxDistance: int> [as target] run <Command: command>]
mp:testfor raycast <Entity: entity> block <MaxDistance: int> [at (pos | block_pos)] run <Command: command>
mp:testfor raycast <Entity: entity> miss <MaxDistance: int> [at target] run <Command: command>
mp:testfor distance <Entity: entity> entity <Target: entity>
mp:testfor distance <Entity: entity> pos <Pos: x y z>
raycast: Detecting the radiation of entity
raycast <Entity: entity>: Entity emitting radiation
raycast (entity | block | miss): The types of ray targets are entity, block, and miss
raycast <MaxDistance: int>: Maximum range of radiographic testing (0~64)
[as target run <Command: command>]: If the X-ray detection is successful, the command will be executed with (origin | target) as the executor
[at (pos | block_pos) run <Command: command>]: If the X-ray detection is successful, the command will be executed with (pos | block_pos) as the execution location
[at target run <Command: command>]: If the X-ray detection is successful, the command will be executed with (origin | target) as the execution location
distance: Return the distance between the entity and the location
distance <Entity: entity>: Distance from center
distance entity <Target: entity>: Target entity, return the distance between entities
distance pos <Pos: x y z>: Target location, returns the distance between the entity and the location
collision <Entity: entity>: Detecting collision entity
collosion <Facing: facing>: The direction of collision with the block
facing (Facing)
├── all
│ ├── horizontal
│ │ ├── east
│ │ └── south
│ │ ├── west
│ │ └── north
│ ├── vertical
│ │ ├── top
│ │ └── ground
collision block <BlockState: block_state>: Specify the target block
collision blocks: Specify all target blocks
collision run <Command: command>: If the detection is successful, the command will be executed with the block target as the execution position
#Example command
#If the radiation hits a target within a range of 16, the target will execute the command say Hello
mp:testfor raycast @s entity 16 as target run say Hello
#Return the distance between the nearest player entity and the nearest entity, and store it in the result key of the storage test:distance
execute store result storage test:distance result int 1 run mp:testfor distance @p entity @n[type=!player]
mp:player
This command is used to modify content related to the player
Usage:
mp:player skin set <Skin: string>
mp:player skin reset
mp:player name set <Name string>
mp:player name reset
skin set <Skin: string>: Set the appearance of the player's skin
skin reset: Reset to the original skin appearance
name set <Name: string>: Set the appearance of the player's display name
name reset: Reset to the original name
#Example command
mp:player skin set Steve
mp:player name set Pig
mp:mouse
This command is used to implement mouse related functions
Usage:
mp:mouse cursor (default | lock | unlock)
mp:mouse icon (set <Image: path> [<OffsetX: float> <OffsetY: float> <Scale: int>] | reset)
mp:mouse event (left_click | middle_click | right_click) [as target | at (pos | block_pos) | facing (target | pos | block_pos)] run <Command: string>
cursor (default | lock | unlock): Set whether the mouse is displayed (default) (lock locked, not displayed) (unlock unlocked, displayed)
icon set <Image: path> [<OffsetX: float> <OffsetY: float> <Scale: int>]: Set mouse icon, set the XY offset and size of the icon '[1~4]' (optional)
icon reset: Reset mouse icon
event (left_click | middle_click | right_click) run <Command: string>: The command triggered for execution when the mouse clicks (left/middle/right)
event (...) [as target | at (pos | block_pos) | facing (target | pos | block_pos)] run <Command: string>: Carry (executor / position(pos/block pos) / facing(target/pos/block pos)) when executing command
#Example command
#Unlock mouse cursor
mp:mouse cursor unlock
#Set the mouse icon to a golden apple and double its size
mp:mouse icon set minecraft:textures/item/golden_apple.png 0 0 2
#When the mouse right-click on an entity,/say hello! Will be executed!
mp:mouse event right_click as target run say hello!
#When the left mouse button touches the block, it will destroy the block
mp:mouse event left_click at block_pos run setblock ~ ~ ~ air destroy
mp:rotate
This method is similar to the original Minecraft 1.21.2
mp:sound
This command is similar to /playsound, but provides more options
Usage:
mp:sound <Sound: path> <SoundCategory: sound_category> static [<Volume: float>] [<Pitch: float>] [<Repeat: boolean>] [<RepeatDelay: int>]
mp:sound <Sound: path> <SoundCategory: sound_category> stereo <Pos: x y z> <UseDistance: boolean> [<Volume: float>] [<Pitch: float>] [<Repeat: boolean>] [<RepeatDelay: int>]
<Sound: path>: Specify the sound event to be played, which is the same as the original version
<SoundCategory: sound_category>: Specify the category to which the playback sound belongs, corresponding to the category set in the "Music and Sound" option of the game, which is the same as the original version
static: Specify to play as static sound, such as background music in games
stereo <Pos: x y z> <UseDistance: boolean>: Specify the playback as stereo sound, such as a note box, which requires filling in coordinates and whether it is affected by distance volume attenuation (note: the audio needs to support stereo sound, otherwise it is no different from static sound)
[<Volume: float>] [<Pitch: float>] [<Repeat: boolean>] [<RepeatDelay: int>]: Volume when playing sound (default 1.0F), pitch size (default 1.0F), whether to play repeatedly (default false), and the interval between repetitions (default 0)
mp:schedule
This directive provides more powerful scheduling capabilities than the vanilla schedule command. It allows attaching command execution sources and uses command blocks for more efficient task execution.
Additionally, it supports persistent data that won't disappear due to game cycle updates.
Usage:
mp:schedule <Name: string> <Time: int> (append | replace | loop) <CommandBlock: command_block>
<Name: string>: The name of the scheduled task. To clear a task, use /schedule clear mapperplugin:<Name>.
<Time: int>: The delay time in ticks.
(append | replace | loop): Specifies how to handle existing schedules:
append: Add a new schedule.
replace: Replace existing schedules.
loop: Repeat the schedule indefinitely.
<CommandBlock: command_block>: A command block parameter.
#Command Block Format
#Commands are combined using `{}` and `;`:
execute as @n[type=minecraft:pig] run mp:schedule demo 10t append { say 1; say 2; }
This will execute 'say 1' and 'say 2' after 10 ticks, with @n[type=minecraft:pig] as the executor.
#你也可以在命令块内嵌套多个命令块,如:
mp:schedule demo 10t append { say 1; say 2; mp:schedule demo1 10t append { say 3; say 4; mp:schedule demo2 10t append { say 5; say 6; }; }; say happy;}
#Execution Order:
#---10t---
say 1
say 2
say happy
#---20t---
say 3
say 4
#---30t---
say 5
say 6
#Line breaks inside command blocks do not require \ (only within command blocks):
demo.mcfunction
tellraw @a ["begin"]
mp:schedule demo 10t append {
say 1;
say 2;
mp:schedule demo1 10t append {
say 3;
say 4;
};
}
tellraw @a ["middle \
"]
tellraw @a ["end"]
#Important Notes::Avoid using special characters {, }, or ; inside command blocks unless properly enclosed.
#Invalid Example:
mp:schedule error 10t append {
say >>{ DEMO;
say this;that;
};
#Error:
?Unclosed brackets: say >>{ DEMO
?Unkown command: that
Use the vanilla schedule clear command with the mapperplugin:<Name> identifier:
#Assuming you have executed the following command:
mp:schedule demo_loop 10t loop {say 1;}
# To clear a looped schedule:
schedule clear mapperplugin:demo_loop
2025/05/15 - Version 1.4.4
- Fixed
mp: schedule can be executed at time 0 when executing the LOOP task plan
- Enhanced
mp: schedule command feedback during task execute
- Enhanced missing parts of the document (
mp:camera mp:gui mp:testfor)
2025/05/11 - Version 1.4.3
- Added
mp:schedule directive with enhanced scheduling capabilities beyond vanilla behavior
- Enhanced
<Command: command> parameter parsing and suggestions
2025/04/21 - Version 1.4.2
- Fixed
mp:mouse event ... as target failing to select entities in the upper half of the screen
- Fixed Compatibility issues between
mp:input and certain mods
- Updated Syntax documentation for
mp:rotate (/rotate <target> <yaw> <pitch>)
2025/04/15 - Version 1.4.1
- Added
mp:camera fov_effect_scale to modify field of view effects
- Modified
mp:motion command tree structure, added set and append sub-commands
- Modified
mp:sound parameter thresholds - changed Volume and Pitch range from [0.5f, 1.5f] to [0.0f, 2.0f]
- Fixed
mp:shader invalid issue caused by incorrect Path parameter
- Removed legacy debugging code from development process
2025/04/10 - Version 1.4.0
- Added
mp:mouse to provide cursor functionality.
- Added
mp:sound with more parameter adjustments compared to the original /playsound.
- Added
mp:camera normalize to normalize camera entity orientation.
- Added
mp:camera option offset to offset camera position (testing).
- Added
mp:rotate with similar functionality to the new version of /rotate.
- Added
mp:input permission with PLAYER_LIST and SPRINT.
- Added options related to
mp:input operate.
- Added
mp:hud send where PlayerHeadPart now supports modifiable text $(key).
- Modified
mp:testfor raycast maximum distance from 64 to 128 and removed redundant command tree.
- Modified
mp:shader to optimize the input for Path parameters and provide suggestions.
- Fixed issue where
mp:camera and mp:particle would automatically correct parameters when entered.
- Fixed issue where double jumping could not be performed when falling in mid-air.
2025/03/26 - Version 1.3.3
- Fixed issue with
mp:gui where specifying the mc:// protocol wouldn't work for MacOS users.
- Fixed issue with
mp:camera where moving in specific cases caused coordinate offsets.
2025/03/15 - Version 1.3.2
- Added
mp:shader uniform functionality to pass uniform values.
- Added
mp:player to modify player-related content.
2025/03/01 1.2.3
- Fixed
mp:gui Minor issues when using commands to close the player interface
- Added
mp:gui command section, now you can pass JavaScript functions through server storage, and a new JS interface playerList has been added.
- Added
mp:testfor to detect or return certain functionalities.
- Added a warning message that will pop up after the game initialization if there is an issue with MCEF initialization.
- Added two new options in the mod configuration interface.
2025/02/17 1.2.2
Corrected errors in the document and added some missing information
- Added Item Component
mapperplugin:attack_event mapperplugin:use_event
- Fixed In
Custom HUD File , optional filling may result in errors, ItemPart add custom item model data, and fixed LayerDrawComponent animation
- Fixed
mp:animate unable to stop animation issue
- Fixed
mp:pose server and client un-synchronized issue
- Fixed GameRule
playerDamageInvulnerable change invalid issues
- Modify simplified particles
mapperplugin:abstract_custom_particle parameter requirements, there are default values now
- Modify recode
mp:particle sphere algorithm for graphic generation
- Removed
mp:nbt ,then /data can merge player data
- Removed
mp:ride ,then /ride allow riding players (but there is still an un-synchronized issue when canceling riding)
2025/01/30 1.2.1
- Added
mp:hud, render custom HUD to players and store it in the form of data packets
- Optimized custom GUI rendering
2024/12/23 1.2.0
If the player re-enters the world now, all client related configurations changed by the server will be reset (such as mp:camera).
- Added
mp: animation to allow player animations to be played, supporting GeckoLib, EmoteCraft, and Minecraft BE Animation animation parsing
- Add the
mp:reconfig_cef client command to reconfigure Cef
- Change the
<Path> required for mp:shader to a more standard format
2024/12/09 1.1.9
Optimize related network communication logic and document description
- Modify the
NBT Options key name and add sneak
- Supplementary
mp:aimassist parameter FocusTime(0~2000L ms), for mp:camera marking the focus time when aiming (affects the player's movement trajectory)
- Added
mp:gui send for passing and executing JS, changing the original command tree structure
- New
mp:camera roll is used to modify the camera roll angle
- New module configuration interface, need to install
ModMenu
Deleted some code logic
2024/11/27 1.1.8
Fixed the vulnerability where warning messages would always appear when MCEF is not installed.
- New
mp:target is used to mark entities or perform pathfinding navigation
2024/11/22 1.1.7
- Added
mapperplugin:abstract_custom_particle particle, used to customize particle templates.
- Added
mp:hotbar to control the player's slot bar status.
Rewritten mp:input input permission logic
Fixed some bugs
2024/11/09 1.1.6
- Added
mp:camera option shake, used to set the camera shake effect.
- New Added new parameter requirement
easing for set in mp:camera option zoom.
- Added
mp:input, used to control player operation permissions, etc.
- Added
mp:aimassist, used to change the aiming assist function.
2024/10/13 1.1.5
New parameter requirements added for the mp:motion directive.
Supplemented with more comprehensive command tips and feedback.
- Added
mp:mapgenerator command to generate map images.
- Added
mp:stats command to update player status JUMP
2024/10/12 1.1.4
Fixed the issue where the client would crash and fail to start if the MCEF (Minecraft Chromium Embedded Framework) pre-module was not installed.
?Optimized some code contents.
- Added
mp:camera option lock_rotation, used to lock the player's perspective direction.
- Newly added
Pitch value of display entity class DisplayEntity is no longer restricted by the original version ([-90F,90F]).
2024/10/06 1.1.3
- Added
mp:particle for drawing line segments, ellipsoids, etc.
Deleted some code
2024/10/01 1.1.2
- Player attribute
mapperplugin:player.multi_jump is used to change the multi-jump ability (default 1.0, invalid below 1.0, return integer, maximum value 6.0), replace the original mapperplugin:generic.double_jump.
The custom GUI rendering logic has been optimized and now no longer requires first initialization when using JS接口.
- Now compatible with servers instead of only supporting single player and host.
2024/09/27 1.1.1
- Add mp:camera with more options and provide more functions
- Game rules
mobDamageInvulnerable Change whether biological entities enable damage interval (default true) (not for players)
playerDamageInvulnerable changes whether the player entity enables damage interval (default true) (for players)
2024/09/08 1.1.0
In addition to the original functions of ride, this command also allows the player to be the rider.
This command is used to customize the shader of the client-side rendering screen.
- New game rules
mobDamageInvulnerable
Used to modify whether the entity has a damage invincibility interval.
- Tentative (not completed) Add player attributes
mapperplugin:generic.double_jump
Used to change the player's multi-jump ability.
Most commands will now have command execution feedback sendFeedBack().
2024/08/30 1.0.9
camera
- Fixed the logic of setting player orientation and camera orientation
gui
- Fixed a small chance of the game crashing due to the
.getRender() issue when enabled
other
2024/08/27 1.0.8
pathfinder
- Safety check performed before pathfinding
- Optimize algorithm logic
camera
- Fixed the bug where the selection point was different due to different player orientation and camera orientation.
gui
- Security checks have been performed when executing requests. It is now possible not to install dependent libraries, but this will cause the gui to become unusable, but will not cause the game to crash.
评论 0
登录后参与评分
还没有评论,来抢沙发吧