Minecraft Wiki
Register
Advertisement
Brush
This article needs cleanup to comply with the style guide. [discuss]
Please help improve this page. The talk page may contain suggestions.
Reason: need to check whether there's anything out of date
Information icon
This feature is exclusive to Bedrock Edition. 
This article is about the format since Bedrock Edition 1.2.13. For the format in former game versions, see Bedrock Edition level format/History.

Bedrock Edition uses a modified version of Google's LevelDB, which uses the Zlib compression format for level storage.

LevelDB based format[]

Mojang variant LevelDB format[]

Mojang has modified Google's Original LevelDB to add Zlib compression and Windows support. The code is available at https://github.com/Mojang/leveldb-mcpe, and the building instructions are documented by Tommaso at https://twitter.com/_tomcc/status/477950809427427328.

For a Java implementation of LevelDB + Zlib, see https://github.com/tinfoiled/leveldb

Google's leveldb library has evolved extensively since Mojang released their version, but the Mojang version still works (as of 2022). The code does require some minor tweaks to compile:

  • db/snappy_compressor.cc should refer include <snappy.h> instead of <snappy/snappy.h>
  • table/table_test.cc contains two references to snappy that are unresolvable but irrelevant. port::Snappy_Compress and leveldb::SnappyCompressor. If these are simply commented out the rest will compile and function properly.

The database is stored in the db/ subdirectory of a Bedrock Edition world. The database path which is passed to the LevelDB API is this directory path, not the path to any file within it. It seems this is also where terrain generation is stored. This is because you can turn an old world infinite by replacing its db folder with one from an infinite world.

Chunk key format[]

A database key for data regarding a chunk is the concatenation of:

  • Two signed 32-bit little-endian integers (x and z in chunk coordinates, respectively),
  • An optional third 32-bit little-endian integer (1 for the Nether, 2 for the End, omitted for the Overworld),
  • A one-byte tag specifying the type of record represented by the key (see table), and
  • (for a "SubChunkPrefix" record) a one-byte subchunk index (from 0 to 15).

Accordingly, such a key may be 9, 10, 13 or 14 bytes long. Not all subchunks necessarily exist for a given chunk.

The "BlockEntity", "Entity" and "PendingTicks" records are represented by a sequence of concatenated root tags in a variant of NBT which stores the lengths and the multi-byte integer types in little-endian format, as opposed to the big-endian format used by Java Edition or the original NBT specification.

The value 0 is used in the "Version" record in old style worlds; higher values are used in infinite worlds.

Key type tags
Tag byte Name Structure Description
Dec Hex ASCII
43 2B + Data3D Heightmap (256x2 bytes)

Biome data (varying lengths)

Biomes are stored as palettes similar to blocks. Exactly 25 palettes are written. Biome IDs are written as integers.
44 2C , Version 1 byte A byte
45 2D - Data2D Heightmap (256x2 bytes)

2D biomes (256x1 bytes)

Biome IDs are written as 8-bit integers. No longer written since v1.18.0.
46 2E . Data2DLegacy Heightmap (256x2 bytes)

2D biomes (256x4 bytes)

Each entry of the biome array contains a biome ID in the first byte, and the final 3 bytes are red/green/blue respectively. No longer written since v1.0.0.
47 2F / SubChunkPrefix Subchunk version (1 byte) Version-dependent data Terrain for a 16×16×16 subchunk
48 30 0 LegacyTerrain Block IDs (32768 bytes)

Block meta (32768 nibbles)

Block sky light (32768 nibbles)

Block light (32768 nibbles)

Heightmap (256x1 bytes)

2D biomes (256x4 bytes)

Data ordered in XZY order, unlike Java.

No longer written since v1.0.0.

Biomes are IDs plus RGB colours similar to Data2DLegacy.

49 31 1 BlockEntity List of NBT compound roots Block entity data (little-endian NBT)
50 32 2 Entity List of NBT compound roots Entity data (little-endian NBT)
51 33 3 PendingTicks List of NBT compound roots Pending tick data (little-endian NBT)
52 34 4 LegacyBlockExtraData Entry count (4 bytes)

Entries: Key (4 bytes), Value (2 bytes).

Array of blocks that appear in the same place as other blocks. Used for grass appearing inside snow layers prior to v1.2.13. No longer written as of v1.2.13.
53 35 5 BiomeState
54 36 6 FinalizedState 4 bytes A 32-bit little endian integer
55 37 7 ConversionData No longer used
56 38 8 BorderBlocks Education Edition Feature
57 39 9 HardcodedSpawners Bounding boxes for structure spawns stored in binary format
58 3A : RandomTicks List of NBT compound roots Random tick data (little-endian NBT)
59 3B ; Checksums xxHash checksums of other chunk records. No longer written as of v1.18.0.
61 3D = MetaDataHash
61 3E > GeneratedPreCavesAndCliffsBlending Not used
63 3F ? BlendingBiomeHeight Not used
64 40 @ BlendingData
65 41 A ActorDigestVersion
118 76 v LegacyVersion 1 byte Moved to 44 in v1.16.100

Other keys[]

There's also the special key ~local_player for an entity data entry that holds the local player entity. If entity data exists here, it takes precedence over the player data stored in level.dat. The value associated with the ~local_player key is NBT encoded and only has a single compound tag at the root level.

There's also a special key for remote players which consists of two parts. The first part is the prefix "player_" (without the quotes) and the second part is the client ID which is contained in the remote player's clientid.txt file. For example, player_-12345678 would be the key for a remote client with an client ID of -12345678. The value associated with the "player_" prefixed key is NBT encoded and only has a single compound tag at the root level.

There's also a special "game_flatworldlayers" key of length 20 for flat worlds. The value associated with this key is a set of numbers in ASCII text format. An example of a value associated with the "game_flatworldlayers" key is "[7,3,3,2]" where the value length for this example is 9.

There are several keys related to villages

  • VILLAGE_[0-9a-f\\-]+_DWELLERS
    • Consists mainly of an entity/mob ID's. Dwellers include villagers, iron golems, and cats.
  • VILLAGE_[0-9a-f\\-]+_INFO
    • Includes the village bounding box.
  • VILLAGE_[0-9a-f\\-]+_POI
    • Provides a mapping between villagers and work stations. Bed assignments do not appear to be stored.
  • VILLAGE_[0-9a-f\\-]+_PLAYERS

Other keys start with the following strings

  • actorprefix
  • digp
  • map_
  • portals
  • schedulerWT
  • structuretemplate
  • tickingarea

Sample parsers of Bedrock level-db[]

  • An example implementation of a Bedrock level-db parser can be found in minecraft_mmccoo. This implementation walks the NBTs of all block, entities/mobs, elevations, and village related items.

NBT structures[]

The following articles document NBT structures of block entity and entity.

level.dat[]

The level.dat is still in uncompressed NBT format. The file begins with an 8-byte header, consisting of a little-endian 4-byte integer indicating the type of the file, which is 3 (was 2 before latest update) for level.dat. It is followed by another integer containing the length of the file, minus the header.

NBT Structure[]

  • : World data.
    •  abilities: The default permissions for players in the world.
      •  attackmobs: 1 or 0 (true/false) - true if the player can attack mobs.
      •  attackplayers: 1 or 0 (true/false) - true if the player can attack other players.
      •  build: 1 or 0 (true/false) - true if the player can place blocks.
      •  doorsandswitches: 1 or 0 (true/false) - true if the player is able to interact with redstone components.
      •  flying: 1 or 0 (true/false) - true if the player is currently flying.
      •  flySpeed: The flying speed, always 0.05.
      •  instabuild: 1 or 0 (true/false) - true if the player can instantly destroy blocks.
      •  invulnerable: 1 or 0 (true/false) - true if the player is immune to all damage and harmful effects.
      •  lightning: 1 or 0 (true/false) - true if the player was struck by lightning.
      •  mayfly: 1 or 0 (true/false) - true if the player can fly.
      •  mine: 1 or 0 (true/false) - true if the player can destroy blocks.
      •  mute: 1 or 0 (true/false) - true if the player messages cannot be seen by other players.
      •  noclip: 1 or 0 (true/false) - true if the player can phase through blocks.
      •  op: 1 or 0 (true/false) - true if the player has operator commands.
      •  opencontainers: 1 or 0 (true/false) - true if the player is able to open containers.
      •  permissionsLevel: What permissions a player will default to, when joining a world.
      •  playerPermissionsLevel: What permissions a player has.
      •  teleport: 1 or 0 (true/false) - true if the player is allowed to teleport.
      •  walkSpeed: The walking speed, always 0.1.
      •  worldbuilder: 1 or 0 (true/false) - true if the player is a world builder.
    •  allowdestructiveobjects: The allowdestructiveobjects game rule.
    •  allowmobs: The allowmobs game rule.
    •  baseGameVersion: The version of Minecraft that is the maximum version to load resources from. Eg. setting this to 1.16.0 removes any features that were added after version 1.16.0. [more information needed]
    •  BiomeOverride: Makes the world into a single biome world and the biome set here is the biome of this single biome world. [more information needed]
    •  bonusChestEnabled: 1 or 0 (true/false) - true if the bonus chest is enabled.
    •  bonusChestSpawned: 1 or 0 (true/false) - true if the bonus chest has been placed in the world. Turning this to false will spawn another bonus chest near the spawn coordinates.
    •  codebuilder: [more information needed]
    •  commandblockoutput: The commandblockoutput game rule.
    •  CenterMapsToOrigin: 1 or 0 (true/false) - true if the maps should be on a grid or centered to exactly where they are created. Default to 0.
    •  commandblocksenabled: The commandblocksenabled game rule.
    •  commandsEnabled: 1 or 0 (true/false) - true if cheats are on.
    •  ConfirmedPlatformLockedContent: 1 or 0 (true/false) - tells if the world has Platform-Specific texture packs or content. Used to prevent cross play in specific worlds, that use assets only allowed on specific consoles.
    •  currentTick: [more information needed]
    •  Difficulty: The current difficulty setting. 0 is Peaceful, 1 is Easy, 2 is Normal, and 3 is Hard.
    •  Dimension: The dimension the player is in. 0 is the Overworld.
    •  dodaylightcycle: The dodaylightcycle game rule.
    •  doentitiydrops: The doentitiydrops game rule.
    •  dofiretick: The dofiretick game rule.
    •  doimmediaterespawn: The doimmediaterespawn game rule.
    •  doinsomnia: The doinsomnia game rule.
    •  dolimitedcrafting: The dolimitedcrafting game rule.
    •  domobloot: The domobloot game rule.
    •  domobspawning: The domobspawning game rule.
    •  dotiledrops: The dotiledrops game rule.
    •  doweathercycle: The doweathercycle game rule.
    •  drowningdamage: The drowningdamage game rule.
    •  educationFeaturesEnabled: [more information needed]
    •  EducationOid: An UUID. [more information needed]
    •  EducationProductId: [more information needed]
    •  eduOffer: Marks a world as an Education Edition world (worlds with this set to 1 will not open on Bedrock!).
    •  eduSharedResource
    •  experiments
      •  experiments_ever_used: 1 or 0 (true/false) - true if the world is locked on experimental gameplay.
      •  saved_with_toggled_experiments: 1 or 0 (true/false) - true if the world has been saved with experiments on before.
      • ... Additional bytes for each experiment that Minecraft has/had.
    •  falldamage: The falldamage game rule.
    •  firedamage: The firedamage game rule.
    •  FlatWorldLayers: JSON that controls generation of flat worlds. Default is {"biome_id":1,"block_layers":[{"block_name":"minecraft:bedrock","count":1},{"block_name":"minecraft:dirt","count":2},{"block_name":"minecraft:grass","count":1}],"encoding_version":6,"structure_options":null,"world_version":"version.post_1_18"}.
    •  freezedamage: The freezedamage game rule.
    •  functioncommandlimit: The functioncommandlimit game rule.
    •  globalmute: The globalmute game rule.
    •  ForceGameType: 1 or 0 (true/false) - true if force the player into the game mode defined in GameType.
    •  GameType: The default game mode of the player. 0 is Survival, 1 is Creative, 2 is Adventure, and 3 is Spectator.
    •  Generator: The world type. 0 is Old, 1 is Infinite , and 2 is Flat.
    •  hasBeenLoadedInCreative: [more information needed]
    •  hasLockedBehaviorPack: [more information needed]
    •  hasLockedResourcePack: [more information needed]
    •  immutableWorld: Is read-only.
    •  InventoryVersion: [more information needed]
    •  isCreatedInEditor: 1 or 0 (true/false) - true if it was created from the bedrock editor.
    •  isExportedFromEditor: 1 or 0 (true/false) - true if exported from the bedrock editor.
    •  isFromLockedTemplate: 1 or 0 (true/false) - true if the world is created from a world template where the world options were intended not to be modified.
    •  isFromWorldTemplate: 1 or 0 (true/false) - true if the world is created from a world template.
    •  isRandomSeedAllowed
    •  IsSingleUseWorld: 1 or 0 (true/false) - (unused) may cause world to not save, or delete after use. Seems to default back to false when a world is loaded.
    •  isWorldTemplateOptionLocked: 1 or 0 (true/false) - true if the world options cannot be modified until the user accepts that they are changing the map.
    •  keepinventory: The keepinventory game rule.
    •  LANBroadcast: [more information needed]
    •  LANBroadcastIntent: [more information needed]
    •  lastOpenedWithVersion: Five  ints representing the last version with which the world was opened. Eg. for the beta/preview 1.20.30.22 the version is 1 20 30 22 1.
    •  LastPlayed: Stores the Unix time stamp (in seconds) when the player saved the game.
    •  LevelName: Specifies the name of the world.
    •  lightningLevel: [more information needed]
    •  lightningTime: [more information needed]
    •  LimitedWorldOriginX: The X coordinate where limited (old) world generation started.
    •  LimitedWorldOriginY: The Y coordinate where limited (old) world generation started.
    •  LimitedWorldOriginZ: The Z coordinate where limited (old) world generation started.
    •  LimitedWorldWidth: The width (in chunks) of the borders surrounding the (old) world generation. Defaults to 16.
    •  LimitedWorldDepth: The depth (in chunks) of the borders surrounding the (old) world generation. Defaults to 16.
    •  maxcommandchainlength: The maxcommandchainlength game rule.
    •  MinimumCompatibleClientVersion: Five  ints representing the minimum compatible client version that is needed to open the world. Eg. for the beta/preview 1.20.30.22 the minimum compatible version is 1 20 30 0 0.
    •  mobgriefing: [more information needed]
    •  MultiplayerGame: [more information needed]
    •  MultiplayerGameIntent: [more information needed]
    •  naturalregeneration: The naturalregeneration game rule.
    •  NetherScale: Defaults to 8. This is used to tell the game how many Overworld blocks go into one nether block (X blocks in the nether = 1 block in the overworld).
    •  NetworkVersion: [more information needed]
    •  Platform: Seems to store the platform that the level is created on. Currently observed value is 2.
    •  PlatformBroadcastIntent: [more information needed]
    •  prid: [more information needed]
    •  pvp: The pvp game rule.
    •  rainLevel: [more information needed]
    •  rainTime: [more information needed]
    •  RandomSeed: Level seed.
    •  randomtickspeed: The randomtickspeed game rule.
    •  recipesunlock: The recipesunlock game rule.
    •  requiresCopiedPackRemovalCheck: [more information needed]
    •  respawnblocksexplode: The respawnblocksexplode game rule.
    •  sendcommandfeedback: The sendcommandfeedback game rule.
    •  serverChunkTickRange: Simulation distance.[more information needed]
    •  showbordereffect: The showbordereffect game rule.
    •  showcoordinates: The showcoordinates game rule.
    •  showdeathmessages: The showdeathmessages game rule.
    •  showtags: The showtags game rule.
    •  spawnMobs: 1 or 0 (true/false) - true if mobs can spawn.
    •  spawnradius: The spawnradius game rule.
    •  SpawnV1Villagers: Spawn pre-1.10.0 villagers.
    •  SpawnX: The X coordinate of the player's spawn position. Defaults to 0.
    •  SpawnY: The Y coordinate of the player's spawn position. Defaults to 64.
    •  SpawnZ: The Z coordinate of the player's spawn position. Defaults to 0.
    •  startWithMapEnabled: 1 or 0 (true/false) - true if new players spawn with a locator map.
    •  StorageVersion: Version of Bedrock Edition Storage Tool, currently is 8.
    •  texturePacksRequired: 1 or 0 (true/false) - true if the user must download the texture packs applied to the world to join.
    •  Time: Stores the current "time of day" in ticks. There are 20 ticks per real-life second, and 24000 ticks per Minecraft daylight cycle, making the full cycle length 20 minutes. 0 is the start of daytime, 12000 is the start of sunset, 13800 is the start of nighttime, 22200 is the start of sunrise, and 24000 is daytime again. The value stored in level.dat is always increasing and can be larger than 24000, but the "time of day" is always modulo 24000 of the "Time" field value.
    •  tntexplodes: The tntexplodes game rule.
    •  useMsaGamertagsOnly: Whether the world is restricted to Microsoft Accounts only (players must be signed in).
    •  world_policies: [more information needed]
    •  worldStartCount: Counts how many times the game has been closed since the world was created, with its value decreasing by 1 each time.
    •  XBLBroadcastIntent: [more information needed]

LOG[]

The LOG files are located at the /db path of a level, and are part of the leveldb format, used in between compaction of the LDB files. It is similar to a Log file for a program. The format is:

YYYY /MM/DD-Hour/Minute/Second.StepName "Info"

Example:

2014/07/24-22:20:08.400488 4a3638 Recovering log #3

History[]

Pocket Edition Alpha
v0.2.0
{{Extension DPL}}<ul><li>[[Torchflower Seeds|Torchflower Seeds]]<br/>{{wip}}
{{Block
| image = <gallery>
Torchflower Age 0.png| Age 0
Torchflower Age 1.png| Age 1
Torchflower Age 2.png| Age 2
</gallery>
| image2 = Torchflower Seeds JE1.png
| transparent = Yes
| light = No
| tool = N/A
| renewable = Yes
| stackable = Yes (64)
| rarity = Common
|flammable=No
|lavasusceptible=No
}}

'''Torchflower seeds''' are seeds that have a chance to be dropped by [[Sniffer|sniffers]] when they finish digging.

== Obtaining ==
[[Sniffer]]s will occasionally bury their nose in the ground and start digging. Once the sniffer has finished digging, one torchflower seed will have a chance to be dropped on the floor as an item.

Sniffers can only dig for torchflower seeds in the following blocks:
*{{BlockLink|Dirt}}
*{{BlockLink|Grass Block}}
*{{BlockLink|Podzol}}
*{{BlockLink|Coarse Dirt}}
*{{BlockLink|Rooted Dirt}}
*{{BlockLink|Moss Block}}
*{{BlockLink|Mud}}
*{{BlockLink|Muddy Mangrove Roots}}
They cannot dig for torchflower seeds on [[mycelium]], which is intended.<ref>{{bug|MC-260259||Sniffers cannot dig nor find seeds on mycelium|WAI}}</ref>

== Usage ==
=== Crop ===
{{main|Tutorials/Crop farming|title1=Crop farming}}

Torchflower seeds can be {{control|placed}} on [[farmland]], where they grow through three stages. Breaking the torchflower crop before it matures drops the seed, while breaking the final stage produces one [[torchflower]] and does not yield the seed.

Crops break if pushed by a [[piston]] or if their supporting farmland breaks or turns to dirt (i.e. by being trampled), dropping their usual drops.

Farmer [[villager]]s can plant torchflower seeds, but cannot harvest them after they have fully grown.<ref>{{bug|MC-263382|||WAI}}</ref>

=== Feeding ===
Torchflower seeds can be used to breed [[sniffer]]s and [[chicken]]s and reduce the remaining growth duration of snifflets and chicks by 10%. Also, if some torchflower seeds were fed to an injured sniffer, it will heal it by {{hp|2}} health points.

=== Taming ===
Torchflower seeds can be used to tame [[parrot]]s.

=== Composting ===
Placing torchflower seeds into a [[composter]] has a 30% chance of raising the compost level by 1.

== Sounds ==
{{Sound table/Block/Crop}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showblocktags=y
|showitemtags=y
|showforms=y
|generatetranslationkeys=y
|displayname=Torchflower Crop
|spritetype=block
|nameid=torchflower_crop
|form=block
|blocktags=bee_growables, crops}}
{{ID table
|displayname=Torchflower Seeds
|spritetype=item
|nameid=torchflower_seeds
|form=item
|itemtags=villager_plantable_seeds
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|generatetranslationkeys=y
|displayname=Torchflower Crop
|spritetype=block
|nameid=torchflower_crop
|id=-567
|form=block
|translationkey=-}}
{{ID table
|displayname=Torchflower Seeds
|spritetype=item
|nameid=torchflower_seeds
|id=296
|form=item
|foot=1}}

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

