Minecraft Wiki

Minecraft Wiki ไม่ถือว่าเป็นวิกิอย่างเป็นทางการของ Microsoft อีกต่อไป ดังนั้นจึงมีการเปลี่ยนแปลงหลายประการเกิดขึ้น ซึ่งรวมไปถึงโลโก้ของวิกิด้วย โปรดอ่านที่ประกาศนี้สำหรับข้อมูลเพิ่มเติม

READ MORE

Minecraft Wiki
Advertisement
Translation Thai Alphabet
บทความนี้มีเนื้อหาบางส่วนเป็นภาษาต่างประเทศ 
คุณสามารถช่วยพัฒนาบทความนี้ได้ด้วยการแปลเนื้อหา
Disambig color บทความนี้เกี่ยวกับconsole commands สำหรับthe block that executes commands ดูที่ Command Block สำหรับthe minecart that executes commands ดูที่ Minecart with Command Block สำหรับthe similar system found in the Legacy Console Editionดูที่ host privileges

คำสั่ง (อังกฤษ: Commands) เฃนั้นเป็นคุณสมบัติขั้นสูงที่สามารถที่เปิดใช้งานโดยการพิมพ์ข้อความที่ถูกต้อง

การใช้งาน[]

In the client, commands are entered via the chat window, which is displayed by pressing the T key (default) or, ในรุ่น Java, / key. Using the / key also enters the forward-slash that commands require as a prefix, so it is a useful shortcut. The and keys can be used to view previously entered text, including all previously executed commands. Pressing Tab ↹ while entering commands cycles through possible commands or arguments, and can be used to auto-enter the coordinates of the block looked at before entering the chat.

When the cursor is at a location corresponding to some types of argument (such as an ID), a list of applicable values appears above the text box. If the argument is already containing some characters, the list displays only those values containing the typed command/text

Commands may also be entered in a multiplayer server's console, but are not preceded by a / when entered this way. A server admin running commands in this way is often referred to as "ghosting".

Commands in command blocks can be preceded by a slash, but it is not required. Commands in a command block usually also require an argument, like a player's username.

The majority of commands are available only in the following situations:

  • In functions, as part of a data pack or add-on.
  • In a multiplayer game, entered by an operator or command block.
  • In other multiplayer games, entered by the player who opened a LAN game with cheats enabled, or is hosting their own multiplayer server
  • In singleplayer, if cheats are enabled.

Some player commands are also available in singleplayer even when cheats are not enabled.

Note: ในรุ่น Java, in singleplayer worlds where cheats were not enabled at creation, they can be enabled on a temporary basis by opening the current game session to LAN play ( Esc → "Open to LAN", then "Allow Cheats" button and "Start LAN World"). The player does not actually need to be on a LAN or have others join. This is not permanent but allows the use of commands until the player quits the world, and changes the player makes via commands (items spawned, etc.) are saved with the world. The player can do this each time the player starts playing the world again. Note that this disables game pausing for the duration, so while open to LAN, the player should get somewhere safe or reload their world before using the Game Menu. The player can disable the LAN world by reloading the world. To permanently enable cheats, the level.dat has to be edited.

ในรุ่น Bedrock, cheats can be toggled at any time in the "Game" tab of the settings menu. Enabling cheats in a world permanently prevents players from unlocking achievements in that world, even if cheats are later turned off.

พิกัดโลกสัมพัทธ์: เครื่องหมายตัวหนอน[]

Ordinarily, position arguments are expressed as a set of three absolute world coordinates (X Y Z), each number representing a distance along an axis from the world origin.

Each coordinate can alternatively be expressed as a relative world coordinate, written in tilde notation (~ΔX ~ΔY ~ΔZ). A number following a tilde (~) describes an offset from execution position along one of the world axes, and a lone tilde assumes an offset of 0; for example, the position ~10 ~ ~-30 means "10 blocks east (+X) and 30 blocks north (–Z) of here."

Essentially, ~ ~ ~ is shorthand for the command's current position.

Relative world coordinates can mix with absolute coordinates; for example, /tp ~ 64 ~ keeps the sender's X and Z positions unchanged but teleports them to an absolute height of 64 blocks.

The /execute command can update a command's current position, changing the meaning of ~ ~ ~.

ในรุ่น Java, pressing F3 replaces the crosshair with a display of these three directions: +X in red, +Y in green, +Z in blue (westwards, upwards, and southwards, respectively).

พิกัดท้องถิ่น: เครื่องหมายยกกำลัง[]

The other way to describe positions is with local coordinates, written entirely in caret notation (แม่แบบ:Local frame). Like relative coordinates, these describe positions relative to where a command is executed from, but with different directions. A number following a caret (^) is an offset within a moving, entity-centric frame: This is a coordinate system which is centered at the sender's feet, with +Xlocal directed to its left, +Ylocal directed upwards, and +Zlocal directed in the direction it is facing. (Note that an entity with rotation 0 0 has its local frame aligned with the world frame.)

  • Described in other terms, these coordinates express ^ΔSway ^ΔHeave ^ΔSurge

For example, /tp ^ ^ ^5 teleports the player 5 blocks forwards. If they turn around and repeat the command, they are teleported back to where they started.

ในรุ่น Java, pressing F3+B displays the +Zlocal direction for all entities as a blue ray centered on their heads

Local coordinates cannot be mixed with world coordinates (e.g. ^ 0 ^, ^ 0 ~1), and attempting so alerts the typist, "Cannot mix world & local coordinates (everything must either use ^ or not)." So such a command fails or cannot be executed.

A command's execution position, rotation, dimension, and anchor all change the effect of using ^ ^ ^. These can be updated by the /execute command.

ตัวเลือกเป้าหมาย[]

In most commands where a player may be specified as an argument, it is possible to "target" one or more players satisfying certain conditions instead of specifying players by name. To target players by condition, choose a target selector variable and, optionally, one or more target selector arguments to modify the conditions to be satisfied.

For example, to change the game mode of all players on team Red to creative mode, instead of specifying them by name individually:

/gamemode creative @a[team=Red][รุ่น Java เท่านั้น]


ตัวแปรของตัวเลือกเป้าหมาย[]

Summary of target selector variables
Variable Function
@p nearest player
@r random player
@a all players
@e all entities
@s entity executing the command
@c the player's agent‌[รุ่นสำหรับการศึกษา เท่านั้น]
@v all agents‌[รุ่นสำหรับการศึกษา เท่านั้น]

