Compatibility
Minecraft: Java Edition
Platforms
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Links
Creators
Details
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
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
https://minecraft.wiki/w/Commands/rotate
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 theLOOP
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, addedset
andappend
sub-commands - Modified
mp:sound
parameter thresholds - changedVolume
andPitch
range from[0.5f, 1.5f]
to[0.0f, 2.0f]
- Fixed
mp:shader
invalid issue caused by incorrectPath
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
withPLAYER_LIST
andSPRINT
. - Added options related to
mp:input operate
. - Added
mp:hud send
wherePlayerHeadPart
now supports modifiable text$(key)
. - Modified
mp:testfor raycast
maximum distance from64
to128
and removed redundant command tree. - Modified
mp:shader
to optimize the input forPath
parameters and provide suggestions. - Fixed issue where
mp:camera
andmp: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 themc://
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 throughserver storage
, and a new JS interfaceplayerList
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 LayerDrawComponentanimation
- 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, supportingGeckoLib
,EmoteCraft
, andMinecraft BE Animation
animation parsing - Add the
mp:reconfig_cef
client command to reconfigure Cef - Change the
<Path>
required formp: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 addsneak
- Supplementary
mp:aimassist
parameterFocusTime(0~2000L ms)
, formp: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
forset
inmp: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 statusJUMP
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 classDisplayEntity
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 originalmapperplugin: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
- New mp:ride
In addition to the original functions of ride
, this command also allows the player to be the rider.
- New mp:shader
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.
- Optimize
Commands
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.