{{/BS}}

== Achievements ==
{{Load achievements|Planting The Past}}

== Advancements ==
{{load advancements|A Seedy Place;Planting The Past;Little Sniffs}}

== History ==
{{History|java}}
{{History||1.20<br>(Experimental)|link=1.19.4|snap=23w07a|[[File:Torchflower Seeds JE1.png|32px]] Added torchflower seeds behind the [[Java Edition 1.20|Update 1.20 experimental datapack]].}}
{{History|||snap=1.19.4 Pre-release 1|Torchflower seeds can now be used to breed [[chicken]]s and tame [[parrot]]s.<ref>{{bug|MC-260035|||Fixed}}</ref>|Torchflower seeds are now next to other seeds in the [[Creative inventory]].|Placing torchflower seeds in farmland now gives the player the "A Seedy Place" [[advancement]].}}
{{History||1.20|snap=23w12a|[[Sniffer]]s can now be obtained in Survival, making torchflower seeds [[renewable]].|Torchflower seeds are now available without using the "Update 1.20" experimental datapack.}}
{{History|||snap=23w14a|Torchflower seeds can now be picked up by farmer [[villager]]s.|[[Sniffer]]s can now be tempted with torchflower seeds.}}
{{History|||snap=23w16a|[[Villager]]s can now plant torchflower seeds.}}
{{History|||snap=23w17a|The player now get the [[advancement]] "Little sniffs" when they feed a [[snifflet]] using torchflower seeds, "Planting the past" when they plant torchflower seeds on [[farmland]].}}

{{History|bedrock}}
{{History||Sniffer<br>(Experimental)|link=Bedrock Edition 1.19.70|snap=beta 1.19.70.23|[[File:Torchflower Seeds JE1.png|32px]] Added torchflower seeds behind the "[[Bedrock Edition 1.20.0|Sniffer]]" [[experimental]] toggle.}}
{{History||1.20.0|snap=beta 1.20.0.20|Torchflower seeds are now available without using the "Sniffer" experimental toggle.}}
{{History|foot}}

== Issues ==
{{issue list}}

== Trivia ==
* The final growth stage of the torchflower crop uses the same ID as the actual torchflower. This causes some side effects, such as the plant becoming offset and randomly jumping to the side.<ref>{{bug|MC-260472|resolution=wai}}</ref>
 
== Gallery ==
<gallery>
Torchflower Seeds stages.png|All the growth stages of torchflower seeds.
</gallery>

== Notes ==
{{notelist}}

== References ==
{{reflist}}

{{Blocks|upcoming}}
{{Items}}
[[Category:Plants]]
[[Category:Non-solid blocks]]

