Minecraft Wiki
No edit summary
(Changed two Wikipedia links to avoid redirects)
(46 intermediate revisions by 22 users not shown)
Line 1: Line 1:
{{exclusive|java}}
 
 
{{about|the NBT file format|using NBT in commands|Tutorials/Command NBT tags}}
 
{{about|the NBT file format|using NBT in commands|Tutorials/Command NBT tags}}
The '''Named Binary Tag''' format is used by Minecraft for the various files in which it saves data. The format is described by Notch in a very brief [http://web.archive.org/web/20110723210920/http://www.minecraft.net/docs/NBT.txt specification]. The format is designed to store data in a tree structure made up of various ''tags''. All tags have an ID and a name. The original known version was 19132 as introduced in [[Beta]] 1.3, and since then has been updated to 19133 with [[Anvil file format|Anvil]], with the addition of the Int Array tag. The NBT format dates all the way back to [[Indev]] with tags 0 to 10 in use.
+
The '''Named Binary Tag''' ('''NBT''') format is used by ''Minecraft'' for the various files in which it saves data. The format is described by [[Notch]] in a brief specification.<ref>http://web.archive.org/web/20110723210920/http://www.minecraft.net/docs/NBT.txt specification</ref> The format is designed to store data in a tree structure made up of various ''tags''. All tags have an ID and a name. The original known version was 19132 as introduced in [[Beta 1.3]], and since then has been updated to 19133 with the [[Anvil file format]], which adds the {{cd|Int Array}} tag. The NBT format dates all the way back to [[Indev]] with tags 0 to 10 in use.
   
Another more user-friendly format of NBT is in plain string, as used in [[command]]s. This format is referred to as ''SNBT'', short for ''stringified NBT''. It is different from the [[JSON]] format; hence, any JSON used in NBT, such as [[Commands#Raw_JSON_text|raw json text]], must be enclosed within a {{nbt|string}} string tag.
+
Another more user-friendly format of NBT is in plain string, as used in [[command]]s. This format is referred to as '''SNBT''', short for '''stringified NBT'''. It is different from the [[JSON]] format; hence, any JSON used in NBT, such as [[Commands#Raw JSON text|raw JSON text]], must be enclosed within a {{nbt|string}} string tag.
   
 
== TAG definition ==
 
== TAG definition ==
 
A tag is an individual part of the data tree. The first byte in a tag is the tag type (ID), followed by a two byte big-endian unsigned integer for the length of the name, then the name as a string in UTF-8 format (Note TAG_'''End''' is not named and does not contain the extra 2 bytes; the name is assumed to be empty). The name of tags ''may'' contain spaces, although Minecraft itself never saves tags with spaces in the names. Finally, depending on the type of the tag, the bytes that follow are part of that tag's ''payload''. This table describes each of the 13 known tags in version 19133 of the NBT format:
{{msgbox
 
| title = Add more columns
 
| text = This section might benefit of the addition of the "prefix and/or suffix in SNBT" column.
 
| discuss = 1
 
}}
 
A tag is an individual part of the data tree. The first byte in a tag is the tag type (ID), followed by two bytes for the length of the name, then the name as a string in UTF-8 format (Note TAG_'''End''' is not named and does not contain the extra 2 bytes; the name is assumed to be empty). The name of tags ''may'' contain spaces, although Minecraft itself never saves tags with spaces in the names. Finally, depending on the type of the tag, the bytes that follow are part of that tag's ''payload''. This table describes each of the 12 known tags in version 19133 of the Named Binary Tag format:
 
 
{| class="wikitable" data-description="NBT tags"
 
{| class="wikitable" data-description="NBT tags"
 
|-
 
|-
Line 18: Line 12:
 
! Tag Type
 
! Tag Type
 
! Payload
 
! Payload
! SNBT Format
+
! SNBT Format{{only|java|short=y}}
 
! Description
 
! Description
 
! width="33%" align="center" | Storage Capacity
 
! width="33%" align="center" | Storage Capacity
Line 68: Line 62:
 
| <code><number>f</code> or <code><number>F</code>
 
| <code><number>f</code> or <code><number>F</code>
 
| A signed floating point type.
 
| A signed floating point type.
| Precision varies throughout number line;<br>See [[wikipedia:Single precision floating-point format|Single-precision floating-point format]]. Maximum value about 3.4*10<sup>38</sup>
+
| Precision varies throughout number line;<br>See [[wikipedia:Single-precision floating-point format|Single-precision floating-point format]]. Maximum value about 3.4*10<sup>38</sup>
 
|-
 
|-
 
| style="text-align:center" | '''6'''
 
| style="text-align:center" | '''6'''
Line 76: Line 70:
 
| <code><decimal number></code>, <code><number>d</code> or <code><number>D</code>
 
| <code><decimal number></code>, <code><number>d</code> or <code><number>D</code>
 
| A signed floating point type.
 
| A signed floating point type.
| Precision varies throughout number line;<br>See [[wikipedia:Double precision floating-point format|Double-precision floating-point format]]. Maximum value about 1.8*10<sup>308</sup>
+
| Precision varies throughout number line;<br>See [[wikipedia:Double-precision floating-point format|Double-precision floating-point format]]. Maximum value about 1.8*10<sup>308</sup>
 
|-
 
|-
 
| style="text-align:center" | '''7'''
 
| style="text-align:center" | '''7'''
Line 89: Line 83:
 
| style="text-align:center" | {{nbt|string}}
 
| style="text-align:center" | {{nbt|string}}
 
| TAG_'''String'''
 
| TAG_'''String'''
| TAG_Short's payload ''length'', then a UTF-8 string with size ''length''.
+
| A TAG_Short-like, but instead unsigned<ref>https://docs.oracle.com/javase/8/docs/api/java/io/DataOutput.html#writeUTF-java.lang.String-</ref> payload ''length'', then a UTF-8 string resembled by ''length'' bytes.
 
| <code><a-zA-Z0-9 text></code>, <code>"<text>"</code> ({{cd|"}} within needs to be escaped to {{cd|\"}}), or <code>'<text>'</code> ({{cd|'}} within needs to be escaped to {{cd|\'}})
 
| <code><a-zA-Z0-9 text></code>, <code>"<text>"</code> ({{cd|"}} within needs to be escaped to {{cd|\"}}), or <code>'<text>'</code> ({{cd|'}} within needs to be escaped to {{cd|\'}})
 
| A UTF-8 string. It has a size, rather than being null terminated.
 
| A UTF-8 string. It has a size, rather than being null terminated.
| 32,767 bytes interpretable as UTF-8 (see [[wikipedia:UTF-8|UTF-8 format]]; most commonly-used characters are a single byte).
+
| 65,535 bytes interpretable as UTF-8 (see [[wikipedia:UTF-8#Modified_UTF-8|modified UTF-8 format]]; most commonly-used characters are a single byte).
 
|-
 
|-
 
| style="text-align:center" | '''9'''
 
| style="text-align:center" | '''9'''
Line 128: Line 122:
 
The List and Compound tags can be and often are recursively nested. It should also be noted that, in a list of lists, each of the sub-lists can list a different kind of tag.
 
The List and Compound tags can be and often are recursively nested. It should also be noted that, in a list of lists, each of the sub-lists can list a different kind of tag.
   
== File Format ==
+
== File format ==
An NBT file is a GZip'd Compound tag, name and tag ID included. Some of the files utilized by Minecraft may be uncompressed, but in most cases the files follow Notch's original specification and are compressed with GZip. In the [[Legacy Console Edition]], [[chunks]] are compressed with XMemCompress, a variation of an LZX compression algorithm. There is no header to specify the version or any other information - only the [[level.dat]] file specifies the version.
+
An NBT file is a zipped Compound tag, with the name and tag ID included. The file in the zip must contain the Compound tag that it is as the first bytes. Some of the files utilized by ''Minecraft'' may be uncompressed, but in most cases, the files follow Notch's original specification and are compressed with GZip.
   
== As used in Minecraft ==
+
== Usage ==
Minecraft's use of the NBT format is odd at times. In some instances, empty lists may be represented as a list of Byte tags rather than a list of the correct type, or as a list of End tags in newer versions of Minecraft, which can break some older NBT tools. Additionally, almost every root tag has an empty name string and encapsulates only one Compound tag with the actual data and a name. For instance:
+
''Minecraft'' sometimes uses the NBT format inconsistently; in some instances, empty lists may be represented as a list of Byte tags rather than a list of the correct type, or as a list of End tags in newer versions of Minecraft, which can break some older NBT tools. Additionally, almost every root tag has an empty name string and encapsulates only one Compound tag with the actual data and a name. For instance:
 
<div class="treeview">
 
<div class="treeview">
 
* {{nbt|compound}} The root tag for most Minecraft NBT structures.
 
* {{nbt|compound}} The root tag for most Minecraft NBT structures.
 
** {{nbt|compound|SomeName}}: The only tag contained within the root tag - it has a name and contains all the actual data.
 
** {{nbt|compound|SomeName}}: The only tag contained within the root tag - it has a name and contains all the actual data.
 
</div>
 
</div>
Another noticeable oddity is that, although the original specification by Notch allows for spaces in tag names, and even the example uses spaces in the tag names, Minecraft has no known files where any tags have spaces in their names. There is also inconsistent use of letter case, mostly either camelCase or PascalCase, but sometimes even in all lowercase.
+
Additionally, although the original specification by Notch allows for spaces in tag names, and even the example uses spaces in the tag names, ''Minecraft'' has no known files where any tags have spaces in their names. There is also inconsistent use of letter case, mostly either camelCase or PascalCase, but sometimes even in all lowercase.
   
 
=== Uses ===
 
=== Uses ===
  +
{{missing information|section|Bedrock Edition NBTs|type=code}}
* [[level.dat]] is stored in compressed NBT format.
 
* [[Player.dat format|<player>.dat]] files are stored in compressed NBT format.
+
* <samp>[[level.dat]]</samp> is stored in compressed NBT format.
* [[idcounts.dat]] is stored in uncompressed NBT format.
+
* <samp>[[Player.dat format|<''player''>.dat]]</samp> files are stored in compressed NBT format.
* [[villages.dat]] is stored in compressed NBT format.
+
* <samp>[[idcounts.dat]]</samp> is stored in compressed NBT format.
* [[Map item format|map_<#>.dat]] files are stored in compressed NBT format.
+
* <samp>[[villages.dat]]</samp> is stored in compressed NBT format.
 
* <samp>[[Map item format|map_<#>.dat]]</samp> files are stored in compressed NBT format.
* [[Servers.dat Format|servers.dat]], which is used to store the list of saved multiplayer servers as uncompressed NBT.
+
* <samp>[[Servers.dat format|servers.dat]]</samp>, which is used to store the list of saved multiplayer servers as uncompressed NBT.
 
* [[Chunk format|Chunk]]s are stored in compressed NBT format within [[Region file format|Region]] files.
 
* [[Chunk format|Chunk]]s are stored in compressed NBT format within [[Region file format|Region]] files.
* [[Scoreboard#NBT format|scoreboard.dat]] is stored in compressed NBT format.
+
* <samp>[[Scoreboard#NBT format|scoreboard.dat]]</samp> is stored in compressed NBT format.
 
* [[Generated structures data file format|Generated structures]] are stored in compressed NBT format.
 
* [[Generated structures data file format|Generated structures]] are stored in compressed NBT format.
 
* [[Structure block file format|Saved structures]] are stored in compressed NBT format.
 
* [[Structure block file format|Saved structures]] are stored in compressed NBT format.
   
== Software ==
+
== Official software ==
  +
{{see also|Tutorials/Running the Data Generator}}
Since [[Java Edition 1.13|1.13]], ''Minecraft'' includes a builtin converter between SNBT format and compressed NBT format. It comes with the client and the [[client.jar|client]] and the [https://minecraft.net/download/server official server].<ref>https://wiki.vg/Data_Generators#NBT_converters</ref>
+
Mojang has provided sample Java NBT classes for developers to use and reference as part of the source code for the [[MCRegion]] to [[Anvil file format]] converter.<ref>http://www.mojang.com/2012/02/new-minecraft-map-format-anvil/</ref> Since [[Java Edition 1.13]], ''Minecraft'' includes a built-in converter between the SNBT format and compressed NBT format, which comes with both the [[client.jar|client]] and official server.<ref>https://wiki.vg/Data_Generators#NBT_converters</ref>
   
  +
The data generator from ''Minecraft'' is able to convert uncompressed Stringified NBT files with <samp>.snbt</samp> extension in an input folder to GZip compressed NBT format files with <samp>.nbt</samp> extension in an output folder, and vice versa.
Mojang has provided sample Java NBT classes for developers to use and reference as part of the source code for the [http://www.mojang.com/2012/02/new-minecraft-map-format-anvil/ McRegion -> Anvil converter]. Other than this, the community has developed programs to view and modify compressed and uncompressed NBT files:
 
  +
{| class="wikitable" style="width: 100%" data-description="NBT editing software"
 
  +
The vanilla data generator can convert any GZip compressed NBT format to SNBT format. The file extension of a file can simply be changed, such as <samp>[[level.dat]]</samp> to <samp>level.nbt</samp> and put in the input folder, and the generator then decodes the GZip compressed NBT data.
|-
 
! Name
 
! NBT Version
 
! Description
 
! Screenshot
 
|-
 
| [https://github.com/terminal625/cl-nbt CL-NBT]
 
| {{tc|no|19132|style=text-align:center}}
 
| CL-NBT is an NBT implementation in Common Lisp that can read and write NBT files and load and save McRegion files. Anvil format works with slight modification.
 
|-
 
| [http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/1261629-mineback-minecraft-automated-backup-single-player/ MineBack Ultimate]
 
| {{tc|yes|19133|style=text-align:center}}
 
| MineBack Ultimate provides a full NBT editor supporting all available types of NBT format file (Map, Level, World etc.). It comes with a modern GUI and many helper functions.
 
|[[File:MineBackNBTEditor.png|128px]]
 
|-
 
| [https://github.com/twoolie/nbt NBT for Python]
 
| {{tc|yes|19133|style=text-align:center}}
 
| Library to parse & write NBT files, both standalone or in region files, in the Python scripting language. Provided with application examples for inspecting & editing the Minecraft data files (block / chest / mobs statistics and simple world mapping). Supports old McRegion, pre-flattened and latest Anvil formats.
 
|-
 
| [http://www.minecraftforum.net/topic/6661-nbtedit/ NBTEdit]
 
| {{tc|no|19132|style=text-align:center}}
 
| Allows for viewing and modifying NBT files via a Windows tree control. It is outdated not only from being an NBT version behind, but because it does not support multiple tags with the same name and it forces incorrect ranges on some types, and it lacks support for uncompressed NBT files.
 
| [[File:NBTEdit Level.Dat.png|128px]]
 
|-
 
| [[Programs and editors/NBTExplorer|NBTExplorer]] - [http://www.minecraftforum.net/topic/840677-nbtexplorer/ Forum Post]
 
| {{tc|yes|19133|style=text-align:center}}
 
| Inspired by and based on NBTEdit, this program allows viewing and editing of NBT files via a Windows tree control. It supports compressed and uncompressed NBT files, and allows for direct editing of the NBT structures in [[MCRegion]] and [[Anvil file format|Anvil]] files, [[level.dat]], etc.
 
| [[File:NBTExplorer.png|128px]]
 
|-
 
| [http://www.minecraftforum.net/topic/2078055-nbt-decoding-grammar-for-synalyze-it-mac-os-x/ NBT grammar for Synalyze It!]
 
| {{tc|no|19132|style=text-align:center}}
 
| Using this grammar Synalyze It! displays a color-coded hex dump along with the parsed tag tree. Currently only uncompressed files are supported.
 
| [[File:Synalyze-It-NBT-decoded.png|128px]]
 
|-
 
| [http://www.minecraftforum.net/topic/63854-neinedit-nbt-editor-for-mac-os-x/ NEINedit]
 
| {{tc|no|19132|style=text-align:center}}
 
| NBT editor for mac with a text-based tree structure.
 
| [[File:NEINedit.png|128px]]
 
|-
 
| [https://pypi.python.org/pypi/nbt2yaml/0.3.0 NBT2YAML]
 
| {{tc|yes|19133|style=text-align:center}}
 
| nbt2yaml presents a command line interface for reading and editing Minecraft NBT files using a custom YAML format. It also includes a Python API for parsing and writing NBT files to/from a simple Python data structure.
 
|-
 
| [https://irath96.github.io/webNBT/ webNBT]
 
| {{tc|yes|19133|style=text-align:center}}
 
| webNBT is an NBT-editor that runs in modern browsers without requiring the user to download an application or use third-party browser plugins (like Flash or Java).
 
|
 
|}
 
   
 
== History ==
 
== History ==
Line 210: Line 159:
 
{{History||1.0.0|snap=September 28, 2011|slink={{tweet|notch|119296531592515584}}|Notch works on "saving arbitrary data with item instances."}}
 
{{History||1.0.0|snap=September 28, 2011|slink={{tweet|notch|119296531592515584}}|Notch works on "saving arbitrary data with item instances."}}
 
{{h||1.12|snap=?|Added {{nbt|long array}} long array tags.}}
 
{{h||1.12|snap=?|Added {{nbt|long array}} long array tags.}}
{{h||1.13|snap=?|Added a data generator to both the ''Minecraft'' [[client.jar|client]] and the default multiplayer software.}}
+
{{h||1.13|snap=18w01a|Added a data generator to both the ''Minecraft'' [[client.jar|client]] and the default multiplayer software.}}
{{h||1.14|snap=19w08a|{{nbt|string}} String tags can now be within single quotes {{cd|'}} besides double quotes {{cd|"}}.<ref>{{Link|url=https://github.com/Mojang/brigadier/pull/52|title=Allow single quote in strings by boq · Pull Request #52 |website=Mojang/brigadier – GitHub}}</ref>}}
+
{{h||1.14|snap=19w08a|{{nbt|string}} String tags in SNBT can now be within single quotes {{cd|'}} in addition to double quotes {{cd|"}}.<ref>{{Link|url=https://github.com/Mojang/brigadier/pull/52|title=Allow single quote in strings by boq · Pull Request #52 |website=Mojang/brigadier – GitHub}}</ref>}}
 
{{History|foot}}
 
{{History|foot}}
  +
  +
== References ==
  +
{{reflist}}
  +
  +
== External links ==
  +
* [https://wiki.vg/NBT NBT] on wiki.vg
  +
* [http://www.minecraftforum.net/topic/840677-nbtexplorer/ NBTExplorer], a tool for viewing and editing NBT files.
  +
* [http://irath96.github.io/webNBT/ webNBT], an online tool for viewing and editing NBT files.
   
 
{{Java Edition}}
 
{{Java Edition}}

Revision as of 14:33, 8 February 2021

This article is about the NBT file format. For using NBT in commands, see Tutorials/Command NBT tags.

The Named Binary Tag (NBT) format is used by Minecraft for the various files in which it saves data. The format is described by Notch in a brief specification.[1] The format is designed to store data in a tree structure made up of various tags. All tags have an ID and a name. The original known version was 19132 as introduced in Beta 1.3, and since then has been updated to 19133 with the Anvil file format, which adds the Int Array tag. The NBT format dates all the way back to Indev with tags 0 to 10 in use.

Another more user-friendly format of NBT is in plain string, as used in commands. This format is referred to as SNBT, short for stringified NBT. It is different from the JSON format; hence, any JSON used in NBT, such as raw JSON text, must be enclosed within a string tag.

TAG definition

A tag is an individual part of the data tree. The first byte in a tag is the tag type (ID), followed by a two byte big-endian unsigned integer for the length of the name, then the name as a string in UTF-8 format (Note TAG_End is not named and does not contain the extra 2 bytes; the name is assumed to be empty). The name of tags may contain spaces, although Minecraft itself never saves tags with spaces in the names. Finally, depending on the type of the tag, the bytes that follow are part of that tag's payload. This table describes each of the 13 known tags in version 19133 of the NBT format:

ID Icon Tag Type Payload SNBT Format‌[JE only] Description Storage Capacity
0 TAG_End None. - Used to mark the end of compound tags. This tag does not have a name, so it is only ever a single byte 0. It may also be the type of empty List tags. N/A
1 TAG_Byte 1 byte / 8 bits, signed <number>b or <number>B A signed integral type. Sometimes used for booleans. Full range of -(27) to (27 - 1)
(-128 to 127)
2 TAG_Short 2 bytes / 16 bits, signed, big endian <number>s or <number>S A signed integral type. Full range of -(215) to (215 - 1)
(-32,768 to 32,767)
3 TAG_Int 4 bytes / 32 bits, signed, big endian <number> A signed integral type. Full range of -(231) to (231 - 1)
(-2,147,483,648 to 2,147,483,647)
4 TAG_Long 8 bytes / 64 bits, signed, big endian <number>l or <number>L A signed integral type. Full range of -(263) to (263 - 1)
(-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)
5 TAG_Float 4 bytes / 32 bits, signed, big endian, IEEE 754-2008, binary32 <number>f or <number>F A signed floating point type. Precision varies throughout number line;
See Single-precision floating-point format. Maximum value about 3.4*1038
6 TAG_Double 8 bytes / 64 bits, signed, big endian, IEEE 754-2008, binary64 <decimal number>, <number>d or <number>D A signed floating point type. Precision varies throughout number line;
See Double-precision floating-point format. Maximum value about 1.8*10308
7 TAG_Byte_Array TAG_Int's payload size, then size TAG_Byte's payloads. [B;<byte>,<byte>,...] An array of bytes. Maximum number of elements ranges between (231 - 9) and (231 - 1) (2,147,483,639 and 2,147,483,647), depending on the specific JVM.
8 TAG_String A TAG_Short-like, but instead unsigned[2] payload length, then a UTF-8 string resembled by length bytes. <a-zA-Z0-9 text>, "<text>" (" within needs to be escaped to \"), or '<text>' (' within needs to be escaped to \') A UTF-8 string. It has a size, rather than being null terminated. 65,535 bytes interpretable as UTF-8 (see modified UTF-8 format; most commonly-used characters are a single byte).
9 TAG_List TAG_Byte's payload tagId, then TAG_Int's payload size, then size tags' payloads, all of type tagId. [<value>,<value>,...] A list of tag payloads, without repeated tag IDs or any tag names. Due to JVM limitations and the implementation of ArrayList, the maximum number of list elements is (231 - 9), or 2,147,483,639. Also note that List and Compound tags may not be nested beyond a depth of 512.
10 TAG_Compound Fully formed tags, followed by a TAG_End. {<tag name>:<value>,<tag name>:<value>,...} A list of fully formed tags, including their IDs, names, and payloads. No two tags may have the same name. Unlike lists, there is no hard limit to the number of tags within a Compound (of course, there is always the implicit limit of virtual memory). Note, however, that Compound and List tags may not be nested beyond a depth of 512.
11 TAG_Int_Array TAG_Int's payload size, then size TAG_Int's payloads. [I;<integer>,<integer>,...] An array of TAG_Int's payloads. Maximum number of elements ranges between (231 - 9) and (231 - 1) (2,147,483,639 and 2,147,483,647), depending on the specific JVM.
12 TAG_Long_Array TAG_Int's payload size, then size TAG_Long's payloads. [L;<long>,<long>,...] An array of TAG_Long's payloads. Maximum number of elements ranges between (231 - 9) and (231 - 1) (2,147,483,639 and 2,147,483,647), depending on the specific JVM.

The List and Compound tags can be and often are recursively nested. It should also be noted that, in a list of lists, each of the sub-lists can list a different kind of tag.

File format

An NBT file is a zipped Compound tag, with the name and tag ID included. The file in the zip must contain the Compound tag that it is as the first bytes. Some of the files utilized by Minecraft may be uncompressed, but in most cases, the files follow Notch's original specification and are compressed with GZip.

Usage

Minecraft sometimes uses the NBT format inconsistently; in some instances, empty lists may be represented as a list of Byte tags rather than a list of the correct type, or as a list of End tags in newer versions of Minecraft, which can break some older NBT tools. Additionally, almost every root tag has an empty name string and encapsulates only one Compound tag with the actual data and a name. For instance:

  • The root tag for most Minecraft NBT structures.
    •  SomeName: The only tag contained within the root tag - it has a name and contains all the actual data.

Additionally, although the original specification by Notch allows for spaces in tag names, and even the example uses spaces in the tag names, Minecraft has no known files where any tags have spaces in their names. There is also inconsistent use of letter case, mostly either camelCase or PascalCase, but sometimes even in all lowercase.

Uses

This section is missing information about Bedrock Edition NBTs. 
Please expand the section to include this information. Further details may exist on the talk page.

Official software

Mojang has provided sample Java NBT classes for developers to use and reference as part of the source code for the MCRegion to Anvil file format converter.[3] Since Java Edition 1.13, Minecraft includes a built-in converter between the SNBT format and compressed NBT format, which comes with both the client and official server.[4]

The data generator from Minecraft is able to convert uncompressed Stringified NBT files with .snbt extension in an input folder to GZip compressed NBT format files with .nbt extension in an output folder, and vice versa.

The vanilla data generator can convert any GZip compressed NBT format to SNBT format. The file extension of a file can simply be changed, such as level.dat to level.nbt and put in the input folder, and the generator then decodes the GZip compressed NBT data.

History

Java Edition
1.0.0
{{Extension DPL}}<ul><li>[[Ghast Tear|Ghast Tear]]<br/>{{Item
| image = Ghast Tear.png
| renewable = Yes
| stackable = Yes (64)
}}

'''Ghast tears''' are items [[Drops|dropped]] by [[ghast]]s. They can be used to make potions of [[Regeneration]] and [[end crystal]]s.

== Obtaining ==

=== Mob loot ===
[[Ghast]]s drop 0–1 ghast tears. [[Looting]] increases the maximum ghast tears dropped by one per level, for a maximum of 4 ghast tears with Looting III. Looting also works when knocking back a [[fireball]] with an enchanted item.

== Usage ==

=== Brewing ingredient ===
{{brewing
  |showname=1
  |head=1
  |Ghast Tear
  |Mundane Potion
  |base=Water Bottle
}}
{{brewing
  |foot=1
  |Ghast Tear
  |Potion of Regeneration
}}

=== Crafting ingredient ===

{{crafting usage}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Ghast Tear
|spritetype=item
|nameid=ghast_tear
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Ghast Tear
|spritetype=item
|nameid=ghast_tear
|id=424
|form=item
|foot=1}}

== History ==

{{History|java}}
{{History||1.0.0|snap=Beta 1.9 Prerelease|[[File:Ghast Tear JE1 BE1.png|32px]] Added ghast tears.}}
{{History|||snap=Beta 1.9 Prerelease 3|Ghast tears can now be brewed in a [[water bottle]] to create a [[mundane potion]], or in an [[awkward potion]] to create a [[potion of Healing]].}}
{{History|||snap=Beta 1.9 Prerelease 4|Ghast tears now create [[potion of regeneration|potions of Regeneration]]. This was due to the sheer difficulty in obtaining them.<ref>{{tweet|jeb|123671273904680960|Since Ghast Tears are so hard to get, I've decided to replace the "Instant Health" with "Regeneration" for them|October 11, 2011}}</ref> [[Glistering melon]]s have been added to create potions of Healing, instead.}}
{{History||1.9|snap=15w44b|A ghast tear is now used to [[crafting|craft]] an [[end crystal]].}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 370.}}
{{History||1.14|snap=18w43a|[[File:Ghast Tear JE2 BE2.png|32px]] The texture of ghast tears has been changed.}}

{{History|pocket alpha}}
{{History||v0.12.1|snap=build 1|[[File:Ghast Tear JE1 BE1.png|32px]] Added ghast tears.|Ghast tears are currently unobtainable as [[ghast]]s don’t [[drops|drop]] them.}}
{{History|||snap=build 7|Ghasts now drop ghast tears.<ref>{{bug|MCPE-9338}}</ref>}} 
{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|A ghast tear is now used to [[crafting|craft]] an [[end crystal]].}}
{{History|bedrock}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Ghast Tear JE2 BE2.png|32px]] The texture of ghast tears has been changed.}}

{{History|console}}
{{History||xbox=TU7|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|[[File:Ghast Tear JE1 BE1.png|32px]] Added ghast tears.}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Ghast Tear JE2 BE2.png|32px]] The texture of ghast tears has been changed.}}

{{History|New 3DS}}
{{History||0.1.0|[[File:Ghast Tear JE1 BE1.png|32px]] Added ghast tears.}}
{{History|foot}}

== Issues ==

{{issue list}}

== References ==

{{reflist}}

{{items}}

[[Category:Renewable resources]]
[[Category:Brewing recipe]]

[[cs:Ďasova slza]]
[[de:Ghast-Träne]]
[[es:Lágrima de ghast]]
[[fr:Larme de Ghast]]
[[hu:Kísértetkönny]]
[[it:Lacrima di ghast]]
[[ja:ガストの涙]]
[[ko:가스트 눈물]]
[[nl:Ghasttraan]]
[[pl:Łza ghasta]]
[[pt:Lágrima de ghast]]
[[ru:Слеза гаста]]
[[uk:Сльоза ґаста]]
[[zh:恶魂之泪]]</li><li>[[Medicine|Medicine]]<br/>{{Redirect|Elixir", "Antidote", "Eye Drops", and "Tonic|s=1|the brewable items|Potion}}
{{Education feature}}
{{Exclusive|bedrock|education}}
{{Item
| image = <gallery>
Antidote.png | Antidote
Elixir.png | Elixir
Eye Drops.png | Eye Drops
Tonic.png | Tonic
</gallery>
| renewable = Yes
| stackable = No
}}
A '''medicine''' is a type of [[potion]] that cures the specified [[effect]] instead of applying it.

== Obtaining ==

=== Brewing ===
Cures are brewed from awkward potions using different [[element]]s.{{only|bedrock|education}} These drinks remove the specified effect when drank, and cannot be modified into splash, lingering, extended or enhanced versions.

{| class="wikitable" style="text-align: center;" data-description="Remedies"
! Potion
! Reagent, base
! Effect
! Notes
|-
! {{Inventory slot|Antidote}}<br>Antidote
| {{Brewing Stand
 |Input= Silver
 |Output2= Awkward Potion
 }}
| Cures [[Poison]]
| Silver detects poison {{w|Silver#Symbolic role|in folklore}}, and possesses anti-microbial properties.
|-
! {{Inventory slot|Elixir}}<br>Elixir
| {{Brewing Stand
 |Input= Cobalt
 |Output2= Awkward Potion
 }}
| Cures [[Weakness]]
|
|-
! {{Inventory slot|Eye Drops}}<br>Eye Drops
| {{Brewing Stand
 |Input= Calcium
 |Output2= Awkward Potion
 }}
| Cures [[Blindness]]
|
|-
! {{Inventory slot|Tonic}}<br>Tonic
| {{Brewing Stand
 |Input= Bismuth
 |Output2= Awkward Potion
 }}
| Cures [[Nausea]]
| In real life, {{w|bismuth subsalicylate}} is used as a nausea treatment.
|}

== Usage ==

Each type of medicine has an associated effect that it can cure (see {{slink||Brewing}} for details). Players can drink the medicine only if they have the corresponding effect. Drinking the medicine eliminates the effect. Although medicine does not resemble [[potion]]s, the player still gets the [[glass bottle]] back.

== Sounds ==
{{Sound table
|type=bedrock
|sound=Drink.ogg
|source=player
|description=When a player drinks medicine
|id=random.drink
|foot=1}}

== Data values ==
=== ID ===
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|generatetranslationkeys=y
|displayname=Medicine
|spritetype=item
|nameid=medicine
|id=599
|form=item
|notshowbeitemforms=y
|translationkey=item.medicine.poison.name,item.medicine.weakness.name,item.medicine.blindness.name,item.medicine.nausea.name
|foot=1}}

== History ==

{{History|bedrock}}
{{History||1.4.0|snap=beta 1.2.20.1|[[File:Antidote BE1.png|32px]] [[File:Elixir BE1.png|32px]] [[File:Eye Drops BE1.png|32px]] [[File:Tonic BE1.png|32px]] Added medicines.}}

{{History|education}}
{{History||1.0.27|[[File:Antidote BE1.png|32px]] [[File:Elixir BE1.png|32px]] [[File:Eye Drops BE1.png|32px]] [[File:Tonic BE1.png|32px]] Added medicines.}}
{{History|foot}}

== Issues ==

{{issue list|Cures|Medicine}}

== See also ==

* [[Potion]]
* [[Splash Potion]]
* [[Lingering Potion]]

{{Items}}
{{Education Edition}}

[[Category:Non-renewable resources]]
[[Category:Education Edition items]]

[[de:Medizin]]
[[it:Medicinale]]
[[ja:治療薬]]
[[lzh:藥]]
[[pl:Leki]]
[[pt:Remédio]]
[[zh:药物]]</li></ul>
September 28, 2011Notch works on "saving arbitrary data with item instances."
1.12
{{Extension DPL}}<ul><li>[[Brown Dye|Brown Dye]]<br/>{{Item
| image = Brown Dye.png
| renewable = Yes
| stackable = Yes (64)
}}

'''Brown dye''' is a [[Dye#Primary|primary color dye]] derived from [[cocoa beans]].

== Obtaining ==
=== Crafting ===
{{Crafting
 |Cocoa Beans
 |Output=Brown Dye
 |type=Material
 |head=
}}

== Usage  ==

{{dye usage}}

=== Crafting ingredient ===

{{crafting usage|ignore=Banner|continue=1}}
{{banner crafting usage}}

=== Loom ingredient ===
{{Banner loom usage|Brown Dye}}

=== Trading ===

Apprentice-level Shepherd villagers have a 20% chance to buy 12 brown dye for an emerald.‌{{only|bedrock}}

Expert-level Shepherd villagers have a {{frac|2|7}} chance to buy 12 brown dye for an emerald.{{only|java}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Brown Dye
|spritetype=item
|nameid=brown_dye
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|showaliasids=y
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Brown Dye
|spritetype=item
|nameid=brown_dye
|aliasid=dye / 17
|id=398
|form=item
|translationkey=item.dye.brown_new.name
|foot=1}}

== History ==
{{expand section|Item textures and more from a development video on twitter by bartek.}}
{{History|java}}
{{History||1.14|snap=18w43a|[[File:Brown Dye JE1 BE1.png|32px]] Added brown dye.}}
{{History|||snap=18w44a|Brown dye now can change the text color on [[sign]]s to brown.}}
{{History|||snap=19w05a|Added the [[wandering trader]], which sell brown dyes.}}
{{History|||snap=19w11a|Brown dye can now be [[trading|bought]] by shepherd villagers.}}
{{History||1.17|snap=20w45a|Brown dye can now used to craft newly added [[brown candle]]s.}}
{{History|||snap=21w19a|Brown dye can no longer used to craft brown candles.}}
{{History|||snap=Pre-release 1|Brown dye can once again used to craft brown candles.}}
{{History||1.20<br>(Experimental)|link=1.19.3|snap=22w42a|Brown dye now can change the text color on [[hanging sign]]s to brown.}}

{{History|bedrock}}
{{History||1.8.0|snap=beta 1.8.0.10|[[File:Brown Dye JE1 BE1.png|32px]] Added brown dye.}}
{{History||1.11.0|snap=beta 1.11.0.4|Brown dye can now be [[trading|sold]] to shepherd [[villager]]s.}}
{{History||1.16.100|snap=beta 1.16.100.56|The ID of brown dye has been changed from <code>dye/17</code> to <code>brown_dye</code>.}}

{{History|ps4}}
{{History||1.83|[[File:Brown Dye JE1 BE1.png|32px]] Added brown dye.}}
{{History|foot}}

== Issues ==

{{issue list}}

{{Items}}

[[Category:Dyes]]
[[Category:Renewable resources]]

[[de:Brauner Farbstoff]]
[[es:Tinte marrón]]
[[fr:Teinture marron]]
[[ja:茶色の染料]]
[[ko:갈색 염료]]
[[pl:Brązowy barwnik]]
[[pt:Corante marrom]]
[[th:สีย้อมสีน้ำตาล]]
[[zh:棕色染料]]</li><li>[[Heart of the Sea|Heart of the Sea]]<br/>{{Item
| image = Heart of the Sea.png
| stackable = Yes (64)
| rarity = Uncommon
| renewable = No
}}

A '''heart of the sea''' is a rare [[item]] that can be crafted into a [[conduit]].

== Obtaining ==
The heart of the sea must be found. It cannot be crafted or obtained by trading, making it a [[non-renewable resource]].

A heart of the sea is obtained from a [[buried treasure]]. The location is marked with a noticeable red X on a [[Explorer Map|buried treasure map]], which is found in [[Ocean_Ruins|ocean ruins]] and [[Shipwreck|shipwrecks]]. Feeding [[raw cod]] or [[raw salmon]] to a [[dolphin]] causes the dolphin to swim toward the nearest [[buried treasure]], [[shipwreck]], or [[ocean ruins]].

=== Chest loot ===

{{LootChestItem|heart-of-the-sea}}

== Usage ==
=== Crafting===

{{crafting usage}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Heart of the Sea
|spritetype=item
|nameid=heart_of_the_sea
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Heart of the Sea
|spritetype=item
|nameid=heart_of_the_sea
|id=571
|form=item
|foot=1}}

== History ==

{{History|java}}
{{History||1.13|snap=18w15a|[[File:Heart of the Sea JE1 BE2.png|32px]] Added heart of the sea.}}
{{History|||snap=18w19a|Heart of the sea now generates in all [[buried treasure]] [[chest]]s in a stack of 1.}}

{{History|bedrock}}
{{History||1.4.0|snap=beta 1.2.14.2|An entry in the [[buried treasure]] loot table has been added named <code>nautilus_core</code>. It is unobtainable though since the <code>nautilus_core</code> has not been added into the game yet.}}
{{History|||snap=beta 1.2.20.1|[[File:Heart of the Sea BE1.png|32px]] Added heart of the sea as an [[item]] obtainable in buried treasure [[chest]]s. It cannot be used to craft [[conduit]]s yet.}}
{{History|||snap=beta 1.2.20.2|[[File:Heart of the Sea JE1 BE2.png|32px]] The texture of heart of the sea has been changed.}}
{{History||1.5.0|snap=beta 1.5.0.1|Heart of the sea can now be used to craft [[conduit]]s.}}

{{History|console}}
{{History||xbox=TU69|ps=1.76|wiiu=Patch 38|[[File:Heart of the Sea JE1 BE2.png|32px]] Added heart of the sea.}}

{{History|education}}
{{History||1.4.0|[[File:Heart of the Sea JE1 BE2.png|32px]] Added heart of the sea. It generates in all [[buried treasure]] [[chest]]s in a stack of 1.}}
{{History|foot}}

== Issues ==
{{issue list}}

== Trivia ==
* Before the heart of the sea was added to {{el|be}}, there was an entry found in the buried treasure chest loot table named <code>nautilus_core</code>, which was later revealed to be the heart of the sea. Despite the name change, the heart of the sea continues to be referred to as the <code>nautilus_core</code> in most game files.

== External Links ==
*[https://www.minecraft.net/en-us/article/heart-sea Taking Inventory: Heart of the Sea] – Minecraft.net on August 31, 2023

{{items}}

[[Category:Non-renewable resources]]

[[de:Herz des Meeres]]
[[fr:Cœur de la mer]]
[[es:Corazón del mar]]
[[it:Cuore del mare]]
[[ja:海洋の心]]
[[ko:바다의 심장]]
[[nl:Hart van de zee]]
[[pl:Serce oceanu]]
[[pt:Coração do mar]]
[[ru:Сердце моря]]
[[uk:Серце моря]]
[[zh:海洋之心]]</li></ul>
?Added long array tags.
1.13
{{Extension DPL}}<ul><li>[[Green Dye|Green Dye]]<br/>{{redirect|Cactus Green|the plant|Cactus}}{{Item
| title = Green Dye
| renewable = Yes
| stackable = Yes (64)
}}
'''Green dye''' is a [[primary color dye]].

== Obtaining ==

=== Chest loot ===
{{LootChestItem|green-dye}}

=== Smelting ===
{{Smelting
|head=1
|showdescription=1
|Cactus
|Green Dye
|1
|description={{only|Java}}<ref>{{bug|MC-210211||Smelting cactus gives too much experience since 1.13}}</ref>
}}
{{Smelting
|head=0
|showdescription=1
|Cactus
|Green Dye
|0,2
|description={{only|Bedrock}}
|foot=1
}}

=== Trading ===

[[Wandering trader]]s sell 3 green dye for an [[emerald]].

== Usage ==

{{dye usage}}

=== Crafting ingredient ===

{{crafting usage|ignore=Banner|continue=1}}
{{banner crafting usage}}

=== Loom ingredient ===
{{Banner loom usage|Green Dye}}

=== Trading ===
Expert level shepherd villagers have {{frac|1|6}} chance to buy 12 green dye for an emerald.{{only|bedrock}} Expert level shepherds have a {{frac|2|7}} chance to buy 12 green dye for 1 emerald.{{only|java}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Green Dye
|spritetype=item
|nameid=green_dye
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|showaliasids=y
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Green Dye
|spritetype=item
|nameid=green_dye
|aliasid=dye / 2
|id=397
|form=item
|translationkey=item.dye.green.name
|foot=1}}

== Video ==
<div style="text-align:center">{{yt|O4KVTPI4qIc}}</div>

== History ==

{{History|java beta}}
{{History||1.2|[[File:Green Dye JE1 BE1.png|32px]] Added cactus green, together with all other dyes.}}
{{History|java}}
{{History||1.3.1|snap=1.3|[[File:Green Dye JE2 BE2.png|32px]] The texture of cactus green has been changed.}}
{{History||1.4.2|snap=12w34a|Added the ability to [[Armor#Dyeing|dye]] leather [[armor]] and [[wolf]] collars.}}
{{History||1.4.6|snap=12w49a|Cactus green can be crafted with [[gunpowder]] to create a [[firework star]].}} 
{{History||1.6.1|snap=13w19a|[[Stained clay]] can now be [[crafting|crafted]].}}
{{History||1.7.2|snap=13w41a|[[Stained glass]] can now be crafted.}}
{{History||1.8|snap=14w30a|Added [[banner]]s, which can be dyed.}}
{{History||1.11|snap=16w39a|Added the ability to dye [[shulker box]]es.}}
{{History||1.12|snap=17w06a|Cactus green can now be used to craft green [[concrete powder]].}}
{{History||1.12|snap=17w15a|Added the ability to dye [[bed]]s.}}
{{History||1.13|snap=17w47a|The different data values for the <code>dye</code> ID have now been split up into their own IDs.
|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 351.}}
{{History||1.14|snap=18w43a|"Cactus Green" has been renamed to "Green Dye".
|[[File:Green Dye JE3 BE3.png|32px]] The texture of green dye has been changed.}}
{{History|||snap=18w44a|Green dye can now change the text color on [[sign]]s to green.}}
{{History|||snap=18w50a|Green dye can now be found in [[chest]]s in [[desert]] [[village]] houses.}}
{{History|||snap=19w05a|Added the [[wandering trader]], which sells green dye.}}
{{History|||snap=19w11a|Green dye can now be [[trading|bought]] by shepherd villagers.}}
{{History||1.17|snap=20w45a|Green dye can now be used to craft [[green candle]]s.}}
{{History|||snap=21w19a|Green dye can no longer be used to craft green candles.}}
{{History|||snap=Pre-release 1|Green dye can once again be used to craft green candles.}}
{{History||1.20<br>(Experimental)|link=1.19.3|snap=22w42a|Green dye can now change the text color on [[hanging sign]]s to green.}}

{{History|pocket alpha}}
{{History||v0.3.0|[[File:Green Dye JE1 BE1.png|32px]] Added cactus green. It is currently unobtainable and has no usage.}}
{{History||v0.3.2|Cactus green is now obtainable by [[smelting]] cacti in a [[furnace]]. It still has no usage.}}
{{History||v0.4.0|Cactus green can now be used to craft [[cyan dye]], [[lime dye]], and [[green wool]].}}
{{History||v0.8.0|snap=build 1|[[File:Green Dye JE2 BE2.png|32px]] The texture of cactus green has been changed.}}
{{History||v0.14.0|snap=build 1|Cactus green can now be used to dye [[water]] in [[cauldron]]s.}}
{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|Cactus green can now be used to dye [[shulker]]s.}}
{{History||1.1.0|snap=alpha 1.1.0.0|Cactus green can now be used to dye [[bed]]s, [[shulker box]]es, and craft [[concrete powder]].}}
{{History|bedrock}}
{{History||1.2.0|snap=beta 1.2.0.2|Cactus green can now be used to craft [[stained glass]], patterns on [[banner]]s, and [[firework star]]s.}}
{{History||1.4.0|snap=beta 1.2.20.1|Cactus green can now be used to craft [[balloon]]s and [[glow stick]]s.}}
{{History||1.8.0|snap=beta 1.8.0.10|"Cactus Green" has been renamed to "Green Dye".}}
{{History||1.10.0|snap=beta 1.10.0.3|Green dye is now sold by [[wandering trader]]s.
|[[File:Green Dye JE3 BE3.png|32px]] The texture of green dye has been changed.}}
{{History||1.11.0|snap=beta 1.11.0.1|Green dye can now be found in [[desert]] [[village]] house [[chest]]s.}}
{{History|||snap=beta 1.11.0.4|Green dye can now be [[trading|sold]] to shepherd [[villager]]s.}}
{{History||1.16.100|snap=beta 1.16.100.56|The ID of green dye has been changed from <code>dye/2</code> to <code>green_dye</code>.}}

{{History|console}}
{{History||xbox=TU1|xbone=CU1|ps=1.00|wiiu=Patch 1|[[File:Green Dye JE1 BE1.png|32px]] Added cactus green.}}
{{History|PS4}}
{{History||1.83|"Cactus Green" has been renamed to "Green Dye".}}
{{History||1.90|[[File:Green Dye JE3 BE3.png|32px]] The texture of green dye has been changed.}}

{{History|new 3ds}}
{{History||0.1.0|[[File:Green Dye JE1 BE1.png|32px]] Added cactus green.}}
{{History|foot}}

== Issues ==

{{issue list}}

{{Items}}

[[cs:Kaktusová zeleň]]
[[de:Grüner Farbstoff]]
[[es:Tinte verde]]
[[fr:Teinture verte]]
[[hu:Kaktuszzöld]]
[[ja:緑色の染料]]
[[ko:초록색 염료]]
[[nl:Cactusgroen]]
[[pl:Zielony barwnik]]
[[pt:Corante verde]]
[[ru:Зелёный краситель]]

[[Category:Items]]
[[Category:Dyes]]
[[Category:Renewable resources]]</li><li>[[Clock|Clock]]<br/>{{about|the item|the redstone circuit|Redstone circuits/Clock}}
{{Item
| image = Clock.gif
| renewable = Yes
| stackable = Yes (64)
}}

'''Clocks''' are [[Daylight cycle|time]]-telling devices that display the current in-game position of the sun and the moon. Clocks only function properly in the [[Overworld]].

== Obtaining ==

=== Crafting ===

{{Crafting
|B1= Gold Ingot
|A2= Gold Ingot
|B2= Redstone Dust
|C2= Gold Ingot
|B3= Gold Ingot
|Output= Clock
|type= Tool
}}

=== Natural generation ===

{{LootChestItem|clock}}

=== Trading ===

Expert-level [[Trading#Librarian|librarian villagers]] have a {{frac|1|3}} (roughly 33.3%) chance to sell a single clock for 4 [[emerald]]s as part of their trades.{{only|bedrock}}

Expert-level librarian villagers have a {{frac|1|2}} (50%) chance to sell a clock for 5 emeralds.{{only|java}}

== Usage ==

[[File:WatchCycle.gif|thumb|Clock animation]]
The clock dial consists of two halves, a day side and a night side. The dial spins clockwise slowly to indicate the time of day, corresponding to the sun or moon's actual position in the sky. The player is able to [[bed|sleep]] a few seconds after the clock shows exactly dusk.

The dial always shows the current in-game time when in the [[Overworld]], regardless of where it appears. This includes a player's hand, an inventory slot, a [[Crafting table|crafting grid]], an [[item frame]], or even as a dropped [[Item (entity)|item]]. For a clock to be mounted on a wall, an [[item frame]] is required.

Because there is no day/night cycle in [[the Nether]] or [[the End]], clocks do not work properly in these dimensions. Instead, the dial rotates rapidly and randomly {{in|JE}} or clockwise {{in|BE}}, making them useless.

=== Piglins ===
{{EntityLink|Piglin|Piglins}} are attracted to clocks and run toward any clock on the ground, and inspect it for 6 to 8 seconds before putting it in their inventory.

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Clock
|spritetype=item
|nameid=clock
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Clock
|spritetype=item
|nameid=clock
|id=393
|form=item
|foot=1}}

== Achievements ==
{{load achievements|Oooh, shiny!}}
== Advancements ==
{{load advancements|Oh Shiny}}

== Video ==
''Note: This video doesn't state that clocks can be found in [[shipwreck]]s or [[ruined portal]]s because the video was released in an earlier [[Java Edition version history|version]].''
<div style="text-align:center">{{yt|Q3bsT84oVz4}}</div>

== History ==
{{History|java alpha}}
{{History||v1.2.0|snap=<nowiki>?|slink=:Category:Information needed requiring unarchived version|[[File:Clock JE1.gif|32px]] Added clocks.
|They have 228 visually distinct frames due to how the texture is generated – see the section below.}}
{{History|java}}
{{History||1.3.1|snap=12w21a|Librarian [[villager]]s now [[trading|sell]] clocks for 10-11 [[emerald]]s, making them [[renewable]].}}
{{History||1.5|snap=13w02a|[[File:Clock JE2 BE2.gif|32px]] Clocks now use the new animation feature included in [[texture pack]]s. As a result, they are considerably less precise, having only 64 frames.}}
{{History||1.8|snap=14w02a|Librarian [[villager]]s now [[trading|sell]] clocks for 10-12 [[emerald]]s.}}
{{History||1.9|snap=15w31a|Clocks are now broken up into individual textures, instead of having every individual frame on one vertical strip like with animated textures.}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 347.}}
{{History|||snap=18w14a|Clocks can now be found in [[shipwreck]] map rooms.}}
{{History||1.16|snap=20w09a|Clocks can now be used to distract [[piglin]]s.<ref>{{bug|MC-172363}}</ref>}}
{{History|||snap=20w16a|Clocks now generate in [[ruined portal]] chests.}}
{{History|||snap=20w19a|Clocks no longer work in the [[recipe book]].<ref>{{bug|MC-116293}}</ref>}}
{{History|||snap=20w22a|Clocks no longer work in the villager trading GUI.<ref>{{bug|MC-182888}}</ref>}}
{{History||1.17|snap=20w48a|[[File:Clock JE3.gif|32px]] The texture of clocks has been changed to match the new gold ingot texture from the texture update.}}

{{History|pocket alpha}}
{{History||v0.2.0|[[File:Clock BE1.png|32px]] Added clocks.
|Clocks currently have no function or legitimate method of obtaining them.}}
{{History||v0.8.0|snap=build 1|Clocks are now functional and [[crafting|craftable]]. They have been added into the Creative inventory.
|[[File:Clock JE2 BE2.gif|32px]] The texture of clocks has been changed. They use an predefined texture file with 64 different frames.}}
{{History|pocket}}
{{History||1.0.4|snap=alpha 1.0.4.0|Librarian [[villager]]s now [[trading|sell]] clocks for 10-12 [[emerald]]s.}}
{{History|bedrock}}
{{History||1.4.0|snap=beta 1.2.20.1|Clocks can now be found inside map room [[chest]]s in [[shipwreck]]s.}}
{{History||1.11.0|snap=beta 1.11.0.4|[[Trading]] has been changed, librarian [[villager]]s now have {{frac|1|3}} chance to [[trading|sell]] a clock for 4 [[emerald]]s as part of their [[trading|trades]].}}
{{History||1.16.0|snap=beta 1.16.0.57|Clocks now generate in [[ruined portal]] chests.}}
{{History||1.17.0|snap=beta 1.17.0.54|[[File:Clock JE3.gif|32px]] The texture of clocks has been changed to match the new gold ingot texture from the texture update.}}

{{History|console}}
{{History||xbox=TU1|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|[[File:Clock JE2 BE2.gif|32px]] Added clocks.}}
{{History||xbox=TU69|xbone=none|ps=1.76|wiiu=Patch 38|switch=none|Clocks can now be found in [[shipwreck]] map rooms.}}

{{History|New Nintendo 3DS Edition}}
{{History||0.1.0|[[File:Clock JE2 BE2.gif|32px]] Added clocks.}}
{{History|foot}}

=== Texture generation prior to Java Edition 13w02a ===
{{:Procedural animated texture generation/Clocks}}

== Issues ==

{{issue list}}

== Trivia ==
* {{IN|java}}, a clock can be viewed under the item [[statistics]] page as long as one obtained a clock at some point.
* {{IN|java}}, the default resource pack for the clock contains 64 individual frames, each frame lasting about 18.75 seconds in real time (375 ticks) (1350 seconds (22 minutes, 30 seconds) in Minecraft time).
* When the time of day changes suddenly, such as after sleeping or when {{cmd|time}} is used, the clock dial spins rapidly to catch up.
* Although clocks do not function in the Nether or the End, the actual daylight cycle does continue.

== Gallery ==
<gallery>
File:Clockonawall.png|A clock in an [[item frame]] on a wall in a [[player]]'s base, showing the night is near.
File:Player Holding Clock.png|Early-game player holding a clock.
File:Clock In Item Frame.png|A clock placed in an item frame.
</gallery>

== References ==
{{Reflist}}

{{Items}}

[[Category:Tools]]
[[Category:Renewable resources]]

[[cs:Hodiny]]
[[de:Uhr]]
[[es:Reloj]]
[[fr:Montre]]
[[hu:Óra]]
[[it:Orologio]]
[[ja:時計]]
[[ko:시계]]
[[nl:Klok]]
[[pl:Zegar]]
[[pt:Relógio]]
[[ru:Часы]]
[[th:นาฬิกา]]
[[uk:Годинник]]
[[zh:时钟]]</li></ul></nowiki>
18w01aAdded a data generator to both the Minecraft client and the default multiplayer software.
1.14
{{Extension DPL}}<ul><li>[[Head|Head]]<br/>{{Block
| image = 
<gallery>
Skeleton Skull.png | Skeleton
Wither Skeleton Skull.png | Wither Skeleton 
Player Head.png | Player
Zombie Head.png| Zombie
Creeper Head.png | Creeper
Dragon Head.png | Dragon
Piglin Head.png | Piglin
</gallery>
| transparent = Yes
| light = No
| tool = any
| renewable = 
* '''Skeleton, Wither Skeleton, Zombie, Creeper, Piglin:''' 
* Yes
* '''Dragon, Player:'''
* No
| stackable = Yes (64)
| flammable = No
| lavasusceptible = No
| rarity = Uncommon
}}

A '''head''' or '''skull''' is a [[block]] modeled after the head of a specific [[entity]]. There are seven types of heads: [[player]] ([[Steve]]'s head by default), [[zombie]], [[skeleton]], [[wither skeleton]], [[creeper]], [[piglin]], and [[dragon]].

== Obtaining ==

=== Breaking ===

A mob head can be mined using any item,<ref>{{bug|MC-192905||Heads & Skulls have no assigned tool}}</ref> and drops itself when broken.
{{breaking row|horizontal=1|Mob Head|sprite=Heads}}
If a head is pushed by a [[piston]] or comes in contact with [[water]] or [[lava]], it breaks off as an [[item (entity)|item]].

When destroyed by an [[explosion]], the head ''always'' drops as an item.

===Natural generation===

Dragon heads generate on [[end ships]] found in [[End City|end cities]].

Skeleton skulls can generate in [[ancient cities]], which sometimes generate in the [[deep dark]].

=== Mob loot ===

A [[wither skeleton]] has a 2.5% chance of dropping a wither skeleton skull when killed by a player or a tamed [[wolf]]. The chance is increased by 1% per level of [[Looting]], for a maximum of 5.5% with Looting III. {{IN|bedrock}}, the chance is increased by 2% per level of [[Looting]], for a maximum of 8.5% with Looting III.

[[Skeleton]], [[wither skeleton]], [[zombie]], [[creeper]] and [[piglin]] heads are always dropped by the respective mob if it dies due to a [[charged creeper]]'s explosion. {{IN|bedrock}}, if multiple mobs are killed by the same charged creeper, all of them drop their heads, however {{in|java}} only one mob selected at random drops its head.<ref>{{bug|MC-63534|||WAI}}</ref> If an [[ender dragon]] or a [[player]] is killed by a charged creeper, it does not drop its head.<ref name=":0">{{bug|MC-132933|||WAI}}</ref>

==Usage ==

===Decoration===

Mob heads can be oriented in 16 different directions on top of a block, and 4 directions on the sides of blocks, similar to [[sign]]s. They can be placed on top of, or beside each other by shift clicking.

When placed and powered by redstone, the piglin and dragon heads plays an animation. The piglin head flaps its ears (2 times per second for the right ear and 2.5 times per second for the left ear) while the dragon head opens and closes its mouth repeatedly (2 times per second). The same animation occurs when worn by a (horizontally) moving player, zombie, skeleton, or [[armor stand]] (note: the animation does not play if the <code>NoGravity</code> tag is set to 1)

=== Wearing ===
{{See also|#Renders}}

The player can wear heads, similarly to [[pumpkin]]s or helmets. This overlays the second layer of the player's [[skin]].

====Disguise====

Wearing the corresponding mob head reduces the detection range for [[skeleton]]s (but not [[wither skeleton]]s), [[creeper]]s, [[zombie]]s, and [[piglin]]s to 50% of the normal range. This is similar to (and stacks with) the reductions in detection range from [[sneaking]] and from the [[Invisibility]] status effect.

{{IN|bedrock}}, wearing any mob head or carved pumpkin makes the player invisible to other players on a locator [[map]].

=== Withers===
{{FakeImage|{{BlockGrid|scale=2|w=Wither Skeleton Skull|s=Soul Sand|www|sss| s }}|Wither build configuration}}

[[Wither]]s can be spawned by placing soul sand or soul soil in a T shape, and putting 3 wither skeleton skulls on top of the T. The T can be horizontal or vertical. The last block placed must be one of the three wither skeleton skulls. A dispenser can also create a wither, by placing the final skull onto soul sand directly in front of and below it.

===Dispensers===
A [[dispenser]] can equip a mob head on a player, mob, or armor stand with an empty helmet slot, within the block the dispenser is facing.

[[Dispenser]]s can also complete the construction of a wither.

=== Crafting ingredient===

{{crafting usage|Wither Skeleton Skull,Creeper Head|continue=1}}
{{Crafting
  |ignoreusage=1
  |ingredients=Any '''Mob head''' +<br>[[Gunpowder]] +<br>Any [[Dye]]
  |Gunpowder
  |Wither Skeleton Skull;Skeleton Skull;Zombie Head;Head;Creeper Head;Dragon Head;Player Head
  |Matching Dye
  |Output= Matching Firework Star
  |description=Forms Creeper shape
  |foot=1
}}

===Enchantments===

Mob heads can receive the following enchantments, but only through an [[anvil]].
{| class="wikitable col-2-center col-3-right"
|+
!Name
!Max Level
![[Enchanting|Method]]
|-
|[[Curse of Binding]]
|I
|{{Inventory slot|Anvil}}
|-
|[[Curse of Vanishing]]
|I
|{{Inventory slot|Anvil}}
|-
|}

=== Note blocks ===
Placing a head above a [[note block]] causes the note block to play the corresponding mob's {{cd|ambient}} sound when activated. The only exception is the creeper head; as creepers don't make {{cd|ambient}} sounds, the note block plays the {{cd|primed}} (hissing) sound instead.

The block below the note block does not affect the mob sound it creates.

==Player skins==
{{exclusive|java|section=1}}
Human heads have an extra usage for map makers, they can be given [[Chunk format#Entity Format|NBT data]] so that they appear with the skin of any ''Minecraft'' account. This means if a player knows that a specific account has a head that is desired to display, the NBT data can be edited to make it appear.

The command to give the player a head with the skin of another player is {{cmd|give @s minecraft:player_head{SkullOwner:"<''PlayerName''>"} }}. Commonly, this kind of head is called a custom head. 

Another command to give the player a head with another player's skin is {{cmd|give @s minecraft:player_head{SkullOwner:{Id:"<''PlayerUUID''>",Properties:{textures:[{Value:"<''SkinURL''>"}]} } } }}. ''SkinURL'' is a string encoded in [https://en.wikipedia.org/wiki/Base64 Base64] containing the URL of the player's skin.<ref>Example: {"textures":{"SKIN":{"url":"<nowiki>http://textures.minecraft.net/texture/292009a4925b58f02c77dadc3ecef07ea4c7472f64e0fdc32ce5522489362680"}}}</ref> A player head saves the skin of the player from the time it was created, meaning if the player changes their skin, the head still displays the original texture.<ref>{{tweet|Dinnerbone|464414369452142592|Skulls are a snapshot of the skin as it was made; just change your skin, make a skull, and change your skin back. That's intended behaviour.|May 8, 2014}}</ref>

Note that it is therefore necessary to be connected to the internet to load the texture of a skin, whatever the property used.
When they are loaded for the first time by the client, the skins textures are cached in {{code|[[.minecraft]]\assets\skins\(subfolders)\(files)}}.
If the client does not have access to the internet when it first loads, the player's head displays a regular head (Steve's skin) which is also cached.
Afterwards, even if the client reconnects to the internet, in order to display the skin correctly, it is necessary to clear the cache manually by deleting the recently created files in {{code|[[.minecraft]]\assets\skins\(subfolder)}}, then restarting the game.

When NBT-customized heads (with names and lores) are placed on the ground, they lose their names and given lores upon picking up. Therefore, using Ctrl + {{ctrl|pick block}} on a custom player head gives the player a head that still retains its textures, but with no lores and its name is reset to either {{code|[PlayerName]'s Head}} (heads obtained by MHF-Marc's Head Format or existing players in the world) or {{code|Player Head}} (heads obtained by using skin URLs).

=== Marc's Head Format===
[[File:Allmobheads.png|thumb|right|Most of the MHF mob heads provided.]]

{{exclusive|Java|section=1}}

[[Marc Watson]] created a number of accounts with specific skins so map makers could use common heads without the risk of someone changing their skins.<ref>{{reddit|1m0itx/twitter_marc_irl_mapmakers_would_it_be_useful|cc4m1cq|I'm here to make it so that people don't have to worry about having a consistent account whose skin might change.|Marc_IRL|September 9, 2013}}</ref> Nowadays, since heads do not update the skin if a player changes their skin, this is not something map-makers need to worry about, though these skins are still useful. These accounts have names in the format <code>MHF_<''Name''></code>, for example <code>MHF_PigZombie</code> is the name of a ''Minecraft'' user with a [[zombified piglin]] head. MHF stands for "Marc's Head Format".<ref>{{tweet|Marc_IRL|377453670410891264|head format. I needed to pick a prefix that was short and not already taken by other usernames.|September 10, 2013}}</ref> There are also a few blocks and "bonus" heads, for more variety. These player heads have not been updated in compliance with the [[Texture Update]], and are outdated.

Because these are names of player accounts, these heads are obtained or placed using the <code>SkullOwner</code> tag, for instance: {{cmd|/give @s minecraft:player_head{SkullOwner:"MHF_''<Name>''"}<nowiki />}}.

The following names/heads have been made available:<ref>{{tweet|Marc_IRL|542330244473311232|For those following the MHF list, I have presents for you. Full list of accounts I've made: http://pastebin.com/5mug6EBu|December 9, 2014}}</ref> 
<!--

DO NOT add ANY skull to this list without a source that it is made by Mojang; unsourced additions will be reverted!

In particular:
* MHF_Apple, MHF_Wither and MHF_Tree are not made by Mojang, see {{tweet|Marc_IRL|542599419678707714}} and {{tweet|Marc_IRL|590522239616954369}}
* MHF_Guardian is unofficial, see http://redd.it/3439u0

-->

;Mobs
<div class="list-style-none" style="-moz-column-width:15em;-webkit-column-width:15em;column-width:15em">
*{{InvSprite|MHF Alex}} MHF_Alex
*{{InvSprite|MHF Blaze}} MHF_Blaze
*{{InvSprite|MHF CaveSpider}} MHF_CaveSpider
*{{InvSprite|MHF Chicken}} MHF_Chicken
*{{InvSprite|MHF Cow}} MHF_Cow
*{{InvSprite|MHF Creeper}} MHF_Creeper
*{{InvSprite|MHF Enderman}} MHF_Enderman
*{{InvSprite|MHF Ghast}} MHF_Ghast
*{{InvSprite|MHF Golem}} MHF_Golem
*{{InvSprite|MHF Herobrine}} MHF_Herobrine
*{{InvSprite|MHF LavaSlime}} MHF_LavaSlime
*{{InvSprite|MHF MushroomCow}} MHF_MushroomCow
*{{InvSprite|MHF Ocelot}} MHF_Ocelot
*{{InvSprite|MHF Pig}} MHF_Pig
*{{InvSprite|MHF PigZombie}} MHF_PigZombie
*{{InvSprite|MHF Sheep}} MHF_Sheep
*{{InvSprite|MHF Skeleton}} MHF_Skeleton
*{{InvSprite|MHF Slime}} MHF_Slime
*{{InvSprite|MHF Spider}} MHF_Spider
*{{InvSprite|MHF Squid}} MHF_Squid
*{{InvSprite|MHF Steve}} MHF_Steve
*{{InvSprite|MHF Villager}} MHF_Villager
*{{InvSprite|MHF WSkeleton}} MHF_WSkeleton
*{{InvSprite|MHF Zombie}} MHF_Zombie
</div>

;Blocks
<div class="list-style-none" style="-moz-column-width:15em;-webkit-column-width:15em;column-width:15em">
*{{InvSprite|MHF Cactus}} MHF_Cactus
*{{InvSprite|MHF Cake}} MHF_Cake
*{{InvSprite|MHF Chest}} MHF_Chest
*{{InvSprite|MHF CoconutB}} MHF_CoconutB
*{{InvSprite|MHF CoconutG}} MHF_CoconutG
*{{InvSprite|MHF Melon}} MHF_Melon
*{{InvSprite|MHF OakLog}} MHF_OakLog
*{{InvSprite|MHF Present1}} MHF_Present1
*{{InvSprite|MHF Present2}} MHF_Present2
*{{InvSprite|MHF Pumpkin}} MHF_Pumpkin
*{{InvSprite|MHF TNT}} MHF_TNT
*{{InvSprite|MHF TNT2}} MHF_TNT2
</div>

;Bonus
<div class="list-style-none" style="-moz-column-width:15em;-webkit-column-width:15em;column-width:15em">
*{{InvSprite|MHF ArrowUp}} MHF_ArrowUp
*{{InvSprite|MHF ArrowDown}} MHF_ArrowDown
*{{InvSprite|MHF ArrowLeft}} MHF_ArrowLeft
*{{InvSprite|MHF ArrowRight}} MHF_ArrowRight
*{{InvSprite|MHF Exclamation}} MHF_Exclamation
*{{InvSprite|MHF Question}} MHF_Question
</div>

==Sounds==
===Generic===
{{Sound table/Block/Stone}}
===Unique===
{{Edition|Java}}:
{{Sound table
|sound=Zombie idle1.ogg
|sound2=Zombie idle2.ogg
|sound3=Zombie idle3.ogg
|subtitle=Zombie groans
|source=record
|description=When a zombie head is played using a note block
|id=block.note_block.imitate.zombie
|translationkey=subtitles.entity.zombie.ambient
|volume=3.0
|pitch=1.0
|distance=16}}
{{Sound table
|sound=Skeleton idle1.ogg
|sound2=Skeleton idle2.ogg
|sound3=Skeleton idle3.ogg
|subtitle=Skeleton rattles
|source=record
|description=When a skeleton skull is played using a note block
|id=block.note_block.imitate.skeleton
|translationkey=subtitles.entity.skeleton.ambient
|volume=3.0
|pitch=1.0
|distance=16}}
{{Sound table
|sound=Creeper fuse.ogg
|subtitle=Creeper hisses
|source=record
|description=When a creeper head is played using a note block
|id=block.note_block.imitate.creeper
|translationkey=subtitles.entity.creeper.primed
|volume=3.0
|pitch=0.5
|distance=16}}
{{Sound table
|sound=Ender dragon idle1.ogg
|sound2=Ender dragon idle2.ogg
|sound3=Ender dragon idle3.ogg
|sound4=Ender dragon idle4.ogg
|subtitle=Dragon roars
|source=record
|description=When an ender dragon head is played using a note block
|id=block.note_block.imitate.ender_dragon
|translationkey=subtitles.entity.ender_dragon.ambient
|volume=3.0
|pitch=1.0
|distance=16}}
{{Sound table
|sound=Wither skeleton idle1.ogg
|sound2=Wither skeleton idle2.ogg
|sound3=Wither skeleton idle3.ogg
|subtitle=Wither Skeleton rattles
|source=record
|description=When a wither skeleton skull is played using a note block
|id=block.note_block.imitate.wither_skeleton
|translationkey=subtitles.entity.wither_skeleton.ambient
|volume=3.0
|pitch=1.0
|distance=16}}
{{Sound table
|sound=Piglin idle1.ogg
|sound2=Piglin idle2.ogg
|sound3=Piglin idle3.ogg
|sound4=Piglin idle4.ogg
|sound5=Piglin idle5.ogg
|subtitle=Piglin snorts
|source=record
|description=When a piglin head is played using a note block
|id=block.note_block.imitate.piglin
|translationkey=subtitles.entity.piglin.ambient
|volume=1.98
|pitch=1.0
|distance=16}}
{{Sound table
|sound=Equip generic1.ogg
|sound2=Equip generic2.ogg
|sound3=Equip generic3.ogg
|sound4=Equip generic4.ogg
|sound5=Equip generic5.ogg
|sound6=Equip generic6.ogg
|subtitle=Gear equips
|source=player
|description=When a carved pumpkin is equipped
|id=item.armor.equip_generic
|translationkey=subtitles.item.armor.equip
|volume=1.0
|pitch=1.0
|distance=16
|foot=1}}

<!--volumes and pitches seem to be approximately v=0.9 p=0.84, but those values are approximate and are not in the files. They are probably inside of the code.-->
{{Edition|Bedrock}}:
{{Sound table
|type=bedrock
|sound=Zombie idle1.ogg
|sound2=Zombie idle2.ogg
|sound3=Zombie idle3.ogg
|source=record
|description=When a zombie head is played using a note block
|id=note.zombie
|pitch=0.84 <ref group=sound name=pitch>Actually equal to <math>\frac{1}{\sqrt[4]{2}}</math>, which is about 0.8409</ref>}}
{{Sound table
|sound=Skeleton step1.ogg
|sound2=Skeleton step2.ogg
|sound3=Skeleton step3.ogg
|sound4=Skeleton step4.ogg
|source=record
|description=When a skeleton skull is played using a note block<wbr><ref group=sound name=skeletoncreeper>{{Bug|MCPE-164530}}</ref>
|id=note.skeleton
|pitch=0.84 <ref group=sound name=pitch/>}}
{{Sound table
|sound=Fuse.ogg
|source=record
|description=When a creeper head is played using a note block<wbr><ref group=sound name=skeletoncreeper/>
|id=note.creeper
|pitch=0.84 <ref group=sound name=pitch/>}}
{{Sound table
|sound=Ender dragon idle1.ogg
|sound2=Ender dragon idle2.ogg
|sound3=Ender dragon idle3.ogg
|sound4=Ender dragon idle4.ogg
|source=record
|description=When a dragon head is played using a note block
|id=note.enderdragon
|pitch=0.84 <ref group=sound name=pitch/>}}
{{Sound table
|sound=Skeleton step1.ogg
|sound2=Skeleton step2.ogg
|sound3=Skeleton step3.ogg
|sound4=Skeleton step4.ogg
|source=record
|description=When a wither skeleton skull is played using a note block<wbr>{{Until|BE 1.20.40}}<wbr><ref group=sound name=skeletoncreeper/>
|id=note.witherskeleton
|pitch=0.84 <ref group=sound name=pitch/>}}
{{Sound table
|sound=Wither skeleton step1.ogg
|sound2=Wither skeleton step2.ogg
|sound3=Wither skeleton step3.ogg
|sound4=Wither skeleton step4.ogg
|source=record
|description=When a wither skeleton skull is played using a note block<wbr>{{Upcoming|BE 1.20.40}}<wbr><ref group=sound name=skeletoncreeper/>
|id=note.witherskeleton
|pitch=0.84 <ref group=sound name=pitch/>}}
{{Sound table
|sound=Piglin angry1.ogg
|sound2=Piglin angry2.ogg
|sound3=Piglin angry3.ogg
|sound4=Piglin angry4.ogg
|source=record
|description=When a piglin head is played using a note block<wbr><ref group=sound>{{Bug|MCPE-164710}}</ref>
|id=note.piglin
|pitch=0.84 <ref group=sound name=pitch/>}}
{{Sound table
|sound=Equip generic1.ogg
|sound2=Equip generic2.ogg
|sound3=Equip generic3.ogg
|sound4=Equip generic4.ogg
|sound5=Equip generic5.ogg
|sound6=Equip generic6.ogg
|source=player
|description=When a carved pumpkin is equipped
|id=armor.equip_generic
|volume=1.0
|pitch=1.0
|foot=1}}

==Data values==

===ID===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Skeleton Skull
|spritetype=block
|nameid=skeleton_skull}}
{{ID table
|displayname=Wither Skeleton Skull
|spritetype=block
|nameid=wither_skeleton_skull}}
{{ID table
|displayname=Zombie Head
|spritetype=block
|nameid=zombie_head}}
{{ID table
|displayname=Player Head
|spritetype=block
|nameid=player_head}}
{{ID table
|displayname=Creeper Head
|spritetype=block
|nameid=creeper_head}}
{{ID table
|displayname=Dragon Head
|spritetype=block
|nameid=dragon_head}}
{{ID table
|displayname=Piglin Head
|spritetype=block
|nameid=piglin_head}}
{{ID table
|displayname=Skeleton Wall Skull
|spritetype=block
|nameid=skeleton_wall_skull
|form=block}}
{{ID table
|displayname=Wither Skeleton Wall Skull
|spritetype=block
|nameid=wither_skeleton_wall_skull
|form=block}}
{{ID table
|displayname=Zombie Wall Head
|spritetype=block
|nameid=zombie_wall_head
|form=block}}
{{ID table
|displayname=Player Wall Head
|spritetype=block
|nameid=player_wall_head
|form=block}}
{{ID table
|displayname=Creeper Wall Head
|spritetype=block
|nameid=creeper_wall_head
|form=block}}
{{ID table
|displayname=Dragon Wall Head
|spritetype=block
|nameid=dragon_wall_head
|form=block}}
{{ID table
|displayname=Piglin Wall Head
|spritetype=block
|nameid=piglin_wall_head
|foot=1}}
{{ID table
|displayname=Block entity
|spritename=heads
|spritetype=block
|nameid=skull
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|firstcolumnname=Head
|shownumericids=y
|showforms=y
|generatetranslationkeys=y
|displayname=Block
|spritename=skulls
|spritetype=block
|nameid=skull
|id=144
|form=block
|itemform=item.skull
|translationkey=-}}
{{ID table
|displayname=Item
|spritename=skulls
|spritetype=item
|nameid=skull
|id=516
|form=item
|translationkey=item.skull.skeleton.name, item.skull.wither.name, item.skull.zombie.name, item.skull.char.name, item.skull.creeper.name, item.skull.dragon.name, item.skull.piglin.name
|foot=1}}
{{ID table
|notnamespaced=y
|displayname=Block entity
|spritename=heads
|spritetype=block
|nameid=Skull
|foot=1}}

===Metadata===
{{see also|Data values}}
{{IN|bedrock}}, mob heads use the following data values:
{{/DV}}

===Item data===

{{el|java}}:
{{main|Player.dat format}}
Player heads use item NBT to save the owner.
<div class="treeview">
* {{nbt|compound|tag}}: The item's '''tag''' tag.
{{:Player.dat_format/Player Heads}}
</div>

{{el|bedrock}}:
:{{IN|bedrock}}, heads have no additional item tag.
:See [[Bedrock Edition level format/Item format]].

===Block states===
{{see also|Block states}}

{{/BS}}

===Block data===

A mob head has a block entity associated with it that holds additional data about the block.

{{el|java}}:
{{see also|Block entity format}}
{{/BE}}

{{el|bedrock}}:
:See [[Bedrock Edition level format/Block entity format]].

== Achievements==
{{load achievements|Camouflage;The Beginning?}}

==Advancements==
{{load advancements|Spooky Scary Skeleton;Withering Heights}}

==History==
''For a more in-depth breakdown of changes to textures and models, including a set of renders for each state combination, see [[/Asset history]]''
{{History|java}}
{{History||August 28, 2012|link={{tweet|jeb|240383066831462401}}|[[Jeb]] released images of the skeleton head, hinting of more types to come.}}
{{History||PAX 2012|link={{ytl|IqciEbjYd-I|t=03m21s}}|At [[wikipedia:PAX (event)|PAX]], [[Dinnerbone]] revealed that there would be rare [[drops]] of these [[mob]]s.<ref>http://www.twitch.tv/pax2/b/330745811 (at 3:59:00)</ref>}}
{{History||1.4.2|snap=12w36a|[[File:Skeleton Skull (item) JE1.png|32px]] [[File:Wither Skeleton Skull (item) JE1.png|32px]] [[File:Zombie Head (item) JE1.png|32px]] [[File:Player Head (item) JE1.png|32px]] [[File:Creeper Head (item) JE1.png|32px]] Added skeleton, wither skeleton, zombie, player, and creeper heads.
|Wither skeleton skulls are rarely [[drops|dropped]] by the [[wither skeleton]] upon [[death]] (2.5% chance), while the other four are obtainable only from the [[creative]] [[inventory]].}}
{{History|||snap=12w37a|[[File:Skeleton Skull (item) JE1 BE1.png|32px]] [[File:Wither Skeleton Skull (item) JE1 BE1.png|32px]] [[File:Zombie Head (item) JE1 BE1.png|32px]] [[File:Player Head (item) JE1 BE1.png|32px]] [[File:Creeper Head (item) JE1 BE1.png|32px]] Changed item textures.
|Added as a hidden and disabled feature, player heads can now have the [[skin]] of a specific [[player]]. A line in the language file implies that there either used to be, or in a future update, the possibility of obtaining a specific player's head.<ref name="en_US 12w21">Snapshot 12w37a {{cd|lang/en_US.lang}}: <code>item.skull.player.name=%s's Head</code></ref> 
|Player heads do not [[drops|drop]] in vanilla, but mapmakers/modders/etc. can make them by adding an [[NBT format|NBT]] string tag <code>{"SkullOwner":"''player_name''"}</code> on the skull [[item]]s.<ref name="playerheads">{{reddit|zxn7u/its_apparently_my_cakeday_so_lets_cash_in_this}}</ref>}}
{{History||November 7, 2012|link=https://www.reddit.com/r/minecraftsuggestions/comments/12qtbz/killing_other_players_with_a_sword_should_drop/c6xqpym/?context=3|[[Jeb]] states that the official opinion is that "[dropping] player heads [on player kills] are a bit too gory for [[Minecraft]], so it's better suited for a plugin or mod."}}
{{History||1.4.6|snap=12w49a|Any kind of [[mob]] head can now be used to [[crafting|craft]] a [[firework star]] with [[creeper]]-face effect.}}
{{History||1.7.2|snap=13w36a|Custom heads can now be obtained without third party programs via {{cmd|give}}.}}
{{History||1.8|snap=14w03a|Player heads now show the [[skin]]'s hat layer (this also works when a [[mob]]/player wears the head).}}
{{History|||snap=14w29a|Heads now display a cracking animation.}}
{{History|||snap=14w30a|[[File:Skeleton Skull (item) JE2.png|32px]] [[File:Wither Skeleton Skull (item) JE2.png|32px]] [[File:Zombie Head (item) JE2.png|32px]] [[File:Player Head (item) JE2.png|32px]] [[File:Creeper Head (item) JE2.png|32px]] Player and mob heads in [[inventory|inventories]] and held by mobs/players now display as [[block]]s. 
|Skulls worn by [[mob]]s and [[player]]s are now displayed on the armor layer. Previously, the skull replaced the mob/player's head texture; the hat layer appeared over the skull.
|Skeleton, zombie, and creeper heads are now available in [[survival]]. The player can obtain them by killing the appropriate mob with a charged [[creeper]].
|Creeper heads and wither skeleton skulls are now used in [[crafting]] specific [[banner]] patterns.}}
{{History|||snap=14w30b|A single charged creeper explosion no longer yields more than one [[mob]] head. The mob head that drops is chosen randomly.}}
{{History||1.8.4|snap=release|For security reasons, custom heads can now have textures only from [[mojang.com]] and [[minecraft.net]].}}
{{History||1.9|snap=15w31a|[[File:Dragon Head (8) JE2.png|32px]] Added dragon heads.
|Dragon heads are currently available only in [[creative]] mode.
|[[Mob]] heads now appear larger in the [[inventory]].}}
{{History|||snap=15w32a|Creeper, zombie, and skeleton heads can now be worn to reduce detection by the corresponding mobs by 50%.}}
{{History|||snap=15w32c|Dragon heads now generate on [[end ship]]s, meaning they are now obtainable in [[survival]].}}
{{History|||snap=15w33c|The disguise that is given by mob heads now reduces detection range to 37.5% of normal.}}
{{History|||snap=15w36a|The disguise that is given by mob heads now reduces detection range to 50% of normal again.}}
{{History|||snap=15w39a|[[Dispenser]]s can now equip mob heads onto [[player]]s, [[mob]]s and [[armor stand]]s.}}
{{History||1.13|snap=17w47a|The ID of heads have been split into 12; one of each available standard head, as well as a wall counterpart of each.
|<code>skeleton_skull</code>, <code>wither_skeleton_skull</code>, <code>player_head</code>, <code>zombie_head</code>, <code>creeper_head</code> and <code>dragon_head</code> are now available as [[item]]s and placed [[block]]s with a <code>rotation</code> block state of 0-15.
|<code>skeleton_wall_skull</code>, <code>wither_skeleton_wall_skull</code>, <code>player_wall_head</code>, <code>zombie_wall_head</code>, <code>creeper_wall_head</code> and <code>dragon_wall_head</code> are available only as placed blocks with a <code>facing</code> block state of north, south, east or west.
|Prior to [[1.13/Flattening|''The Flattening'']], this [[block]]'s numeral ID was 144, and the [[item]]'s 397.}}
{{History||1.19|snap=Deep Dark Experimental Snapshot 1|Skeleton skulls now generate as part of [[ancient cities]].}}
{{History||November 14, 2022|link=https://www.minecraft.net/en-us/article/playable-mob-sounds-coming-minecraft-1-20|Piglin heads are announced to be added in [[Java Edition 1.20]] on the Minecraft website.}}
{{History||1.19.3|snap=22w45a|[[File:Player Head (8) JE5.png|32px]] The texture of the player head has been changed.}}
{{History||1.20<br>(Experimental)|link=1.19.3|snap=22w46a|[[File:Piglin Head (8) JE1.png|32px]] Added piglin heads behind the [[Java Edition 1.20|Update 1.20 experimental datapack]].}}
{{History||1.20<br>(Experimental)|link=1.19.4|snap=23w03a|Heads can now be placed on top of note blocks without sneaking.}}
<!-- 
{{History||1.19.4|snap=23w05a|Heads can now be swapped by let [[helmet]]s {{ctrl|using}} in the hotbar.<ref>{{bug|MC-216270|||Fixed}}</ref>}}
{{History||?|Head can now be swapped in [[armor stand]]s by {{ctrl|using}} them/[[helmet]]s/[[carved pumpkin]]s in the armor stand's slot.}}
RE-ADD WHEN THE WORDING IS BETTER -->
{{History||1.20|snap=23w12a|Piglin heads are now available without using the "Update 1.20" experimental datapack.}}

{{History|pocket alpha}}
{{History||v0.12.1|snap=build 1|[[File:Skeleton Skull (item) JE1 BE1.png|32px]] [[File:Wither Skeleton Skull (item) JE1 BE1.png|32px]] [[File:Zombie Head (item) JE1 BE1.png|32px]] [[File:Player Head (item) JE1 BE1.png|32px]] [[File:Creeper Head (item) JE1 BE1.png|32px]] Added skeleton, wither skeleton, zombie, player, and creeper heads. 
|The skeleton, wither skeleton, zombie, player and creeper heads use the [[Java Edition|Java]] textures prior to [[Java Edition 14w30a|14w30a]].}} 
{{History||v0.14.0|snap=build 1|Mob heads can now be worn as armor.}}
{{History||v0.16.0|snap=build 4|Wither skeleton skulls can now be used to spawn the [[wither]].}}
{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|[[File:Dragon Head (item) BE1.png|32px]] Added dragon heads. 
|Dragon heads use a two-dimensional sprite, unlike [[Java Edition|Java]] does.}}
{{History|bedrock}}
{{History||1.2.0|snap=beta 1.2.0.2|Mob heads can now be used to craft [[firework star]]s.
|Creeper heads and wither skeleton skulls are now used to [[crafting|craft]] specific patterns on [[banner]]s.}}
{{History|||snap=beta 1.2.0.11|[[File:Skeleton Skull (item) BE2.png|32px]] [[File:Wither Skeleton Skull (item) BE2.png|32px]] [[File:Zombie Head (item) BE2.png|32px]] [[File:Head (item) BE2.png|32px]] [[File:Creeper Head (item) BE2.png|32px]] [[File:Dragon Head (item) BE2.png|32px]] [[Player]] and [[mob]] heads in [[inventory|inventories]] and when held by mobs/players now display as [[block]]s.}}
{{History||1.10.0|snap=beta 1.10.0.3|Wither skeleton skulls and creeper heads can now be used to craft [[banner pattern]]s.}}
{{History||November 14, 2022|link=https://www.minecraft.net/en-us/article/playable-mob-sounds-coming-minecraft-1-20|Piglin heads are announced to be added in [[Bedrock Edition 1.20.0]] on the Minecraft website.}}
{{History||Next Major Update<br>(Experimental)|link=1.19.60|snap=beta 1.19.60.20|[[File:Piglin Head (item) BE1.png|32px]] Added piglin heads behind the "[[Bedrock Edition 1.20.0|Next Major Update]]" [[experimental]] toggle.}}
{{History|||snap=beta 1.19.60.25|Heads can now be placed on top of note blocks without sneaking.}}
{{History||1.20.0|snap=beta 1.20.0.21|Piglin heads are now available without using the "Next Major Update" experimental toggle.}}
{{History||1.20.40|snap=beta 1.20.40.20|Wither skeleton skulls now make their respective step sounds when played by a note block.}}

{{History|console}}
{{History||xbox=TU12|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|[[File:Skeleton Skull (item) JE1 BE1.png|32px]] [[File:Wither Skeleton Skull (item) JE1 BE1.png|32px]] [[File:Zombie Head (item) JE1 BE1.png|32px]] [[File:Player Head (item) JE1 BE1.png|32px]] [[File:Creeper Head (item) JE1 BE1.png|32px]] Added skeleton, wither skeleton, zombie, player, and creeper heads to the [[creative inventory]]. 
|Wither skeleton skulls currently do not have a use.}}
{{History||xbox=TU19|xbone=CU7|ps=1.12|Wither skeleton skulls can now be obtained by killing [[wither skeleton]]s.
|Wither skeleton skulls can now be used to build the [[wither]].}}
{{History||xbox=TU31|xbone=CU19|ps=1.22|wiiu=Patch 3|Skeleton, zombie, and creeper heads are now available in [[survival]]. The [[player]] can obtain them by killing the appropriate [[mob]] with a charged [[creeper]].}}
{{History||xbox=TU46|xbone=CU36|ps=1.38|wiiu=Patch 15|[[File:Dragon Head (item) JE1.png|32px]] Added dragon heads.}}

{{History|new 3ds}}
{{History||0.1.0|[[File:Skeleton Skull (item) JE1 BE1.png|32px]] [[File:Wither Skeleton Skull (item) JE1 BE1.png|32px]] [[File:Zombie Head (item) JE1 BE1.png|32px]] [[File:Player Head (item) JE1 BE1.png|32px]] [[File:Creeper Head (item) JE1 BE1.png|32px]] Added skeleton, wither skeleton, zombie, player, and creeper heads.}}
{{History||1.7.10|[[File:Dragon Head (item) BE1.png|32px]] Added dragon heads.}}
{{History|foot}}

===Skull "item"===
{{:Technical blocks/Skull}}

==Issues==

{{issue list}}

== Trivia==
* Despite there being a default Steve head, heads for the other protagonist skins cannot be obtained without using custom names.
*{{IN|be}}, the skull variant for the item is stored under the {{cd|damage}} component, normally used for items with [[durability]].
*The head item's model when wore on a player is slightly larger than its placed block counterpart in the world, which in turn is also slightly larger than the actual player's head. Therefore, a player who wears their own head appears with a larger head.

==Gallery==

===Renders===
<gallery>
Steve wearing Skeleton Skull.png|
Steve wearing Wither Skeleton Skull.png|
Steve wearing Creeper Head.png|
Steve wearing Zombie Head.png|
Steve wearing Dragon Head.png|
Alex wearing Skeleton Skull.png|
Alex wearing Wither Skeleton Skull.png|
Alex wearing Creeper Head.png|
Alex wearing Zombie Head.png|
Alex wearing Dragon Head.png|
Dragon Head.gif|An animation of the dragon head when redstone power is supplied.
</gallery>

===Screenshots===
<gallery>
All The Heads.png|All of the heads.
Headsrotation.png|Heads oriented in different directions.
HeadsOnAFence.png|Heads are the same scale as [[cobblestone wall]] posts.
Playerheads.png|A picture of player heads, including some Mojang characters.
EndShipBow.png|A dragon head found at the bow of an end ship.
</gallery>

====Development====
<gallery>
1st image Mob Head.png|First screenshot released of heads.
Minecart with chest and head thing.png|Notch's head in a [[minecart with chest]].
PauseUnpause's Head 1.png|First image of held heads rendering as blocks.
PauseUnpause's Head 2.png|Second image of held heads rendering as blocks.
Pocket Edition Heads.jpg|First image of a head being worn in bedrock edition.
1.16 Dev failed head holding.jpg|First attempt to fix {{bug|MC-91869}} by [[Xilefian]].
1.16 Dev failed head holding 2.jpg|Second attempt.
</gallery>

===In other media===
<gallery>
Efe Looking at Makena Napping on a Note Block.jpg|[[Efe]] looking at [[Makena]] napping on a Note block
Efe Placing a Zombie Head on a Note Block.jpg|Efe placing a zombie head sneakily on the note block.
Makena Waking up Startled by the Zombie Noise.jpg|Makena waking up startled at the sound of zombies being played on the note block.
File:Piglin Head Animation.jpg|[[Sunny]] using a piglin head to make noise in a [[Crimson Forest]].<ref>https://www.instagram.com/p/Ct7CfOBplrG/</ref>
</gallery>

==References==
{{reflist}}

{{blocks|Utility}}
{{items}}

[[Category:Utility blocks]]
[[Category:Manufactured blocks]]
[[Category:Generated structure blocks]]
[[Category:Block entities]]
[[Category:Non-solid blocks]]

[[cs:Hlava]]
[[de:Kopf]]
[[es:Cabeza]]
[[fr:Tête]]
[[hu:Mob fejek]]
[[it:Testa di creatura]]
[[ja:Mobの頭]]
[[ko:몹 머리]]
[[nl:Wezenhoofd]]
[[pl:Głowa]]
[[pt:Cabeça de criatura]]
[[ru:Голова]]
[[uk:Голова]]
[[zh:生物头颅]]</li><li>[[Sword|Sword]]<br/>{{For|the item in ''Minecraft Dungeons''|MCD:Sword|MCD:Diamond Sword}}
{{Item
| image = <gallery>
Wooden Sword.png | Wooden
Stone Sword.png | Stone
Iron Sword.png | Iron
Golden Sword.png | Golden
Diamond Sword.png | Diamond
Netherite Sword.png | Netherite
</gallery>
| rarity = Common
| renewable = 
* '''Netherite''': No
* '''All others''': Yes
| durability = 
'''Java Edition'''<br>
Golden: 32<br>
Wood: 59<br>
Stone: 131<br>
Iron: 250<br>
Diamond: 1561<br>
Netherite: 2031<br>
'''Bedrock Edition'''<br>
Golden: 33<br>
Wood: 60<br> 
Stone: 132<br>
Iron: 251<br>
Diamond: 1562<br>
Netherite: 2032
| stackable = No
}}
The '''sword''' is a melee [[weapon]] that is mainly used to deal [[damage]] to [[entity|entities]] or for breaking certain blocks faster than by hand. A sword is made from one of six materials, in order of increasing quality and expense: wood, gold, stone, iron, diamond and netherite.

== Obtaining ==
=== Crafting ===
{{Crafting
  |showname=0
  |showdescription=1
  |head=1
  |name=[[Swords]]
  |B1={Any Planks}; Iron Ingot; Gold Ingot; Diamond
  |B2={Any Planks}; Iron Ingot; Gold Ingot; Diamond
  |B3=Stick
  |Output=Wooden Sword; Iron Sword; Golden Sword; Diamond Sword
  |type=Combat
}}
{{Crafting
  |name=Stone Sword
  |B1=Any stone-tier block
  |B2=Any stone-tier block
  |B3=Stick
  |Output=Stone Sword
  |description=Can use cobblestone and its other variants interchangeably.
  |type=Combat
}}
{{Crafting
  |foot=1
  |ignoreusage=1
  |name=[[Swords]]
  |ingredients=Damaged Matching [[Swords]]
  |Damaged Wooden Sword; Damaged Stone Sword; Damaged Iron Sword; Damaged Golden Sword; Damaged Diamond Sword; Damaged Netherite Sword
  |Damaged Wooden Sword; Damaged Stone Sword; Damaged Iron Sword; Damaged Golden Sword; Damaged Diamond Sword; Damaged Netherite Sword
  |description= The durability of the two swords is added together, plus an extra 5% of the tool type's total durability. Enchantments are removed unless combined on an [[anvil]].<br>'''Example:''' Two wooden swords, each with remaining durability of 20, combine into a wooden sword having 43 durability (20 + 20 + 5% of 60).
  |Output=Wooden Sword; Stone Sword; Iron Sword; Golden Sword; Diamond Sword; Netherite Sword
  |type=Combat
}}

=== Upgrading ===
{{Smithing
|Netherite Upgrade
|Diamond Sword
|Netherite Ingot
|Netherite Sword
|description=
|tail=1
}}

=== Repairing ===
==== Grinding ====
{{Grinding
|showdescription=1
|ingredients=2x Damaged Wooden Sword or<br>2x Damaged Stone Sword or<br>2x Damaged Iron Sword or<br>2x Damaged Golden Sword or<br>2x Damaged Diamond Sword or <br>2x Damaged Netherite Sword
|Damaged Wooden Sword; Damaged Stone Sword; Damaged Iron Sword; Damaged Golden Sword; Damaged Diamond Sword; Damaged Netherite Sword
|Damaged Wooden Sword; Damaged Stone Sword; Damaged Iron Sword; Damaged Golden Sword; Damaged Diamond Sword; Damaged Netherite Sword
|Wooden Sword; Stone Sword; Iron Sword; Golden Sword; Diamond Sword; Netherite Sword
|description=The durability of the two swords is added together, plus an extra 5% durability. Any enchantments, besides curses, would be removed.
}}

==== Unit repair ====
{{main|Anvil mechanics#Unit repair}}
{{/Repairing with Anvils}}
A sword can be repaired in an [[anvil]] by adding units of the [[tiers]]' repair material, with each repair material restoring 25% of the sword's maximum durability, rounded down.

=== Mob loot ===
{{Main|Drops#Equipped items}}

Some [[mobs]] can spawn with a sword and have an 8.5% chance of dropping them upon death caused by player. This chance is increased by 1% per level of [[Looting]], up to a maximum of 11.5% with Looting III. [[Zombie]]s and [[husk]]s can drop iron swords, [[zombified piglin]]s and [[piglin]]s can drop golden swords, and [[wither skeleton]]s can drop stone swords. The dropped sword is usually badly damaged and may be enchanted. Stone swords dropped by wither skeletons are never enchanted.

A [[vex]] wields an iron sword that normally has a 0% chance of dropping, because their main hand's <code>HandDropChances</code> is 0. However, this chance increases by 1 percentage point per level of Looting. It is never damaged{{only|java}} and may be enchanted.

{{IN|be}}, [[pillager]]s and [[vindicator]]s that spawn from raids have a 4.1% chance (5.12% chance on hard mode) of dropping a damaged iron sword. This sword has a 50% chance of being enchanted.

=== Trading ===
[[File:Weaponsmith Diamond Sword Trade.png|thumb|right|The diamond sword trade of a weaponsmith.]]

{{IN|bedrock}}, an apprentice-level weaponsmith villagers sells enchanted iron swords for at least 7-21 emeralds, and a master-level weaponsmith sells enchanted diamond swords for at least 13-27 emeralds.

{{IN|java}}, a novice-level weaponsmith villager has a {{frac|2|3}} chance of selling an enchanted iron sword for at least 7-22 emeralds. A master-level weaponsmith offers to sell an enchanted diamond sword for at least 11–27 emeralds.

The enchantments of the swords offered by villagers are the same as the ones obtained from an [[enchantment table]] at levels 5–19.

=== Chest loot ===
{{LootChestItem|iron-sword,level-enchanted-iron-sword,damaged-random-enchanted-iron-sword,golden-sword,random-enchanted-golden-sword,diamond-sword,damaged-diamond-sword,level-enchanted-diamond-sword,damaged-random-enchanted-diamond-sword,damaged-random-enchanted-diamond-sword-2}}

== Usage ==
=== Attacking ===
Pressing {{control|attack}} while holding a sword inflicts damage on both mobs and other players. Upon damaging a mob or player, the sword's [[Item Durability|durability]] decreases by 1.

Attacking a [[boat]] or a [[minecart]] with a sword stone tier or higher instantly destroys it {{only|java}}, without decreasing the sword's durability. Otherwise, it requires 2 hits, with neither decreasing durability.

==== Sweeping ====
{{exclusive|Java|section=1}}
If the attack recharge meter is 84.8% or above and the player is on the ground standing or moving slower than the [[sprinting]] speed in a straight line, the sword performs a sweeping attack indicated by a gale [[particle]] that reaches nearby enemies for {{hp|1}} and knocks them back; the amount of knockback is 80% that of the basal knockback and does not benefit from the [[knockback]] enchantment. As result, the player can perform a sweep attack while they are sprinting diagonally but it is impossible to perform a sweep attack at the same time as a critical hit or while riding some [[entity]]. All enemies within an 1 by 0.25 by 1 block area of any part of the attacked mob and whose feet are 3 or less blocks away from player's feet are affected. The [[sweeping edge]] enchantment increases the damage dealt by 50% of the normal hit damage for level I, 67% for level II and 75% for level III.

=== Damage ===
{{Main|Damage}}

==== Java Edition ====
Swords have an attack speed of 1.6 and take 0.625 seconds to [[Damage#Attack cooldown|recover]]. 

{| class="wikitable" style="text-align:center" data-description="Sword attack damage by type"
! Material
! {{ItemSprite|Wooden Sword|text=Wooden}}
! {{ItemSprite|Golden Sword|text=Gold}}
! {{ItemSprite|Stone Sword|text=Stone}}
! {{ItemSprite|Iron Sword|text=Iron}}
! {{ItemSprite|Diamond Sword|text=Diamond}}
! {{ItemSprite|Netherite Sword|text=Netherite}}
|-
! Attack Damage
| {{hp|4}}
| {{hp|4}}
| {{hp|5}}
| {{hp|6}}
| {{hp|7}}
| {{hp|8}}
|-
! Attack Speed
| 1.6
| 1.6
| 1.6
| 1.6
| 1.6
| 1.6
|-
! Damage/Second (DPS)
| 6.4
| 6.4
| 8
| 9.6
| 11.2
| 12.8
|-
! Durability
| 59
| 32
| 131
| 250
| 1561
| 2031
|-
! Lifetime damage inflicted<ref group="note">The formula to find the total lifetime damage is ''Lifetime damage minimum = Durability × Damage per hit''. It ignores enchantments and [[Damage#Critical_hit|critical hits]], and assumes the sword is at maximum charge</ref>
| {{hp|236}}
| {{hp|128}}
| {{hp|655}}
| {{hp|1500}}
| {{hp|10927}}
| {{hp|16248}}
|}
{{notelist}}

==== Bedrock Edition ====
{{IN|bedrock}}, swords have no attack cooldown or sweep attack, and deal the following damage:

{| class="wikitable" style="text-align:center" data-description="Sword attack damage by type"
! Material
! {{ItemSprite|Wooden Sword|text=Wooden}}
! {{ItemSprite|Golden Sword|text=Gold}}
! {{ItemSprite|Stone Sword|text=Stone}}
! {{ItemSprite|Iron Sword|text=Iron}}
! {{ItemSprite|Diamond Sword|text=Diamond}}
! {{ItemSprite|Netherite Sword|text=Netherite}}
|-
! Attack Damage
| {{hp|5}} <!-- DO NOT CHANGE THESE! The values are correct, '+4 Attack Damage' means 5 total attack damage. -->
| {{hp|5}}
| {{hp|6}}
| {{hp|7}}
| {{hp|8}}
| {{hp|9}}
|-
! Durability
| 60
| 33
| 132
| 251
| 1562
| 2032
|-
! Lifetime damage inflicted<ref group="note">The formula to find the total lifetime damage is ''Durability × Damage per hit = Lifetime damage minimum''. It excludes enchantments and critical hits</ref>
| {{hp|300}}
| {{hp|165}}
| {{hp|792}}
| {{hp|1757}}
| {{hp|12496}}
| {{hp|18288}}
|}
{{notelist}}

The most amount of damage that a sword enchanted with [[Sharpness]] V can do is 11 {{in|java}} and 15.25 {{in|bedrock}}, without critical hits.

=== Sword breaking times ===
{{main|Breaking}}

A sword can also be used to destroy certain blocks 50% quicker, sometimes much quicker than with fists. Using a sword to destroy any block that doesn't break instantly by hand decreases its durability by 2; this includes bamboo, despite that the sword is the fastest tool for breaking it.<ref>{{bug|MC-195168||Swords consume double durability than they normally would when destroying bamboo saplings, bamboo, or cobwebs}}</ref>

If a sword is enchanted with [[Silk Touch]], either using [[Creative]] or [[commands]], cobwebs the sword destroys will drop the cobwebs themselves instead of the usual string. This is due to the sword being classified as the proper tool for cobwebs.

The following table shows the time it takes to break blocks on which swords have any effect. Colors indicate what gets dropped:
* White: an original block.
* Blue: block's normal drop (e.g. seeds, sapling, apple).
* Red: nothing.

{| class="wikitable" style="text-align:center" data-description="Blocks affected by swords"
! Block
! Fists
! Sword
! colspan="2" | Proper/fastest tool
|-
!style="text-align:left"| {{BlockLink|Bamboo}}
| {{tc|no|{{breaking time|Bamboo}} s }} || 0.05 s (instant) <!-- this doesn't work: {{tc|planned|{{breaking time|Bamboo|Sword}} s}} -->
| {{ItemSprite|sword|link=Sword}}
| 0.05 s (instant) <!-- this doesn't work: {{breaking time|Bamboo|Sword}} s -->
|-
!style="text-align:left"| {{BlockLink|Cobweb}}
| {{tc|no|{{breaking time|Cobweb|drop=None}} s}} || {{tc|planned|{{breaking time|Cobweb|Sword}} s}}
| {{ItemSprite|shears|link=Shears}}
| {{breaking time|Cobweb|Shears}} s
|-
!style="text-align:left"| {{BlockLink|Cocoa}}
| {{tc|planned|{{breaking time|Cocoa}}s}} || {{tc|planned|{{breaking time|Cocoa|Sword}}s}}
| {{ItemSprite|wooden-axe|link=Axe}}
| {{tc|planned|{{breaking time|Cocoa|Golden}} – {{breaking time|Cocoa|Wooden}} s}}
|-
! style="text-align:left"|{{BlockLink|Hay Bale}}
| 1s
| 0.8s{{only|bedrock}}
| {{ItemSprite|wooden-hoe|link=Hoe}}
| {{breaking time|Hay Bale|Golden}} – {{breaking time|Hay Bale|Wooden}} s
|-
!style="text-align:left" rowspan="2"| {{BlockLink|Leaves}}
!rowspan="2" {{tc|planned|{{breaking time|Leaves}} s}}
!rowspan="2" {{tc|planned|{{breaking time|Leaves|Sword}} s}}
| {{ItemSprite|shears|link=Shears}}
| {{breaking time|Leaves|Shears}}s
|-
| {{ItemSprite|wooden-hoe|link=Hoe}}
| {{tc|planned|{{breaking time|Leaves|Golden}} – {{breaking time|Leaves|Wooden}} s}}
|-
!style="text-align:left"| {{BlockLink|Jack o'Lantern}}
| {{breaking time|Jack o'Lantern}} s || {{breaking time|Jack o'Lantern|Sword}} s
| {{ItemSprite|wooden-axe|link=Axe}}
| {{breaking time|Jack o'Lantern|Golden}} – {{breaking time|Jack o'Lantern|Wooden}} s
|-
!style="text-align:left"| {{BlockLink|Melon}}
| {{tc|planned|{{breaking time|Melon}} s}} || {{tc|planned|{{breaking time|Melon|Sword}} s}}
| {{ItemSprite|wooden-axe|link=Axe}}
| {{tc|planned|{{breaking time|Melon|Golden}} – {{breaking time|Melon|Wooden}} s}}
|-
!style="text-align:left"| {{BlockLink|Pumpkin}}
| {{breaking time|Pumpkin}}s || {{breaking time|Pumpkin|Sword}} s
| {{ItemSprite|wooden-axe|link=Axe}}
| {{breaking time|Pumpkin|Golden}} – {{breaking time|Pumpkin|Wooden}} s
|-
!style="text-align:left" rowspan="2"| {{BlockLink|Vines}} 
| rowspan="2" {{tc|no|{{breaking time|Vines}} s}} || rowspan="2" {{tc|no|{{breaking time|Vines|Sword}} s}}
| {{ItemSprite|wooden-axe|link=Axe}}
| {{tc|no|{{breaking time|Vines|Golden}} – {{breaking time|Vines|Wooden}} s}}
|-
| {{ItemSprite|shears|link=Shears}}
| {{breaking time|Vines|Shears}} s
|}

==== Safety around constructions ====
In Creative mode, swords are unable to break blocks. However, care must still be taken around [[minecart]]s, [[painting]]s, [[item frame]]s,{{only|java}} and [[armor stand]]s; these are entities, thus can be broken with swords in Creative.<ref>{{bug|MC-27140}}</ref><ref>{{bug|MC-18463}}</ref>

=== Enchantments ===
Swords can receive, gathered from mob drops/villager trades or be found in various loot chests (example: End City, Bastion Remnant)with the following [[enchantment]]s:

{| class="wikitable sortable col-2-center col-3-right"
|+
!Name
!Max Level
![[Enchanting|Method]]
!Weight
|-
|[[Fire Aspect]]
|II
|{{Inventory slot|Enchanting Table}}{{Inventory slot|Anvil}}
|2
|-
|[[Looting]]
|III
|{{Inventory slot|Enchanting Table}}{{Inventory slot|Anvil}}
|2
|-
|[[Unbreaking]]
|III
|{{Inventory slot|Enchanting Table}}{{Inventory slot|Anvil}}
|5
|-
|[[Sharpness]]<ref group=note name=note1>Sharpness, Smite, and Bane of Arthropods are mutually exclusive.</ref>
|V
|{{Inventory slot|Enchanting Table}}{{Inventory slot|Anvil}}
|10
|-
|[[Smite]]<ref group=note name=note1/>
|V
|{{Inventory slot|Enchanting Table}}{{Inventory slot|Anvil}}
|5
|-
|[[Bane of Arthropods]]<ref group="note" name=note1/>
|V
|{{Inventory slot|Enchanting Table}}{{Inventory slot|Anvil}}
|5
|-
|[[Knockback]]
|II
|{{Inventory slot|Enchanting Table}}{{Inventory slot|Anvil}}
|5
|-
|[[Mending]]
|I
|{{Inventory slot|Anvil}}
|2
|-
|[[Curse of Vanishing]]
|I
|{{Inventory slot|Anvil}}
|1
|-
|[[Sweeping Edge]]{{Only|java|short=1}}
|III
|{{Inventory slot|Enchanting Table}}{{Inventory slot|Anvil}}
|2
|}
Golden swords have the highest enchantability, yet the least durability{{Notelist}}

=== Fuel ===
Wooden swords can be used as fuel in [[furnace]]s, smelting 1 item per sword.

=== Smelting ingredient ===
{{Smelting|showname=1|Iron Sword;Golden Sword|Iron Nugget;Gold Nugget|0,1}}

=== Piglins ===
[[Piglin]]s are attracted to golden swords, run toward any golden swords on the ground and inspect it for 6 to 8 seconds before putting it in their [[inventory]] slot.

== Sounds ==
{{Edition|Java}}:
{{Sound table
|sound=Strong attack1.ogg
|sound2=Strong attack2.ogg
|sound3=Strong attack3.ogg
|sound4=Strong attack4.ogg
|sound5=Strong attack5.ogg
|sound6=Strong attack6.ogg
|subtitle=Strong attack
|source=player
|description=When a player deals an attack that does not trigger any other attack sounds
|id=entity.player.attack.strong
|translationkey=subtitles.entity.player.attack.strong
|volume=''varies'' <ref group=sound>0.6 for <code>strong1</code> through <code>strong4</code>, and 0.7 for <code>strong5</code> and <code>strong6</code></ref>
|pitch=1.0
|distance=16}}
{{Sound table
|sound=Critical attack1.ogg
|sound2=Critical attack2.ogg
|sound3=Critical attack3.ogg
|subtitle=Critical attack
|source=player
|description=When a player deals a critical hit
|id=entity.player.attack.crit
|translationkey=subtitles.entity.player.attack.crit
|volume=0.7
|pitch=1.0
|distance=16}}
{{Sound table
|sound=Knockback attack1.ogg
|sound2=Knockback attack2.ogg
|sound3=Knockback attack3.ogg
|sound4=Knockback attack4.ogg
|subtitle=Knockback attack
|source=player
|description=When a player deals a sprinting attack
|id=entity.player.attack.knockback
|translationkey=subtitles.entity.player.attack.knockback
|volume=0.7
|pitch=1.0
|distance=16}}
{{Sound table
|sound=Sweep attack1.ogg
|sound2=Sweep attack2.ogg
|sound3=Sweep attack3.ogg
|sound4=Sweep attack4.ogg
|sound5=Sweep attack5.ogg
|sound6=Sweep attack6.ogg
|sound7=Sweep attack7.ogg
|subtitle=Sweeping attack
|source=player
|description=When a player deals a sweep attack
|id=entity.player.attack.sweep
|translationkey=subtitles.entity.player.attack.sweep
|volume=0.7
|pitch=1.0
|distance=16}}
{{Sound table
|rowspan=2
|sound=Weak attack1.ogg
|sound2=Weak attack2.ogg
|sound3=Weak attack3.ogg
|sound4=Weak attack4.ogg
|subtitle=Weak attack
|source=player
|description=When a player deals an attack with no damage
|id=entity.player.attack.nodamage
|translationkey=subtitles.entity.player.attack.weak
|volume=0.7
|pitch=1.0
|distance=16}}
{{Sound table
|subtitle=Weak attack
|source=player
|description=When a player attempts to attack without sufficient cooldown
|id=entity.player.attack.weak
|translationkey=subtitles.entity.player.attack.weak
|volume=0.7
|pitch=1.0
|distance=16}}
{{Sound table
|sound=Random break.ogg
|subtitle=Item breaks
|source=player
|description=When a sword's durability is exhausted
|id=entity.item.break
|translationkey=subtitles.entity.item.break
|volume=0.8
|pitch=0.8-1.2
|distance=16
|foot=1}}

{{Edition|Bedrock}}:
{{Sound table
|type=bedrock
|sound=Strong attack1.ogg
|sound2=Strong attack2.ogg
|sound3=Strong attack3.ogg
|sound4=Strong attack4.ogg
|sound5=Strong attack5.ogg
|sound6=Strong attack6.ogg
|source=player
|description=When a player deals an attack with damage
|id=game.player.attack.strong
|volume=0.2
|pitch=0.8-1.2}}
{{Sound table
|sound=Weak attack1.ogg
|sound2=Weak attack2.ogg
|sound3=Weak attack3.ogg
|sound4=Weak attack4.ogg
|source=player
|description=When a player deals an attack with no damage
|id=game.player.attack.nodamage
|volume=0.2
|pitch=0.8-1.2}}
{{Sound table
|sound=Random break.ogg
|source=player
|description=When an sword's durability is exhausted
|id=random.break
|volume=1.0
|pitch=0.9
|foot=1}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Wooden Sword
|spritetype=item
|nameid=wooden_sword
|form=item}}
{{ID table
|displayname=Stone Sword
|spritetype=item
|nameid=stone_sword
|form=item}}
{{ID table
|displayname=Iron Sword
|spritetype=item
|nameid=iron_sword
|form=item}}
{{ID table
|displayname=Diamond Sword
|spritetype=item
|nameid=diamond_sword
|form=item}}
{{ID table
|displayname=Golden Sword
|spritetype=item
|nameid=golden_sword
|form=item}}
{{ID table
|displayname=Netherite Sword
|spritetype=item
|nameid=netherite_sword
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Wooden Sword
|spritetype=item
|nameid=wooden_sword
|id=308
|form=item}}
{{ID table
|displayname=Stone Sword
|spritetype=item
|nameid=stone_sword
|id=312
|form=item}}
{{ID table
|displayname=Iron Sword
|spritetype=item
|nameid=iron_sword
|id=307
|form=item}}
{{ID table
|displayname=Diamond Sword
|spritetype=item
|nameid=diamond_sword
|id=316
|form=item}}
{{ID table
|displayname=Golden Sword
|spritetype=item
|nameid=golden_sword
|id=322
|form=item}}
{{ID table
|displayname=Netherite Sword
|spritetype=item
|nameid=netherite_sword
|id=604
|form=item
|foot=1}}

== Achievements ==
{{load achievements|Time to Strike!;Overkill;Oooh, shiny!}}

== Advancements ==
{{load advancements|Oh Shiny}}

== History == 
=== Blocking ===
{{main|Blocking}}
[[File:Parrying.png|thumb|right|The blocking animation using a sword before and after [[Java Edition 14w30a]] (from the [[Adventure Update|Adventure]] to the [[Bountiful Update|Bountiful]] updates).]]
 
Previously, since the [[Adventure Update]], all types of swords could be used to parry to block some forms of damage. If the player is blocking with a sword when attacked, the sword deflects 50% of incoming damage from melee, non-magical projectiles like arrows, and explosions, along with minimizing airborne knockback. The sword is held in front of the player and its durability is not reduced by blocking. The player moves at a slower rate than [[sneaking]] if blocking with a sword. Sword blocks could be engaged and disengaged instantly, with no delay between the input and damage mitigation nor cooldown between lowering a block and raising a new one.
 
After the [[Combat Update]], the sword blocking functionality was replaced by blocking with [[shield]]s and to accommodate the [[dual wield]] system. Shields negate more damage and knockback than sword blocking from "blockable" attacks (they block 100% damage and knockback after [[Java Edition 1.11]]), but, unlike swords, they lose durability, have a 0.25 second startup period before damage can be mitigated and can be temporarily disabled by attacks with an [[axe]].

=== Knockback ===
The knockback dealt by swords used to be higher than while the players are using another melee [[item]]s, like an axe or with the hands. This feature was removed in [[Java Edition 1.9]] and is also no longer used in ''[[Bedrock Edition]]''.

=== Historical changes per version ===
{{History|java indev}}
{{History||0.31|snap=20091231-2|[[File:Iron Sword JE1 BE1.png|32px]] Added iron swords.
|Iron swords cannot be [[craft]]ed yet, but can be added to the [[player]]'s [[inventory]] during world creation.}}
{{History||0.31|snap=?|The iron sword is no longer added to the player's inventory during world creation.}}
{{History||0.31|snap=20100128|[[File:Wooden Sword JE1 BE1.png|32px]] [[File:Stone Sword JE1 BE1.png|32px]] [[File:Diamond Sword JE1 BE1.png|32px]] Swords made from wood, stone, and diamond have been added.
|Swords cannot be crafted yet, but have been added to the [[item]] [[chest]] in the Indev house.|A sword held by the player is now rendered to appear more 3D.}}
{{History||0.31|snap=20100129|Wood, stone, iron, and diamond swords can now be [[craft]]ed.}}
{{History|||snap=20100130|[[File:Golden Sword JE1.png|32px]] Swords can now be made out of gold.}}
{{History|||snap=20100131|Swords now have [[durability]]. 
|Better swords now last longer.
|Swords now cost 1 durability per hit, and 2 points per block broken.}}
{{History||20100206|[[File:Golden Sword JE2 BE1.png|32px]] The texture of gold swords has been slightly changed.}}
{{History|java alpha}}
{{History||v1.2.0|snap=release|[[Zombie pigmen]] now hold golden swords.}}
{{History|java beta}}
{{History||1.2|Swords, like all [[tool]]s, now have more [[item durability|durability]].
|Prior, diamond swords had 1024 durability, iron swords had 128, stone swords 64 and wood and gold had 32 durability.}}
{{History||1.5|The damages of all swords have increased by 1, due to the player's barehand damage increasing from {{hp|1}} to {{hp|2}}.
|As a result, wooden and golden swords now dealt {{hp|5}}, stone swords {{hp|7}}, iron swords {{hp|9}}, and diamond swords {{hp|11}}.}}
{{History||1.8|snap=Pre-release|Added the ability to block with a sword, giving the [[player]] more options in combat.
|Swords deflect 50% of incoming melee damage, non-magical projectiles like arrows and explosion damage, and a bit of knockback.
|The sword is held in front of the player and its durability is not reduced by blocking.|The player moves at a slower rate than [[sneaking]] when blocking with a sword.
|As barehand damage has been reduced from {{hp|2}} to {{hp|1}}, the damages of all swords have been reduced to their pre Beta 1.5 values.}}
{{History|java}}
{{History||1.0.0|snap=Beta 1.9 Prerelease 3|Sword [[damage]] has been reduced to make way for [[enchanting]]. A diamond sword's damage has been reduced from {{hp|10}} to {{hp|7}}, iron has been reduced from {{hp|8}} to {{hp|6}} and stone has been reduced from {{hp|6}} to {{hp|5}}. Wooden and golden swords still deal {{hp|4}} damage.|Iron swords are now found in the new [[stronghold]] altar [[chest]]s.}}
{{History|||snap=Beta 1.9 Prerelease 4|Swords can now be enchanted in the [[enchantment table]].}}
{{History||1.1|snap=12w01a|Iron swords are now found in [[village]] blacksmith chests.}}
{{History||1.2.1|snap=12w06a|The [[player]] now has a rare chance of obtaining iron swords by killing [[zombie]]s and golden swords from [[zombie pigmen]] from the addition of [[rare drops]]. These swords have a 20% chance of being enchanted.}}
{{History||1.2.4|snap=release|[[Spruce planks]], [[birch planks]], and [[jungle planks]] can now be used to craft wooden swords.}}
{{History||1.3.1|snap=12w18a|Wooden swords can now be used as [[fuel]] in a [[furnace]].}}
{{History|||snap=12w21a|Blacksmith [[villager]]s now [[trading|sell]] diamond swords for 12–13 [[emerald]]s, and iron swords for 7–10 emeralds.
|With the [[trading]] implementation, renewable [[item]]s such as [[wheat]] can now be [[trading|sold]] to buy a diamond sword. This has now made all swords [[Renewable Resource|renewable]].}}
{{History||1.4.2|snap=12w32a|[[Zombie]]s may sometimes wield iron swords, dealing extra [[damage]].}}
{{History|||snap=12w34a|If a [[player]] has dyed leather armor equipped and selected a sword of any kind, it appears in the color of the dye applied to the armor, when switching to second or third person view.}}
{{History|||snap=12w36a|Added [[wither skeleton]]s, which hold stone swords.}}
{{History||1.4.6|snap=12w49a|[[Unbreaking]] can now be applied to a sword with an [[enchanted book]].}}
{{History||1.6.1|snap=13w18a|Golden swords are now found in the new [[chest]]s in [[nether fortress]]es.}}
{{History|||snap=13w21a|Instead of replacing the barehanded [[damage]] ({{hp|1}}), swords now add their damage onto the barehanded damage, which results in all swords doing {{hp|1}} more damage than before.}}
{{History|||snap=13w25b|In [[Creative]] mode, swords are no longer able to break [[block]]s, and no [[sound]] plays when they're hit with one.}}
{{History||1.7.2|snap=1.7.1|[[Acacia planks]] and [[dark oak planks]] can now be used to craft wooden swords.}}
{{History||1.8|snap=14w02a|Weaponsmith [[villager]]s now [[trading|sell]] enchanted diamond swords for 12–15 [[emerald]]s, and iron swords for 9–10 emeralds. Unenchanted swords are no longer sold.}}
{{History|||snap=14w30a|Sword holding position have been tweaked, and the blocking animation has changed. Blocking while mining was made impossible. Blocking immediately after attacking no longer continues the swing animation.}}
{{History||1.9|snap=15w31a|[[Enchanting|Enchanted]] iron and diamond swords can now be found in [[end city]] ship [[chest]]s.}}
{{History|||snap=15w33c|Swords no longer block attacks. Instead, [[shield]]s are used.}}
{{History|||snap=15w34b|Swords now use the attack speed [[attribute]]. The attack speed of a sword is 1.25 or 0.8 seconds.}}
{{History|||snap=15w34c|Nerfed swords, they now do {{hp|1}} less [[damage]] and have an attack speed of 1.45, or 0.69 seconds.
|Swords can now do a sweep attack when moving at walking speed or slower, which knock back [[mob]]s near the one hit. The attack speed meter must be filled for it to work.}}
{{History|||snap=15w36a|Each [[Sharpness]] level now adds {{hp|1}} damage to the base damage at level I and an additional {{hp|0.5}} for each additional level, down from a flat {{hp|1.25}} per level.}}
{{History|||snap=15w37a|Swords now have an attack speed of 1.6, or 0.63 seconds.}}
{{History|||snap=15w43a|The average yield of golden swords in [[nether fortress]] chests has been decreased.}}
{{History|||snap=15w49a|Sweep attack now does {{hp|1}} damage to affected [[mob]]s and players.}}
{{History||1.11.1|snap=16w50a|Golden and iron swords now [[smelt]] down into one of their respective [[nugget]]s.
|Added [[Sweeping Edge]] enchantment.}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], these [[item]]s' numeral IDs were 268, 272, 267, 276 and 283.}}
{{History|||snap=18w10a|Swords can now generate in [[buried treasure]] chests.}}
{{History||September 10, 2018|link={{tweet|JasperBoerstra|1039167196801458176}}|[[File:Wooden Sword JE2 BE2.png|32px]] [[File:Stone Sword JE2 BE2.png|32px]] [[File:Iron Sword JE2 BE2.png|32px]] [[File:Golden Sword JE3 BE2.png|32px]] [[File:Diamond Sword JE2 BE2.png|32px]] [[Jasper Boerstra]] tweets an image of updated sword textures.}}
{{History||1.14|snap=18w43a|[[File:Wooden Sword JE2 BE2.png|32px]] [[File:Stone Sword JE2 BE2.png|32px]] [[File:Iron Sword JE2 BE2.png|32px]] [[File:Golden Sword JE3 BE2.png|32px]] [[File:Diamond Sword JE2 BE2.png|32px]] The textures of all swords have been changed.
|Swords now break [[bamboo]] instantly.}}
{{History||1.16|snap=20w06a|[[File:Netherite Sword JE1.png|32px]] Added netherite swords.
|Netherite swords are obtained by combining one diamond sword and one [[netherite ingot]] in a [[crafting table]].
|[[Crimson planks]] and [[warped planks]] can now be used to craft wooden swords.}}
{{History|||snap=20w09a|[[File:Diamond Sword JE3 BE3.png|32px]] The texture of diamond swords has been changed.}}
{{History|||snap=20w10a|[[File:Netherite Sword JE2 BE2.png|32px]] The texture of netherite swords has been changed.
|Netherite swords can no longer be [[crafted]].
|Netherite swords are now obtained by combining one diamond sword and one [[netherite ingot]] in a [[smithing table]].}}
{{History|||snap=20w15a|Stone swords can now be crafted using [[blackstone]].}}
{{History|||snap=20w16a|Golden and netherite swords now generate in [[bastion remnants]] chests.
|Golden swords now generate randomly enchanted in [[ruined portal]] chests.}}
{{History|||snap=20w17a|Diamonds swords now generate in place of netherite swords in bastion remnant [[chest]]s.}}
{{History||1.16.2|snap=20w30a|Damaged enchanted iron swords can now be found in [[bastion remnant]] chests.}}
{{History||1.17|snap=21w08a|Stone swords can now be crafted using [[cobbled deepslate]].}}
{{History||1.19|snap=22w11a|[[Mangrove planks]] can now be used to craft wooden swords.}}
{{History||1.20<br>(Experimental)|link=1.19.4|snap=23w04a|Upgrading diamond swords to netherite swords now requires the netherite upgrade [[smithing template]].}}
{{History|upcoming java}}
{{History||Combat Tests|snap=1.14.3 - Combat Test|The attack speed for all swords has been increased to 3.
|The base [[damage]] is now {{Hp|2}}, meaning that all swords now do {{Hp|1}} more damage than before}.
|The attack reach of swords has been increased to 3.5 [[block]]s.}}
{{History|||snap=Combat Test 2|The attack speed of all swords has been decreased to 2.5.}}
{{History|||snap=Combat Test 3|The attack speed of all swords has been changed from 2.5 back to 3.0.
|The attack key can now again be held down to automatically attack when the attack meter is full.
|Attacks now happen only when the sword is at 120% charge, slower than if attacks were timed.}}
{{History|||snap=Combat Test 4|Sword can now perform critical, knockback ([[sprint]]) hits on 100% charge.
|The attack reach of all weapons was decreased by 0.5 [[block]]. Sword now have a 3 [[block]]s reach.
|The 200% attack now gives a bonus reach of 1 [[block]].}}
{{History|||snap=Combat Test 5|Weapons have been nerfed. All material tiers have been nerfed by {{Hp|1}} except wood and gold, and the sword tier have been nerfed by {{Hp|1}}. This means that the wooden/stone/golden sword now does {{Hp|4}} damage, the iron sword now does {{Hp|5}} damage and the diamond sword now does {{Hp|6}} damage.}}
{{History|||snap=Combat Test 6|All weapons' attack reach have been buffed by 0.5 [[block]].
|200% attacks have been removed.
|Swords now always do sweep attack, even in the air.
|The cooldown for missed hit is a 4-tick cooldown instead of using the attack speed attribute.}}
{{History|||snap=Combat Test 7c|All weapons' attack reach have been nerfed by 0.5 [[block]]. The sword's attack reach is now 3 [[block]]s again.
|200% attacks have been re-added.
|Swords no longer sweep without [[Sweeping Edge]] and 200% charge again.
|Adjusted the netherite tier value to match the weapon nerf in Combat Test 5}}
{{History|||snap=Combat Test 8b|Enchantment bonus attack damage are now included in the base damage when calculating critical hits (they were excluded before). Due to this change, enchanted swords critical attacks are now way more powerful (especially with high enchantments)}}

{{History|pocket alpha}}
{{History||v0.2.0|[[File:Stone Sword JE1 BE1.png|32px]] Added stone swords.}}
{{History||v0.3.0|[[File:Wooden Sword JE1 BE1.png|32px]] Added wooden swords.
|Survival players no longer start out with an infinite durability stone sword in the inventory.}}
{{History||v0.3.2|[[File:Iron Sword JE1 BE1.png|32px]] [[File:Golden Sword JE2 BE1.png|32px]] [[File:Diamond Sword JE1 BE1.png|32px]] Added iron, gold, and diamond swords.}}
{{History||v0.4.0|Iron swords have replaced stone swords in the creative inventory.}}
{{History||v0.9.0|snap=build 1|Iron swords can now be found in [[stronghold]] altar [[chest]]s and inside blacksmith chests.}}
{{History||v0.11.0|snap=build 11|Wooden, stone, golden and diamond swords are now available in the [[creative]] [[inventory]].}}
{{History||v0.11.0|snap=build 12|Wooden, stone, golden and diamond swords have been removed from creative.}}
{{History||v0.11.0|snap=build 13|All swords are available in creative mode again.}}
{{History||v0.12.1|snap=build 1|Instead of replacing the barehanded [[damage]] ({{hp|1}}), swords now add their damage onto the barehanded damage, which results in all swords doing {{hp|1}} more damage than before.|In [[creative]] mode, swords are no longer able to break [[block]]s, and no [[sound]] plays when they're hit with one.|Golden swords can now be found in [[nether fortress]] chests.
|[[Zombie]]s now rarely spawn holding an iron sword that have a chance to [[drops|dropped]].
|Golden swords are now rarely dropped by [[zombie pigmen]].
|Stone swords are now rarely dropped by [[wither skeleton]]s.}}
{{History||v0.15.0|snap=build 1|Iron swords are now sometimes dropped by [[husk]]s that spawn holding an iron sword.}}
{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|Enchanted iron and diamond swords can now be found in [[end city]] [[chest]]s.}}
{{History||1.0.4|snap=alpha 1.0.4.0|Iron swords and enchanted diamond swords are now sold by weaponsmith [[villager]]s.}}
{{History||1.1.0|snap=alpha 1.1.0.0|Iron and golden swords are now [[smelting|smeltable]].
|Added [[vex]]es, which rarely drop an iron sword if killed using [[Looting]] enchantment.}}
{{History|bedrock}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Wooden Sword JE2 BE2.png|32px]] [[File:Stone Sword JE2 BE2.png|32px]] [[File:Iron Sword JE2 BE2.png|32px]] [[File:Golden Sword JE3 BE2.png|32px]] [[File:Diamond Sword JE2 BE2.png|32px]] The textures of all swords have been changed.
|Iron swords are now found in [[plains]] [[village]] weaponsmiths.}}
{{History||1.11.0|snap=beta 1.11.0.1|Iron swords can now be found in [[savanna]], [[snowy taiga]], [[taiga]] and [[desert]] village weaponsmiths.}}
{{History|||snap=beta 1.11.0.4|[[Pillager]]s and [[vindicator]]s that spawn in [[raid]]s can now drop iron swords upon [[death]].
|[[Trading]] has been changed. Iron swords [[trading|sold]] by weaponsmith [[villager]]s now cost 2 [[emerald]]s while diamond swords cost 8 emeralds as part of their fourth tier trades.}}
{{History||1.16.0|snap=beta 1.16.0.51|[[File:Netherite Sword BE1.png|32px]] Added netherite swords.
|Netherite swords are obtained by combining one diamond sword and one [[netherite ingot]] in a [[crafting table]].
|[[File:Diamond Sword JE3 BE3.png|32px]] The texture of diamond swords has been changed.
|Golden swords are now sometimes [[drops|dropped]] by [[piglin]]s that spawn holding a golden sword.}}
{{History|||snap=beta 1.16.0.57|Netherite swords can no longer be [[crafting|crafted]].
|Netherite swords are now obtained by combining one diamond sword and one [[netherite ingot]] in a [[smithing table]].
|Stone swords can now be crafted using [[blackstone]].
|Golden and netherite swords now generate in [[bastion remnant]] chests.
|Golden swords now generate randomly enchanted in [[ruined portal]] chests.}}
{{History|||snap=beta 1.16.0.63|Diamonds swords now generate in place of netherite swords in bastion remnant [[chest]]s.}}
{{History||1.17.30|snap=beta 1.17.20.20|Swords now break [[bamboo]] instantly.}}

{{History|console}}
{{History||xbox=TU1|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|[[File:Wooden Sword JE1 BE1.png|32px]] [[File:Stone Sword JE1 BE1.png|32px]] [[File:Iron Sword JE1 BE1.png|32px]] [[File:Golden Sword JE2 BE1.png|32px]] [[File:Diamond Sword JE1 BE1.png|32px]] Added swords (all five types).}}
{{History||xbox=TU5|The ability to block with swords has been added, giving the [[player]] more options in combat.}}
{{History||xbox=TU53|xbone=CU43|ps=1.49|wiiu=Patch 23|switch=1.0.3|Iron and golden swords are now [[smelting|smeltable]].}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Wooden Sword JE2 BE2.png|32px]] [[File:Stone Sword JE2 BE2.png|32px]] [[File:Iron Sword JE2 BE2.png|32px]] [[File:Golden Sword JE3 BE2.png|32px]] [[File:Diamond Sword JE2 BE2.png|32px]] The textures of all swords have been changed.}}
{{History||ps=1.92|The ability to block with swords has been removed.}}

{{History|New Nintendo 3DS Edition}}
{{History||0.1.0|[[File:Wooden Sword JE1 BE1.png|32px]] [[File:Stone Sword JE1 BE1.png|32px]] [[File:Iron Sword JE1 BE1.png|32px]] [[File:Golden Sword JE2 BE1.png|32px]] [[File:Diamond Sword JE1 BE1.png|32px]] Added swords.
|Swords cannot block attacks.}}
{{History|foot}}

== Issues ==
{{issue list}}

== Trivia ==
*The sword's traditional [[texture]] came from [[Notch]]'s abandoned RPG, ''[[Legend of the Chambered]]''. The iron sword's texture was created first, as it was from the game, and the other swords followed.
*In ''Java Edition'', with the introduction of netherite swords, it is possible to one-hit kill undead [[mob]]s in the game (except [[wither]]s and [[zombie]]s/[[skeleton]]s with random armor) using a sword with the [[Smite]] V enchantment, without the need to perform a critical hit (this was previously possible only with a [[Smite]] V stone, iron, or diamond axe).
*Plastic diamond and enchanted swords are official ''[[Minecraft]]'' merchandise.<ref>https://shop.minecraft.net/products/minecraft-sword?_pos=1&_psq=sword&_ss=e&_v=1.0</ref><ref>https://shop.minecraft.net/products/minecraft-enchanted-purple-sword?_pos=4&_psq=sword&_ss=e&_v=1.0</ref>
*In the game [[wikipedia:Transformice|''Transformice'']], a diamond sword can be found in the shop.

== Gallery ==
=== Enchanted swords ===
<gallery>
Enchanted Wooden Sword.gif|Enchanted wooden sword.
Enchanted Stone Sword.gif|Enchanted stone sword.
Enchanted Iron Sword.gif|Enchanted iron sword.
Enchanted Golden Sword.gif|Enchanted golden sword.
Enchanted Diamond Sword.gif|Enchanted diamond sword.
Enchanted Netherite Sword.gif|Enchanted netherite sword.
</gallery>

=== Texture packs ===
<gallery>
File:Wood sword TP.png|Wooden sword in the [[Texture Pack DLC|Plastic Pack]].
Stone Sword SDGP.png|Stone sword in the [[Super Duper Graphics Pack]].
File:Gold sword Natural.png|Gold sword in the [[Texture Pack DLC|Natural Pack]].
</gallery>

=== In other media ===
<gallery>
File:Alex Fighting in Nether.jpeg|Pixel art of [[Alex]] fighting with a diamond sword in the [[Nether]].
File:Alex Retrieving Diamond Sword.jpeg|Alex retrieving another diamond sword from a [[chest]].
File:Sinister Sword Sprite MCD.png|The [[MCD:Sinister Sword|Sinister Sword]], a unique sword featured in ''Minecraft Dungeons''.
File:Sword GUI.png|A nondescript [[MCD:Sword|sword]] as it appears in ''[[Minecraft Dungeons]]''.
File:Sword (item).png|A sword as it appears in ''[[Legend of the Chambered]]''.
File:Sword Shirt.png|Officially licensed T-Shirt of a diamond sword.
File:IronSword replica.jpg|Foam replica of an iron sword.
</gallery>

== References ==
{{reflist}}

{{Items}} 
[[Category:Tools]]
[[Category:Combat]]

[[de:Schwert]]
[[es:Espada]]
[[fr:Épée]]
[[hu:Kard]]
[[ja:剣]]
[[ko:검]]
[[nl:Zwaard]]
[[pl:Miecz]]
[[pt:Espada]]
[[ru:Меч]]
[[tr:Kılıç]]
[[uk:Меч]]
[[zh:剑]]</li></ul></nowiki>
19w08a String tags in SNBT can now be within single quotes ' in addition to double quotes ".[5]

References

External links

  • NBT on wiki.vg
  • NBTExplorer, a tool for viewing and editing NBT files.
  • webNBT, an online tool for viewing and editing NBT files.