A target selector variable identifies the broad category of targets to select. There are five (or, ในรุ่นสำหรับการศึกษา, seven) variables:

@p
Targets the nearest player. When run by the console, the origin of selection is (0, 0, 0). If there are multiple nearest players, caused by them being precisely the same distance away, the player who most recently joined the server is selected.
Target selector arguments may be used to specify what category of players to select the nearest player from. For example, @p[team=Red] targets the nearest player on team Red even if there are other players closer.
The c[BE เท่านั้น] or limit[JE เท่านั้น] target selector argument can be used to increase the number of nearest players targeted (for example, @p[c=3] or @p[limit=3] targets the three nearest players, respectively).

ในรุ่น Bedrock, @p ignores dead players.

@r
Targets a random player.
Target selector arguments may be used to specify what category of players to select a random player (or more) from. For example, @r[team=Red] targets a random player from team Red. Whereas @r[limit=3] targets three random players.
ในรุ่น Java, one cannot use @r to target entities via the type selector argument. To select a random entity, use @e[sort=random,limit=1] instead.
ในรุ่น Bedrock, @r ignores dead players.
@a
Targets every player (alive or dead) by default unless Target selector arguments are used. For example, @a[team=Red] only targets all players on team Red.
@e
Targets all alive entities in loaded chunks (Includes players unless if @e[type=!player] is specified).
Target selector arguments may be used to specify what category of entities to target from. For example, @e[type=cow] only targets cows.
@s
Targets the entity (alive or dead) that executed the command. It does not target anything if the command was run by a command block or server console.
Target selector arguments may be used to specify whether the executor is actually eligible to be targeted. For example, @s[type=cow,team=Red] targets the executor of the command if the executor was a cow on team Red.
@c[รุ่นสำหรับการศึกษา เท่านั้น]
Target the player's agent only.
Target selector arguments may be used to target the player's agent. For example, /tp @c 50 60 40 teleports the player's agent only to the specified location.
@v[รุ่นสำหรับการศึกษา เท่านั้น]
Target all agents. Works only if more than one agent exists.
Target selector arguments may be used to target all agents. For example, /remove @v removes all agents.


ข้อโต้แย้งตัวเลือกเป้าหมาย

Summary of target selector arguments
Selection by Position
Argument(s) Selection criteria
x, y, z coordinate
distance[รุ่น Java เท่านั้น]
r, rm[รุ่น Bedrock เท่านั้น]
distance
dx, dy, dz volume dimensions
Selection by Scoreboard Values
Argument(s) Selection criteria
scores scores
tag scoreboard tag
team[รุ่น Java เท่านั้น] team name
Selection by Traits
Argument(s) Selection criteria
limit,sort[รุ่น Java เท่านั้น]
c[รุ่น Bedrock เท่านั้น]
limit
level[รุ่น Java เท่านั้น]
l,lm[รุ่น Bedrock เท่านั้น]
experience level
gamemode[รุ่น Java เท่านั้น]
m[รุ่น Bedrock เท่านั้น]
game mode
name entity name
x_rotation[รุ่น Java เท่านั้น]
rx,rxm[รุ่น Bedrock เท่านั้น]
vertical rotation
y_rotation[รุ่น Java เท่านั้น]
ry,rym[รุ่น Bedrock เท่านั้น]
horizontal rotation
type entity type
family[รุ่น Bedrock เท่านั้น] entity family
nbt[รุ่น Java เท่านั้น] nbt
advancements[รุ่น Java เท่านั้น] advancements
predicate[รุ่น Java เท่านั้น] predicate

After a target selector, optional arguments can be used to narrow down the set of targets to a group that also matches certain criteria. When used with @a or @e, arguments narrow down the targets from the full list to a specific group. When used with @p or @r, the nearest or random player is selected from the group. When used with @s, the player using the command is targeted only if they would be in the narrowed group.

Argument-value pairs appear within square brackets after the target selector variable, separated by commas:

@<variable>[<argument>=<value>,<argument>=<value>,...].

Arguments and values are case-sensitive. Spaces are allowed around the brackets, equal signs, and commas, except in between the target variable and the first bracket. Commas must be used to separate argument-value pairs.

If there are multiple argument-value pairs, they all must be satisfied to add a potential target to the group. (In other words, they are AND-ed together).

Position arguments
[x=<value>,y=<value>,z=<value>]
Define a position in the world the selector starts at, for use with the distance argument or the volume arguments, dx, dy and dz. Defining the position alone can be used with a target selector that selects the nearest entity from those coordinates, but it otherwise has no use, so applying it (and only it) to @e still selects all entities in the same dimension.
The positional components are doubles, allowing for values like +12.34, and they are not center-corrected, meaning x=0 is not corrected to x=0.5 - tilde notation is available for selector argument coordinates.‌[รุ่น Bedrock เท่านั้น]
Selecting targets by distance
[<x>,<y>,<z>,distance=<value>] - Filter target selection based on their Euclidean distances from some point, searching for the target's feet (a point at the bottom of the center of their hitbox). If the positional arguments are left undefined, radius/i is calculated relative to the position of the command's execution. Only unsigned values are allowed.
ในรุ่น Java, ranges are supported to select a specific region:
  • @e[distance=10] — Target all entities exactly ten blocks away.
  • @e[distance=8..16] — Target all entities more than eight blocks, but less than 16 blocks away (inclusive).
ในรุ่น Bedrock, r represents the maximum range to find entities and rm represents the minimum. As such:
  • @e[rm=10,r=10] — Target all entities exactly ten blocks away.
  • @e[rm=8,r=16] — Target all entities from 8 to 16 blocks away.
Selecting targets by volume
[<x>,<y>,<z>,dx=<value>,dy=<value>,dz=<value>] - Filter target selection based on their x-difference, y-difference, and z-difference from some point, as measured from the closest corner of the entities' hitboxes[JE] or by their feet.[BE]
This can be interpreted as creating a rectangular volume defined by an initial position (<x>,<y>,<z>) and diagonal vector (<dx>,<dy>,<dz>), then selecting all entities whose hitboxes are at least partially contained by that volume (ในรุ่น Bedrock, whose feet are within that volume). If the positional arguments are left out, the selection is interpreted as originating from the position of the command's execution. Any values are allowed, including signed and fractional numbers.
Note that dx,dy,dz specify signed differences from the given coordinate. They do not specify a separate coordinate, nor do they extend in both the positive and negative directions.
Examples ในรุ่น Java:
  • @e[x=1,dx=4,y=2,dy=5,z=3,dz=6] — Select all entities whose hitbox collides with the block region (1~5, 2~7, 3~9) (or, mathematically speaking, the region that is {(x,y,z)∈R3|x∈[1.0,5.0),y∈[2.0,7.0),z∈[3.0,9.0)}).
  • @e[x=1,y=2,z=3,dx=0,dy=0,dz=0] — Select all entities whose hitbox contains the point (1,2,3).
