Technical Minecraft Wikia
Tag: Visual edit
m (Undo revision 5715 by 65.5.201.19 (talk))
Line 1: Line 1:
  +
[Work In Progress]
  +
  +
Items, like many other things in minecraft have data tags. With them you can give items names and enchantments.
  +
  +
== Basics ==
  +
To give yourself an item, use the command "/give".
  +
  +
The syntax for /give is /give <player> <item> [amount] [data] [dataTag]
  +
  +
<player> is the player - player name, @p, @a. Attempting to give items to non-players will give an error.
  +
  +
<item> is the item name, such as minecraft:stone.
  +
  +
[amount] is the amount of items to give.
  +
  +
[data] is the data value of an item such as for stone 0 is stone, 1 is granite,ect.
  +
  +
[dataTag] is the tag for the item.
  +
  +
Another way to get items is using "/replaceItem entity".
  +
  +
== Item data dags ==
  +
  +
=== Naming items ===
  +
To give a named item to someone, use <code>/give @p minecraft:stone 1 2 {display:{Name:"NAMED ITEM"<nowiki>}}</nowiki></code>. You can also use that in /replaceitem.
  +
  +
=== Checking for items ===
  +
To check if a player has an item, use the player data tag <code>{Inventory:[{Slot:1234b,id:"minecraft:redstone"}]}</code>
  +
  +
Slot: is the slot you want to check, if you want to search for the item anywhere, delete the <code>Slot:IDb</code>.
  +
  +
if you want to find a slots ID, you can do a <code>/replaceitem entity </code>on yourself with the wanted slot name (using tab) BUT with the exeption with whe off hand with the ID <code>-106</code>.
  +
  +
This is usable in /testfor and /scoreboard as the last parameter, but not possible in /execute as it has no dataDag input. (AKA you cannot put that in <code>@e[Inventory:{</code>blahblah<code>}]</code>
  +
  +
=== Enchanting items ===
 
[[Category:Commands]]
 
[[Category:Commands]]

Revision as of 11:09, 30 May 2019

[Work In Progress]

Items, like many other things in minecraft have data tags. With them you can give items names and enchantments.

Basics

To give yourself an item, use the command "/give".

The syntax for /give is /give <player> <item> [amount] [data] [dataTag]

<player> is the player - player name, @p, @a. Attempting to give items to non-players will give an error.

<item> is the item name, such as minecraft:stone.

[amount] is the amount of items to give.

[data] is the data value of an item such as for stone 0 is stone, 1 is granite,ect.

[dataTag] is the tag for the item.

Another way to get items is using "/replaceItem entity".

Item data dags

Naming items

To give a named item to someone, use /give @p minecraft:stone 1 2 {display:{Name:"NAMED ITEM"}}. You can also use that in /replaceitem.

Checking for items

To check if a player has an item, use the player data tag {Inventory:[{Slot:1234b,id:"minecraft:redstone"}]}

Slot: is the slot you want to check, if you want to search for the item anywhere, delete the Slot:IDb.

if you want to find a slots ID, you can do a /replaceitem entity on yourself with the wanted slot name (using tab) BUT with the exeption with whe off hand with the ID -106.

This is usable in /testfor and /scoreboard as the last parameter, but not possible in /execute as it has no dataDag input. (AKA you cannot put that in @e[Inventory:{blahblah}]

Enchanting items