ATTENZIONE: Ogni utente è invitato a seguire le regole della pagina Traduzione per non incorrere in sanzioni

Comandi

Da Minecraft Wiki.

I comandi sono delle funzioni avanzate di Minecraft, che possono essere attivate grazie a determinate stringhe di testo.

Uso[modifica | modifica wikitesto]

Nella modalità giocatore singolo di Minecraft, i comandi si usano con la chat di testo, apribile con il pulsante T (default) o con /. Usando /, comparirà automaticamente nella chat il simbolo /, che è l'inizio di ogni comando.. Premendo Tab ↹ dopo aver scritto un comando, verrando elencati tutti gli argomenti di esso.

I comandi posso anche essere inseriti nella console di un server multigiocatore, ma non devono essere preceduti da / quando vengono scritti in questo modo. I comandi scritti nel blocco comandi possono essere preceduti da una /, ma non è necessario.

La maggioranza dei comandi possono essere eseguiti solo in queste situazioni:

  • In un server multigiocatore, scritti da un amministratore in chat, nella console del server, oppure in un blocco comandi.
  • In un proprio server multigiocatore connesso via LAN, con i trucchi attivati.
  • In un mondo singolo, se i trucchi sono stati attivati alla creazione del mondo. (grazie al pulsante: "Altre opzioni del mondo").


Nota:In un mondo giocatore singolo, è possibile abilitare temporaneamente i trucchi abilitando la connesione LAN, premendo ( Esc -> "Apri alla LAN", e cliccando su "Trucchi" e infine su "Avvia mondo LAN"). In realtà, non c'è bisogno di avere una rete LAN, o che altri giocatori entrino nel server. Con questa procedura, i comandi non rimarrando per sempre, ma solo fino alla chiusura del mondo, e tutte le modifiche fatte fino ad allora, saranno comunque salvate. Per avere i trucchi sempre abilitati, bisogna fare lo stesso procedimento ogni volta che si apre il proprio mondo. Bisogna ricordare, però, che mentre un mondo è aperto alla LAN, premendo il pulsante Esc, il gioco non andrà in pausa, e per disabilitare la LAN sarà necessario chiudere e riaprire il mondo.

Note sul tilde[modifica | modifica wikitesto]

In molti comandi, possono essere indicate le coordinate del posto in cui ci si trova utilizzando il segno (~). Aggiungendo o sottraendo un numero da esso, ci si sposterà solamente nell'asse in cui è stato aggiunto quel numero di tanto quanto è stato specificato. Scrivere un unico tilde, infatti, è la stessa cosa di scrivere ~0.

Per esempio: /tp 0 64 0 teletrasporterà il giocatore alle coordinate (0;64;0), mentre /tp ~2 ~ ~ farà spostare il giocatore di due blocchi sull'asse "x".

Questi due medoti di scrivere le coordinate, possono anche essere mescolati fra loro. Se uno vuole spostarsi in un posto preciso solamente di un'asse, può scrivere /tp 64 ~ ~.

Bisogna fare attenziona a come viene usato il tilde nel blocco comandi, per alcuni comandi, come /tp , il tilde si riferisce alla posizione del giocatore, mentre per altri, come /setblock, si riferisce alla posizione del blocco comandi.

Selezione dei Target[modifica | modifica wikitesto]

Nei comandi in cui il nome di un giocatore è considerato come un argomento, è possibile selezionare più giocatori con una stessa caratteristica.

Per esempio, per cambiare la modalità di gioco a tutti i giocatori della squadra Rossa, basterà scrivere:

/gamemode creative @a[team=Red]

Variabili di selezione[modifica | modifica wikitesto]

Sommario delle variabili
Variable Function
@p giocatore più vicino
@r giocatore casuale
@a tutti i giocatori
@e tutte le entità
@s l'entità che esegue il comando

Una variabile di selezione identifica un determinato gruppo di giocatori. Esistono quattro variabili:

@p
Seleziona il giocatore più vicino. Se ci sono più giocatori alla stessa distanza, viene selezionato il primo giocatore che è entrato nel server.
La Selezione dei Target può essere usata per selezionare solo alcuni player, anche se sono tutti alla stessa distanza. Per esempio, @p[team=Red] seleziona solamente i giocatori della squadra Rossa, escludendo eventuali altri giocatori, anche se essi sono più vicini.
Utilizzando l'argomento c, si potrà cambiare il numero massimo di giocatori che vengono selezionati. (per esempio, @p[c=3] seleziona i tre giocatori più vicini). Se negativo, invertirà il comando (per esempio, @p[c=-1] seleziona il giocatore più lontano).
@r
Seleziona un giocatore a caso.
La Selezione dei Target può essere usata per ridurre il numero di giocatori che possono essere selezionati. Per esempio, @r[team=Red] potrà selezionare solamente giocatori della squadra Rossa.
Utilizzando l'argomento c, si può aumentare l numero di giocatori scelti casualmente. Per esempio, @r[c=3] seleziona tre giocatori a caso.
@a
Seleziona tutti i giocatori..
La Selezione dei Target può essere usata per selezionare solamente un gruppo specifico di giocatori. Per esempio, @a[team=Red] seleziona solamente i giocatori della squadra Rossa.
@e
Seleziona tutte le entità (inclusi i giocatori).
La Selezione dei Target può essere usata per selezionare solamente un gruppo specifico di entità. Per esempio, @e[type=Cow] seleziona solamente le mucche.