Examples ในรุ่น Bedrock:
  • @e[x=1,dx=4,y=2,dy=5,z=3,dz=6] — Select all entities whose feet are within the block region (1~5, 2~7, 3~9).
  • @e[x=1,y=2,z=3,dx=0,dy=0,dz=0] — Select all entities whose feet contains the point (1, 2, 3).
It is possible to combine selection by distance and selection by volume, in which case the command select targets only within the overlap of both regions (within a certain radius/I of the volume's initial point and not outside the defined volume).
ในรุ่น Java, entities without a hitbox (for example, armor stands with {Marker:1b}), may not be selected.
Selecting targets by scores
[scores={<objective>=<value>,...}] - Filter target selection based on their scores in the specified objectives.
All tested objectives are in a single tag, with a list of individual score selectors between braces afterward. The selectors inside the braces support ranges.
  • @e[scores={myscore=10}] — Select all entities with a score in objective myscore of exactly ten.
  • @e[scores={myscore=10..12}] — Select all entities with a score in objective myscore of between ten and 12 (inclusive).
  • @e[scores={myscore=5..}] — Select all entities with a score in objective myscore of five or greater.
  • @e[scores={myscore=..15}] — Select all entities with a score in objective myscore of 15 or less.
  • @e[scores={foo=10,bar=1..5}] — Select all entities with a score in objective foo of exactly ten, and a score in objective bar of between one and five (inclusive).
ดูเพิ่มเติมที่: Scoreboard § Objectives
Selecting targets by team‌[รุ่น Java เท่านั้น]
[team=<teamName>] - Filter target selection to those who are on a given team.
[team=!<teamName>] — Filter to those who are not on a given team.
[team=] — Filter to those who are teamless.
[team=!] — Filter to those who have some team.
ดูเพิ่มเติมที่: Scoreboard § Teams
Limiting and sorting target selection
[limit=<value>] - Limit the number of targets selected to be no higher than the given value.
When using the variables @p and @r, this argument defaults to one. Applying the limit argument to them may artificially increase the number of nearest or random targets selected. When applying this argument to @a or @e, this argument returns only a limited number of targets.
[limit=<value>,sort=(nearest|furthest|random|arbitrary)][JE] - Limit the number of targets, and specify selection priority.
  • sort=nearest — Sort by increasing distance. (Default for @p, @e[BE], @a[BE])
  • sort=furthest — Sort by decreasing distance.
  • sort=random — Sort randomly. (Default for @r)
  • sort=arbitrary — Do not sort. (Default for @e[JE], @a[JE])
Examples ในรุ่น Java:
  • @a[limit=3,sort=nearest] or @p[limit=3] — Select the nearest three players.
  • @a[limit=4,sort=furthest] — Select the furthest four players.
  • @a[limit=2,sort=random] or @r[limit=2] — Select two players, chosen randomly.
Examples ในรุ่น Bedrock:
  • @a[c=3] — Select the nearest three players.
  • @a[c=-4] — Select the furthest four players.
  • @r[c=2] — Select two living players, chosen randomly.
Selecting targets by experience level
[level=<value>] - Filter target selection based on their experience levels. This naturally filters out all non-player targets.
ในรุ่น Java, this selector supports ranges:
  • @a[level=10] — Select all players who have exactly ten levels.
  • @a[level=8..16] — Select all players who have between eight and 16 levels (inclusive).
ในรุ่น Bedrock, l represents the maximum level to search for and lm represents the minimum. As such:
  • @a[lm=10,l=10] — Select all players who have exactly ten levels.
  • @a[lm=8,l=16] — Select all players who have between eight and 16 levels (inclusive).
Selecting targets by game mode
[gamemode=<gamemodeName>] — Filter target selection to those who are in the specified game mode.
[gamemode=!<gamemodeName>] — Filter target selection to those who are not in the specified game mode.
This naturally filters out all non-player targets. Permitted values for <gamemodeName> are spectator[รุ่น Java เท่านั้น], adventure, creative, and survival. ในรุ่น Bedrock, the shorthand values a and 2, c and 1, and s and 0 may be used for Adventure mode, Creative mode, and Survival mode respectively.
Examples ในรุ่น Java:
  • @a[gamemode=survival] — Select all players who are in Survival mode.
  • @a[gamemode=!spectator] — Select all players who are not in Spectator mode.
Examples ในรุ่น Bedrock:
  • @a[m=survival] or @a[m=s] or @a[m=0] — Select all players who are in Survival mode.
  • @a[m=!creative] or @a[m=!c] or @a[m=!1] — Select all players who are not in Creative mode.
Selecting targets by name
[name=<givenName>] — Filter target selection to all those with a given name.
[name=!<givenName>] — Filter target selection to all those without a given name.
This is a string, so spaces are allowed only if quotes are applied. This cannot be a JSON text compound.
  • @e[name=!Steve] - Select all entities that are not named "Steve".
Selecting targets by vertical rotation
[x_rotation=<value>] — Filter target selection based on their pitch, or more specifically their declination from the horizon, measured in degrees. Values range from -90 (straight up) to 0 (at the horizon) to +90 (straight down).
ในรุ่น Java, this argument supports ranges:
  • @e[x_rotation=0] — Select all entities that are looking directly at the horizon.
  • @e[x_rotation=30..60] — Select all entities that are looking between 30° and 60° (inclusive) below the horizon.
  • @e[x_rotation=45..] — Select all entities that are looking 45° or more below the horizon.
  • @e[x_rotation=..0] — Select all entities that are looking at or above the horizon.
ในรุ่น Bedrock, rx represents the maximum x-rotation value to search for and rxm represents the minimum. As such:
  • @e[rxm=0,rx=0] — Selects all entities that are looking directly at the horizon.
  • @e[rxm=30,rx=60] — Selects all entities that are looking between 30° and 60° (inclusive) below the horizon.
  • @e[rxm=45] — Select all entities that are looking 45° or more below the horizon.
  • @e[rx=0] — Select all entities that are looking at or above the horizon.
Selecting targets by horizontal rotation
[y_rotation=<value>] — Filter target selection based on their rotation in the horizontal XZ-plane, measured clockwise in degrees from due south (or the positive Z direction). Values vary from -180 (facing due north) to -90 (facing due east) to 0 (facing due south) to +90 (facing due west) to +180 (facing due north again).
ในรุ่น Java, this argument supports ranges, and the maximum can reach values over 180. Some examples:
  • @e[y_rotation=0] — Select all entities that are facing due south.
  • @e[y_rotation=45] — Select all entities that are facing 45° west of south.
  • @e[y_rotation=180..270] — Select all entities that are facing in the 90° between due north and due east (inclusive).
  • @e[y_rotation=-90..0] — Select all entities that are facing in the 90° between due east and due south (inclusive).
  • @e[y_rotation=-90..90] — Select all entities that are facing between due east and due west (inclusive), through south.
  • @e[y_rotation=0..180] — Select all entities that are not facing at all east.
ในรุ่น Bedrock, ry represents the maximum y-rotation value to search for and rym represents the minimum. As such:
  • @e[rym=0,ry=0] — Select all entities that are facing due south.
  • @e[rym=45,ry=45] — Select all entities that are facing 45° west of south.
  • @e[rym=-90,ry=0] — Select all entities that are facing in the 90° between due east and due south (inclusive).
  • @e[rym=0,ry=180] — Select all entities that are not facing at all east.
Selecting targets by type
[type=<entityType>] — Filter target selection to those of a specific entity type.
[type=!<entityType>] — Filter target selection to those not of a specific entity type.
The given entity type must be a valid entity ID or entity type tag[รุ่น Java เท่านั้น] used to identify different types of entities internally. The namespace can be left out if the ID is within the minecraft: namespace. (For example, creeper for creepers, minecart for regular minecarts, tnt for primed TNT, etc.) Entity IDs or tags are case-sensitive.
When using the @r parameter, this argument defaults to the type player. Defining a type for this parameter can filter the random selection to other entities.‌[รุ่น Bedrock เท่านั้น]
  • @e[type=skeleton] — Select all skeletons.
  • @e[type=!chicken,type=!cow] — Select all entities except chickens and cows.
  • @e[type=#skeletons] — Select all skeletons, wither skeletons, and strays.‌[รุ่น Java เท่านั้น]
Note that @e[type=pig,type=cow] fails because a given entity cannot be both a pig and a cow.
Selecting targets by family‌[รุ่น Bedrock เท่านั้น]
[family=<family>] — Filter target selection to those of a specific entity family.
[family=!<family>] — Filter target selection to those not of a specific entity family.
The given entity family can be any string. It does not include a namespace. These entity families are defined in an entities type_family behavior component. Default values used by the vanilla behavior pack include among others more broad terms like mob, inanimate, monster and undead as well as more specific, smaller families like zombie and skeleton and single-mob families like wandering_trader, enderman and creeper. A single entity can be part of multiple families.
  • @e[family=skeleton] — Select all skeletons, wither skeletons and strays.
  • @e[family=mob,family!=monster] — Select all mobs that are not also monsters (so for example cows, chickens, pigs, but not zombies or skeletons).
  • @e[family=monster,family=undead] — Select all monsters that are also undead (that includes monsters like zombies and skeletons, but not creepers or endermen).


Selecting targets by data tag
[tag=<string>] — Filter target selection to those that have at least one tag of the given name.
[tag=!<string>] — Filter to those that have no tags of the given name.
[tag=] — Filter to those that have exactly zero tags.
[tag=!] — Filter to those that have at least one tag.
Multiple tag arguments are allowed. All argument specifications must be fulfilled for an entity to be selected.
  • @e[tag=a,tag=b,tag=!c] — Select all entities that have tags a and b, but not tag c.
  • @r[tag=a] — Select one random player who has tag a.
ดูเพิ่มเติมที่: Scoreboard § Tags_commands
Selecting targets by NBT‌[รุ่น Java เท่านั้น]
[nbt=<compoundTag>] — Select all targets that have the specified NBT. The NBT is written in its command definition.
[nbt=!<compoundTag>] — Select all targets that does not have the specified NBT.
For example:
  • @a[nbt={OnGround:true}] — Select all players on the ground.
  • @e[type=sheep,nbt={Color:0b}] — Select all sheep that are dyed white.
  • @e[type=item,nbt={Item:{id:"minecraft:slime_ball"}}] — Selects all slime ball item entities.
  • @e[nbt={Tags:[a,b]}] is the same as @e[tag=a,tag=b]. The latter is simpler and reduces CPU load.
Note: When matching the string form of namespaced IDs within a tag, the namespace cannot be omitted.
Hence @e[type=item,nbt={Item:{id:slime_ball}}] cannot find any item entities as the  id field always contains a namespaced ID-converted string.
Selecting targets by advancements‌[รุ่น Java เท่านั้น]
[advancements={<namespaced ID>=<bool>}] — Select all targets that match the specified advancement and value.
[advancements={<namespaced ID>={<criteria>=<bool>}}] — Select all targets that match the specified advancement and value.
The argument name is the advancement ID (namespace can be left out when namespaced minecraft). The value is true or false.
For advancements with one criterion, testing for that criterion always gives the same results as testing for the advancement.
  • @a[advancements={story/form_obsidian=true}] — Selects players who have achieved the advancement minecraft:story/form_obsidian.
  • @a[advancements={story/form_obsidian=false}] — Selects players who haven't achieved the advancement minecraft:story/form_obsidian.
  • @a[advancements={story/obtain_armor={iron_helmet=true}}] — Selects players who had armored with iron helmet. The selected players needn't be wearing iron helmet when selected, and needn't have achieved the advancement minecraft:story/obtain_armor.
  • @a[advancements={story/follow_ender_eye=true}] is the same as @a[advancements={story/follow_ender_eye={in_stronghold=true}}].
Selecting targets by predicate‌[รุ่น Java เท่านั้น]
[predicate=<namespaced ID>] — Select all targets that match the specified predicate.
[predicate=!<namespaced ID>] — Select all targets that fail to match the specified predicate.
Since 19w38a, selectors can use predicates in the argument.
  • @a[predicate=example:test_predicate] — Selects players who match the example:test_predicate predicate.
  • @e[predicate=!minecraft-wiki:smart_entity] — Selects entities who do not match the minecraft-wiki:smart_entity predicate.


แท็กข้อมูล[]

บทความหลัก: NBT format

A data tag is a tree-shaped data structure that can be described starting with attribute-value pairs enclosed in curly braces. One common usage of data tags ในรุ่น Java is in commands, used to specify complex data for any entity.

A data tag consists of zero or more attribute-value pairs delimited by commas and enclosed in curly braces. Each attribute-value pair consists of an attribute name and the attribute's value, separated by a colon. Some values, however, may themselves contain attribute-value pairs, allowing a data tag to describe a hierarchical data structure.

Example: {name1:123,name2:"sometext",name3:{subname1:456,subname2:789}}

The data structures that data tags describe are the same ones used in Minecraft's save files. These data structures are described in other articles and commands expect data tags to use the same attribute names (which are case-sensitive):

Data Structure Specification Links
Objects Examples
Block entities chests, furnaces, command blocks, mob spawners, signs, etc.
Items items in inventories (includes specifications for enchantments, lore, custom names, etc.)
Item entities items on the ground
Mobs creepers, cows, villagers, etc.
Projectiles arrows, fireballs, thrown potions, etc.
Vehicles boats, minecarts, etc.
Dynamic tiles primed TNT, falling sand/gravel/concrete powder/anvils
Other entities firework rockets, paintings, and item frames

The defined data structures also expect the values to be of the correct type.

Data Tags Value Types
Type Description
 Byte A signed 8-bit integer, ranging from -128 to 127 (inclusive).
 Short A signed 16-bit integer, ranging from -32,768 to 32,767 (inclusive).
 Int A signed 32-bit integer, ranging from -2,147,483,648 and 2,147,483,647 (inclusive).
 Long A signed 64-bit integer, ranging from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (inclusive).
 Float
 Double
Float: A 32-bit, single-precision floating-point number, ranging from -3.4E+38 to +3.4E+38.
Example: 3.1415926

Double: A 64-bit, double-precision floating-point, ranging from -1.7E+308 to +1.7E+308.

Example: 3.141592653589793

See IEEE floating point for details.

 String A sequence of characters, enclosed in quotes. For strings without commas, brackets, braces or spaces, quote enclosure is optional. Nested quotes can be included within a string by escaping the character with the \" escape sequence.
Example: "Call me \"Ishmael\""
 List An ordered list of tags, enclosed in square brackets and delimited by commas. The tags must be of the same type, determined by the first tag in the list.
Example: [3.2,64.5,129.5]
 Compound An ordered list of attribute-value pairs, enclosed in curly braces and delimited by commas.
Example: {X:3,Y:64,Z:129}

Each tag may be of any type.

 Byte Array B; followed by an ordered list of 8-bit integers, delimited by commas. Tag is enclosed in square brackets.
Example: [B;1b,2b,3b]
 Int Array I; followed by an ordered list of 32-bit integers, delimited by commas. Tag is enclosed in square brackets.
Example: [I;1,2,3]
 Long Array L; followed by an ordered list of 64-bit integers, delimited by commas. Tag is enclosed in square brackets.
Example: [L;1l,2l,3l]
 Boolean A value, expressed as "true" or "false". This is seen only in JSON formatting, as a  Byte tag is usually used in NBT data to determine a boolean value as 0 (for false) and 1 (for true).
Example: {doFoo:true}

Some commands may require that a number's type be specified by adding a letter (B, S, L, F, D) to the end of the value. For example, 3s for a short, 3.2f for a float, etc. (This doesn't work with I for int.) The letter can be uppercase or lowercase. When no letter is used and Minecraft can't tell the type from context, it assumes double if there's a decimal point, int if there's no decimal point and the size fits within 32 bits, or string if neither is true. A square-bracketed literal is assumed to be a list unless an identifier is used: [I;1,2,3] for an int array and [L;1L,2L,3L] for a long array.

When commands such as /clear are used to match data tags, they check only for the presence of the provided tags in the target entity/block/item. This means that the entity/block/item can have additional tags and still match. This is true even for lists and arrays: the order of a list is not acknowledged, and as long as every requested element is in the list, it matches even if there are additional elements.

ข้อความ Raw JSON[]

บทความหลัก: Raw JSON text format

The /tellraw and /title commands use the raw JSON text format to display texts.

Also, Some values of arguments in NBT structures are using JSON format.

ID ข้อโต้แย้งในรุ่น Java[]

ดูเพิ่มเติมที่: Namespaced ID § Conversion from string
Information icon
ฟีเจอร์นี้พิเศษเฉพาะใน รุ่น Java 

Many commands have arguments that identify particular types of blocks, items, entities, advancements, bossbars, effects, enchantments and so on. In the command syntax below, these typically appear as elements named <block>, <item>, or the like, which are replaced with identifiers such as minecraft:stone in the examples. These IDs all have namespaces. All original Minecraft contents are namespaced minecraft while contents from mods or data packs have other namespaces. Namespace prefix of IDs namespaced minecraft can be omitted for most situations; however, in certain cases, such as NBT data tag matching, full namespaced ids are required.

<block>[]

A single <block> argument looks like this:

  • stone
  • minecraft:redstone_wire[power=15,north=up,south=side]
  • minecraft:jukebox{RecordItem:{...}}
  • minecraft:furnace[facing=north]{BurnTime:200}

The format of <block> parameters is namespaced ID[block states]{data tags}, in which block states and data tags can be omitted when they are not needed.

  • Namespaced ID is required (though if namespace isn't set it defaults to minecraft:).
    • In the context of "conditions"/testing for blocks, it can also be the namespace ID of block tag with the prefix of #, such as #minecraft:planks.
  • Block states are inside [], comma-separated and must be properties/values supported by the blocks. They are optional.
    • minecraft:stone[doesntexist=purpleberry] is a syntax error, because stone doesn't have doesntexist.
    • minecraft:redstone_wire[power=tuesday] is a syntax error, because redstone_wire's power is a number between 0 and 15.
  • Data tags are inside {}. It's optional.
  • In the context of "conditions"/testing for blocks, only the states provided are tested.
    • If command tests redstone_wire[power=15], it checks only power, but ignores other states such as north.
  • In the context of setting blocks, any states provided are set, but anything omitted retain their default values, depending on the block.
    • If command sets redstone_wire[power=15], it is set power to 15, but north is a default value (in this case, set to none).

<item>[]

A single <item> argument that looks like this:

  • stone
  • minecraft:stick{display:{Name:"\"Stick of Untruths\""}}

The format of <item> parameters is namespaced ID{data tags}, in which data tags can be omitted when not needed.

  • Namespaced ID is required (though if namespace isn't set it defaults to minecraft:).
  • Data tags are inside {}. It's optional.

รายการชนิดของข้อโต้แย้งในรุ่น Java[]

บทความหลัก: Java Edition list of argument types

These are the argument types ในรุ่น Java.

รายการและสรุปของคำสั่ง[]

The table below summarizes all commands, including upcoming ones.

Summary of Commands
Command Description BE EE JE OP level MP only
/ability Grants or revokes a player ability. ใช่ ใช่ 2
/attribute Queries, adds, removes or sets an entity attribute. ใช่ 2
/advancement Gives, removes, or checks player advancements. ใช่ 2
/ban Adds player to banlist. ใช่ 3 MP
/ban-ip Adds IP address to banlist. ใช่ 3 MP
/banlist Displays banlist. ใช่ 3 MP
/bossbar Creates and modifies bossbars. ใช่ 2
/camerashake Used to enable a camera shaking effect. ใช่ 2
/classroommode Ability to edit restricted blocks. ใช่ 3
/clear Clears items from player inventory. Yes ใช่ ใช่ 2
/clearspawnpoint Remove spawnpoints in the world. ใช่ 2
/clone Copies blocks from one place to another. ใช่ ใช่ ใช่ 2
/code Used to access code connection. ใช่ ?
/collect Collects all items within a one block from Agent in three dimensions. ใช่ ?
/createagent Creates Agent on the current player position. ใช่ ?
/data Gets, merges, modifies and removes block entity and entity NBT data. ใช่ 2
/datapack Controls loaded data packs. ใช่ 2
/debug Starts or stops a debugging session. ใช่ 3
/defaultgamemode Sets the default game mode. ใช่ 2
/deop Revokes operator status from a player. ใช่ ใช่ ใช่ 3 MP‌[รุ่น Java เท่านั้น]
/destroy Agent destroys block or item in the specified direction. ใช่ ?
/detect Agent detects if there is a collidable block in the specified direction. ใช่ ?
/detectredstone Agent detects a redstone signal in the specified direction. ใช่ ?
/difficulty Sets the difficulty level. ใช่ ใช่ ใช่ 2
/dropall Agent drops all items from all slots onto the ground by one block in the specified direction. ใช่ ?
/effect Add or remove status effects. ใช่ ใช่ ใช่ 2
/enchant Enchants a player item. ใช่ ใช่ ใช่ 2
/event Used to trigger an event on an entity. ใช่ 2
/execute Executes another command. ใช่ ใช่ ใช่ 2
/experience Adds or removes player experience. ใช่ ใช่ ใช่ 2
/fill Fills a region with a specific block. ใช่ ใช่ ใช่ 2
/fog Used for managing active fog settings for players. ใช่ 2
/forceload Forces chunks to constantly be loaded or not. ใช่ 2
/function Runs a function. ใช่ ใช่ 2
/gamemode Sets a player's game mode. ใช่ ใช่ ใช่ 2
/gamerule Sets or queries a game rule value. ใช่ ใช่ ใช่ 2
/geteduclientinfo Shows the information about the client. ใช่ ?
/give Gives an item to a player. ใช่ ใช่ ใช่ 2
/help Provides help for commands. ใช่ ใช่ ใช่ 0
/item Manipulates items in inventories. ‌[กำลังมา: JE 1.17] ไม่ใช่ ไม่ใช่ Planned 2
/immutableworld Allows setting immutable state of a world. ใช่ 3
/kick Kicks a player off a server. ใช่ ใช่ ใช่ 3
/kill Kills entities (players, mobs, items, etc.). ใช่ ใช่ ใช่ 2
/list Lists players on the server. ใช่ ใช่ ใช่ 0
/locate Locates closest structure. ใช่ ใช่ ใช่ 2
/locatebiome Locates closest biome. ใช่ 2
/loot Drops items from an inventory slot onto the ground. ใช่ 2
/me Displays a message about the sender. ใช่ ใช่ ใช่ 0
/mixer Mixer interactivity control. ใช่ 2
/mobevent Enables/disables a specified mob event. ใช่ ใช่ 2
/move Moves an Agent in a specified direction. ใช่ ?
/msg Displays a private message to other players. ใช่ ใช่ ใช่ 0
/music Allows the player to control playing music tracks. ใช่ 2
/op Grants operator status to a player. ใช่ ใช่ ใช่ 3 MP‌[รุ่น Java เท่านั้น]
/pardon Removes entries from the banlist. ใช่ 3 MP
/particle Creates particles. ใช่ ใช่ 2
/playanimation Used to run a one-off animation ใช่ 2
/playsound Plays a sound. ใช่ ใช่ ใช่ 2
/position Toggles player coordinates to be displayed on the HUD. ใช่ ?
/publish Opens single-player world to local network. ใช่ 4 SP only
/raytracefog Adjusts ray tracing fog. Planned 3 MP
/recipe Gives or takes player recipes. ใช่ 2
/reload Reloads loot tables, advancements, and functions from disk. ใช่ ใช่ 2
/remove Removing agent. ใช่ 3
/replaceitem Replaces items in inventories. ใช่ ใช่ Yes[จนถึง JE 1.17] 2
/ride Used to make entities ride other entities, stop entities from riding, make rides evict their riders, or summon rides or riders.. ใช่ 4 MP
/save Prepares a backup, queries its status, or resumes. BDS only MP
/save-all Saves the server to disk. ใช่ 4 MP
/save-off Disables automatic server saves. ใช่ 4 MP
/save-on Enables automatic server saves. ใช่ 4 MP
/say Displays a message to multiple players. ใช่ ใช่ ใช่ 2
/schedule Delays the execution of a function. ใช่ 2
/scoreboard Manages scoreboard objectives and players. ใช่ ใช่ 2
/seed Displays the world seed. ใช่ 2
/setblock Changes a block to another block. ใช่ ใช่ ใช่ 2
/setidletimeout Sets the time before idle players are kicked. ใช่ 3 MP
/setmaxplayers Sets the maximum number of players allowed to join. ใช่ ใช่ 0
/setworldspawn Sets the world spawn. ใช่ ใช่ ใช่ 2
/spawnpoint Sets the spawn point for a player. ใช่ ใช่ ใช่ 2
/spectate Make one player in spectator mode spectate an entity. ใช่ 2
/spreadplayers Teleports entities to random locations. ใช่ ใช่ ใช่ 2
/stop Stops a server. ใช่ 4 MP
/stopsound Stops a sound. ใช่ ใช่ ใช่ 2
/structure Used to save and load structures without having to use structure blocks.items in inventories. ใช่ 2
/summon Summons an entity. ใช่ ใช่ ใช่ 2
/tag Controls entity tags. ใช่ ใช่ 2
/team Controls teams. ใช่ 2
/teammsg Specifies the message to send to team. ใช่ 0
/teleport Teleports entities. ใช่ ใช่ ใช่ 2
/tell Displays a private message to other players. ใช่ ใช่ ใช่ 0
/tellraw Displays a JSON message to players. ใช่ ใช่ 2
/testfor Counts entities matching specified conditions. ใช่ ใช่ 2
/testforblock Tests whether a block is in a location. ใช่ ใช่ 2
/testforblocks Tests whether the blocks in two regions match. ใช่ ใช่ 2
/tickingarea Add, remove, or list ticking areas. ใช่ ใช่ 2
/time Changes or queries the world's game time. ใช่ ใช่ ใช่ 2
/title Manages screen titles. ใช่ ใช่ ใช่ 2
/toggledownfall Toggles the weather. ใช่ ใช่ 2
/tp Teleports entities. ใช่ ใช่ ใช่ 2
/tpagent Teleport player to the Agent's position. ใช่ ?
/transfer Transfers specified quantity of items from the selected slot to another specified slot of Agent's inventory. ใช่ ?
/transferserver Transfer player to a server. ใช่ ใช่ 0
/trigger Sets a trigger to be activated. ใช่ 0
/turn Rotates Agent in the specified direction by 90 degrees. ใช่ ?
/w Displays a private message to other players. ใช่ ใช่ ใช่ 0
/weather Sets the weather. ใช่ ใช่ ใช่ 2
/whitelist Manages server whitelist. ใช่ ใช่ 3 MP
/worldborder Manages the world border. ใช่ 2
/worldbuilder Ability to edit restricted blocks. ใช่ ใช่ 3
/wsserver Connects to a WebSocket server. ใช่ ใช่ 0
/xp Adds or removes player experience. ใช่ ใช่ ใช่ 2


คำสั่งที่นำออกไปแล้ว[]

Summary of Commands
Command Description Version Removed Reason for Deletion BE EE JE OP level MP Only
/achievement Gives or takes an achievement from a player Java Edition 1.12
(17w13a)
Achievements were superseded by advancements Removed 2
/banip Bans a player by IP number Java Edition Indev 0.31 Superseded by /ban-ip Removed ? MP
/blockdata Modifies the data tag of a block Java Edition 1.13
(17w47a)
Superseded by /data Removed 2
/broadcast Broadcasts a message across the entire server Java Edition Classic 0.0.16a_01 Superseded by /say Removed 1
/clearfixedinv Clears fixed inventory slots Pocket Edition Alpha 0.16.0
(build 2)
? Removed ? ?
/entitydata Modifies the data tag of an entity Java Edition 1.13
(17w45b)
Superseded by /data Removed 2
/home Teleports player to the world spawn Java Edition Alpha v1.2.5 World spawn became based on spawn chunks instead of a singular location Removed 0
/resupply Update the villagers' supply for economic trade. ? ? Removed 2
/setfixedinvslot Sets fixed inventory slot with a specific item. Pocket Edition Alpha 0.16.0
(build 2)
? Removed ? ?
/setfixedinvslots Sets the amount of fixed inventory slots Pocket Edition Alpha 0.16.0
(build 2)
? Removed ? ?
/setspawn Sets the current location as the default spawn location for new players Java Edition Indev 0.31 World spawn became based on spawn chunks instead of a singular location Removed 2
/solid Toggles between placing stone and placing bedrock Java Edition Indev 0.31 Placing blocks became inventory based Removed 2
/stats Update objectives from command results Java Edition 1.13
(17w45a)
Merged with /execute Removed 2
/toggledownfall Toggles the weather Java Edition 1.13
(17w45a)
Redundancy with /weather Available Available Removed 2
/unban Pardons a banned player Java Edition Alpha v1.0.16 Superseded by /pardon Removed 3 MP

คำสั่ง Debug[]

sectionนี้ขาดข้อมูลเกี่ยวกับFill in the last six columns with content obtained from zh:基岩版开发者命令. Also create dedicated pages for each command.. 
โปรดขยายความsectionนี้เพื่อรวมข้อมูลที่มี รายละเอียดเพิ่มเติมที่จำเป็นอาจมีอยู่ในหน้าพูดคุย.

These developer exclusive commands were accidentally left in the iOS release of Bedrock Edition 1.2.13. They were removed in Bedrock Edition 1.2.14.[1][2]

Summary of Commands
Command Description OP level MP Only
/aigoals [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/automate [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/automateactivetool [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/automatebreakblock [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/automatefindblock [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/automatefly [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/automategetinteractionpositionforblock [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/automatelookat [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/automatemove [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/automatemoveto [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/automateplaceblock [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/bhave [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/bounds [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/cleanroom [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/clearslot [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/clearinventory [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/crash [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/crashclient [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/crashserver [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/createlocalworld [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/destroyblock [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/dumpblocknames [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/dumpentitiesclient [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/dumpentitiesserver [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/enchantrandom [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/fillchestblock [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/filldrive [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/findanchoredbuildpos [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/findflatarea [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/findnearbypickups [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/fixbiomes [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/fly [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getactivescreen [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getavgendframerate [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getavgremaindertimepercent [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getavgrendertime [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getavgticktime [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getavgunaccountedtimepercent [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getblockname [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getbrightness [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getchestcontents [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getchunkdirtycount [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getchunkrebuildcount [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getchunksortcount [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getcpu [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getdurability [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getexperience [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getfps [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getgpu [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getgpumemory [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getguiscale [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getmsaalevel [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getos [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getplayerbiome [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getplayerid [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getpos [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getpower [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getprofilersecondsperupdate [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getresolution [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getselecteditemcount [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getskin [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getstructure [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getsysteminfo [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getsystemmem [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getviewdistance [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/getworldname [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/health [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/hunger [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/islargechestblock [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/isplayercrouching [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/isplayerflying [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/isplayergrounded [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/isworldloaded [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/kit [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/leaveworld [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/loadbehaviortreedefinitions [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/log [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/lookat [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/memwarn [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/nearbyentityisbaby [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/networkstats [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/notifyprofiler [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/paths [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/pause [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/placefromhand [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/playerstat [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/profile [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/redstonetest [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/register3pserver [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/rot [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/selectinventoryitem [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/sendmodalform [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/sendshowstoreoffer [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/setbrightness [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/setguiscale [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/setskin [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/setviewdistance [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/showallitems [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/showfrustum [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/simlock [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/simscale [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/skin [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/spawnfeature [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/spawning [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/spawnitem [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/spawnmob [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/stoptime [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/systemstat [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/test [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/testassets [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/timelock [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/tptosuitabletree [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/transferserver [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/villages [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?
/wipeout [ต้องการข้อมูลเพิ่มเติม] ? ? ? ? ? ?

Command guide[]

Syntax[]

ในรุ่น Java:

Syntax Meaning
plain text Enter this literally, exactly as shown.
<argumentsName> An argument that should be replaced with an appropriate value.
[entry] This entry is optional.
(entry|entry) (Required) Pick one of the entries that is shown.
[entry|entry] (Optional) Pick one of the entries that is shown.
ellipsis ... Another sub-command is required.

ในรุ่น Bedrock:

Syntax Meaning
plain text Enter this literally, exactly as shown.
name: type An argument that should be replaced with an appropriate value.
entry|entry Pick one of the entries that is shown.
<entry> This entry is required.
[entry] This entry is optional.

Success Conditions[]

A command's Success Conditions must be met in order for the game to consider the command "successful". This is used to determine a variety of things, such as the output of a redstone comparator feeding from a command block with a command. Note that not all "successful" commands actually do something, and not all "failed" commands fail to do something useful.

Restrictions[]

Describes restrictions on who can use the command or in what context.
  • None: The command can be used by any player in any world. The following commands have no restrictions: /help, /me, /tell, and /trigger.
  • Operator: The command may be used only by an operator or in singleplayer mode with cheats enabled. On multiplayer servers, the results of these commands are broadcast to other ops online.
  • Multiplayer: The command is available only on a multiplayer server. The following commands are restricted to multiplayer servers: /ban, /ban-ip, /banlist, /deop, /kick, /list, /op, /pardon, /pardon-ip, /save-all, /save-off, /save-on, /setidletimeout, /stop, /whitelist.
No multiplayer commands permit target selectors in arguments.
Except for /list, multiplayer commands cannot be used in command blocks.
Many of these commands can be used on players who have never been to the server, or even on names that are not (or cannot be) registered as Minecraft accounts.
  • No command blocks: The command cannot be executed by a command block.


History[]

รุ่น Java Classic
0.0.15a (Multiplayer Test 3)Added commands.
รุ่น Java Indev
0.31Removed all commands.
รุ่น Java Alpha
v1.0.16Re-added several commands.
รุ่น Java
1.3.112w16aAdded cheats mode.
12w25aCheats can now be turned on or off when opening a world to other players through LAN.
1.4.212w32aAdded target selectors.
1.814w02aAdded the @e target selector variable.
14w03aAdded dx, dy, and dz to target selector arguments.
NBT data now supports using string IDs rather than numerical IDs.
Numerical IDs no longer work in other parts of commands, though they still work for NBT data.
1.916w02aThe m selector now accepts the standard literal gamemode values and abbreviations, such as a and adventure, and these may be negated as well.
1.1116w32aAdded block state support to commands.
16w38aRemoved implicit target selectors (for example, @e[167,28,454]).
Invalid target selectors (such as @e[Type=creeper], @e[asdf=nonexistent], and @e[malformed]) now generate an error instead of being silently ignored.
1.1217w16bAdded the @s target selector variable
1.1317w45aA new library named Brigadier is now used to parse commands. Different components of commands are displayed in different colors, and errors are displayed in red without having to run the command. Commands, for the most part, do not allow uppercase letters, and are now much faster and more efficient.
Added the nbt target selector argument.
17w46aThe player now has the option to toggle automatic command suggestions.
The command UI has a new prototype, and now works in multiplayer.
17w47aAdded an option in chat to toggle automatic command suggestions.
17w48aTweaked the command suggestion UI.
Reworked tab-completion for coordinates.
17w50aLocal coordinates can now be specified in commands using ^.
Tab-completing when not targeting a block suggests ~ ~ ~.
18w01aChanged all custom names (blocks, items, entities, block entities) to translatable text components.
Thrower and Owner nbt keys of item entities are no longer strings, but are instead compounds with two longs named L and M.
owner nbt key of snowballs, eggs and ender pearls are no longer strings, but are instead compounds with two longs named L and M.
18w02aErrors during a command are now a nicer error message (with a tool tip for more info).
Server commands now run from world spawn in the Overworld, instead of at 0,0,0.
18w03aImproved performance of command parsing and command execution.
18w05aAdded basic entity selector suggestions in the command UI.
A warning is now logged for ambiguous commands.
18w06aAdded command suggestions for entity selectors.
Whitespaces are now allowed in entity selectors & block state arguments.
September 26, 2018Brigadier open-sourced under the MIT license. (Source code previously was available on the library site, with no license specified).
1.1620w17aAdded /attribute.
รุ่น Java ที่กำลังจะมา
1.1720w46aRemoved /replaceitem. Replaced with /item replace.
รุ่น Pocket
รุ่น Pocket Alpha
0.7.4Added support for commands, though none are implemented yet.
0.16.0build 1Added commands.
Functionality of most commands is equivalent to Java Edition 1.10 usage. Differences include: no support for data tags.

Issues[]

ปัญหาเกี่ยวกับ “คำสั่ง” จะถูกซ่อมแซมให้ดีขึ้นได้ที่ ติดตามปัญหา โดยที่จะต้องรายงานปัญหาที่นี่

See also[]

  • Formatting codes
  • Entity format

References[]

Hju

Advertisement