[[de:Fackelliliensamen]]
[[es:Semillas de plantorcha]]
[[ja:トーチフラワーの種]]
[[pt:Sementes de plantocha]]
[[zh:火把莲种子]]</li><li>[[Diamond|Diamond]]<br/>{{For}}
{{redirect|Diamonds|the achievement|Achievements#DIAMONDS!|the advancement|Advancements#Diamonds!}}
{{Item
| image = Diamond.png
| renewable = No
| stackable = Yes (64)
| rarity = Common}}
A '''diamond''' is a mineral that can only be obtained from [[Diamond Ore|diamond ore]], [[chest loot|loot chests]] and [[Suspicious Block|suspicious blocks]]. It is required to craft diamond [[tool]]s and [[armor]] (and therefore obtain [[obsidian]] to access the [[The Nether|Nether]]), [[enchanting table]]s, [[jukebox]]es and duplicate [[smithing template]]s.

== Obtaining ==
{{see also|Tutorials/Diamonds}}
=== Mining ===
{{see also|Diamond Ore#Natural generation}}
[[Diamond ore]] can be mined using an iron [[pickaxe]] or stronger. An ore drops a single diamond. If mined by any other tool, it drops nothing. If the pickaxe is enchanted with [[Fortune]], it can drop an extra diamond per level of Fortune, allowing for a maximum of 4 diamonds with Fortune III. If the ore is mined using a pickaxe enchanted with [[Silk Touch]], it drops an ore block rather than a diamond. The ore is found at level 15 or lower, most commonly between -50 and -64; levels -58 and -59 are the preferred levels to mine at since they don't contain [[bedrock]], as it starts spawning at -60.

=== Chest loot ===
{{LootChestItem|diamond}}

=== Suspicious sand ===

When brushing [[suspicious sand]] in [[desert pyramid]]s, they have a {{frac|1|7}} chance to drop a diamond.

=== Crafting ===
{{Crafting
|Block of Diamond
|Output= Diamond,9
|type= Material
}}

=== Smelting ===
{{Smelting
|showname=1
|Diamond Ore; Deepslate Diamond Ore
|Diamond
|1
}}

== Usage ==

Diamonds are mainly used to craft high-tier armor and equipment, which in turn are also used in making [[netherite]] armor and equipment. 

=== Crafting ingredient ===

{{crafting usage}}

=== Trading ===

{{IN|bedrock}}, expert-level armorer, toolsmith, and weaponsmith villagers buy one diamond for an emerald as part of their trades.

{{IN|java}}, journeyman-level armorer villagers have a 40% chance of offering to buy one diamond for one emerald. Expert-level toolsmith villagers have {{frac|2|3}} chance of offering to buy one diamond for one emerald. Expert-level weaponsmith villagers always offer to buy one diamond for one emerald.

=== Repairing ===

Diamonds are the repair items for the diamond [[tier]] and [[armor material]], and thus can be used to [[item repair|repair]] the following items in an [[anvil]] or [[grindstone]]:
* {{ItemLink|Diamond Helmet}}
* {{ItemLink|Diamond Chestplate}}
* {{ItemLink|Diamond Leggings}}
* {{ItemLink|Diamond Boots}}
* {{ItemLink|Diamond Sword}}
* {{ItemLink|Diamond Pickaxe}}
* {{ItemLink|Diamond Axe}}
* {{ItemLink|Diamond Shovel}}
* {{ItemLink|Diamond Hoe}}

=== Beacons ===

Diamonds can be used to select powers from a [[beacon]]. The player must select one of the available powers then insert a diamond into the item slot. 

A diamond can be substituted for an [[iron ingot]], a [[gold ingot]], an [[emerald]] or a [[netherite ingot]].

=== Smithing ingredient ===
{{Smithing
|head=1
|ingredients=Any Armor Trim +<br/>Any Armor Piece + <br/>Diamond
|Any Armor Trim Smithing Template
|Netherite Chestplate
|Diamond
|Diamond Trim Netherite Chestplate
|showdescription=1
|description = All armor types can be used in this recipe,<br/>a netherite chestplate is shown as an example.<br/>
|tail=1
}}

;Trim color palette
The following color palettes are shown on the designs on trimmed armor:
*{{TrimPalette|diamond}}
*{{TrimPalette|diamond|darker=1}} (a darker color palette is used when a diamond armor piece is trimmed using a diamond).

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showitemtags=y
|showforms=y
|generatetranslationkeys=y
|displayname=Diamond
|spritetype=item
|nameid=diamond
|itemtags=beacon_payment_items
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Diamond
|spritetype=item
|nameid=diamond
|id=304
|form=item
|foot=1}}

== Achievements ==

{{load achievements|DIAMONDS!;Diamonds to you!;Enchanter}}

== Advancements ==

{{load advancements|Diamonds!}}

== History ==

{{History|java indev}}
{{History||0.31|snap=20100128|[[File:Diamond JE1 BE1.png|32px]] Added diamonds. Initially, they were referred to as "emeralds".
|A stack of 100 diamonds can be found inside the  [[Indev house]] [[chest]]s.}}
{{History|||snap=20100129|Diamond can be used to craft [[diamond block]]s and diamond [[sword]]s, [[shovel]]s, [[pickaxe]]s and [[axe]]s.
|Diamonds can no longer be found inside the Indev House due to all items having been removed from its chests.
|Diamond can be obtained by smelting diamond blocks.}}
{{History|||snap=20100130|[[Emerald]]s from the previous version are now officially known as "diamonds", though this has no actual effect as item names are not yet displayed in-game.
|[[Diamond block]]s now require 9 diamonds (3×3) instead of 4 (2×2) to be [[crafting|crafted]], making them much more expensive.}}
{{History||20100206|Diamonds are now used to craft diamond [[hoe]]s.}}
{{History||20100212-1|Diamonds are now used to craft diamond [[helmet]]s, [[chestplate]]s, [[leggings]] and [[boots]].}}
{{History|java alpha}}
{{History||v1.0.14|Diamonds are now used to craft [[jukebox]]es.}}
{{History|java beta}}
{{History||1.8|snap=Pre-release|Diamonds are now found in [[mineshaft]] [[chest]]s.}}
{{History|java}}
{{History||1.0.0|snap=Beta 1.9 Prerelease 2|[[Diamond ore]] can now be [[smelting|smelted]] into diamonds.}}
{{History|||snap=Beta 1.9 Prerelease 3|Diamonds are now used to craft [[enchantment table]]s.
|Diamonds are now found in [[stronghold]] altar [[chest]]s.}}
{{History||1.1|snap=12w01a|Diamonds are now found in [[village]] [[villager|blacksmith]] [[chest]]s.}}
{{History||1.3.1|snap=12w21a|Diamonds can now be [[trading|traded]] to blacksmith [[villager]]s in quantities of 3–5 for 1 [[emerald]].
|Added [[desert temple]]s, with a hidden [[chest]] room and loot containing diamonds.}}
{{History|||snap=12w21b|Diamonds have been changed in the game code from "emerald" to "diamond", due to actual [[emerald]]s being added. Diamond's original name during [[Indev]], as stated above, was emerald in the code, and was kept this way until this snapshot.}}
{{History|||snap=12w22a|Added [[jungle temple]]s, which contain loot [[chest]]s with diamonds.}}
{{History|||snap=1.3|[[File:Diamond JE2 BE2.png|32px]] The texture of diamonds has been changed.}}
{{History||1.4.6|snap=12w49a|Diamonds can now be used to [[crafting|craft]] a [[firework star]] with a trail.}}
{{History||1.6.1|snap=13w16a|Diamond is now used to craft diamond [[horse armor]].}}
{{History|||snap=13w18a|Diamond is no longer used to craft diamond [[horse armor]].|Diamonds are now found in [[nether fortress]] [[chest]]s.}}
{{History||1.8|snap=14w02a|Diamonds can now be [[traded]] to any black apron [[villager]] in quantities of 3–4 for 1 [[emerald]], as their tier III trade.}}
{{History||1.9|snap=15w31a|Diamonds now generate in [[end city]] [[chest]]s.}}
{{History|||snap=15w43a|The average yield of diamonds have been slightly decreased in [[nether fortress]] chests.}}
{{History|||snap=15w44a|The average yield of diamonds in [[desert temple]] and [[mineshaft]] chests have been decreased.}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 264.}}
{{History|||snap=18w10a|Diamonds now generate in [[buried treasure]] [[chest]]s.}}
{{History|||snap=18w11a|Diamonds now generate in [[shipwreck]] treasure chests.}}
{{History||1.14|snap=18w43a|[[File:Diamond JE3 BE3.png|32px]] The texture of diamonds has been changed.}}
{{History|||snap=18w50a|Diamonds can now be found in [[chest]]s in [[village]] toolsmith houses.}}
{{History||1.16|snap=20w16a|Diamonds now generate in bastion remnants chests.}}
{{History||1.16.2|snap=20w30a|The chance of finding diamonds in bastion remnant chests is increased from 8.6% to 15.8%.}}
{{History||1.17|snap=21w08a|Diamonds can now drop and be smelted from [[deepslate diamond ore]].}}
{{History||1.20<br>(Experimental)|link=1.19.4|snap=23w04a|Diamonds can now be used to craft [[smithing template]]s.
|Diamonds can now be used as an armor trim material.}}
{{History|||snap=23w07a|Diamonds now drop when brushing [[suspicious sand]] in [[desert pyramid]]s.}}
{{History||1.20|snap=23w12a|The probability for the diamond to generate in the [[suspicious sand]] in [[desert temple]] has been changed from 1/7 to 1/8.}}

{{History|pocket alpha}}
{{History||v0.2.0|[[File:Diamond JE1 BE1.png|32px]] Added diamonds. They are currently unobtainable and serve no purpose.}}
{{History||v0.3.2|Diamonds can be collected and used to craft [[blocks of diamond]] and diamond [[axe]]s, [[pickaxe]]s, [[sword]]s and [[shovel]]s.}}
{{History||v0.4.0|Diamonds are now used to [[crafting|craft]] diamond [[hoe]]s.}}
{{History||v0.5.0|Diamonds are now used to craft [[nether reactor core]]s.}}
{{History||v0.6.0|Diamonds are now used to craft diamond [[armor]].}}
{{History||v0.8.0|snap=build 1|[[File:Diamond JE2 BE2.png|32px]] The texture of diamonds has been changed.}}
{{History||v0.12.1|snap=build 1|Diamonds are now used to craft [[enchanting table]]s.
|Diamonds are no longer used to craft [[nether reactor core]]s and are now instead dropped by it.
|Diamonds now generate in [[nether fortress]] [[chest]]s.}}
{{History||v0.13.0|snap=build 1|Diamonds now have a chance to generate in [[desert temple]] chests.}}
{{History||v0.14.0|snap=build 1|Diamonds are now found in [[minecart with chest]]s in [[mineshaft]]s.}}
{{History||v0.15.0|snap=build 1|Diamonds can now be found in [[jungle temple]] [[chest]]s.}}
{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|Diamonds can now be found in altar [[chest]]s in [[stronghold]]s, [[dungeon]] chests and [[end city]] chests.}}
{{History|||snap=alpha 1.0.0.0|Diamonds can now be found in [[villager|blacksmith]] [[chest]]s in [[village]]s.}}
{{History||1.0.4|snap=alpha 1.0.4.0|3-4 diamonds can now be traded to blacksmith [[villager]]s for an [[emerald]] as part of their third tier trades.}}
{{History|bedrock}}
{{History||1.2.0|snap=beta 1.2.0.2|Diamonds can now be used to [[crafting|craft]] a [[firework star]] with a trail. 
|Diamonds can now be used to craft [[jukebox]]es.}}
{{History||1.4.0|snap=beta 1.2.14.2|Diamonds can now be found inside [[buried treasure]] [[chest]]s and [[shipwreck]]s.}}
{{History||1.10.0|snap=beta 1.10.0.3|Diamonds can now be found in [[plains]] [[village]] weaponsmith chests.
|[[File:Diamond JE3 BE3.png|32px]] The texture of diamonds has been changed.}}
{{History||1.11.0|snap=beta 1.11.0.1|Diamonds can now be found in village toolsmith chests and in [[savanna]], [[desert]], [[taiga]], and [[snowy taiga]] village weaponsmith chests.}}
{{History|||snap=beta 1.11.0.4|Armorer, toolsmith, and weaponsmith [[villager]]s now [[trading|buy]] one diamond for an [[emerald]] as part of their fourth tier [[trading|trades]].}}
{{History||1.16.0|snap=beta 1.16.0.57|Diamonds can now be found in [[bastion remnant]] chests.}}
{{History||1.17.0|snap=beta 1.16.230.52|Diamonds can now drop and be smelted from [[deepslate diamond ore]].}}
{{History||1.20.0<br>(Experimental)|link=Bedrock Edition 1.19.70|snap=beta 1.19.70.23|Diamonds now drop when brushing [[suspicious sand]] in [[desert pyramid]]s.}}
{{History||1.20.0<br>(Experimental)|link=Bedrock Edition 1.19.80|snap=beta 1.19.80.21|Diamonds can now be used to craft [[smithing template]]s.
|Diamonds can now be used as an armor trim material.}}

{{History|console}}
{{History||xbox=TU1|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|[[File:Diamond JE1 BE1.png|32px]] Added diamonds.}}
{{History||xbox=TU5|Diamonds are now found in the new [[mineshaft]] [[chest]]s.}}
{{History||xbox=TU7|Diamonds are now used to craft [[enchantment table]]s.}}
{{History||xbox=TU9|Diamonds are now found in [[village]] [[villager|blacksmith]] [[chest]]s.}}
{{History||xbox=TU14|ps=1.04|Diamonds can now be [[trading|traded]] to blacksmith [[villager]]s in quantities of 3–5 for 1 [[emerald]].
|Added [[desert temple]]s, with a hidden [[chest]] room and loot containing diamonds.|Added [[jungle temple]]s, which contain loot [[chest]]s with diamonds.|[[File:Diamond JE2 BE2.png|32px]] The texture of diamonds has been changed.}}
{{History||xbox=TU19|xbone=CU7|ps=1.12|Diamonds can now be used to [[crafting|craft]] a [[firework star]] with a trail|Diamonds are now found in the new [[nether fortress]] [[chest]]s.}}
{{History||xbox=TU31|xbone=CU19|ps=1.22|wiiu=Patch 3|Diamonds can now be [[traded]] to any black apron [[villager]] in quantities of 3–4 for 1 [[emerald]], as their tier III trade.}}
{{History||xbox=TU46|xbone=CU36|ps=1.36|wiiu=Patch 15|Diamonds now generate in [[end city]] [[chest]]s.}}
{{History||xbox=TU69|xbone=none|ps=1.76|wiiu=Patch 38|switch=none|Diamonds now generate in [[buried treasure]] [[chest]]s.|Diamonds now generate in [[shipwreck]] treasure chests.}}
{{History||xbox=none|ps=1.90|wiiu=none|[[File:Diamond JE3 BE3.png|32px]] The texture of diamonds has been changed.}}

{{History|new3DS}}
{{History||0.1.0|[[File:Diamond JE2 BE2.png|32px]] Added diamonds.}}
{{History|foot}}

==Issues==
{{issue list}}

==Trivia==
*Unlike in ''Minecraft'', newly mined [[Wikipedia:Diamond|diamond]]s in real life are rough, cloudy stones. The largest, purest ones are polished into crystal-clear gemstones, while the rest are used in industry for cutting and grinding.
*Although diamonds themselves are not renewable, all tools, weapons, and armor made from diamonds can be acquired through [[trading]], and are therefore renewable. Other items crafted from diamonds are not renewable.
*In the April fools version [[Java Edition 2.0]], [[Diamond Chicken|diamond chickens]] can lay diamonds. This does not exist in newer versions, as this was a joke.
*The item forms of diamonds and [[Turtle Egg|turtle eggs]] have the same shape.

==Gallery==
<gallery>
File:DiamondOre.png|Naturally occurring diamonds.
File:MultipleOreBlobs.png|Multiple ore blobs.
File:Lava Diamond.png|Diamond ore near Lava.
File:Diamond ore blob.png|Another Diamond ore blob near Lava.
File:10 ore diamond blob.png|10 ore diamond blob.
File:Trading a diamond for an emerald.png|A blacksmith offering an [[emerald]] for a diamond.
File:Diamond Pendant Necklace JINX.jpg|Official diamond pendant made by [https://www.jinx.com JINX].
File:All Mine JINX.jpg|Official t-shirt artwork "All Mine" which features a diamond. Made by JINX
File:4 ways of viewing 12 diamonds in stone form.png|4 ways of viewing 12 diamonds in stone form
</gallery>

== External Links ==
*[https://www.minecraft.net/en-us/article/taking-inventory--diamond Taking Inventory: Diamond] – Minecraft.net on February 20, 2019

{{items}}

[[cs:Diamant]]
[[de:Diamant]]
[[el:Διαμάντι]]
[[es:Diamante]]
[[fr:Diamant]]
[[hu:Gyémánt]]
[[it:Diamante]]
[[ja:ダイヤモンド]]
[[ko:다이아몬드]]
[[nl:Diamant]]
[[pl:Diament]]
[[pt:Diamante]]
[[ru:Алмаз]]
[[th:เพชร]]
[[tr:Elmas]]
[[uk:Діамант]]
[[zh:钻石]]
[[Category:Non-renewable resources]]</li></ul>
level.dat is now a NBT formatted file.
player.dat information now moved to level.dat
Added entities.dat.
v0.3.2
{{Extension DPL}}<ul><li>[[Enchanted Golden Apple|Enchanted Golden Apple]]<br/>{{Item
| image = Enchanted Golden Apple.png
| rarity = Epic
| heals = {{hunger|4}}
| effects = 
* {{EffectLink|Absorption}} IV (2:00)
* {{EffectLink|Regeneration}} II (0:20){{only|java|short=yes}}/V (0:30){{only|bedrock|short=yes}}
* {{EffectLink|Fire Resistance}} (5:00)
* {{EffectLink|Resistance}} (5:00)
| renewable = No
| stackable = Yes (64)
}}

An '''enchanted golden apple''' ({{in|je}}), notch apple, or '''enchanted apple''' ({{in|be}}), is a rare, uncraftable variant of the [[golden apple]] that grants much more powerful effects when consumed.

== Obtaining ==
=== Chest loot ===
{{LootChestItem|enchanted-golden-apple}}

== Usage ==
{{see also|Tutorials/Hunger management|title1=Hunger management}}

To eat an enchanted golden apple, press and hold {{control|use}} while it is selected in the hotbar. It restores {{hunger|4}} points of hunger and 9.6 [[Hunger#Mechanics|saturation]].

The enchanted golden apple provides: 
* [[Absorption]] IV for 2 minutes (providing {{hp|16|absorption=1}} points of absorption health)
* [[Regeneration]] level II {{in|java}} or V {{in|bedrock}} for 30 seconds ({{in|java}}, {{hp|1}} is restored every 25 ticks, {{hp|2|notag=1}} × 0.4 per second) for 20 seconds (long enough to heal {{hp|16}} points of damage; {{in|bedrock}}, {{hp|1}} is restored every 6 ticks, {{hp|2|notag=1}} × 1.66 per second for 30 seconds, which is long enough to heal up to {{hp|100}} points of damage.
* [[Fire Resistance]] I for 5 minutes
* [[Resistance]] I (20% reduced damage from all sources except the [[void]]) for 5 minutes

=== Horses ===
Enchanted golden apples can be used for improving the chances of taming a [[horse]] by 10%, for [[breeding]] and leading horses, and for speeding up the growth of [[baby]] horses by 4 minutes.

=== Crafting ingredient ===
{{crafting usage|Enchanted Golden Apple|match=start}}
===Piglins===
{{EntityLink|Piglin|Piglins}} are attracted to enchanted golden apples and run toward any enchanted golden apples on the ground, and inspect it for 6 to 8 seconds before putting it in their inventory. However, piglins do not eat enchanted golden apples (or any [[food]]).

== Sounds ==
{{Sound table/Entity/Food}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Enchanted Golden Apple
|spritetype=item
|nameid=enchanted_golden_apple
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|showaliasids=y
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Enchanted Golden Apple
|spritetype=item
|nameid=enchanted_golden_apple
|aliasid=appleenchanted
|id=259
|form=item
|translationkey=item.appleEnchanted.name
|foot=1}}

== Achievements ==
{{load achievements|Overpowered;Fruit on the Loom;Oooh, shiny!}}

== Advancements ==
{{load advancements|Oh Shiny;A Furious Cocktail;How Did We Get Here;Husbandry;A Balanced Diet}}

== History ==
{{History|java}}
{{History||1.3.1|snap=12w21a|[[File:Enchanted Golden Apple JE1 BE1.gif|32px]] Added enchanted golden apples.
|Enchanted golden apples highly resemble the golden apple prior to [[Java Edition 1.1|1.1]]. 
|Enchanted golden apples have [[Regeneration]] IV (30 seconds), [[Resistance]] (5 minutes) and [[Fire Resistance]] (5 minutes). 
|Enchanted golden apples can be [[crafted]] with 8 [[blocks of gold]] and one apple, making them [[renewable]]. 
|Enchanted golden apples shine like an [[enchanting|enchanted]] [[item]] and have a purple tooltip while the standard golden apple's tooltip changed to blue. However, the standard golden apple's effects remain unchanged.}}
{{History|||snap=12w21b|Added Enchanted Golden Apples to the Creative inventory.}}
{{History||1.6.1|snap=13w24b|Enchanted golden apples now give the player Absorption as well, and Regeneration IV has been increased to Regeneration V.}}
{{History|||snap=?|Enchanted golden apples can now be used to tame, breed and heal horses and donkeys.}}
{{History||1.8|snap=14w06a|[[Crafting]] an enchanted golden apple now gives the [[player]] the [[Achievements/Java_Edition|''achievement'']] "Overpowered."}}
{{History||1.9|snap=15w37a|Enchanted golden apples now give Regeneration II (down from V) and [[Absorption]] IV (up from I), in addition to the unchanged [[Resistance]] and [[Fire Resistance]] effects. The duration of the Regeneration effect has now also been decreased to 20 seconds.}}
{{History|||snap=15w44a|Enchanted golden apples are now uncraftable, making them no longer renewable.
|Enchanted golden apples have been added to [[dungeon]], [[desert temple]] and [[mineshaft]] chests.}}
{{History||1.11|snap=16w39a|Enchanted golden apples are now found in the new [[woodland mansion]] chests.}}
{{History||1.13|snap=17w47a|The names and IDs have been split into golden apple and enchanted golden apple.
|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 322.}}
{{History||1.14|snap=18w43a|[[File:Enchanted Golden Apple JE2 BE2.gif|32px]] The texture for enchanted golden apples has been changed.}}
{{History||1.16|snap=20w16a|Enchanted golden apples can now be found inside [[ruined portal]] chests.}}
{{History||1.16.2|snap=20w30a|Enchanted golden apples can now be found inside [[bastion remnant]] chests.}}
{{History||1.18|snap=experimental snapshot 6|Horses, donkeys and mules now follow players holding enchanted golden apples.}}
{{History||1.19|snap=22w13a|Enchanted golden apples may now be found in [[ancient city]] [[chest]]s.}}

{{History|pocket alpha}}
{{History||v0.12.1|snap=build 1|[[File:Enchanted Golden Apple JE1 BE1.gif|32px]] Added enchanted golden apples.}}
{{History|||snap=build 4|A crafting recipe has been added for enchanted golden apples.}}
{{History|pocket}}
{{History||1.1.0|snap=alpha 1.1.0.0|Enchanted golden apples are now known as "Enchanted Apple."}}
{{History|bedrock}}
{{History||1.2.0|snap=?|Enchanted apples now give [[Absorption]] IV rather than Absorption I.}}
{{History||1.2.13|snap=?|Enchanted golden apples are now uncraftable, making them no longer [[renewable resource|renewable]].}}
{{History||?|Enchanted apples now give [[Regeneration]] V rather than IV.}}
{{History||1.10.0|snap=beta 1.10.0.3|Enchanted apples are no longer used to [[crafting|craft]] patterns on [[banner]]s directly, but are now used to craft Thing [[banner pattern]]s.
|[[File:Enchanted Golden Apple JE2 BE2.gif|32px]] The texture for the enchanted golden apple has been changed.}}
{{History||1.16.0|snap=beta 1.16.0.57|Enchanted golden apples can now be found inside [[ruined portal]] chests.}}
{{History||1.16.100|snap=beta 1.16.100.56|The ID of enchanted apples has been changed from <code>appleenchanted</code> to <code>enchanted_golden_apple</code>.}}

{{History|console}}
{{History||xbox=TU14|xbone=CU1|ps=1.04|wiiu=Patch 1|switch=1.0.1|[[File:Enchanted Golden Apple JE1 BE1.gif|32px]] Added enchanted golden apples.}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Enchanted Golden Apple JE2 BE2.gif|32px]] The texture for the enchanted golden apple has been changed.}}

{{History|New 3DS}}
{{History||0.1.0|[[File:Enchanted Golden Apple JE1 BE1.gif|32px]] Added enchanted golden apples.}}
{{History|foot}}

== Issues ==
{{issue list}}

== Trivia ==
* The damage tag of an enchanted apple obtained {{in|be}} is 1, although setting it to 0 makes no difference.

== Gallery ==
<gallery>
GoldenAppleComparison.png|A comparison of the two golden apple variations.
EnchantedGoldenAppleEffects.png|The effects of consuming an enchanted golden apple.
Notch Apple In Mansion Chest.png|An extremely rare occasion where a regular golden apple and an enchanted apple being found in the same woodland mansion chest {{in|ee}}.
GoldenAppleDungeonChest.png|Golden apple in a [[dungeon]] chest, prior to 1.3.1. It resembles the enchanted golden apple.
GodPortal.png|An enchanted golden apple found in a ruined portal chest.
GodSpawner.png|An enchanted golden apple found in a monster room chest.
</gallery>

{{Items}}

[[Category:Non-renewable resources]]
[[Category:Food]]

[[de:Verzauberter goldener Apfel]]
[[es:Manzana dorada encantada]]
[[fr:pomme dorée enchantée]]
[[ja:エンチャントされた金のリンゴ]]
[[pt:Maçã dourada encantada]]
[[th:แอปเปิ้ลทองร่ายมนตร์]]
[[zh:附魔金苹果]]</li><li>[[Dye|Dye]]<br/>{{Item
| title = Dyes
| image = White Dye.png
| extratext = View [[#Gallery|all renders]]
| renewable = Yes
| stackable = Yes (64)
}}
'''Dyes''' are a set of sixteen items used to change the color of [[wool]], [[carpet]]s, [[terracotta]], [[concrete powder]], [[glass]], [[shulker box]]es, [[bed]]s, [[candle]]s, the patterns on [[banner]]s, [[firework star]]s, certain mobs, and text on [[sign]]s and [[hanging sign]]s. {{IN|bedrock}} they can also be used to dye water in a [[cauldron]] (which is thereafter used to dye leather [[armor]]); {{in|java}} leather armor can be dyed directly. {{IN|education}} dyes can also be used to dye [[balloon]]s and [[glow stick]]s.

{{IN|bedrock|education}}, [[bone meal]], [[ink sac]]s, [[lapis lazuli]], and [[cocoa bean]]s can generally substitute for [[white dye]], [[black dye]], [[blue dye]], and [[brown dye]], respectively, in crafting recipes and for use in dyeing items or mobs. However, they have other important uses that aren't related to color, and are therefore not considered true dyes. They are mentioned in this article only in regard to their use as dyeing agents; see their individual articles for complete information about them.

[[File:Dye Recipes.png|400px|thumb|A guide for creating all the dyes]]

== Obtaining ==
<!--[[File:Dye Chart.png|350px|thumb|A guide to crafting all the dyes.{{until|java 1.14}}]]-->

Dyes can be produced by crafting them from plants (mainly flowers), by crafting dyes of different colors together, by smelting plants, or by trading with a [[wandering trader]].

{{loadPage|Crafting/Dye|Crafting|h3}}

=== Smelting ===
{{smelting|head=1|Sea Pickle|Lime Dye|0,2}}
{{smelting|foot=1|Cactus|Green Dye|1||b=Lapis Lazuli|c=Any fuel|d=1}}

=== Trading ===

[[Wandering trader]]s can sell 3 dyes for an [[emerald]]. {{IN|bedrock}}, they can also sell 3 lapis lazuli, bone meal, cocoa beans, or ink sacs for one emerald.

Apprentice-level cleric [[villager]]s sell one lapis lazuli per emerald.

=== Chest loot ===

{{#invoke:LootChest|base3|blue-dye,green-dye,orange-dye,light-blue-dye,yellow-dye,white-dye}}

=== Other ===

Ink sacs can also be created using 1 iron, 1 sulfur, and 4 oxygen in the [[compound creator]]. {{only|bedrock|education}}

== Usage ==

Similar to their use in crafting, [[bone meal]], [[ink sac]]s, [[lapis lazuli]], and [[cocoa beans]] can be substituted for the corresponding dye in any of the following usages unless otherwise specified.{{only|bedrock}} <!--- sections are ordered by craftable dyeable blocks, dyeable items, version exclusive sections, and non-crafting miscellaneous uses--->

=== Dyeing wool and mobs ===

Players can dye wool by placing [[wool]] and any dye in a crafting grid.

{{Crafting
|nocat=1
|Any Wool
|Matching Dye
|Output=Any Wool
}}

Dyes can be {{control|use|text=used}} on sheep to change the color of the wool. Shearing a colored sheep drops the corresponding color of the wool, and the sheep retains the color when the wool regenerates. [[Breeding]] colored sheep produces a lamb colored as one of the parent sheep, or a color resulting from the combination of both parents' color. The color combining follows the same rules that dyes use – red and yellow sheep produce an orange lamb, but a blue and yellow sheep cannot create a green lamb. The unlimited reproduction of colored sheep makes dyeing and shearing sheep infinitely more efficient than just dyeing wool directly.
 
Dye can also be used on a tamed [[wolf]] or [[cat]] to change the color of its collar from the default red to the color of the dye.

=== Dyeing carpets ===

Carpets can be dyed.

{{Crafting
 |Any Carpet
 |Matching Dye
 |Output= Matching Carpet
 |type= Building block
}}

=== Dyeing terracotta ===

[[Terracotta]] can be dyed by placing 8 blocks around a dye on a crafting table.

{{Crafting
|nocat=1
|A1=Terracotta |B1=Terracotta |C1=Terracotta
|A2=Terracotta |B2=Matching Dye  |C2=Terracotta
|A3=Terracotta |B3=Terracotta |C3=Terracotta
|Output=Matching Dyed Terracotta,8
}}

=== Creating concrete powder ===

Dyes can also be used to craft [[concrete powder]], which can then be set into their respective [[concrete]] blocks (they cannot be dyed directly).

{{Crafting
|nocat=1
|Sand |Gravel |Sand
|Gravel |Matching Dye |Gravel
|Sand |Gravel |Sand
|Output=Matching Concrete Powder,8
}}

=== Staining glass ===

[[Stained glass]] can be stained by placing 8 blocks of glass around a dye on a [[crafting table]]. Just like regular glass, stained glass can be crafted into stained glass panes. The recipe for this is the same as with regular glass.

{{Crafting
|nocat=1
|A1=Glass |B1=Glass        |C1=Glass
|A2=Glass |B2=Matching Dye |C2=Glass
|A3=Glass |B3=Glass        |C3=Glass
|Output=Matching Stained Glass,8
|head=1
}}
{{Crafting
|nocat=1
|A1= Glass Pane
|B1= Glass Pane
|C1= Glass Pane
|A2= Glass Pane
|B2= Matching Dye
|C2= Glass Pane
|A3= Glass Pane
|B3= Glass Pane
|C3= Glass Pane
|Output= Matching Stained Glass Pane,8
|type= Decoration block
|foot=1
}}

=== Dyeing shulker boxes ===

[[Shulker box]]es are generated in a light shade of purple (like the [[purpur block]]), but can be dyed any color. They can also be re-dyed as often as desired.

{{Crafting
  |ignoreusage=1
  |showname=1
  |Any Shulker Box
  |Matching Dye
  |Output=Matching Shulker Box
}}

=== Dyeing beds ===

Players can dye beds by placing a [[bed]] and any color dye in a crafting grid.

{{Crafting
|nocat=1
|Any Bed
|Matching Dye
|Output=Matching Bed
}}

=== Dyeing candles ===

Players can dye [[candles]] by placing an undyed candle and any color dye in a crafting grid.

{{Crafting
|ignoreusage=1
|Candle
|Matching Dye
|Output=Matching Dyed Candle
}}

=== Banner patterns ===
{{main|Banner#Patterns}}

Dyes are used in most banner patterns to determine the pattern and color displayed.

=== Dyeing armor ===

[[File:DyeGraph2.png|200px|thumb|A graph showing all combinations of two dyes on a [[tunic]].]]

Leather [[armor]] can be dyed by:
* Crafting dyes with a piece of leather armor or leather [[horse armor]].{{Only|java}}
* Dousing the leather armor or leather [[horse armor]] in a [[cauldron]] to which dyes have been added.{{Only|bedrock}}

There are 5,713,438<ref>https://anrar4.github.io/DyeLeatherArmor/</ref> (34.1% of sRGB) colors leather armor can be, as it is possible to put more than one dye on the crafting bench alongside the leather armor. Armor can be dyed multiple times with previous colors affecting the final outcome. Colored armor can be reverted to their original color using a [[cauldron]] with undyed water.

The game has a specific formula for calculating the color of dyed armor: each color, in the RGB color model, has a red value, green value, and blue value. For each dye in the crafting grid, and the armor itself (if it is already dyed), the red, green, and blue values are added to running totals. In addition, a running total of the highest value (be it red, green, or blue) is also kept. After this, each total is divided by the number of colors used. This effectively produces the average red, green, blue, and maximum values. The maximum value of the average RGB values is also calculated. Finally, each average RGB value is multiplied by the average maximum value and divided by the maximum of the average RGB values. The modified average RGB values are then used as the final color. This procedure can be summed up with the following equations:
 for each color (all "total" variables start at 0 before counting):
  totalRed = totalRed + redValue
  totalGreen = totalGreen + greenValue
  totalBlue = totalBlue + blueValue
  totalMaximum = totalMaximum + max(redValue, greenValue, blueValue)
  numberOfColors = numberOfColors + 1
 
 averageRed = totalRed / numberOfColors
 averageGreen = totalGreen / numberOfColors
 averageBlue = totalBlue / numberOfColors
 averageMaximum = totalMaximum / numberOfColors
 
 maximumOfAverage = max(averageRed, averageGreen, averageBlue)
 gainFactor = averageMaximum / maximumOfAverage
 
 resultRed = averageRed * gainFactor
 resultGreen = averageGreen * gainFactor
 resultBlue = averageBlue * gainFactor

Due to the way this formula works, the resulting color can never be darker than the average of the input colors and is often lighter and more saturated. Of course, the resulting color can never be lighter or more saturated than the lightest or most saturated input color. In addition, this formula never creates an RGB value higher than 255 (which would be invalid in the 8-bit RGB color model).

If leather armor is renamed on an [[anvil]], it retains its name when dyed or undyed.

;Mixing Samples
: {{ItemSprite|Yellow Dye}} + {{ItemSprite|Yellow Dye}} = {{Tint|leather-chestplate| #{{CalcDye| yellow=2 }} | code=1}}
: {{ItemSprite|Red Dye}} + {{ItemSprite|Blue Dye}} + {{ItemSprite|White Dye}} = {{Tint|leather-chestplate| #{{CalcDye| red=1 | blue=1 | white=1}} | code=1}}
: {{ItemSprite|Green Dye}} + {{ItemSprite|Red Dye}} + {{ItemSprite|Pink Dye}} = {{Tint|leather-chestplate| #{{CalcDye| green=1 | red=1 | pink=1}} | code=1}}

=== Dyeing firework stars ===

A [[firework star]] can have a single color or a combination of up to eight colors when crafted with dyes. Adding one or more dyes to a crafted firework star adds a "fade to color" effect to it, overwriting any existing fade colors.

{{Crafting
  |head=1
  |ignoreusage=1
  |ingredients=[[Gunpowder]] +<br>Any Dye (1–8) +<br>Extra ingredient (optional)
  |Gunpowder
  |Matching Dye
  |Diamond;Glowstone Dust;Head;Gold Nugget;Feather;Fire Charge;
  |Output=Matching Firework Star
}}
{{Crafting
  |ignoreusage=1
  |Matching Firework Star
  |Any Dye
  |Output=Matching Firework Star
  |foot=1
}}

=== Creating balloons ===

Dye can be used to craft balloons.{{only|education}}

{{Crafting
|nocat=1
|A1= Latex
|B1= Matching Dye
|C1= Latex
|A2= Latex
|B2= Helium
|C2= Latex
|A3= Latex
|B3= Lead
|C3= Latex
|Output= Matching Balloon
}}

=== Creating glow sticks ===

Dye can also be used to craft glow sticks.{{only|education}}

{{Crafting
|nocat=1
|A1= Polyethylene
|B1= Hydrogen Peroxide
|C1= Polyethylene
|A2= Polyethylene
|B2= Matching Dye
|C2= Polyethylene
|A3= Polyethylene
|B3= Luminol
|C3= Polyethylene
|Output= Matching Glow Stick
}}

=== Dyeing water inside cauldrons ===
Water can be dyed in a cauldron by holding any dye in the hand and pressing {{Ctrl|use}} on a cauldron filled with water.{{only|bedrock}}

=== Signs ===
Dye can be {{control|used}} on a [[sign]] or a [[hanging sign]] to change the text color. {{IN|bedrock}}, [[ink sac]]s cannot be used for this purpose; black dye must be used to change the text to black.

=== Trading ===
Apprentice, journeyman and expert-level shepherd [[villager]]s buy any of the 12 dyes for an [[emerald]].

== Color values ==
The "color codes" are used to determine the color imparted on sheep, wolf and cat collars, firework stars, [[beacon]] beams, and dyed leather armor. The hex value is shown in the extended tooltips of dyed leather armor; however, to set the color using an NBT data tag in a [[command]], the decimal value must be used instead. The color values for firework stars are slightly different from the ones listed below, and use [[Item colors#Firework stars|these values]] instead.

{| class="wikitable" style="margin:2px; border: 1px solid silver; text-align: left;" data-description="Data values"
! rowspan=2 | Description
! colspan=2 style="text-align:center" | Color Code
|-
! Dec
! <abbr title="Hexadecimal color code">Hex</abbr>
|-
| style="text-align:center" | White || 16383998 || {{color|#F9FFFE}}
|-
| style="text-align:center" | Light gray || 10329495 || {{color|#9D9D97}}
|-
| style="text-align:center" | Gray || 4673362 || {{color|#474F52}}
|-
| style="text-align:center" | Black || 1908001|| {{color|#1D1D21}}
|-
| style="text-align:center" | Brown || 8606770 || {{color|#835432}}
|-
| style="text-align:center" | Red || 11546150 || {{color|#B02E26}}
|-
| style="text-align:center" | Orange || 16351261 || {{color|#F9801D}}
|-
| style="text-align:center" | Yellow || 16701501 || {{color|#FED83D}}
|-
| style="text-align:center" | Lime || 8439583 || {{color|#80C71F}}
|-
| style="text-align:center" | Green || 6192150 || {{color|#5E7C16}}
|-
| style="text-align:center" | Cyan || 1481884|| {{color|#169C9C}}
|-
| style="text-align:center" | Light blue || 3847130 || {{color|#3AB3DA}}
|-
| style="text-align:center" | Blue || 3949738 || {{color|#3C44AA}}
|-
| style="text-align:center" | Purple || 8991416 || {{color|#8932B8}}
|-
| style="text-align:center" | Magenta || 13061821 || {{color|#C74EBD}}
|-
| style="text-align:center" | Pink || 15961002 || {{color|#F38BAA}}
|}

== Sounds ==
{{edition|java}}:
{{Sound table
|rowspan=2
|sound=Dye.ogg
|subtitle=Dye stains
|source=block
|description=When dye is used on a [[sign]]
|id=item.dye.use
|translationkey=subtitles.item.dye.use
|volume=1.0
|pitch=1.0/0.9/0.95/1.1
|distance=16}}
{{Sound table
|subtitle=Dye stains
|source=player
|description=When dye is used on a [[sheep]]
|id=item.dye.use
|translationkey=subtitles.item.dye.use
|volume=1.0
|pitch=1.0/0.9/0.95/1.1
|distance=16
|foot=1}}

{{edition|bedrock}}:
{{Sound table
|type=bedrock
|sound=Dye.ogg
|source=sound
|description=When dye is used on a sign
|id=sign.dye.use
|volume=1.0
|pitch=1.0}}
{{Sound table
|rowspan=3
|sound=Water Splash Old.ogg
|source=block
|description=When dye is added to a cauldron
|id=cauldron.adddye
|volume=0.1
|pitch=1.0}}
{{Sound table
|source=block
|description=When armor is dyed using a cauldron
|id=cauldron.dyearmor
|volume=0.1
|pitch=1.0}}
{{Sound table
|source=block
|description=When dye is removed from armor using a cauldron
|id=cauldron.cleanarmor
|volume=0.1
|pitch=1.0
|foot=1}}

== Achievements ==
{{load achievements|Rainbow Collection;Tie dye outfit}}

== Video ==

{{Video note|These videos are outdated, as it does not include details of the [[Java Edition 1.7.2|1.7.2]] update's changes to the dyeing system/production chain.}}

<div style="text-align:center">
<span style="display:inline-block">{{yt|8YD7oauNZHE}}</span>
<span style="display:inline-block">{{yt|7tETaRt7STM}}</span>
</div>

== History ==
{{History|java beta}}
{{History||January 3, 2011|link=https://web.archive.org/web/0/http://notch.tumblr.com/post/2582321901/2011-here-we-go|Notch mentions adding a "paint" feature if he can figure out how.}}
{{History||January 10, 2011<ref group="n">Supposed time when fragment was filmed. Based on modified date of client.jar/gui/trap.png in [[Beta 1.2]].</ref>|link=https://www.youtube.com/watch?v=cBF2ugTzXqQ&t=181s|[[File:Red Dye (pre-release).png|32px]] Shown rose red in development as part of [[Minecraft: The Story of Mojang]].}}
{{History||1.2|[[File:Ink Sac JE1 BE1.png|32px]] [[File:Red Dye JE1 BE1.png|32px]] [[File:Green Dye JE1 BE1.png|32px]] [[File:Cocoa Beans JE1 BE1.png|32px]] [[File:Lapis Lazuli JE1 BE1.png|32px]] [[File:Purple Dye JE1 BE1.png|32px]] [[File:Cyan Dye JE1 BE1.png|32px]] [[File:Light Gray Dye JE1 BE1.png|32px]] [[File:Gray Dye JE1 BE1.png|32px]] [[File:Pink Dye JE1 BE1.png|32px]] [[File:Lime Dye JE1 BE1.png|32px]] [[File:Yellow Dye JE1 BE1.png|32px]] [[File:Light Blue Dye JE1 BE1.png|32px]] [[File:Magenta Dye JE1 BE1.png|32px]] [[File:Orange Dye JE1 BE1.png|32px]] [[File:Bone Meal JE1 BE1.png|32px]] Added dyes.
|[[File:Black Dye (Recreated).png|32px]] [[File:Red Dye (pre-release).png|32px]] [[File:Green Dye (Recreated).png|32px]] [[File:Brown Dye (Recreated).png|32px]] [[File:Blue Dye (Recreated).png|32px]] [[File:Purple Dye (Recreated).png|32px]] [[File:Cyan Dye (Recreated).png|32px]] [[File:Light Gray Dye (Recreated).png|32px]] [[File:Gray Dye (Recreated).png|32px]] [[File:Pink Dye (Recreated).png|32px]] [[File:Lime Dye (Recreated).png|32px]] [[File:Yellow Dye (Recreated).png|32px]] [[File:Light Blue Dye (Recreated).png|32px]] [[File:Magenta Dye (Recreated).png|32px]] [[File:Orange Dye (Recreated).png|32px]] [[File:White Dye (Recreated).png|32px]] Leftovers of old textures can be seen in [[items.png]] with 100% opacity. The white dye texture was reused for [[Sugar]].
| The colors were as follows:{{verify|Did the color codes remain the same between Beta 1.2 and Java 1.11.2?}}
{{:Color/Java Edition dye colors before 17w06a}}
}}
{{History|java}}
{{History||1.1|snap=11w49a|[[Sheep]] can now regrow their [[wool]] by eating [[grass block|grass]]. Dyed sheep regrow wool in their new color.}}
{{History||1.3.1|snap=12w19a|[[File:Cocoa Beans JE2.png|32px]] The texture of [[cocoa beans]] has been changed.}}
{{History|||snap=1.3|[[File:bone meal changes.gif|32px]] The textures of [[bone meal]], [[cactus green]], cocoa beans and [[rose red]] have been changed. The textures have been lowered one pixel.}}
{{History||1.4.2|snap=12w34a|Added the ability to dye leather [[armor]] and [[wolf]] collars.}}
{{History||1.4.4|snap=1.4.3|Color codes have been changed. The colors of red, brown, blue, purple, cyan, pink, light blue, magenta and orange were adjusted a little vividly.}}
{{History||1.6.1|snap=13w19a|[[Stained clay]] can now be crafted using dyes.}}
{{history||1.7.2|snap=13w36a|With the addition of new [[flower]]s, many secondary and tertiary dyes are now primary dyes.}}
{{History|||snap=13w41a|[[Stained glass]] can now be crafted using dyes.}}
{{History||1.8|snap=14w02a|As cleric [[villager]]s now sell lapis lazuli, all dyes have become fully renewable.}}
{{History|||snap=14w30a|Added [[banner]]s, which can be dyed.}}
{{History||1.9|snap=15w34a|Added [[shield]]s, which can be dyed indirectly by applying a matching [[banner]].}}
{{History||1.11|snap=16w39b|Dyes are now used to change the color of [[shulker box]]es.}}
{{History||1.12|snap=17w06a|Dyes are now used to craft [[concrete powder]].
|Color codes have been changed. All colors are adjusted more vividly. The changes were as follows:
{{:Color/Java Edition dye color changes in 17w06a}}
|Light blue dye, stained glass, and stained glass panes, did not change colors in this update. This means that they still use old colors.<ref name="unchanged dyes">{{Bug|MC-214643}}<br>{{Bug|MC-214641}}</ref>
}}
{{History|||snap=17w15a|Dyes can now apply color to white [[bed]]s.}}
{{History||1.13|snap=17w47a|The different data values for the <code>dye</code> ID have been split up into their own IDs.}}
{{History||1.14|snap=18w43a|[[Bone meal]], [[ink sac]]s, [[cocoa beans]] and [[lapis lazuli]] are no longer considered dyes.
|[[File:White Dye JE1 BE1.png|32px]] [[File:Black Dye JE1 BE1.png|32px]] [[File:Brown Dye JE1 BE1.png|32px]] [[File:Blue Dye JE1 BE1.png|32px]] Added [[white dye|white]], [[black dye|black]], [[brown dye|brown]] and [[blue dye]]s.
|"Rose Red", "Dandelion Yellow" and "Cactus Green" have been renamed to "Red Dye", "Yellow Dye" and "Green Dye", respectively. 
|[[Glass pane]]s and [[carpet]]s can now be dyed.
|[[File:Light Gray Dye JE2 BE2.png|32px]] [[File:Gray Dye JE2 BE2.png|32px]] [[File:Red Dye JE2 BE2.png|32px]] [[File:Orange Dye JE2 BE2.png|32px]] [[File:Yellow Dye JE2 BE2.png|32px]] [[File:Lime Dye JE2 BE2.png|32px]] [[File:Green Dye JE2 BE2.png|32px]] [[File:Cyan Dye.png|32px]] [[File:Light Blue Dye JE2 BE2.png|32px]] [[File:Purple Dye JE2 BE2.png|32px]] [[File:Magenta Dye JE2 BE2.png|32px]] [[File:Pink Dye JE2 BE2.png|32px]] The textures of light gray, gray, red, orange, yellow, lime, green, cyan, light blue, purple, magenta, and pink dyes, have been changed. The color texture for light blue dye was not changed to reflect the updated colors from 1.12.<ref name="unchanged dyes"></ref>}}
{{History|||snap=18w44a|The color of the text on [[sign]]s can now be changed with dye.}}
{{History|||snap=18w49a|Yellow dyes can now be found in [[chest]]s in [[village]] mason houses.}}
{{History|||snap=18w50a|Green dyes can now be found in [[chest]]s in [[desert]] [[village]] houses.}}
{{History|||snap=19w05a|Added the [[wandering trader]], which can sell any type of dye.}}
{{History|||snap=19w11a|All 16 types of dyes can now be [[trading|bought]] by shepherd villagers.}}
{{History||1.16.2|snap=Pre-release 2|Reversed the order of dyes to match other colored items in the [[Creative inventory]].<ref name="reverse dye">{{Bug|MC-136553}}</ref>
|Regrouped dyes in the Creative inventory such that white, blue, brown, and black dyes are within and not [[cocoa beans]], [[ink sacs]], [[lapis lazuli]], and [[bone meal]].<ref name="regroup dye">{{Bug|MC-177684}}</ref>}}
{{History||1.17|snap=20w45a|Added [[candle]]s, which can be dyed.}}
{{History|||snap=21w03a|Added a sound for applying dyes.}}
{{History|||snap=21w19a|Candles can no longer be dyed.}}
{{History|||snap=Pre-release 1|Candles can now once again be dyed.}}
{{History||1.20<br>(Experimental)|link=1.19.3|snap=22w42a|The color of the text on [[hanging sign]]s can now be changed with dye.}}
{{History||1.20<br>(Experimental)|link=1.19.4|snap=23w07a|[[Torchflower]]s can now be crafted into orange dye.|[[Pink petals]] can now be crafted into pink dye.}}
{{History||1.20|snap=23w12a|[[Pitcher plant]]s can now be crafted into cyan dye.|Blue, light blue, orange, white, and yellow dye can now be found in [[suspicious gravel]] and [[suspicious sand]] in [[trail ruins]].}}
{{History|||snap=23w14a|Pitcher plants can now craft two [[cyan dye]] instead of one.}}
{{History|||snap=23w16a|Blue, light blue, orange, white, and yellow dye no longer generates in [[suspicious sand]] in [[trail ruins]].|Due to the split of the archaeological loot tables for the suspicious gravel within the [[trail ruins]]; blue, light blue, orange, white, and yellow dye now are in the common loot.}}

{{History|pocket alpha}}
{{History||v0.3.0|[[File:Bone Meal JE1 BE1.png|32px]] [[File:Light Gray Dye JE1 BE1.png|32px]] [[File:Gray Dye JE1 BE1.png|32px]] [[File:Ink Sac JE1 BE1.png|32px]] [[File:Cocoa Beans JE1 BE1.png|32px]] [[File:Red Dye JE1 BE1.png|32px]] [[File:Orange Dye JE1 BE1.png|32px]] [[File:Yellow Dye JE1 BE1.png|32px]] [[File:Lime Dye JE1 BE1.png|32px]] [[File:Green Dye JE1 BE1.png|32px]] [[File:Cyan Dye JE1 BE1.png|32px]] [[File:Light Blue Dye JE1 BE1.png|32px]] [[File:Lapis Lazuli JE1 BE1.png|32px]] [[File:Purple Dye JE1 BE1.png|32px]] [[File:Magenta Dye JE1 BE1.png|32px]] [[File:Pink Dye JE1 BE1.png|32px]] Added dyes. Only [[dandelion yellow]] and [[lapis lazuli]] are currently obtainable and have functionality.}}
{{History||v0.3.2|[[Cactus green]] is now obtainable by smelting [[cacti]].}}
{{History||v0.3.3|[[Bone meal]] is now obtainable via [[crafting]].}}
{{History||v0.4.0|[[Cyan dye]], [[light blue dye]], [[lime dye]], [[magenta dye]], [[orange dye]], [[pink dye]], and [[purple dye]] are now obtainable via crafting.
|[[Rose red]] is now obtainable by smelting red [[mushroom]]s.
|All available dyes, excluding bone meal, can now be used to craft their respective [[wool]] color.}}
{{History||v0.8.0|snap=build 1|[[File:Cocoa Beans JE3 BE2.png|32px]] The texture of cocoa beans has been changed.}}
{{History|||snap=build 3|[[Ink sac]]s, [[cocoa bean]]s, [[gray dye]], and [[light gray dye]] are now available in the [[creative]] [[inventory]].
|Rose red can now be obtained from [[beetroot]]s.}}
{{History||v0.9.0|snap=build 1|Cocoa beans can now be obtained from [[cocoa pod]]s.
|The [[rose]] has been removed and replaced with a new poppy [[flower]] that can be crafted into rose red.}}
{{History|||snap=build 3|All new [[flower]]s can now be [[crafting|crafted]] into dyes. Because of this, many secondary and tertiary dyes are now primary dyes.
|[[Gray dye]] and [[light gray dye]] can now be obtained in [[survival]].}}
{{History|||snap=build 11|[[Terracotta|Stained clay]] can now be crafted using dyes.}}
{{History||v0.11.0|snap=build 1|[[Ink sac]]s can now be obtained from [[squid]].
|Added the ability to dye [[wolf]] collars.}}
{{History||v0.12.1|snap=build 1|Red [[mushroom]]s can no longer be smelted to obtain [[rose red]].}}
{{History||v0.14.0|snap=build 1|[[Cauldron]]s now used for leather dyeing, by applying a dye to a [[water]]-filled cauldron.}}
{{History||v0.16.0|snap=build 1|[[Cocoa bean]]s can no longer be crafted.}}
{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|Added a ''Dye'' button for [[sheep]].
|Added [[shulker]]s, which can be dyed.
|Added [[stained glass]]. Stain glass cannot be [[crafting|crafted]], but purple glass generates in [[end city|end cities]].}}
{{History||1.1.0|snap=alpha 1.1.0.0|Dyes can now apply color to a white [[bed]]s.
|Dyes are now used to craft [[concrete powder]].
|The color palette has been changed.}}
{{History|bedrock}}
{{History||1.2.0|snap=beta 1.2.0.2|Dyes can now be used for [[banner]] crafting.
|Dyes can now be used to craft [[firework star]]s.
|[[Stained glass]] is now [[crafting|craftable]], using dyes.}}
{{History||1.4.0|snap=beta 1.2.20.1|[[Lime dye]] can now be obtained from smelting [[sea pickle]]s.
|Dyes can now used to craft [[glow stick]]s and [[balloon]]s.}}
{{History||1.8.0|snap=beta 1.8.0.8|Dyes can now be used to dye [[cat]] collars.}}
{{History|||snap=beta 1.8.0.10|[[File:White Dye JE1 BE1.png|32px]] [[File:Black Dye JE1 BE1.png|32px]] [[File:Brown Dye JE1 BE1.png|32px]] [[File:Blue Dye JE1 BE1.png|32px]] Added [[white dye|white]], [[brown dye|brown]], [[black dye|black]] and [[blue dye]]s, which can be crafted from [[lapis lazuli]], [[bone meal]], [[cocoa beans]] and [[ink sac]]s. This, however, the later four still use as dyes.<ref>{{Bug|MCPE-42473}}</ref>
|"Rose Red", "Dandelion Yellow" and "Cactus Green" have been renamed to "Red Dye", "Yellow Dye" and "Green Dye", respectively.}}
{{History||1.9.0|snap=beta 1.9.0.0|Blue and white dye can now be obtained from [[cornflower]]s and [[lily of the valley]]s.}}
{{History||1.10.0|snap=beta 1.10.0.3|[[Glass pane]]s and [[carpet]]s can now be dyed.
|Only a single dye is now required to apply a banner pattern in a [[loom]].
|Various dyes except black dye, white dye, brown dye and blue dye are now [[trading|sold]] by [[wandering trader]]s.
|[[File:Bone Meal JE2 BE2.png|32px]] [[File:Light Gray Dye JE2 BE2.png|32px]] [[File:Gray Dye JE2 BE2.png|32px]] [[File:Ink Sac JE2 BE2.png|32px]] [[File:Cocoa Beans JE4 BE3.png|32px]] [[File:Red Dye JE3 BE3.png|32px]] [[File:Orange Dye JE2 BE2.png|32px]] [[File:Yellow Dye JE2 BE2.png|32px]] [[File:Lime Dye JE2 BE2.png|32px]] [[File:Green Dye JE2 BE2.png|32px]] [[File:Cyan Dye.png|32px]] [[File:Light Blue Dye JE2 BE2.png|32px]] [[File:Lapis Lazuli JE2 BE2.png|32px]] [[File:Purple Dye JE2 BE2.png|32px]] [[File:Magenta Dye JE2 BE2.png|32px]] [[File:Pink Dye JE2 BE2.png|32px]] The textures of bone meal, light gray, gray, ink sac, cocoa beans, red, orange, yellow, lime, green, cyan, light blue, lapis lazuli, purple, magenta, and pink dyes have been changed.}}
{{History||1.11.0|snap=beta 1.11.0.4|Dye can now be [[trading|sold]] to shepherd [[villager]]s.}}
{{History||1.16.210|snap=beta 1.16.210.59|The color of the text on [[sign]]s can now be changed with dye.}}
{{History|||snap=beta 1.16.210.60|The ability to dye the color of the text on [[sign]]s was temporarily removed.}}
{{History||1.16.220|snap=beta 1.16.220.50|The color of the text on [[sign]]s can now be changed with dye again.}}
{{History||1.17.10|snap=beta 1.17.10.22|Added [[candles]], which can be dyed.}}

{{History|console}}
{{History||xbox=TU1|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|[[File:Bone Meal JE1 BE1.png|32px]] [[File:Light Gray Dye JE1 BE1.png|32px]] [[File:Gray Dye JE1 BE1.png|32px]] [[File:Ink Sac JE1 BE1.png|32px]] [[File:Cocoa Beans JE1 BE1.png|32px]] [[File:Red Dye JE1 BE1.png|32px]] [[File:Orange Dye JE1 BE1.png|32px]] [[File:Yellow Dye JE1 BE1.png|32px]] [[File:Lime Dye JE1 BE1.png|32px]] [[File:Green Dye JE1 BE1.png|32px]] [[File:Cyan Dye JE1 BE1.png|32px]] [[File:Light Blue Dye JE1 BE1.png|32px]] [[File:Lapis Lazuli JE1 BE1.png|32px]] [[File:Purple Dye JE1 BE1.png|32px]] [[File:Magenta Dye JE1 BE1.png|32px]] [[File:Pink Dye JE1 BE1.png|32px]] Added dyes.}}
{{History||xbox=TU9|[[File:Cocoa Beans JE3 BE2.png|32px]] The texture of cocoa beans has been changed.}}
{{History||xbox=none|xbone=none|ps=1.83|wiiu=none|switch=none|[[File:White Dye JE1 BE1.png|32px]] [[File:Black Dye JE1 BE1.png|32px]] [[File:Brown Dye JE1 BE1.png|32px]] [[File:Blue Dye JE1 BE1.png|32px]] Added [[white dye|white]], [[black dye|black]], [[brown dye|brown]], and [[blue dye|blue]] dyes, which can crafted from [[bone meal]], [[ink sac]], [[cocoa beans]], and [[lapis lazuli]].
|"Rose Red", "Dandelion Yellow" and "Cactus Green" have been renamed to "Red Dye", "Yellow Dye" and "Green Dye", respectively.}}
{{History||ps=1.90|[[File:Bone Meal JE2 BE2.png|32px]] [[File:Light Gray Dye JE2 BE2.png|32px]] [[File:Gray Dye JE2 BE2.png|32px]] [[File:Ink Sac JE2 BE2.png|32px]] [[File:Cocoa Beans JE4 BE3.png|32px]] [[File:Red Dye JE2 BE2.png|32px]] [[File:Orange Dye JE2 BE2.png|32px]] [[File:Yellow Dye JE2 BE2.png|32px]] [[File:Lime Dye JE2 BE2.png|32px]] [[File:Green Dye JE2 BE2.png|32px]] [[File:Cyan Dye.png|32px]] [[File:Light Blue Dye JE2 BE2.png|32px]] [[File:Lapis Lazuli JE2 BE2.png|32px]] [[File:Purple Dye JE2 BE2.png|32px]] [[File:Magenta Dye JE2 BE2.png|32px]] [[File:Pink Dye JE2 BE2.png|32px]] The textures of bone meal, light gray, gray, ink sac, cocoa beans, red, orange, yellow, lime, green, cyan, light blue, lapis lazuli, purple, magenta, and pink dyes have been changed.}}
{{History|3ds}}
{{History||0.1.0|[[File:Bone Meal JE1 BE1.png|32px]] [[File:Light Gray Dye JE1 BE1.png|32px]] [[File:Gray Dye JE1 BE1.png|32px]] [[File:Ink Sac JE1 BE1.png|32px]] [[File:Cocoa Beans JE3 BE2.png|32px]] [[File:Red Dye JE1 BE1.png|32px]] [[File:Orange Dye JE1 BE1.png|32px]] [[File:Yellow Dye JE1 BE1.png|32px]] [[File:Lime Dye JE1 BE1.png|32px]] [[File:Green Dye JE1 BE1.png|32px]] [[File:Cyan Dye JE1 BE1.png|32px]] [[File:Light Blue Dye JE1 BE1.png|32px]] [[File:Lapis Lazuli JE1 BE1.png|32px]] [[File:Purple Dye JE1 BE1.png|32px]] [[File:Magenta Dye JE1 BE1.png|32px]] [[File:Pink Dye JE1 BE1.png|32px]] Added dyes from [[Pocket Edition v0.15.4 alpha]].}}
{{History|foot}}
<gallery>
Pre-release dyes.png|Pre-release dye textures hidden within [[Items.png]].
</gallery>
;Notes
{{reflist|group=n}}

== Gallery ==
<gallery>
White Dye.png|White Dye
Light Gray Dye.png|Light Gray Dye
Gray Dye.png|Gray Dye
Black Dye.png|Black Dye
Brown Dye.png|Brown Dye
Red Dye.png|Red Dye
Orange Dye.png|Orange Dye
Yellow Dye.png|Yellow Dye
Lime Dye.png|Lime Dye
Green Dye.png|Green Dye
Cyan Dye.png|Cyan Dye
Light Blue Dye.png|Light Blue Dye
Blue Dye.png|Blue Dye
Purple Dye.png|Purple Dye
Magenta Dye.png|Magenta Dye
Pink Dye.png|Pink Dye
</gallery>

==Issues==
{{issue list}}

== Trivia ==
* Players can obtain each one of every color with 1 cocoa bean, 2 yellow dye, 2 ink sac, 3 green dye, 4 lapis lazuli, 4 red dye, and 6 bone meal (2 bones).
* The dyed sheep breeding behavior mirrors [[wikipedia:Lamarckism|Lamarck's theory]], in which the organisms evolve inheriting the external changes and adaptations of the previous generation, transmitting them to their offspring.
* In ''Bedrock Edition'', tertiary colors, along with their regular crafting recipes, can be crafted with primary colors. E.g.: Magenta can be crafted with one rose red and two bone meals.
* The colors of the dyes match the chat colors in [[color codes]] except for brown (dye only), light aqua, and gold (color codes only).
* The texture for light blue dye still uses the color from prior to the 1.12 World of Color update.<ref name="unchanged dyes"></ref>

== References ==
{{reflist}}

== External Links ==
* Tools for calculating leather dye combination: [https://minecraft.tools/en/armor.php minecraft.tools] (webapp); [https://github.com/pudquick/pyMCdyes/ pyMCDyes] (open-source Python script, outdated); [https://anrar4.github.io/DyeLeatherArmor/ DyeLeatherArmor]: a tool for calculating an exact crafting recipe for any sRGB color

{{Items}}

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

[[cs:Barvivo]]
[[de:Farbstoff]]
[[es:Tinte]]
[[fr:Teinture]]
[[hu:Színezés]]
[[it:Colorante]]
[[ja:染料]]
[[ko:염료]]
[[nl:Kleurstof]]
[[pl:Barwniki]]
[[pt:Corante]]
[[ru:Красители]]
[[th:สีย้อม]]
[[uk:Барвники]]
[[zh:染料]]</li></ul>
Entities.dat extended to store tile entity information.
v0.9.0
{{Extension DPL}}<ul><li>[[:Category:Education Edition items|Category:Education Edition items]]<br/>[[Category:Education Edition]]
[[Category:Items]]</li><li>[[Cocoa Beans|Cocoa Beans]]<br/>{{Block
|image=<gallery>
Cocoa Age 0.png|Age 0 JE
Cocoa Age 1.png|Age 1 JE
Cocoa Age 2.png|Age 2 JE
</gallery>
|image2=<gallery>
Cocoa Age 0 BE.png|Age 0 BE
Cocoa Age 1 BE.png|Age 1 BE
Cocoa Age 2 BE.png|Age 2 BE
</gallery>
|transparent=Yes
|light=No
|tool=axe
|renewable=Yes
|stackable=Yes (64)
|flammable=No
|lavasusceptible=No
}} '''Cocoa beans''' are items obtained from cocoa pods and are used to plant them, as well as to craft [[dye|brown dye]] and [[cookie|cookies]].

'''Cocoa pods''' are [[Bone Meal|bonemealable]] [[plant]]s placed on [[Log|jungle log]] sides that grow cocoa beans, and can be found naturally in [[Jungle|jungles]].

==Obtaining==
In ''Java Edition'', cocoa beans are only obtained through the natural generation of cocoa pods, while in ''Bedrock Edition'', they can also be gotten in bonus chests, from [[fishing]] inside the jungle, bamboo jungle and sparse jungle biomes and during a [[trading]] with a wandering trader.

Cocoa beans come from cocoa pods, which are found on the trunks of normal-sized naturally-generated [[jungle tree]]s in [[jungle]], [[bamboo jungle]]s and [[sparse jungle]] temperate [[biome]]s.

Cocoa pods can be mined with any item, but [[axe]]s are the quickest. Fully grown cocoa pods drop 3 cocoa beans. Using a tool enchanted with Fortune does not increase the amount of cocoa beans dropped.
{{breaking row|horizontal=1|Cocoa|Axe|sword=1|link=none}}
The block itself can be obtained by inventory editing or [[add-on]]s {{in|bedrock}}.

From one to two cocoa beans can be found in 40% of bonus [[chest]]s {{in|bedrock}}.
{{LootChestItem|cocoa-beans}}

Cocoa beans can be obtained from [[fishing]] in a jungle {{in|bedrock}}.

[[Wandering trader]]s may sell 3 cocoa beans for an [[emerald]] during a [[trading]] {{in|bedrock}}.

==Usage==
===Farming===
{{main|Tutorials/Cocoa bean farming}}
Placing cocoa beans on the side of a jungle [[log]] plants a new cocoa pod. The log does not need to be attached to a tree. A cocoa pod can be placed on jungle logs, jungle [[wood]], stripped jungle logs and stripped jungle wood.
[[File:Cocoaplant farm.png|thumb|left|A somewhat efficient cocoa pod farm, minimizing space and wood use.]]
Cocoa has three stages of growth. During its first stage, the pod is small and green. In the second stage, the plant is bigger and colored tan. In its last stage, the pod is even larger and orange. The cocoa block has a 20% chance to grow a stage when receiving a [[Tick#Random tick|random tick]], giving it an average time of 5 minutes and 41 seconds per stage. When destroyed in the first two stages, the pod yields only one cocoa bean. When destroyed in the third stage, it gives 3 cocoa beans. [[Bone meal]] can be used to force the cocoa pod forward by one growth stage. Cocoa pods burst and drop their beans when struck by flowing water, pushed by a piston or if their [[log]] or wood are removed by any means.

===Composting===
Placing cocoa beans into a [[composter]] has a 65% chance of raising the compost level by 1. {{IN|bedrock}}, cocoa beans are accepted as a direct substitute of brown dye in many recipes.

===Crafting ingredient===
{{crafting usage}}

{{Dye usage}}

{{IN|bedrock}}, cocoa beans can be also used in banner patterns:
{{banner crafting usage}}

{{Banner loom usage|Cocoa Beans}}

==Sounds==
{{Sound table/Block/Wood}}

==Data values==
===ID===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Cocoa
|spritetype=block
|nameid=cocoa
|form=block}}
{{ID table
|displayname=Cocoa Beans
|spritetype=item
|nameid=cocoa_beans
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|showforms=y
|showaliasids=y
|shownumericids=y
|generatetranslationkeys=y
|displayname=Cocoa
|spritetype=block
|nameid=cocoa
|id=127
|form=block}}
{{ID table
|displayname=Cocoa Beans
|spritetype=item
|nameid=cocoa_beans
|aliasid=dye / 3
|id=412
|form=item
|translationkey=item.dye.brown.name
|foot=1}}

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

==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 beta}}
{{History||1.2|[[File:Cocoa Beans JE1 BE1.png|32px]] Added cocoa beans.
|Cocoa beans are currently obtainable only through an inventory editor.}}
{{History||1.2_02|Prior to this, Cocoa Beans were misspelled as 'Coco Beans'.}}
{{History||1.4|Cocoa beans have been formally brought into the game as a reward found in [[dungeon]] chests.<ref>{{tweet|notch|53161729990987776}}</ref> (53% chance) Also, brown [[sheep]] now naturally spawn, making brown [[wool]] obtainable without hacking the game.
|Cocoa beans can now be used to craft [[cookie]]s.}}
{{History|java}}
{{History||May 8, 2012|link={{tweet|jeb|199867730927697920}}|[[Jeb]] revealed cocoa with a screenshot.}}
{{History||1.3.1|snap=12w18a|For only this snapshot, cocoa beans have been given a small (0.5%) chance of dropping from destroyed [[jungle tree]] [[leaves]] in a similar fashion to [[apple]]s from oak leaves, which makes cocoa beans [[renewable resource|renewable]] for the first time.}}
{{History|||snap=12w19a|[[File:Cocoa Age 0 (S) JE1.png|32px]] [[File:Cocoa Age 1 (S) JE1.png|32px]] [[File:Cocoa Age 2 (S) JE1.png|32px]]  Added cocoa. The top textures of cocoa always keep a completely constant rotation, regardless of what direction they face. They also not shaded.
|[[File:Cocoa Beans JE2.png|32px]] The texture of cocoa beans has been changed.
|Cocoa has replaced jungle [[leaves]] as the main method of finding cocoa beans.
|[[File:Cocoa Age 3 (S) JE1.png|32px]] Cocoa with values 12–15 is inaccessible normally, and use the texture of the [[dragon egg]]. This is due to the dragon egg texture being to the left of the ripe cocoa texture in <samp>[[terrain.png]]</samp>, as cocoa textures are arranged with the oldest on the left and the youngest on the right, resulting in the unusually ripe cocoa reading the dragon egg texture.}}
{{History|||snap=1.3|[[File:Cocoa Beans JE3 BE2.png|32px]] The texture of cocoa beans has been changed.}}
{{History||1.4.2|snap=12w34a|Cocoa beans have been given the ability to [[Armor#Dyeing|dye]] leather [[armor]] and [[wolf]] collars.}}
{{History||1.4.6|snap=12w49a|Cocoa beans can now be [[crafting|crafted]] with [[gunpowder]] to create a [[firework star]].}} 
{{History||1.5|snap=13w02a|Due to textures being stored in individual files, cocoa beans with data 12–15 no longer have a texture to use, and now crash the game if a [[chunk]] containing one is loaded.}}
{{History|||snap=13w03a|Cocoa with data values 12–15 now only crash the game if one is directly in the field of view.}}
{{History|||snap=13w04a|[[Bone meal]] now grows cocoa by only one stage.}}
{{History|||snap=13w10a|[[File:Cocoa Age 3 (S) JE2.png|32px]] Cocoa with data 12–15 now use the age 2 texture, resulting in a broken appearance, preventing previously mentioned crashes.}}
{{History||1.6.1|snap=13w18a|Cocoa beans have been removed from [[dungeon]] [[chest]]s.}}
{{History|||snap=13w19a|Brown [[Terracotta|stained clay]] can now be [[crafting|crafted]] using cocoa beans.}}
{{History||1.7.2|snap=13w41a|Brown [[stained glass]] can now be crafted using cocoa beans.}}
{{History||1.8|snap=14w07a|[[File:Cocoa Age 0 (S) JE2.png|32px]] [[File:Cocoa Age 1 (S) JE2.png|32px]] [[File:Cocoa Age 2 (S) JE2.png|32px]] [[File:Missing Model JE1.png|32px]] The top textures of cocoa now rotate with the blocks themselves (cocoa facing north remaining visually unaffected), and cocoa of age 3 has [[Missing model|no model]].}}
{{History|||snap=14w10a|[[File:Cocoa Age 0 (S) JE3.png|32px]] [[File:Cocoa Age 1 (S) JE3.png|32px]] [[File:Cocoa Age 2 (S) JE3.png|32px]] [[File:Missing Model JE2.png|32px]] The large section of cocoa is shaded, and the missing model (which age 3 cocoa uses) has changed.}}
{{History|||snap=14w25a|[[File:Cocoa Age 0 (S) JE4.png|32px]] [[File:Cocoa Age 1 (S) JE4.png|32px]] [[File:Cocoa Age 2 (S) JE4.png|32px]] The connecting region of cocoa is now shaded.}}
{{History|||snap=14w26a|Cocoa with data 12–15 has been effectively removed from the game, as such blocks now convert to a proper value with {{cmd|setblock}}. Loading worlds with existing out of range cocoa crash the game.}}
{{History|||snap=14w30a|Cocoa beans can now be used to dye [[banner]]s.}}
{{History||1.13|snap=17w47a|The different data values for the <code>dye</code> ID have been split up into their own IDs.
|Prior to [[1.13/Flattening|''The Flattening'']], this block's and item's numeral ID were respectively 127 and 351.}}
{{History||1.14|snap=18w43a|Cocoa beans can now be used to craft [[brown dye]].
|Cocoa beans can no longer be used as a [[dye]].
|All of the dye-related functions and crafting recipes of cocoa beans (except cookies) have been transferred to brown dye.
|"Cocoa Beans" item has been renamed to "Cocoa".
|[[File:Cocoa Beans JE4 BE3.png|32px]] The texture of cocoa has been changed.
|[[File:Cocoa Age 0 (S) JE5.png|32px]] [[File:Cocoa Age 1 (S) JE5.png|32px]] [[File:Cocoa Age 2 (S) JE5.png|32px]] The textures of cocoa have been changed.
|[[File:Cocoa Age 0 (texture) JE2 BE2.png|32px]] [[File:Cocoa Age 1 (texture) JE2 BE2.png|32px]] Textures for cocoa age 0 and 1 has palette left, visible only on particles.
|Cocoa now has a placement [[sound]].}}
{{History|||snap=19w03a|Placing cocoa into the new [[composter]] has a 50% chance of raising the compost level by 1.}}
{{History|||snap=19w05a|Cocoa now has a 65% chance of increasing the compost level in a composter by 1.}}
{{History|||snap=19w11b|"Cocoa" item has been renamed back to "Cocoa Beans".{{verify|was this not just one bug that affected other crops as well? if so cite the ticket and add to all other affected pages}}}}
{{History||1.18|snap=Pre-release 5|[[File:Cocoa Age 0 (texture) JE3 BE3.png|32px]] [[File:Cocoa Age 1 (texture) JE3 BE3.png|32px]] Textures for cocoa age 0 and 1 were changed. This visually changes only particles.}}
{{History||1.19|snap=22w11a|[[File:Cocoa Age 2 (S) JE6.png|32px]] The texture and model of cocoa age 2 have been changed.}}

{{History|pocket alpha}}
{{History||v0.3.0|[[File:Cocoa Beans JE1 BE1.png|32px]] Added cocoa beans. They are currently unobtainable and serve no purpose.}}
{{History||v0.8.0|snap=build 1|[[File:Cocoa Beans JE3 BE2.png|32px]] The texture of cocoa beans has been changed.
|Cocoa beans can be [[crafted]] from an [[orange dye]] and an [[ink sac]], or from [[dandelion yellow]], [[rose red]], and an ink sac, despite there being no way of obtaining ink sacs at the time.}}
{{History|||snap=build 3|Cocoa beans are now available in [[creative]].}}
{{History||v0.9.0|snap=build 1|[[File:Cocoa Age 0 (S) JE1.png|32px]] [[File:Cocoa Age 1 (S) JE1.png|32px]] [[File:Cocoa Age 2 (S) JE1.png|32px]] {{info needed|How did 12-16 appear?}} Added cocoa.
|Cocoa provides an additional way of obtaining cocoa beans.
|Cocoa beans are now used to craft [[cookie]]s.}}
{{History||v0.11.0|snap=build 14|Cocoa now grows over time.<ref>{{bug|MCPE-7887}}</ref>}}
{{History||?|[[File:Cocoa Age 0 (S) BE4.png|32px]] [[File:Cocoa Age 1 (S) BE4.png|32px]] [[File:Cocoa Age 2 (S) BE2.png|32px]] Cocoa no longer has a stem connecting it to the log.}}
{{History||v0.15.0|snap=Realms build 4|[[File:Cocoa Age 0 (S) JE1.png|32px]] [[File:Cocoa Age 1 (S) JE1.png|32px]] [[File:Cocoa Age 2 (S) JE1.png|32px]] Cocoa stems now render again.<ref>{{bug|MCPE-13579}}</ref>}}
{{History||v0.16.0|snap=build 1|Cocoa beans can no longer be crafted from [[orange dye]] and an ink sac.
|Cocoa beans can no longer be crafted from rose red, dandelion yellow and ink sacs.}}
{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|Cocoa beans can now be used to dye [[shulker]]s.}}
{{History||1.1.0|snap=alpha 1.1.0.0|Cocoa beans can now be used to dye [[shulker box]]es and [[bed]]s.
|Cocoa beans can now be used to craft [[concrete powder]].}}
{{History|bedrock}}
{{History||1.2.0|snap=beta 1.2.0.2|Cocoa beans can now be used to dye [[banner]]s, [[firework star]]s, and [[glass]].
|Cocoa beans can now be found in [[bonus chest]]s.}}
{{History||1.4.0|snap=beta 1.2.20.1|Cocoa beans can now be used to craft brown [[balloon]]s and [[glow stick]]s.}}
{{History||1.8.0|snap=beta 1.8.0.10|Cocoa beans can now be used to craft [[brown dye]].}}
{{History||1.10.0|snap=beta 1.10.0.3|Cocoa beans are now [[trading|sold]] by [[wandering trader]]s.
|[[File:Cocoa Beans JE4 BE3.png|32px]] The texture of cocoa beans has been changed.
|[[File:Cocoa Age 0 (S) BE4.png|32px]] [[File:Cocoa Age 1 (S) BE4.png|32px]] [[File:Cocoa Age 2 (S) BE4.png|32px]] The textures of cocoa have been changed.}}
{{History||1.11.0|snap=beta 1.11.0.1|Cocoa beans can now be used to fill up [[composter]]s.}}
{{History||1.16.100|snap=beta 1.16.100.56|The ID of cocoa beans has been changed from <code>dye/3</code> to <code>cocoa_beans</code>.}}
{{History||1.18.10|snap=beta 1.18.10.22|[[File:Cocoa Age 0 (texture) JE3 BE3.png|32px]] [[File:Cocoa Age 1 (texture) JE3 BE3.png|32px]] Textures for cocoa age 0 and 1 were changed. This visually changes only particles.}}

{{History|console}}
{{History||xbox=TU1|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|[[File:Cocoa Beans JE1 BE1.png|32px]] Added cocoa beans.}}
{{History||xbox=TU9|[[File:Cocoa Beans JE3 BE2.png|32px]] The texture of cocoa beans has been changed.}}
{{History||xbox=TU12|[[File:Cocoa Age 0 (S) JE3.png|32px]] [[File:Cocoa Age 1 (S) JE3.png|32px]] [[File:Cocoa Age 2 (S) JE3.png|32px]]{{verify|Were these the models used?}} Added cocoa.}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Cocoa Beans JE4 BE3.png|32px]] The texture of cocoa beans has been changed once again.
|[[File:Cocoa Age 0 (S) JE5.png|32px]] [[File:Cocoa Age 1 (S) JE5.png|32px]] [[File:Cocoa Age 2 (S) JE5.png|32px]]{{verify|Were these the models used?}} The textures of cocoa have been changed.}}

{{History|new 3ds}}
{{History||0.1.0|[[File:Cocoa Beans JE3 BE2.png|32px]] Added cocoa beans.
|[[File:Cocoa Age 0 (S) JE3.png|32px]] [[File:Cocoa Age 1 (S) JE3.png|32px]] [[File:Cocoa Age 2 (S) JE3.png|32px]]{{verify|Were these the models used?}} Added cocoa.}}
{{History|foot}}

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

== Issues ==
{{issue list|Cocoa Beans|Cocoa Pod}}

== Trivia ==
*Cocoa pods have a different hitbox for each size; however, the top is always 0.25 blocks below the top of the [[log]] it is on.
*If a cocoa pod grows while the player is standing next to it, the player is forced into the appropriate form of [[suffocation prevention]] depending on available space.
*{{IN|be}}, the pixels on top of the fully grown pod are 8/7 the size of those on the side.<ref>{{bug|MC-109055||Fixed}}</ref><ref>{{bug|MCPE-152862}}</ref>

== Gallery ==
<gallery>
CocoaReveal.png|The first screenshot of cocoa pods tweeted by [[Jens Bergensten]], which revealed the plants.
CocoaPlant.png|A screenshot tweeted by Jens Bergensten, showing the pod.
Cocoa Plants in a Jungle Biome (12w19a).png|Naturally generated cocoa pods.
CPlantsJWood.png|A cocoa pod farm.
Cocoa2.jpg|A cocoa farm.
Cocoa beans phases.png|Three growing phases of the cocoa pod.
AreaOptimizedBeanPods.gif|A log and pod layout for optimizing an example area of 14×14 (including walls).
File:CocoaBean15.png|Cocoa beans with values greater than 12 appeared this way
</gallery>

==Literature==
===References===
{{reflist}}

===External Links===
*[https://www.minecraft.net/en-us/article/taking-inventory--cocoa-beans Taking Inventory: Cocoa Beans] – Minecraft.net on December 5, 2019

{{Items}}
{{Blocks|vegetation}}

[[Category:Dyes]]
[[Category:Food]]
[[Category:Plants]]
[[Category:Renewable resources]]
[[Category:Non-solid blocks]]
[[Category:Natural blocks]]

[[cs:Kakaové boby]]
[[de:Kakaobohnen]]
[[es:Semillas de cacao]]
[[fr:Fèves de cacao]]
[[hu:Kakaóbab]]
[[ja:カカオ豆]]
[[ko:코코아 콩]]
[[nl:Cacaobonen]]
[[pl:Ziarna kakaowe]]
[[pt:Sementes de cacau]]
[[ru:Какао-бобы]]
[[uk:Какао-боби]]
[[zh:可可豆]]</li></ul>
build 1Added a new world save format, based on LevelDB 1.17 with Zlib compression support added. Older worlds are automatically converted to the new format when loaded.
Pocket Edition
1.0.0
{{Extension DPL}}<ul><li>[[Brush|Brush]]<br/>{{Item
|image=Brush.png
|rarity=Common
|renewable=Yes
|durability=64
|stackable=No
}}
A '''brush''' is a [[tool]] used in [[archaeology]] to excavate [[suspicious block]]s for different items.

==Obtaining==
===Crafting===
{{Crafting
|head=1
|showname=0
|showdescription=1
|B1=Feather
|B2=Copper Ingot
|B3=Stick
|Output=Brush
|type=Tool
}}
{{crafting
|foot=1
|ignoreusage=1
|Damaged Brush
|Damaged Brush
|Output=Brush
|description=The durability of the two brushes is added together, plus an extra 5% durability.
|type=Tool
}}

==Usage==
{{Main|Suspicious Block}}
{{Control|Using}} the brush on any block displays a brushing animation, slowing down the player and creating breaking [[particles]], but not actually damaging the block or brush. When continuously brushing a [[suspicious block]], a random item slowly emerges from it until it drops out, and the block turns into regular [[sand]] or regular [[gravel]], depleting 1 [[durability]] point on the brush. It takes 96 [[game tick]]s (4.8 seconds) to brush a single suspicious block. 

=== Enchantments ===
A brush can receive the following [[enchantment]]s:
{|class="wikitable col-2-center col-3-right"
|+
!Name
!Max Level
![[Enchanting|Method]]
|-
|[[Unbreaking]]
|III
|{{Inventory slot|Anvil}}   
|-
|[[Mending]]
|I
|{{Inventory slot|Anvil}}   
|-
|[[Curse of Vanishing]]
|I
|{{Inventory slot|Anvil}}   
|}

== Sounds ==
{{Edition|Java}}:
{{Sound table
<!--All of these sounds are, in fact, different-->
|sound=Brushing sand1.ogg
|sound2=Brushing sand2.ogg
|sound3=Brushing sand3.ogg
|sound4=Brushing sand4.ogg
|subtitle=Brushing Sand
|source=block
|description=While a brush is brushing suspicious sand
|id=item.brush.brushing.sand
|translationkey=subtitles.item.brush.brushing.sand
|volume=0.6
|pitch=0.6
|distance=16}}
{{Sound table
|sound=Brushing gravel1.ogg
|sound2=Brushing gravel2.ogg
|sound3=Brushing gravel3.ogg
|sound4=Brushing gravel4.ogg
|subtitle=Brushing Gravel
|source=block
|description=While a brush is brushing suspicious gravel
|id=item.brush.brushing.gravel
|translationkey=subtitles.item.brush.brushing.gravel
|volume=0.6
|pitch=0.6
|distance=16}}
{{Sound table
|sound=Brushing generic1.ogg
|sound2=Brushing generic2.ogg
|sound3=Brushing generic3.ogg
|sound4=Brushing generic4.ogg
|subtitle=Brushing
|source=block
|description=While a brush is brushing any other block
|id=item.brush.brushing.generic
|translationkey=subtitles.item.brush.brushing.generic
|volume=0.6
|pitch=0.6
|distance=16}}
{{Sound table
|sound=Brushing sand completed1.ogg
|sound2=Brushing sand completed2.ogg
|sound3=Brushing sand completed3.ogg
|sound4=Brushing sand completed4.ogg
|sound5=Brushing sand completed5.ogg
|subtitle=Brushing Sand completed
|source=Players<ref group=sound name=badsource>{{Bug|MC-260202}}</ref>|overridesource=1
|description=When a brush finishes brushing suspicious sand
|id=item.brush.brushing.sand.complete
|translationkey=subtitles.item.brush.brushing.sand.complete
|volume=1.0
|pitch=1.0
|distance=16}}
{{Sound table
|sound=Brushing gravel completed1.ogg
|sound2=Brushing gravel completed2.ogg
|sound3=Brushing gravel completed3.ogg
|sound4=Brushing gravel completed4.ogg
|subtitle=Brushing Gravel completed
|source=Players<ref group=sound name=badsource/>|overridesource=1
|description=When a brush finishes brushing suspicious gravel
|id=item.brush.brushing.gravel.complete
|translationkey=subtitles.item.brush.brushing.gravel.complete
|volume=1.0
|pitch=1.0
|distance=16
|foot=1}}

{{Edition|Bedrock}}:
{{Sound table
|type=bedrock
|sound=Brushing sand1.ogg
|sound2=Brushing sand2.ogg
|sound3=Brushing sand3.ogg
|sound4=Brushing sand4.ogg
|source=player
|description=While a brush is brushing suspicious sand
|id=brush.suspicious_sand
|volume=1.0
|pitch=0.8-1.0}}
{{Sound table
|sound=Brushing gravel1.ogg
|sound2=Brushing gravel2.ogg
|sound3=Brushing gravel3.ogg
|sound4=Brushing gravel4.ogg
|source=player
|description=While a brush is brushing suspicious gravel
|id=brush.suspicious_gravel
|volume=1.0
|pitch=0.8-1.0}}
{{Sound table
|sound=Brushing generic1.ogg
|sound2=Brushing generic2.ogg
|sound3=Brushing generic3.ogg
|sound4=Brushing generic4.ogg
|source=player
|description=While a brush is brushing any other block
|id=brush.generic
|volume=1.0
|pitch=0.8-1.0}}
{{Sound table
|sound=Brushing sand completed1.ogg
|sound2=Brushing sand completed2.ogg
|sound3=Brushing sand completed3.ogg
|sound4=Brushing sand completed4.ogg
|sound5=Brushing sand completed5.ogg
|source=player
|description=When a brush finishes brushing suspicious sand
|id=brush_completed.suspicious_sand
|volume=1.0
|pitch=0.8-1.0}}
{{Sound table
|sound=Brushing gravel completed1.ogg
|sound2=Brushing gravel completed2.ogg
|sound3=Brushing gravel completed3.ogg
|sound4=Brushing gravel completed4.ogg
|source=player
|description=When a brush finishes brushing suspicious gravel
|id=brush_completed.suspicious_gravel
|volume=1.0
|pitch=0.8-1.0
|foot=1}}

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

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Brush
|spritetype=item
|nameid=brush
|id=684
|form=item
|foot=1}}

== Advancements ==
{{load advancements|Respecting the Remnants}}

== History ==
{{History||October 3, 2020|link=https://youtu.be/DBvZ2Iqmm3M?t=2178|[[File:Brush (pre-release 1).png|32px]][[File:Brush 2.png|32px]] Brushes were announced at [[Minecraft Live 2020]] with two variants.}}
{{History||?|link=https://youtu.be/klP9SrJFDU8?t=206|[[File:Brush (pre-release 2).png|32px]] Changed the brush's item texture.}}
{{History||February 10, 2023|[[File:Brush JE1 BE1.png|32px]] [[Sofia Dankis]] posted an article about upcoming archaeology features, including brushes.|link=https://www.minecraft.net/en-us/article/archeology-coming-minecraft-120}}
{{History|java}}
{{History||1.20<br>(Experimental)|link=1.19.4|snap=23w07a|[[File:Brush JE1 BE1.png|32px]] Added brushes with an updated texture behind the [[Java Edition 1.20|Update 1.20 experimental datapack]].|The crafting recipe was originally three [[string]] and two [[stick]]s.
{{{!}} class{{=}}"collapsible collapsed" data-description{{=}}"Recipe"
! Recipe
{{!}}-
{{!}}{{Crafting Table
|A1 = String
|B1 = String
|C1 = String
|B2 = Stick
|B3 = Stick
|Output = Brush
|type = Tool
|ignoreusage=1}}
{{!}}}
}}
{{History|||snap=1.19.4 Pre-release 1|The crafting recipe for brushes has been changed:
{{{!}} class{{=}}"collapsible collapsed" data-description{{=}}"Recipe"
! Recipe
{{!}}-
{{!}}{{Crafting Table
|B1 = Feather
|B2 = Copper Ingot
|B3 = Stick
|Output = Brush
|type = Tool
|ignoreusage=1}}
{{!}}}
}}
{{History||1.20|snap=23w12a|Brushes are now available without using the "Update 1.20" experimental data pack.
|Brushes can now brush [[suspicious gravel]].}}
{{History|||snap=23w14a|The brushing sound of brush is now controlled by the "Blocks" sound slider instead of the "Players" sound slider.}}
{{History|||snap=23w17a|The player now gets the [[advancement]] "Respecting the Remnants" when they use a brush on a [[suspicious block]] to obtain a [[pottery sherd]].}}

{{History|bedrock}}
{{History||Next Major Update<br>(Experimental)|link=Bedrock Edition 1.19.70|snap=beta 1.19.70.23|[[File:Brush JE1 BE1.png|32px]] Added brushes behind the "[[Bedrock Edition 1.20.0|Next Major Update]]" [[experimental]] toggle.
|The crafting recipe is originally three [[string]] and two [[stick]]s.
{{{!}} class{{=}}"collapsible collapsed" data-description{{=}}"Recipe"
! Recipe
{{!}}-
{{!}}{{Crafting Table
|A1 = String
|B1 = String
|C1 = String
|B2 = Stick
|B3 = Stick
|Output = Brush
|type = Tool
|ignoreusage=1}}
{{!}}}
}}
{{History||Next Major Update<br>(Experimental)|link=Bedrock Edition 1.19.80|snap=beta 1.19.80.20|The crafting recipe for brushes has been changed:
{{{!}} class{{=}}"collapsible collapsed" data-description{{=}}"Recipe"
! Recipe
{{!}}-
{{!}}{{Crafting Table
|B1 = Feather
|B2 = Copper Ingot
|B3 = Stick
|Output = Brush
|type = Tool
|ignoreusage=1}}
{{!}}}
}}
{{History||1.20.0|snap=beta 1.20.0.21|Brushes are now available without using the "Next Major Update" experimental toggle.}}
{{History|foot}}

== Issues ==
{{Issue list}}

== References ==
{{Reflist}}

==External Links==
*[https://www.minecraft.net/en-us/article/brush Taking Inventory: Brush] – Minecraft.net on July 6, 2023

{{Items}}

[[Category:Renewable resources]]

[[de:Pinsel]]
[[es:Pincel]]
[[ja:ブラシ]]
[[pt:Pincel]]
[[pl:Pędzel]]
[[uk:Щітка]]
[[zh:刷子]]</li><li>[[Redstone Comparator|Redstone Comparator]]<br/>{{Block
| image = 
| image2 = 
| transparent = Yes
| light = No
| tool = any
| renewable = Yes
| stackable = Yes (64)
| flammable = No
| lavasusceptible = No
| group = Redstone Comparator
| group2 = Subtracting
| group3 = Powered
| group4 = Powered+Subtracting
| 1-1 = Redstone Comparator.png
| 2-1 = Subtracting Redstone Comparator.png
| 3-1 = Powered Redstone Comparator.png
| 4-1 = Powered Subtracting Redstone Comparator.png
}}
{{Many images}}
A '''redstone comparator''' is a [[block]] that can produce an [[Redstone Dust|output signal]] from its front by reading [[chest]]s, [[lectern]]s, [[beehive]]s and similar blocks, or repeat a signal without changing its strength. It can also be set to either stop outputting a signal when its side input recieves a stronger one (front torch off), or subtract its side input's signal strength from its output (front torch on).

== Obtaining ==
=== Natural generation ===
Redstone comparators generate in [[Ancient City|ancient cities]].

=== Breaking ===
A redstone comparator can be broken instantly with any [[tool]], or by hand, and drops itself as an item.

{{Breaking row|Redstone Comparator|horizontal=y}}

A redstone comparator is removed and dropped as an item if:
* its attachment block is moved, removed, or destroyed;
* [[water]] flows into its space;{{only|java}}
* a [[piston]] tries to push it or moves a block into its space.

If [[lava]] flows into a redstone comparator's space, the redstone comparator is destroyed without dropping as an item.

=== Crafting ===
{{Crafting
|B1=Redstone Torch
|A2=Redstone Torch
|B2=Nether Quartz
|C2=Redstone Torch
|A3=Stone
|B3=Stone
|C3=Stone
|Output= Redstone Comparator
|type=Redstone
}}

== Usage ==
A redstone comparator can be placed on the top of any [[opaque]] block with a solid full-height top surface (including upside-down [[slab]]s and upside-down [[stairs]]). {{IN|be}}, a comparator can also be placed on [[wall]]s and fences. For more information about placement on transparent blocks, see [[Opacity/Placement]].

The redstone comparator has a front and a back — the arrow on the top of the comparator points to the front. When placed, the comparator faces away from the player. The comparator has two miniature redstone torches at the back and one at the front. The back torches turn on when the comparator's output is greater than zero (the arrow on top also turns red). The front torch has two states that can be toggled by {{control|using}} the comparator:
* Down and unpowered (indicating the comparator is in "comparison mode")
* Up and powered (indicating the comparator is in "subtraction mode")

The redstone comparator can take a signal strength input from its rear as well as from both sides. Side inputs are accepted only from [[redstone dust]], [[block of redstone]], [[redstone repeater]]s, other comparators, and [[observer]]s in specific scenarios. The redstone comparator's front is its output.

It takes 1 [[redstone tick]] (2 game ticks, or 0.1 seconds barring lag) for signals to move through a redstone comparator, either from the rear or from the sides. This applies to changing signal strengths as well as simply to turning on and off. 

Redstone comparators check their power state before their scheduled ticks update. This results in redstone comparators not usually responding to 1-tick fluctuations of power or signal strength — for example, a [[clock circuit|1-clock]] input is treated as always off from the side, and always on from the rear. This happens because the signal changes back to its original state before the redstone comparator checks its input states. However, certain setups such as powering any input with two separate observer pulses at the same time will cause a redstone comparator to respond to 2 gametick pulses.

The redstone comparator has four functions: maintain signal strength, compare signal strength, subtract signal strength, and measure certain block states (primarily the fullness of containers).

=== Maintain signal strength ===
A redstone comparator with no powered sides outputs the same signal strength as its rear input.

=== Compare signal strength ===
[[File:Comparators Explained.png|Comparators in comparison mode.|thumb]]
A redstone comparator in comparison mode (front torch down and unpowered) compares its rear input to its two side inputs. If either side input is greater than the rear input, the comparator output turns off. If neither side input is greater than the rear input, the comparator outputs the same signal strength as its rear input.

The formula for calculating the output signal strength is as follows:

<code>output = rear × [[Wikipedia:Iverson bracket|[]]'''''left''''' ≤ '''''rear''''' AND '''''right''''' ≤ '''''rear'''''[[Wikipedia:Iverson bracket|<nowiki>]]]</code>
{{-}}

=== Subtract signal strength ===
[[File:Redstone comparator.png|thumb|The greatest of the side inputs A and C is subtracted from the rear input B, outputting 1. If either A or C were greater than B, it would output 0.]]
A redstone comparator in subtraction mode (front torch up and powered) subtracts the signal strength of the higher side input from the signal strength of the rear input.

<code>output = max('''''rear''''' − max('''''left''', '''right'''''), 0)</code>

For example: if the signal strength is 6 at the left input, 7 at the right input and 4 at the rear, the output signal has a strength of ''max(4 − max(6, 7), 0) = max(4−7, 0) = max(−3, 0) = 0''.

If the signal strength is 9 at the rear, 2 at the right input and 5 at the left input, the output signal has a strength of ''max(9 − max(2, 5), 0) = max(9−5, 0) = 4''.

=== Measure block state ===
{{Schematic | caption = A redstone comparator can measure the fullness of a chest, as well as other block states, even through an opaque block.
 |rd-ew!|rc-w!|ch|SB|rc-e!|rd-ew!
}}
A redstone comparator treats certain blocks behind it as power sources and outputs a signal strength proportional to the block's state. The comparator may be separated from the measured block by an opaque block. However, {{in|je}}, if the opaque block is powered to signal strength 15, then the comparator outputs 15 no matter the fullness of the container.<ref>{{bug|MC-64394}} (resolved as "Works As Intended")</ref>
[[Category:Java Edition specific information]]
{{-}}

==== Fullness of containers ====
{| class="wikitable floatright" style="margin-left: 0.5em; margin-right: 0; text-align: center;"
|+ Minimum Items for Container Signal Strength
|-
!Containers
!{{BlockSprite|Furnace|link=Furnace}}<br>{{BlockSprite|Blast Furnace|link=Blast Furnace}}<br>{{BlockSprite|Smoker|link=Smoker}}
!{{BlockSprite|Hopper|link=Hopper}}<br>{{EntitySprite|Minecart with Hopper|link=Minecart with Hopper}}<br>{{BlockSprite|Brewing Stand|link=Brewing Stand}}
!{{BlockSprite|Dispenser|link=Dispenser}}<br>{{BlockSprite|Dropper|link=Dropper}}
!{{BlockSprite|Chest|link=Chest}}<br>{{EntitySprite|Minecart with Chest|link=Minecart with Chest}}<br>{{BlockSprite|Shulker Box|link=Shulker Box}}<br>{{BlockSprite|Barrel|link=Barrel}}
![[Double Chest|{{Schematic|size=16|ch-s|-|ch-n}}
]]
!{{BlockSprite|Jukebox|link=Jukebox}}
|-
!Total Slots
!3!!5!!9!!27!!54!!1
|-
!Power Level
! colspan="5" |Number of Items
!Music Disc
|-
|0||0||0||0||0||0||No disc
|-
|1||1||1||1||1||1||"13"
|-
|2||14||23||42||1s 60||3s 55||"cat"
|-
|3||28||46||1s 19||3s 55||7s 46||"blocks"
|-
|4||42||1s 5||1s 60||5s 51||11s 37||"chirp"
|-
|5||55||1s 28||2s 37||7s 46||15s 28||"far"
|-
|6||1s 5||1s 51||3s 14||9s 42||19s 19||"mall"
|-
|7||1s 19||2s 10||3s 55||11s 37||23s 10||"mellohi"
|-
|8||1s 32||2s 32||4s 32||13s 32||27s||"stal"
|-
|9||1s 46||2s 55||5s 10||15s 28||30s 55||"strad"
|-
|10||1s 60||3s 14||5s 51||17s 23||34s 46||"ward"
|-
|11||2s 10||3s 37||6s 28||19s 19||38s 37||"11"
|-
|12||2s 23||3s 60||7s 5||21s 14||42s 28||"wait"
|-
|13||2s 37||4s 19||7s 46||23s 10||46s 19||"Pigstep"
|-
|14||2s 51||4s 42||8s 23||25s 5||50s 10||"Otherside"<br>"Relic"
|-
|15||3s||5s||9s||27s||54s||"5"
|}
A redstone comparator can output a signal indicating how full a container is. (0 for empty, 15 for full, etc.) The table on the right is described more in detail, later in this section.

Containers that can be measured by a comparator include:
* {{BlockLink|Furnace}}
* {{BlockLink|Blast Furnace}}
* {{BlockLink|Smoker}}
* {{BlockLink|Brewing Stand}}
* {{BlockLink|Hopper}}
* {{ItemLink|Minecart with Hopper}} on top of a [[detector rail]]
* {{BlockLink|Dispenser}}
* {{BlockLink|Dropper}}
* {{BlockLink|Chest}}
* {{BlockLink|Trapped Chest}}
* {{ItemLink|Minecart with Chest}} on top of a [[detector rail]]
* {{BlockLink|Barrel}}
* {{SchematicSprite|size=16|ch-e}}{{SchematicSprite|size=16|ch-w}} Large chest
* {{SchematicSprite|size=16|ch-e}}{{SchematicSprite|size=16|ch-w}} Large trapped chest
* {{BlockLink|Shulker Box}} (any color)

Generally speaking, the comparator output signal strength represents the average fullness of the slots, based on how many of that item form a full stack (64, 16, or 1 for non-stackable items).

The ''Minimum Items for Container Signal Strength'' table (right) shows the minimum '''''full-stack-equivalent (FSE)''''' to produce different signal strengths from common containers. A '''''full-stack-equivalent''''' quantifies how many normal 64-stackable items are needed to output a corresponding signal strength. The 's' is a constant 64, with the additional amount needed following after.

One may also consider the terms: '''c''umulative-weight''''' or '''''weighted-sum''''' instead of '''''full-stack-equivalent'''''.

Items that stack to a max of 16  ([[snowball]]s, [[sign]]s, [[ender pearl]]s, etc.), contribute +4 to the ''full-stack-equivalent'' for each unity (count of 1 item). Similarly, items that stack to 1 ([[minecart]], [[boat]], etc.) contribute +64, and items that stack to 64 contribute +1.

Example 1: 3 ender pearls will contribute a 3 x 4 = 12 ''full-stack-equivalent''.

Example 2: 16 ender pearls and 60 redstone dust contributes a 16x4 + 60x1 = 124 ''full-stack-equivalent''.

Example 3: 1 minecart and 60 redstone dust contributes a 1x64 + 60x1 = 124 ''full-stack-equivalent''.

Example 4: To produce a signal strength of 10 from a hopper, one requires a ''full-stack-equivalent'' of at least 3s + 14 = 206 but strictly less than than 3s + 37 = 229. This can be done with 3 minecarts, and 14 dirt.

When a comparator measures a large chest or large trapped chest, it measures the entire large chest (54 slots), not just the half directly behind the comparator. A chest or trapped chest that cannot be opened (either because it has an opaque block, [[ocelot]], or [[cat]] above it) always produces an output of 0 no matter how many items are in the container — shulker boxes can always be measured, even if they cannot open.

;Calculating signal strength from items

:When a container is empty, the output is off.

:When it is not empty, the output signal strength is calculated as follows:

:<code>'''''signal strength''''' = floor(1 + (('''''sum of all slots' fullnesses''''') / ('''''number of slots in container''''')) × 14)</code>

:<code>fullness of a slot = '''''number of items in slot''''' / '''''max stack size for this type of item'''''</code>

:''Example:'' 300 blocks in a dispenser (which has 9 slots), where each block stacks to a maximum of 64 has a 300 ''full-stack-equivalent.'' This produces an output with a signal strength of 8:
<blockquote>
1 + ((300 items / 64 items per slot) / 9 slots) × 14 = 8.292, floored is 8
</blockquote>

;Calculating items from signal strength

:It can be useful in redstone circuits to use containers with comparators to create signals of a specific strength. The number of items required in a container to produce a signal of desired strength is calculated as follows:

:<code>items required = max('''''desired signal strength''''', roundup(('''''total slots in container''''' × 64 / 14) × (desired signal strength − 1)))</code>

:''Example:'' To use a furnace (which has 3 slots) to create a strength 9 signal, players need 110 items:
<blockquote>
max(9, (3×64/14) × (9−1)) = 109.714, rounded up is 110
</blockquote>
{{-}}

==== Miscellaneous ====
[[File:Comparator storage.png|Comparators used to measure containers.|thumb]]
Some non-container blocks can also be measured by a redstone comparator:

;{{BlockLink|Beehive}} and {{BlockLink|Bee nest}}

: A hive or nest outputs a signal strength equal to the amount of honey in the hive/nest.

;{{BlockLink|Cake}}

: A cake outputs a signal strength relative to the amount of cake remaining.  Each slice is worth 2 signal strength, with 7 total slices, for an output of 14 for a full cake.

[[File:Cauldron Redstone Strength Values.png|Cauldron signal strength|thumb]]
;{{BlockLink|Cauldron}}

: A cauldron outputs different signal strengths depending on how much water or powdered snow is inside. From completely empty to completely full, the output values are 0, 1, 2, and 3. If lava or powder snow is inside, the strength is always 3.

[[File:Composter Redstone Strength Values.png|Composter signal strength|thumb]]
;{{BlockLink|Composter}}

: A composter outputs different signal strengths depending on the level inside. From completely empty to completely full, the output values are 0, 1, 2, 3, 4, 5, 6, 7 and 8.

;{{Anchor|CommandBlock}}{{BlockLink|Command Block}}

: A command block stores the "success count" of the last command executed, which represents the number of times the most recently used command of this command block succeeded. A "success" is defined by the [[command]]'s success conditions: if a red error message is returned in the chat, the command was not successful.

: Most commands can succeed once per execution, but certain commands (such as those that accept players as arguments) can succeed multiple times, and the comparator outputs the number of times it succeeded (maximum 15 when sent to redstone dust, but in the code it is able to go up to the 32-bit integer limit, and can be used in contraptions with no redstone dust with those values).

: A command block continues to store the success count of the last command executed until it executes its command again, thus the comparator continues to output the same signal strength even after the command block is no longer being activated (it doesn't turn off when the signal to the command block turns off).

;{{BlockLink|End Portal Frame}}

: An end portal frame outputs a full signal of 15 if it contains an [[eye of ender]] and zero otherwise.

[[File:Item frame and comparator.png|A comparator can measure the presence and rotation of an item frame's contents.|thumb]]

;{{EntityLink|Item Frame}}

: A comparator can measure the state of an [[item frame]]'s contents. An item frame comparator outputs 0 if the item frame is empty, or 1 to 8 for any item depending on its rotation: 1 at initial placement, plus 1 for each 45° of rotation for a maximum of 8.

: For an item frame that holds a map, a unit of rotation is 90° instead of 45°, but a comparator still outputs power levels 1 to 8. It takes two full rotations to cycle through all comparator outputs, and each orientation of the map corresponds to two output levels that differ by 4.

: The comparator must be placed behind the block the item frame is attached to, facing away from the item frame. The block must be a full block, and the item frame cannot be submerged in water. Having a sign in the same block as the item frame will prevent the frame from sending a signal as well.{{only|java}}

;{{BlockLink|Jukebox}}

: A jukebox outputs a signal strength indicating which music disc is currently playing. See the ''Minimum Items for Container Signal Strength'' table above.

;{{BlockLink|Lectern}}

: A lectern outputs a signal strength that depends on what page the player is currently on. The calculation used is:
:<code>'''''signal strength''''' = floor(1 + (('''''current page''''' - 1) / ('''''number of pages in book''''' - 1)) × 14)</code>
:This results in page 1 having a signal strength of 1, and the last page having a signal strength of 15. The exception is a single page book, which will output a signal strength of 15.
:For example, a book with 15 pages will output a signal equal to the current page number.  A book with 5 pages will output signal strengths of 1, 4, 8, 11 and 15 for the different pages. A book with 100 pages will have the signal strength increase to the next level on pages 1, 9, 16, 23, 30, 37, 44, 51, 58, 65, 72, 79, 86, 93 and 100.
:

;{{BlockLink|Respawn Anchor}}

: A respawn anchor outputs a signal strength of 0, 3, 7, 11, or 15, depending on the "charged" value.

;{{BlockLink|Sculk Sensor}}

: A sculk sensor outputs a signal strength depending on the type of vibration that is detected.

;{{BlockLink|Chiseled Bookshelf}}

: A chisled bookshelf outputs a signal strength between 1 and 6 indicating the last slot interacted with. When no slot has been interacted with yet, it outputs 0.
{{-}}

== Sounds ==
=== Generic ===
{{Edition|Java}}:
{{Sound table/Block/Stone/JE}}
{{Edition|Bedrock}}:
{{Sound table/Block/Wood/BE}}

=== Unique ===
{{edition|java}}:
{{Sound table
|rowspan=2
|sound=Click.ogg
|subtitle=Comparator clicks
|source=block
|description=When a comparator is set to subtraction mode
|id=block.comparator.click
|translationkey=subtitles.block.comparator.click
|volume=0.3
|pitch=0.55
|distance=16}}
{{Sound table
|subtitle=Comparator clicks
|source=block
|description=When a comparator is set to comparison mode
|id=block.comparator.click
|translationkey=subtitles.block.comparator.click
|volume=0.3
|pitch=0.5
|distance=16
|foot=1}}

{{edition|bedrock}}:
{{Sound table
|type=bedrock
|rowspan=2
|sound=Click.ogg
|source=block
|description=When a comparator is set to subtraction mode
|id=block.click
|volume=0.2
|pitch=0.55}}
{{Sound table
|source=block
|description=When a comparator is set to comparison mode
|id=block.click
|volume=0.2
|pitch=0.5
|foot=1}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Redstone Comparator
|spritetype=block
|nameid=comparator
|foot=1}}
{{ID table
|displayname=Block entity
|spritename=redstone-comparator
|spritetype=block
|nameid=comparator
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|firstcolumnname=Redstone Comparator
|shownumericids=y
|showforms=y
|generatetranslationkeys=y
|displayname=Unpowered block
|spritename=unpowered-comparator
|spritetype=block
|nameid=unpowered_comparator
|id=149
|form=block
|translationkey=-}}
{{ID table
|displayname=Powered block
|spritename=powered-comparator
|spritetype=block
|nameid=powered_comparator
|id=150
|form=block
|translationkey=-}}
{{ID table
|displayname=Item
|spritename=redstone-comparator
|spritetype=item
|nameid=comparator
|id=522
|form=item
|foot=1}}
{{ID table
|notnamespaced=y
|displayname=Block entity
|spritename=redstone-comparator
|spritetype=block
|nameid=Comparator
|foot=1}}

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

=== Block data ===
A redstone comparator has a block entity associated with it that holds additional data about the block.

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

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

== Advancements ==
{{Load advancements|the power of books}}

== Video ==

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

== History ==
{{info needed section|If {{bug|MC-50242}} also affected comparators?}}
''For a more in-depth breakdown of changes to repeater textures and models, including a set of renders for each state combination, see [[/Asset history]]''
{{History|java}}
{{History||November 24, 2012|link=https://youtube.com/watch?v=YG9RNyRhIow&t=6m56s|[[Jeb]] stated that there may be a "capacitor" in [[Minecraft]]. }}
{{History||December 27, 2012|link={{tweet|Dinnerbone|284388625595125760}}|[[Dinnerbone]] released [https://web.archive.org/web/20190710120115/https://imgur.com/a/FBKed pictures] of the first version of the "comparator", stating it was a replacement for the "capacitor" idea that has variable, alternate inputs.}}
{{History||January 2, 2013|link={{tweet|Dinnerbone|286428595423965184}}|Dinnerbone released one more [http://dinnerbone.com/media/uploads/2013-01/screenshots/2013-01-02_12.06.47.png picture] of the comparator. The picture itself showing a digital-to-analog converter, using the comparator as the main [[block]].}}
{{History||1.5|snap=13w01a|[[File:Redstone Comparator (S) JE1.png|32px]] [[File:Powered Redstone Comparator (S) JE1.png|32px]] [[File:Subtracting Redstone Comparator (S) JE1.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) JE1.png|32px]] [[File:Redstone Comparator (item) JE1 BE1.png|32px]] Added redstone comparators.
|Redstone comparators have 0 delay.
At this point, block ID 149 was used for unpowered comparators, and block ID 150 for powered comparators.}}
{{History|||snap=13w01b|A delay of 1 game tick ({{frac|1|2}} redstone tick) has now been added to redstone comparators to fix bugs.
|The ability to measure containers to redstone comparators has now been added.}}
{{History|||snap=13w02a|[[File:Redstone Comparator (S) JE2.png|32px]] [[File:Powered Redstone Comparator (S) JE2.png|32px]] [[File:Subtracting Redstone Comparator (S) JE2.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) JE2.png|32px]] The appearance of redstone comparators has now been changed - the top texture has changed to show [[quartz]] in the middle and the sides now use the [[smooth stone]] texture rather than the smooth stone slab side texture.
|The algorithm for measuring containers has now been changed so that redstone comparators output a signal with as few as 1 [[item]] in the container.}}
{{History|||snap=13w02b|Redstone comparators now treat large [[chest]]s as a single container.}}
{{History|||snap=13w03a|Redstone comparators now output success count of [[command block]]s.
|Redstone comparators now measure container [[minecart]]s on [[detector rail]]s.}}
{{History|||snap=13w04a|Redstone comparators now measure [[jukebox]]es.}}
{{History|||snap=13w05a|Redstone comparators no longer cause constant [[block]] updates. The delay has now been made consistent, and side input no longer causes a pulse output.
|Block 150 (later <code>powered_comparator</code>) is no longer used; powered state is now represented by the 8s bit on block 149 (later <code>unpowered_comparator</code>).}}
{{History|||snap=13w05b|Redstone comparator delay has now been changed from 1 game tick (1/2 [[redstone]] tick) to 2 game ticks (1 redstone tick).}}
{{History|||snap=13w09c|The redstone signal strength from a redstone comparator next to a [[brewing stand]] with 3 [[water bottle]]s in it is now the same as one with 3 water bottles and 1 ingredient in it.}}
{{History||1.6.1|snap=13w18a|Redstone comparators now measure [[cauldron]]s and [[end portal frame]]s.}}
{{History||1.8|snap=14w04a|Redstone comparators now measure [[item frame]]s.}}
{{History|||snap=14w10a|The torches under redstone comparators have now been shortened, which has changed the underside appearance from [[File:Redstone Comparator UNKVER1 (facing NWU).png|32px]] [[File:Powered Redstone Comparator UNKVER1 (facing NWU).png|32px]] [[File:Subtracting Redstone Comparator UNKVER1 (facing NWU).png|32px]] [[File:Powered Subtracting Redstone Comparator UNKVER1 (facing NWU).png|32px]] to [[File:Redstone Comparator UNKVER2 (facing NWU).png|32px]].}}
{{History|||snap=14w25a|[[File:Redstone Comparator (S) JE3.png|32px]] [[File:Powered Redstone Comparator (S) JE3.png|32px]] [[File:Subtracting Redstone Comparator (S) JE3.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) JE3.png|32px]] The torches on comparators are now subject to ambient occlusion.
|Comparators set to subtract mode appear to be powered as well regardless of incoming power. The subtracting-only model still exists and can be achieved through {{cmd|setblock}}.}}
{{History|||snap=14w25b|[[File:Subtracting Redstone Comparator (S) JE4.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) JE4.png|32px]] The powered front torch when in subtraction mode is now lower.
|Comparators set to subtract by hand now appear normally again.}}
{{History|||snap=14w28a|Redstone comparators now measure [[cake]]s.}}
{{History||1.9|snap=15w42a|With the addition of the [[blaze powder]] fuel slot, [[brewing stand]]s now have 5 slots instead of 4. Their original comparative power values from redstone comparators are listed below:
{{{!}} class{{=}}"wikitable collapsible collapsed" data-description{{=}}"Original values"
! Original values
{{!}}-
{{!}}
*0: 0
*1: 1
*2: 19
*3: 37
*4: 55
*5: 1s 10
*6: 1s 28
*7: 1s 46
*8: 2s
*9: 2s 19
*10: 2s 37
*11: 2s 55
*12: 3s 10
*13: 3s 28
*14: 3s 46
*15: 4s
{{!}}}
}}
{{History|||snap=15w47a|Redstone comparators' side inputs now take power from [[redstone block]]s.}}
{{History||1.13|snap=17w47a|All 3 IDs for the redstone comparator have now been merged into one ID: <code>comparator</code>.
|Redstone comparators now render their underside, which has changed their undersides from [[File:Redstone Comparator UNKVER2 (facing NWU).png|32px]] to [[File:Redstone Comparator UNKVER3 (facing NWU).png|32px]].
|Prior to [[1.13/Flattening|''The Flattening'']], these blocks' numeral IDs were 149 and 150, and the [[item]]'s 404.
|As a result, the formerly unused comparator ID is now technically used again, due to both unpowered and powered versions being merged into a single comparator block ID.}}
{{History||1.14|snap=18w43a|[[File:Redstone Comparator (S) JE4.png|32px]] [[File:Powered Redstone Comparator (S) JE4.png|32px]] [[File:Subtracting Redstone Comparator (S) JE5.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) JE5.png|32px]] [[File:Redstone Comparator (item) JE2 BE2.png|32px]] The textures of redstone comparators have now been changed.}}
{{History|||snap=19w02a|Redstone comparators now measure [[lectern]]s.}}
{{History|||snap=19w03a|Redstone comparators now measure [[composter]]s.}}
{{History|||snap=19w12b|Redstone comparators can now be placed on [[glass]], [[ice]], [[glowstone]] and [[sea lantern]]s.}}
{{History||1.15|snap=19w34a|Redstone comparators now measure how much honey is inside [[beehive|bee hive]]s and [[bee nest]]s.}}
{{History||1.16|snap=20w06a|The way to calculate the input signals of redstone comparators has now been changed.}}
{{History|||snap=20w11a|The changes to the way of calculating the input signals of redstone comparators from [[Java Edition 20w06a|20w06a]] have now been reverted.}}
{{History|||snap=20w16a|Redstone comparators now measure [[Pigstep music disc]]s in [[jukebox]]es.}}
{{History||1.17|snap=20w45a|Redstone comparators now measure [[lava cauldron]]s.}}
{{History|||snap=20w46a|Redstone comparators now measure [[Cauldron#Holding powder snow|powder snow cauldron‌]]s.}}
{{History||1.18|snap=21w41a|[[File:Powered Redstone Comparator (S) JE5.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) JE6.png|32px]] The texture of powered redstone comparator have now been changed.}}
{{History||1.19|snap=22w13a|Redstone comparators now generate as part of [[ancient cities]].}}
{{History||1.20<br>(Experimental)|link=1.19.3|snap=22w42a|Redstone comparators now measure [[chiseled bookshelves]].}}
{{History||1.20.2|snap=23w33a|Redstone comparators now use stone sounds instead of wood sounds.<ref>{{bug|MC-182820|||Fixed}}</ref>}}

{{History|pocket alpha}}
{{History||v0.14.0|snap=build 1|[[File:Redstone Comparator (S) JE2 BE1.png|32px]] [[File:Powered Redstone Comparator (S) JE2 BE1.png|32px]] [[File:Subtracting Redstone Comparator (S) JE2 BE1.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) JE2 BE1.png|32px]]{{verify|Was this the model used?}} [[File:Redstone Comparator (item) JE1 BE1.png|32px]] Added redstone comparators.}}
{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|Redstone comparators now measure [[end portal frame]]s.}}
{{History||1.0.5|snap=alpha 1.0.5.0|Redstone comparators now output success count of [[command block]]s.}}
{{History||1.1.0|snap=alpha 1.1.0.0|Redstone comparators now measure [[shulker box]]es.}}
{{History|bedrock}}
{{History||1.2.0|snap=beta 1.2.0.2|Redstone comparators now measure [[jukebox]]es.
|Redstone comparators now render their underside, which has changed their undersides from [[File:Redstone Comparator UNKVER1 (facing NWU).png|32px]] to [[File:Redstone Comparator UNKVER3 (facing NWU).png|32px]]}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Redstone Comparator (S) BE.png|32px]] [[File:Powered Redstone Comparator (S) BE.png|32px]] [[File:Subtracting Redstone Comparator (S) BE.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) BE.png|32px]] [[File:Redstone Comparator (item) JE2 BE2.png|32px]] The textures of redstone comparators have now been changed.}}
{{History||1.11.0|snap=beta 1.11.0.1|Redstone comparators now measure [[smoker]]s, [[blast furnace]]s, [[lectern]]s and [[composter]]s.}}
{{History||1.18.10|snap=beta 1.18.10.20|[[File:Powered Redstone Comparator (S) JE5.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) JE6.png|32px]] The texture of powered redstone comparator have now been changed.}}
{{History||1.20.30|snap=beta 1.20.30.20|Redstone comparators now use the <code>minecraft:cardinal_direction</code> [[block state]] instead of <code>direction</code>.}}

{{History|console}}
{{History||xbox=TU19|xbone=CU7|ps=1.12|wiiu=Patch 1|switch=1.0.1|[[File:Redstone Comparator (S) JE2 BE1.png|32px]] [[File:Powered Redstone Comparator (S) JE2 BE1.png|32px]] [[File:Subtracting Redstone Comparator (S) JE2 BE1.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) JE2 BE1.png|32px]]{{verify|Was this the model used?}} [[File:Redstone Comparator (item) JE1 BE1.png|32px]] Added redstone comparators.}}
{{History||xbox=TU31|xbone=CU19|ps=1.22|wiiu=Patch 3|switch=1.0.1|Redstone comparators can now measure [[item frame]]s.}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Redstone Comparator (S) BE.png|32px]] [[File:Powered Redstone Comparator (S) BE.png|32px]] [[File:Subtracting Redstone Comparator (S) BE.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) BE.png|32px]]{{verify|Was this the model used?}} [[File:Redstone Comparator (item) JE2 BE2.png|32px]] The textures of redstone comparators have now been changed.}}

{{History|3ds}}
{{History||0.1.0|[[File:Redstone Comparator (S) JE2 BE1.png|32px]] [[File:Powered Redstone Comparator (S) JE2 BE1.png|32px]] [[File:Subtracting Redstone Comparator (S) JE2 BE1.png|32px]] [[File:Powered Subtracting Redstone Comparator (S) JE2 BE1.png|32px]]{{verify|Was this the model used?}} [[File:Redstone Comparator (item) JE2 BE2.png|32px]] Added redstone comparators.}}
{{History|foot}}

=== Redstone comparator "items" ===
{{:Technical blocks/Redstone Comparator}}

== Issues ==
{{issue list}}

== Trivia ==
* Comparators do not emit redstone particles when powered, unlike redstone torches and repeaters.<ref>{{bug|MC-51692|||WAI}}</ref>

== Gallery ==
<gallery>
Dinnerbone Comparator 1.png|Dinnerbone showing how comparators work.
Dinnerbone Comparator 2.png|Dinnerbone showing how comparators work.
Dinnerbone Comparator 3.png|Dinnerbone showing how comparators work.
Dinnerbone Comparators 1.png|A contraption incorporating comparators.
Dinnerbone Comparators 2.png|Comparators in action.
Dinnerbone Comparators 3.png|Output specific signals.
Dinnerbone Comparator Thing.png|Another comparator in use.
Item Frame Comparator.png|Rotating the torch in the item frame adjusts the comparator's output.
</gallery>

== References ==
{{reflist}}

{{Redstone}}
{{Blocks|Utility}}
{{Items}}

[[Category:Mechanics]]
[[Category:Block entities]]
[[Category:Redstone mechanics]]
[[Category:Mechanisms]]
[[Category:Manufactured blocks]]
[[Category:Non-solid blocks]]

[[de:Redstone-Komparator]]
[[es:Comparador de redstone]]
[[fr:Comparateur de redstone]]
[[hu:Redstone-komparátor]]
[[ja:レッドストーンコンパレーター]]
[[ko:레드스톤 비교기]]
[[nl:Redstonevergelijker]]
[[pl:Komparator]]
[[pt:Comparador de redstone]]
[[ru:Компаратор]]
[[uk:Редстоуновий компаратор]]
[[zh:红石比较器]]</li></ul></nowiki>
alpha 0.17.0.1Each sub chunk is now stored separately as a different leveldb key.
Bedrock Edition
1.2.13
{{Extension DPL}}<ul><li>[[Raw Chicken|Raw Chicken]]<br/>{{about|a food item|the mob "chicken"|Chicken}}{{About|a food item|the cooked version|Cooked Chicken}}{{Item
| title = Raw Chicken
| image = Raw Chicken.png
| heals = {{hunger|2}}
| effects = {{EffectLink|Hunger}} (0:30) (30% chance)
| renewable = Yes
| stackable = Yes (64)
}}

'''Raw chicken''' is a [[food]] item that can be eaten by the [[player]]. It can be cooked in a [[furnace]], [[smoker]], or a [[campfire]] to make [[cooked chicken]].

==Obtaining==

===Mob loot ===

Upon death, an adult [[chicken]] drops 1 raw chicken. The maximum is increased by 1 per level of [[Looting]], for a maximum of 1-4 with Looting III. Chickens that die while on [[fire]] drop [[cooked chicken]] instead.

===Cat gifts===
{{main|Cat#Gifts}}

Tamed [[cat]]s have a 70% chance to give the [[player]] a gift as they wake up from a [[bed]], and the gift has a 16.13% chance to be raw chicken.

==Usage==

=== Food===

To eat raw chicken, press and hold {{control|use}} while it is selected in the hotbar. Eating one restores {{hunger|2}} hunger and 1.2 hunger [[Hunger#Mechanics|saturation]], but has a 30% chance of inflicting food poisoning (the {{EffectLink|link=Hunger (status effect)|Hunger}} effect for 30 seconds).

<nowiki>*This has a similar effect as [[Rotten Flesh]].

===Smelting ingredient===

{{Smelting
|showname=1
|Raw Chicken
|Cooked Chicken
|0.35
}}

===Wolves===

Raw chicken can be used to [[breed]] and heal tamed [[wolves]], lead them around, and make baby tamed wolves grow up faster by 10% of the remaining time.

Wolves are at no risk of food poisoning.

===Trading===
Novice-level Butcher villagers have a {{frac|1|3}} chance to buy 14 raw chicken for an emerald.{{only|bedrock}}

Novice-level Butcher villagers have a 50% chance of offering to buy 14 raw chicken for an emerald.{{only|java}}

==Sounds==
{{Sound table/Entity/Food}}

==Data values==

===ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Raw Chicken
|spritetype=item
|nameid=chicken
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Raw Chicken
|spritetype=item
|nameid=chicken
|id=275
|form=item
|foot=1}}

==Advancements ==
{{load advancements|Husbandry;A Balanced Diet}}

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

==History==

{{History|java beta}}
{{History||July 19, 2011|link=https://twitter.com/jeb_/status/93330811608240128|A teaser image for [[cooked chicken]] is revealed by [[Jeb]].}}
{{History||July 19, 2011|link=https://twitter.com/jeb_/status/93946593748852736|[[File:Raw Chicken (pre-release).png|32px]] Jens reveals raw chicken with changed texture based on feedback, saying "the chicken may be too smooth compared to other MC [[item]]s."<ref>https://twitter.com/jeb_/status/93335976298033152</ref>}}
{{History||1.8|snap=Pre-release|[[File:Raw Chicken JE1 BE1.png|32px]] Added raw chicken. 
|Raw chicken is a new [[drops|drop]], obtained by killing a [[chicken]], usually along with a [[feather]].}}
{{History|java}}
{{History||1.2.1|snap=12w03a|Raw chicken can now be used to [[breeding|breed]] wolves.}}
{{History||1.3.1|snap=12w21a|Raw chicken can now be [[trading|sold]] to farmer [[villager]]s, at 14–17 raw chicken for 1 [[emerald]].}}
{{History||1.4.2|snap=12w37a|[[File:Raw Chicken JE2 BE2.png|32px]] The texture of raw chicken has been changed, so that it no longer has a dark outline.}}
{{History||1.8|snap=14w02a|Trading has been changed: butcher [[villager]]s now [[trading|buy]] 14–18 raw chicken for 1 [[emerald]].
|Farmer villagers no longer [[trading|trade]] raw chicken.}}
{{History||1.9|snap=15w43a|[[Chicken]]s can now [[drops|drop]] several raw chickens, if killed with a [[Looting]]-[[enchanting|enchanted]] [[weapon]].}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 365.}}
{{History||1.14|snap=18w43a|[[File:Raw Chicken JE3 BE3.png|32px]] The texture of raw chicken has been changed.}}
{{History|||snap=18w44a|[[Cat]]s now offer raw chicken as [[Cat#Gifts|gift]]s.}}

{{History|pocket alpha}}
{{History||v0.4.0|[[File:Raw Chicken JE1 BE1.png|32px]] Added raw chicken.}}
{{History||v0.5.0|Raw chicken now restores {{hp|2}} instead of {{hp|1}}.}}
{{History||v0.8.0|snap=build 1|[[File:Raw Chicken JE2 BE2.png|32px]] The texture of raw chicken has been changed, so that it no longer has a dark outline.}}
{{History||v0.11.0|snap=build 1|Raw chicken now sometimes inflicts the [[hunger]] effect, despite the hunger bar not existing yet.}}
{{History||v0.12.1|snap=build 1|Raw chicken now restores [[hunger]] instead of [[health]].}}
{{History|pocket}}
{{History||1.0.4|snap=alpha 1.0.4.0|Butcher [[villager]]s now [[trading|buy]] 14-18 raw chicken for one [[emerald]].}}
{{History|bedrock}}
{{History||?|[[Chicken]]s can now [[drops|drop]] several raw chicken, if killed with a [[Looting]]-[[enchanting|enchanted]] [[weapon]].}} 
{{History||1.8.0|snap=beta 1.8.0.8|Tamed [[cat]]s can now give the [[player]] raw chicken as a gift.}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Raw Chicken JE3 BE3.png|32px]] The texture of raw chicken has been changed.}}
{{History||1.11.0|snap=beta 1.11.0.4|Butcher [[villager]]s now have {{frac|1|3}} of a chance to [[trading|buy]] 14 raw chicken.}}

{{History|console}}
{{History||xbox=TU5|xbone=CU1|ps=1.0|wiiu=Patch 1|[[File:Raw Chicken JE1 BE1.png|32px]] Added raw chicken.}}
{{History||xbox=TU12|[[File:Raw Chicken JE2 BE2.png|32px]] The texture of raw chicken has been changed, so that it no longer has a dark outline.}}
{{History|PS4}}
{{History||1.90|[[File:Raw Chicken JE3 BE3.png|32px]] The texture of raw chicken has been changed.}}

{{History|new3DS}}
{{History||0.1.0|[[File:Raw Chicken JE2 BE2.png|32px]] Added raw chicken.}}
{{History|foot}}

==Issues==

{{issue list}}

==Gallery ==
<gallery>
Beta 1.8 Dev Chicken 2.png|First image of raw chicken.
</gallery>

==References==
{{reflist}}

{{Items}}

[[de:Rohes Hühnchen]]
[[es:Pollo crudo]]
[[fr:Poulet cru]]
[[hu:Nyers csirkehús]]
[[ja:生の鶏肉]]
[[ko:익히지 않은 닭고기]]
[[nl:Rauwe kip]]
[[pl:Surowy kurczak]]
[[pt:Frango cru]]
[[ru:Сырая курятина]]
[[th:ไก่ดิบ]]
[[zh:生鸡肉]]
[[Category:Food]]
[[Category:Renewable resources]]</li><li>[[Spyglass|Spyglass]]<br/>{{Item
| title = Spyglass
| image = Spyglass.png
| durability = 
| rarity = Common
| renewable = Yes
| stackable = No
}}
 
A '''spyglass''' is a [[tool]] used to zoom in on distant objects.

== Obtaining ==
=== Crafting ===
{{Crafting
  |B1=Amethyst Shard
  |B2=Copper Ingot
  |B3=Copper Ingot
  |Output=Spyglass
  |type=Tool
}}

== Usage ==
[[File:Steve scoping Spyglass.png|right|100px]] [[File:Alex scoping Spyglass.png|right|100px]]

To use a spyglass, the player selects it from the hotbar and clicks {{control|use}} while looking in the desired direction.

Spyglasses are used to zoom in on a specific location in the player's field of view (FOV). The spyglass changes the FOV to {{frac|1|10}} of the FOV set in [[options]]. By default, the FOV is set to 70° in ''Java Edition'' and 60° in Bedrock Edition, resulting in an FOV of 7° in ''Java Edition'' and 6° in Bedrock Edition through the spyglass. The player's FOV can be set from 30° to 110°, so the spyglass FOV can  range from 3° to 11°. Regardless of the situation, or status effects the player has, using the Spyglass always shows a FOV {{frac|1|10}} of the FOV set in [[options]].

A square vignette is applied when in use, similar to the effect when wearing a [[carved pumpkin]]. Pressing {{key|F1}} removes the vignette,{{only|java}}<ref>{{bug|MC-203575||The spyglass overlay goes away when pressing F1|WAI}}</ref><ref>{{bug|MCPE-125869||Spyglass's overlay don't go away even if the player toggles Hide GUI on/ Pressing F1|}}</ref> similar to a carved pumpkin. 

Hazy distant objects remain hazy when viewed in the spyglass. Mobs too distant to render also do not render in the spyglass. The spyglass shows a magnified view of what the player already sees.

The player is slowed down while watching through the spyglass. When the player uses the spyglass continuously for {{convert|1|minute|game tick}}, the interface is automatically closed.

If the player has a certain effect on their screen like [[fire]], the spyglass does not remove that effect on the player's screen.

[[File:Spyglass Zooming.gif|thumb|center|A spyglass being used to zoom in on a [[block of gold]] starting from normal FOV (70°).]]

== Sounds ==
{{edition|java}}:
{{Sound table
|sound=Spyglass use.ogg
|subtitle=Spyglass expands
|source=player
|description=When a player uses a spyglass
|id=item.spyglass.use
|translationkey=subtitles.item.spyglass.use
|volume=0.5
|pitch=''varies'' <ref group=sound>Can be 1.15, 1.33, 1.4, or 1.55</ref>
|distance=16}}
{{Sound table
|sound=Spyglass stop.ogg
|subtitle=Spyglass retracts
|source=player
|description=When a player stops using a spyglass
|id=item.spyglass.stop_using
|translationkey=subtitles.item.spyglass.stop_using
|volume=0.5
|pitch=''varies'' <ref group=sound>Can be 1.0, 0.8, or 0.9</ref>
|distance=16
|foot=1}}

{{edition|bedrock}}:
{{Sound table
|type=bedrock
|sound=Spyglass use.ogg
|source=player
|description=When a player uses a spyglass
|id=item.spyglass.use
|volume=0.5
|pitch=1.15-1.55}}
{{Sound table
|sound=Spyglass stop.ogg
|source=player
|description=When a player stops using a spyglass
|id=item.spyglass.stop_using
|volume=0.5
|pitch=0.8-1.0
|foot=1}}

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

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Spyglass
|spritetype=item
|nameid=spyglass
|form=item
|foot=1|id=626}}

== Advancements ==
{{load advancements|Is it a Bird?;Is it a Balloon?;Is it a Plane?}}

== History ==
{{History||October 3, 2020|link={{ytl|DBvZ2Iqmm3M|t=25m21s}}|[[File:Spyglass JE1.png|32px]]<!-- [[File:Spyglass scope (pre-release).png|32px]]--> Spyglasses are revealed at [[Minecraft Live 2020]]. They were originally named "telescopes" and had an oval vignette.}}
{{History|java}}
{{History||1.17|snap=20w45a|[[File:Spyglass JE1.png|32px]] Added spyglasses.
|[[File:Spyglass scope JE1.png|32px]] The scope texture is currently a circle with glare spots.}}
{{History|||snap=20w46a|[[File:Spyglass scope JE2.png|32px]] The scope texture is now a [[glass]] square with a [[copper]] border.}}
{{History|||snap=20w48a|[[File:Spyglass JE2 BE1.png|32px]] The spyglass is now a 3D model instead of a flat sprite.
|[[File:Spyglass (texture) JE2.png|32px]] The texture of the spyglass has changed.
|A spyglass in use is anchored better to the player's "eye" when viewed in 3rd person.}}
{{History|||snap=21w05a|Copper ingots are now renewable via [[drowned]], making spyglasses renewable.}}
{{History|||snap=21w10a|[[File:Spyglass (item) JE3 BE1.png|32px]] Spyglasses have a new texture in the inventory. The 3D model is still used in the hand, similar to [[tridents]].}}
{{History||1.17.1|snap=Pre-release 1|[[File:Spyglass (texture) JE3.png|32px]] The texture of the spyglass model has changed.}}
{{History|bedrock}}
{{History||1.17.0|snap=beta 1.17.0.50|[[File:Spyglass JE2 BE1.png|32px]] [[File:Spyglass (item) JE3 BE1.png|32px]] Added spyglasses.}}
{{History|||snap=beta 1.17.0.52|Spyglasses are now available without enabling [[experimental gameplay]].}}
{{History|foot}}

== Issues ==
{{Issue list}}

== Trivia ==
*If {{command|item replace}} is used to place a spyglass on a player's head, the item appears stuck to the center of the player's face.

== Gallery ==
<gallery>
Villager Spyglass.png|Spying on [[villager]]s through a spyglass.
After using the spyglass at FOV 30 F1.png|Hiding the HUD removes the spyglass overlay.
Panda eating a spyglass.png|When eaten by a [[panda]], spyglasses cause [[missing texture]] particles to be produced.<ref>{{bug|MC-206684}}</ref>
JE 1.17 Development Telescope.jpg|The spyglass was originally called the telescope.
JE 1.17 Development Telescope 2.jpg|The telescope's overlay was originally round instead of square.
File:Ari Spyglass.jpg|How the spyglass looks in the third person.
Steve scoping Spyglass JE1.png|Steve using a spyglass before its 3D model was added.
Alex scoping Spyglass JE1.png|Alex using a spyglass before its 3D model was added.
File:Mangrove Portal.jpg|An [[allay]] peeking into view of [[Noor]]’s spyglass.
</gallery>

== References ==
{{Reflist}}

== External Links ==
*[https://www.minecraft.net/en-us/article/taking-inventory--spyglass Taking Inventory: Spyglass] – Minecraft.net on February 17, 2022

{{Items}}

[[Category:Renewable resources]]

[[de:Fernrohr]]
[[es:Catalejo]]
[[fr:Longue-vue]]
[[it:Cannocchiale]]
[[ja:望遠鏡]]
[[pl:Luneta]]
[[pt:Luneta]]
[[ru:Подзорная труба]]
[[zh:望远镜]]</li></ul></nowiki>
?Subchunks are now palleted.[1]

See also[]

References[]

Advertisement