Target selector arguments[modifica | modifica wikitesto]

Summary of target selector arguments
Argument(s) Selection criteria
x, y, z coordinate
r, rm radius (max, min)
m game mode
c count
l, lm experience (max, min)
score_name max score
score_name_min min score
team team name
name player name
dx, dy, dz volume dimensions
rx, rxm vertical rotation (max, min)
ry, rym horizontal rotation (max, min)
type entity type

After using a target selector, you can optionally use arguments to modify the set of targets selected. When used with @a or @e, arguments narrow down the number of targets from the full list to a specific few. When used with @p or @r, arguments narrow the number of targets down from the full list to a smaller set from which the nearest or random player is selected.

Add argument-value pairs as a comma-separated list contained within square brackets after the target selector variable:

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

Spaces are not allowed around the brackets, equal signs, or commas, and only commas may be used to separate argument-value pairs.

Arguments are case-sensitive and unsupported arguments are silently ignored. For example, kill @e[type=Creeper,r=20] will kill all creepers in a 20-block radius, but kill @e[Type=Creeper,r=20] will kill all entities (including players) in that radius because there's no longer an argument limiting the targets to just creepers.

If the first few arguments (up to four) are specified simply as values without identifying the arguments, they are assumed to be, in order, x, y, z, and r. Thus, the following two commands are identical:

/gamemode creative @a[x=10,y=20,z=30,r=4]
/gamemode creative @a[10,20,30,4]
Selecting targets by coordinate
[x=X,y=Y,z=Z] — Selects only targets at that exact position (ignoring fractions).
Use tilde notation to specify a coordinate relative to the command's execution position.
Selecting targets by radius
[r=R] — Selects only targets less than R blocks from the command's execution.
[rm=RM] — Selects only targets more than RM blocks from the command's execution.
If a coordinate (above) and either or both radius/i are both defined, the radius/i will center on the coordinate rather than the postion of the command's execution. By using a very distant coordinate and a very large radius, it is possible to simulate a near-linear edge to use to specify targets.
Selecting targets by game mode
[m=M] — Selects only targets with the specified game mode. Permitted value for M are:
  • -1: all game modes
  • 0: survival mode
  • 1: creative mode
  • 2: adventure mode
  • 3: spectator mode
Selecting targets by count
[c=C] — Selects only the specified number of targets. Usually in order of distance from the command executor.
When used with @p or @r, this argument defaults to 1, so using a higher number will increase the number of nearest or random targets returned. When used with @a or @e, this argument returns only the nearest targets.
If there are multiple nearest players, caused by them being precisely the same distance away, a player is selected by the time the player most recently joined the server. For example, if equally distant, @a[c=1] will select the player who has been on the server the longest and @e[type=Creeper,c=3] will select the three oldest creepers.
When used with a negative value, the order of targets is reversed. For example, @p[c=-3] will return the three farthest targets, and, if all potential targets are equally far away, @e[c=-3] will select the last three targets created.
Selecting targets by experience level
[l=L] — Selects only targets with no more than L experience levels.
[lm=LM] – Selects only targets with no less than LM experience levels.
Selecting targets by score
[score_name=SCORE] — Selects only targets with a score in objective name of no more than SCORE.
[score_name_min=SCOREMIN] — Selects only targets with a score in objective name of no less than SCOREMIN.
For example, @a[score_points_min=30,score_points=39] will select all players with a score in objective "points" between 30 and 39 (inclusive).
Vedi anche: Scoreboard#Objectives
Selecting targets by team
[team=TEAM] — Selects only targets on team TEAM.
[team=!TEAM] — Selects only targets not on team TEAM.
[team=] — Selects only targets not on any team.
Vedi anche: Scoreboard#Teams
Selecting targets by name
[name=NAME] — Selects only targets named NAME.
[name=!NAME] — Selects only targets not named NAME.
Selecting targets by volume
[dx=DX,dy=DY,dz=DZ]
Selects only targets within the volume defined as starting from the location where the command was executed and extending DX blocks in the positive "x" direction (i.e., east), DY blocks in the positive "y" direction (i.e., upwards), and DZ blocks in the positive "z" direction (i.e., south). All values must be positive. If an initial coordinate is specified with the x, y, and z arguments, that will be used instead of the position of the command's execution for the lower northwestern corner (dx, dy, and dz still specify distances from that coordinate; they do not specify a separate coordinate).
It is possible to combine selection by radius and selection by volume, in which case the command will only select targets within the overlap of both regions (within certain radius/i of the volume's lower northwest corner and not outside the defined volume).
Selecting targets by vertical rotation
[rx=RX] — Selects only targets with a maximum vertical rotation of RX.
[rxm=RXM] — Selects only targets with a minimum vertical rotation of RXM.
Vertical rotation values vary from -90.0 facing straight up to 90.0 facing straight down (thus vertical rotation values increase with rotation downwards).
Selecting targets by horizontal rotation
[ry=RY] — Selects only targets with a maximum horizontal rotation of RY.
[rym=RYM] — Selects only targets with a minimum horizontal rotation of RYM.
Horizontal rotation values vary from -180.0 (facing due north), to -90.0 (facing due east), to 0.0 (facing due south), to 90.0 (facing due west), to 179.9 (just west of due north) before wrapping back to -180.0 (thus horizontal rotation values increase with rotation to the right, or clockwise viewed from above).
Selecting targets by type
[type=TYPE] — Selects only targets of the specific entity type.
[type=!TYPE] — Selects only targets not of the specific entity type.
Primarily only used with the @e variable (because all players are type=Player). "Entity types" are the entity IDs used to identify different types of entities internally (for example, Creeper for creepers, MinecartRideable for regular minecarts, PrimedTnt for primed TNT, etc.). Entity IDs are case-sensitive and invalid entity IDs will cause the command to fail.


Data tags[modifica | modifica wikitesto]

NBT tags can be specified for items and entities created with the /give, /summon and other commands. Data tags are data structures. The format is JSON, although it is not strict (lenient). The data is represented as a comma separated list of pairs. Each pair has the format <key>:<value>. The key is the name of the NBT tag and the value is the data that should be assigned to it. Tag names are case-sensitive, and whitespace outside keys or values is ignored.

The value can be different types:

  • String is a piece of text, can be wrapped with double-quotes. Double quotes have to be used if the String contains commas, curly brackets or square brackets. To use double-quotes inside Strings, the quote is escaped by a backslash (\"). When using most commands, escaping is disabled (except for double quotes) and keys must not be quoted (probably a bug [1]). This causes an issue where trailing backslashes do not work (as do any other things that need to be escaped), even when escaped properly. The reason is that it escapes the quotation mark after the string which causes a malformed JSON object. Example:"My name is \"Steve\""
  • Number are 1 or more digits that can have a leading sign (+/-). They're classified in Integers, that don't have a decimal mark, Doubles, that uses a dot (.) as a decimal mark, and Floats, that also have f appended after the number. Examples: integer:-128; double:-1.2345; & float:1.2f
  • List (or 'Array') is multiple, comma separated values wrapped with square brackets. The containing values do not need to be of the same type. Example:[1,2,3]
  • Boolean can either be true or false, but using Numbers works, too. When using numbers, 0 is false, everything else is true. Example:true
  • Compound or 'Object' is a container for data structures (as explained above). They are wrapped with curly braces.
Notice: The Data tag itself is a Compound. Example: {Health:18,CustomName:"Friend"}
  • null This is a placeholder an empty value. Do not put quotes. Example:null

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

For a complete listing of defined tags (though not all can be modified by commands), see:

For a complete list of identifiers, see:

Raw JSON text[modifica | modifica wikitesto]

The /tellraw and /title commands use a specific lenient JSON format to specify complicated text. Similar to the NBT format notation above, concepts such as Strings, Objects (Compounds), and Lists are used to represent the various properties of the raw text.

The format of raw JSON text is a JSON Object which supports the following (mostly optional) elements:


  • The base chat component Object

    •  text: A string representing raw text to display directly in chat. Note that selectors such as "@a" and "@p" are not translated into player names; use selector instead.

    •  extra: A list of additional objects, sharing the same format as the base object.

      • A list element with the same format as the base object (recursive). Note that all properties of this object are inherited by children except for text, extra, translate, with, and score. This means that children will retain the same formatting and events as this object unless they explicitly override them.

    •  color: The color to render this text in. Valid values are "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white", and "reset" (cancels out the effects of colors used by parent objects). Technically, "bold", "underline", "italic", "strikethrough", and "obfuscated" are also accepted, but it may be better practice to use the tags below for such formats.

    •  bold: Boolean (true/false) - whether to render text in bold. Defaults to false.

    •  underlined: Boolean (true/false) - whether to render text underlined. Defaults to false.

    •  italic: Boolean (true/false) - whether to render text in italics. Defaults to false.

    •  strikethrough: Boolean (true/false) - whether to render text with a strikethrough. Defaults to false.

    •  obfuscated: Boolean (true/false) - whether to render text obfuscated. Defaults to false.

    •  insertion: When the text is shift-clicked by a player, this string will be inserted in their chat input. It will not overwrite any existing text the player was writing.

    •  clickEvent: Allows for events to occur when the player clicks on text.

      •  action: The action to perform when clicked. Valid values are "open_url" (opens value as a URL in the player's default web browser), "run_command" (has value entered in chat as though the player typed it themselves. This can be used to run commands, but the command will fail if the player does not have the required permissions to use it), and "suggest_command" (similar to "run_command", but the text only appears in the player's chat input, and is not automatically entered. Unlike insertion, this will replace the existing contents of the chat input).

      •  value: The URL, chat, or command used by the specified action. Note that commands must be prefixed with the usual "/" slash.

    •  hoverEvent: Allows for a tooltip to be displayed when the player hovers their mouse over text.

      •  action: The type of tooltip to show. Valid values are "show_text" (shows raw JSON text), "show_item" (shows the tooltip of an item which can have NBT tags), "show_achievement" (shows formatted text describing an achievement or statistic. Normal achievement names are green, final achievement names are dark_purple, and statistic names are gray. In addition, a description is given for achievements), and "show_entity" (shows an entity's name, possibly its type, and its UUID).

      •  value: The formatting of this tag varies depending on the action. Note that "show_text" is the only action to support an Object as the value; all other action values are Strings and should thus be wrapped in quotes.
        • "show_text": Can be either a raw String of text, or an Object with the same formatting as this base object. Note that clickEvent and hoverEvent do not function within the tooltip, but the formatting and extra tags still work.
        • "show_item": A string formatted like item NBT data. Contains the "id" tag, and optionally the "Damage" tag and "tag" tag (which is the same compound used as "dataTag" in the /give command).
        • "show_achievement": The achievement or statistic's name. This uses the same format as achievement and statistic Scoreboard objective criteria and the /achievement command.
        • "show_entity": A string formatted like a compound with the string values "type" (such as "Zombie"), "name", and "id" (should be an entity UUID, but can actually be any string).

    •  translate: The translation identifier of text to be displayed using the player's selected language. This identifier is the same as the identifiers found in lang files from assets or resource packs. The translated text will only be displayed if the text string is not used.

    •  with: A list of chat component arguments and/or string arguments to be used by translate.
      • The arguments are text corresponding to the arguments used by the translation string in the current language, in order (for example, the first list element corresponds to "%1$s" in a translation string).

    •  score: A compound for displaying a player's score in an objective. Displays nothing if the player is not tracked in the given objective. Ignored completely if text or translate is present.

      •  name: The name of the player whose score should be displayed. Selectors (such as @p) can be used, in addition to "fake" player names created by the scoreboard system. In addition, if the name is "*", it will show the player's own score (for example, /tellraw @a {score:{name:"*",objective:"obj"}} will show every online player their own score in the "obj" objective). Note that non-player entity scores (such as @e[type=Cow]) do not show, even if the entity has been given a score in the objective.

      •  objective: The internal name of the objective to display the player's score in.

      •  value: Optional. If present, this value is used regardless of what the score would have been.

    •  selector: A string containing a selector (@p,@a,@r, or @e) and, optionally, selector arguments. Unlike text, the selector will be translated into the correct player/entity names. If more than one player/entity is detected by the selector, it will be displayed in a form such as 'Name1 and Name2' or 'Name1, Name2, Name3, and Name4'. Ignored completely if text, translate, or score is present.

Due to the extra tag, the above format may be recursively nested to produce very complex and functional text strings. However, a raw json text doesn't have to be complicated at all: virtually all properties are optional and may be left out.

To be valid, each object must have at least either text, translate, or score (everything else is optional). As a matter of shorthand, however, the entire Object may be substituted with a String. In this case, that string will be considered the value of the text property. For example, "This is raw text" is equivalent to {text:"This is raw text"}. This shorthand substitution is valid anywhere a raw text object is required (including the base <raw json message> argument of /tellraw, the elements of the extra list, and the value of a "show_text" hover_event).

Finally, unlike other commands using JSON, /tellraw Strings support Unicode via the notation \u####, where #### is the Unicode hexadecimal number for the desired character.

External links
Skylinerw's JSON Formatting Examples
Tellraw Generator