Minecraft Wiki
Advertisement
Information icon
This feature is exclusive to Java Edition. 
This article is about functions in Java Edition. For functions in Bedrock Edition, see Function (Bedrock Edition).
Move arrows
It has been suggested that this page be moved to Function (Java Edition).
If this move affects many pages or may potentially be controversial, do not move the page until a consensus is reached.
 [discuss]
Reason: This page will be a disambiguation page, less confusion between editions.
When moving, be sure to use the appropriate tool instead of simply copying and pasting the page's contents, to preserve edit history.

Functions allow players to run lists of commands using text files with the extension .mcfunction. It is recommended to use UTF-8 encoding (without BOM) for function files to prevent any problems. This page covers how to use functions in Java Edition.

Usage

To utilize functions, the text files must first be placed into a top-level folder within [WORLD_NAME]/datapacks/[DATA_PACK_NAME]/data/[NAMESPACE]/functions. The name of the new top-level folder will be the namespace used when running the functions inside. Functions can also be placed into subfolders within the top-level folder.

For example, running the function custom:example/test will refer to the file located at data/custom/functions/example/test.mcfunction. If the namespace is left out when trying to call a function, it will default to the minecraft: namespace. Using a custom namespace is recommended in order to prevent unintended behavior in the case of future additions to the default namespace.[1]

Functions, being text files, are easily modifiable and less likely than command blocks to induce lag when used in large quantities. If a function is modified or added, using the /reload command will reload the function files from disk. This allows Minecraft to recognize any changes to the function files, without the need to quit and re-enter the world.

Upon successfully running a function, a message will display in the chat: Executed [amount] command(s) from function '[function file directory]'. The successful output of the commands inside a function cannot be measured with a comparator (although the same effect could be accomplished with the use of /stats and /scoreboard commands).

Function syntax

TestingFunctions

Testing the function system. Three /tellraw messages and one /give command were used in this simple function.

Within the .mcfunction file, one valid command is placed per line, without the usual forward slash (/). Players can add comments within the function text file by preceding them with a #.

Individual commands in functions can be longer than the 32,500 character limit in command blocks but the total number of commands run inside a function will still obey /gamerule maxCommandChainLength, which is 65,536 commands by default; any commands beyond this limit will be ignored.

Running a function

Functions will run all of their commands in a single tick and functions called from within other functions will also run their commands in the same tick as their parent. Functions will use the command environment of whatever called the function. This includes command sender, position, rotation, etc.

Changes to the command environment that happen within a function will not affect the command environment used by the other commands within that same function (or within its child functions) until the next iteration, regardless of the order of commands. The /execute command is an exception and will update the command environment.

For example:

execute as @a at @s run function foo:bar

foo:bar

teleport @s ~ ~5 ~
setblock ~ ~-1 ~ emerald_block
execute at @s run setblock ~ ~-1 ~ diamond_block

When called through a player this function will teleport that player 5 blocks up, place an emerald block one block below their original position before the teleport, and place a diamond block one block below their new position after the teleport. This behavior does not affect target selector arguments.

There are several methods of running a function file in-game:

Commands

/function
  • Allows players to run a function once.
  • The commands in the function are run through the entity or command block that ran the /function command.
  • The optional arguments if and unless will make the function only run when the selector was found or not found in the world respectively.
  • Usage: /function <name>

Advancements

Advancements can run a function once as a reward for completing them. The commands in the function are run through the player who completed the advancement.

Reward functions are called within advancement JSON files using the following format:

{
    "rewards": {
        "function": "namespace:path/to/function/file"
    }
}

Tags

Functions can be grouped together using tags in data packs. These tags can then be called to run all the functions inside that tag with /function #(namespace):tag.

Functions tagged in minecraft:tick will automatically run every tick at the beginning of the tick. Functions tagged in minecraft:load will run after (re)loading the datapack.

History

Java Edition
1.12
{{Extension DPL}}<ul><li>[[Yellow Dye|Yellow Dye]]<br/>{{Item
| title = Yellow Dye
| renewable = Yes
| stackable = Yes (64)
}}
'''Yellow dye''' is a [[Dye#Primary|primary dye]] created by placing a [[dandelion]] or [[sunflower]] into a [[crafting]] grid.

== Obtaining ==

=== Crafting ===
{{Crafting
  |Dandelion;Sunflower
  |Output=Yellow Dye;Yellow Dye,2
  |type=Material
}}

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

=== Trading ===

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

== Usage ==
{{dye usage}}

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

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

=== Trading ===
Expert-level shepherd villagers have a {{frac|1|6}} chance to buy 12 yellow dye for an emerald.

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

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|showaliasids=y
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Yellow Dye
|spritetype=item
|nameid=yellow_dye
|aliasid=dye / 11
|id=406
|form=item
|translationkey=item.dye.yellow.name
|foot=1}}

== Video ==
{{yt|nOQUDjEHGRg}}

== History ==
{{History|java beta}}
{{History||1.2|[[File:Yellow Dye JE1 BE1.png|32px]] Added dandelion yellow.}}
{{History||1.6.6|Dandelions can now be generated using [[Bone Meal|bone meal]], making dandelion yellow [[renewable resource|renewable]].}}
{{History|java}}
{{History||1.4.2|snap=12w34a|Added the ability to [[Armor#Dyeing|dye]] leather [[armor]] and [[wolf]] collars.}}
{{History||1.4.6|snap=12w49a|Dandelion yellow can be crafted with [[gunpowder]] to create a [[firework star]].}} 
{{History||1.6.1|snap=13w19a|[[Stained clay]] can now be crafted.}}
{{History||1.7.2|snap=13w36a|Can now be crafted using sunflower.}}
{{History|||snap=13w37a|Each dandelion now yields only 1 dandelion yellow, instead of 2.}}
{{History|||snap=13w41a|[[Stained glass]] can now be [[crafting|crafted]].}}
{{History||1.8|snap=14w30a|Added [[banner]]s, which can be [[dye]]d.}}
{{History||1.11|snap=16w39a|Added the ability to dye [[shulker box]]es.}}
{{History||1.12|snap=17w06a|Yellow dye can now be used to craft yellow [[concrete powder]].}}
{{History|||snap=17w15a|Added the ability to dye [[bed]]s.}}
{{History||1.13|snap=17w47a|The different data values for the <code>dye</code> ID have now been split up into their own IDs.
|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 351.}}
{{History||1.14|snap=18w43a|"Dandelion Yellow" has now been renamed to "Yellow Dye".
|[[File:Yellow Dye JE2 BE2.png|32px]] The texture of yellow dye has now been changed.}}
{{History|||snap=18w44a|Yellow dye can now change the text color on [[sign]]s to yellow.}}
{{History|||snap=18w49a|Yellow dye can now be found in [[chest]]s in [[village]] mason houses.}}
{{History|||snap=19w05a|Added the [[wandering trader]], which sells yellow dye.}}
{{History|||snap=19w11a|Yellow dye can now be [[trading|bought]] by shepherd villagers.}}
{{History||1.17|snap=20w45a|Yellow dye can now be used to craft [[yellow candle]]s.}}
{{History|||snap=21w19a|Yellow dye can no longer be used to craft yellow candles.}}
{{History|||snap=Pre-release 1|Yellow dye can once again used to craft yellow candles.}}
{{History||1.20<br>(Experimental)|link=1.19.3|snap=22w42a|Yellow dye can now change the text color on [[hanging sign]]s to yellow.}}
{{History||1.20|snap=23w12a|Yellow dye can now be found in [[suspicious gravel]] and [[suspicious sand]] in [[trail ruins]].}}
{{History|||snap=23w16a|Yellow dye no longer generates in [[suspicious sand]] in [[trail ruins]].|Due to the split of the archaeological loot tables for suspicious gravel within [[trail ruins]], yellow dye is now common loot.}}

{{History|pocket alpha}}
{{History||v0.3.0|[[File:Yellow Dye JE1 BE1.png|32px]] Added dandelion yellow.}}
{{History||v0.8.0|snap=build 1|Dandelion yellow is now used to craft [[cocoa beans]].}}
{{History||v0.14.0|snap=build 1|Yellow dye can now be used to dye [[water]] in [[cauldron]]s.}}
{{History||v0.16.0|snap=build 1|Dandelion yellow is no longer used to [[crafting|craft]] cocoa beans.}}
{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|Yellow dye can now be used to dye [[shulker]]s.}}
{{History||1.1.0|snap=alpha 1.1.0.0|Yellow dye can now be used to dye [[shulker box]]es, [[bed]]s, and craft [[concrete powder]].}}
{{History|bedrock}}
{{History||1.2.0|snap=beta 1.2.0.2|Yellow dye can now be used to craft patterns on [[banner]]s, [[firework star]]s, and [[stained glass]].}}
{{History||1.4.0|snap=beta 1.2.20.1|Yellow dye can now be used to craft [[balloon]]s and [[glow stick]]s.}}
{{History||1.8.0|snap=beta 1.8.0.8|Dandelion yellow can now be used to dye [[cat]] collars.}}
{{History|||snap=beta 1.8.0.10|"Dandelion Yellow" has now been renamed to "Yellow Dye".}}
{{History||1.10.0|snap=beta 1.10.0.3|Yellow dye is now [[trading|sold]] by [[wandering trader]]s.
|[[File:Yellow Dye JE2 BE2.png|32px]] The texture of yellow dye has now been changed.}}
{{History||1.11.0|snap=beta 1.11.0.1|Yellow dye can now be found in [[village]] mason [[chest]]s.}}
{{History|||snap=beta 1.11.0.4|Yellow dye can now be sold to shepherd [[villager]]s.}}
{{History||1.16.100|snap=beta 1.16.100.56|The ID of yellow dye has been changed from <code>dye/11</code> to <code>yellow_dye</code>.}}

{{History|console}}
{{History||xbox=TU1|xbone=CU1|ps=1.00|switch=1.0.1|wiiu=Patch 1|[[File:Yellow Dye JE1 BE1.png|32px]] Added dandelion yellow.}}
{{History|ps4}}
{{History||1.83|"Dandelion Yellow" has now been renamed to "Yellow Dye".}}
{{History||1.90|[[File:Yellow Dye JE2 BE2.png|32px]] The texture of yellow dye has now been changed.}}

{{History|new 3ds}}
{{History||0.1.0|[[File:Yellow Dye JE1 BE1.png|32px]] Added dandelion yellow.}}
{{History|foot}}

== Issues ==

{{issue list}}

== References ==

{{reflist}}

{{Items}}

[[cs:Pampelišková žluť]]
[[de:Gelber Farbstoff]]
[[es:Tinte amarillo]]
[[fr:Teinture jaune]]
[[hu:Pitypangsárga]]
[[ja:黄色の染料]]
[[ko:노란색 염료]]
[[nl:Paardenbloemgeel]]
[[pl:Żółty barwnik]]
[[pt:Corante amarelo]]
[[ru:Жёлтый краситель]]
[[zh:黄色染料]]

[[Category:Items]]
[[Category:Dyes]]
[[Category:Renewable resources]]</li><li>[[Glow Berries|Glow Berries]]<br/>{{Block
|image=<gallery>
Cave Vines (head).png|Without Berries
Cave Vines (berries).png|With Berries
</gallery>
|image2 = Glow Berries JE1 BE1.png
|extratext=[[#Gallery|View all renders]]
|rarity=Common
|renewable=Yes
|stackable=Yes (64)
|tool=Any
|light=Yes
|transparent=Yes
|heals={{hunger|2}}
|flammable=Yes
|lavasusceptible=No
}}

'''Glow berries''' are a [[food]] [[item]] obtained from cave vines and can be used to plant them.

'''Cave vines''' are a climbable, [[Bone Meal|bonemealable]] plant that hangs off ceilings and grows glow berries. Cave vines with glow berries produce [[light]] and drop glow berries when broken or harvested. Cave vines with no glow berries will not drop anything.

== Obtaining ==

=== Natural generation ===
Cave vines can be found in [[lush caves]], hanging from cave ceilings.

=== Chest loot ===
{{LootChestItem|glow-berries}}

=== Post-generation ===
Glow berries can be collected from a cave vine by {{control|using}} or {{control|breaking}} the vine. This yields one glow berry when the vine is bearing them and nothing when it is not.  A cave vine also breaks if [[water]] runs over its location or if a [[piston]] extends or pushes a block into its location. 

{{IN|bedrock}}, using a tool with [[Silk Touch]] on cave vines always yields a glow berry, even if the vine appears empty.

[[Fortune]] has no effect on the number of glow berries dropped.

== Usage ==
=== Placement ===
Glow berries can be placed on and grown from the bottom of most blocks. They have no specific lighting requirements. When placed, they can be of any length.

=== Growth ===
Placing glow berries on the bottom of a block creates a cave vine that grows downward one block at a time as long as [[air]] is beneath it and its maximum height (2 to 26 blocks) has not been reached. Each newly-grown cave vine block has a 1 in 9 chance of bearing glow berries.  Only this tip can ever naturally grow them.{{only|JE}}{{More info|exact growth rate and chance to bear glow berries}}

{{control|Using}} [[bone meal]] on a cave vine produces glow berries if the vine was not bearing any.

{{IN|Java}}, cave vines stop growing if [[shears]] are {{control|used}} on the tip.

{{IN|bedrock}}, if placing glow berries in the Nether, cave vines are able to grow and produces glow berries.

=== Food ===
To eat glow berries, press and hold {{control|use}} while it is selected in the hotbar. Eating one restores {{hunger|2}} [[hunger]] and 0.4 hunger [[Hunger#Mechanics|saturation]] points, like [[sweet berries]].

=== Light ===
When bearing glow berries, cave vines give off a [[light]] level of 14.

=== Composting ===
Placing glow berries into a [[composter]] by {{control|using}} them on it has a 30% chance of raising the compost level by 1.

=== Breeding ===
Glow berries can be fed to [[fox]]es to [[breeding|breed]] them. Foxes are similar to cats when being fed as a wild animal; a sudden movement by the player may cause the fox to flee even if the player holds glow berries. The resulting baby fox trusts the [[player]] and does not flee.

Glow berries can be {{control|used}} on baby foxes to reduce the time until they grow by 10%.

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

===Cave vines===
====Generic====
{{Sound table/Block/Cave vines}}

==== Unique ====
{{edition|java}}:
{{Sound table
|sound=Berries pick1.ogg
|sound2=Berries pick2.ogg
|subtitle=Berries pop
|source=block
|description=When glow berries are picked
|id=block.cave_vines.pick_berries
|translationkey=subtitles.item.berries.pick
|volume=1.0
|pitch=0.8-1.2
|distance=16}}
{{Sound table
|sound=Shear.ogg
|subtitle=Plant cropped
|source=block
|description=When the tip of cave vines are cropped with [[Shears#Cropping growing plants|shears]]
|id=block.growing_plant.crop
|translationkey=subtitles.block.growing_plant.crop
|volume=1.0
|pitch=1.0
|distance=16
|foot=1}}

{{edition|bedrock}}:
{{Sound table
|type=bedrock
|sound=Berries pick1.ogg
|sound2=Berries pick2.ogg
|source=block
|description=When glow berries are picked
|id=pick_berries.cave_vines
|volume=1.0
|pitch=0.8-1.2
|foot=1}}

==Data values==
===ID===
{{edition|java}}:
{{ID table
|edition=java
|showblocktags=y
|showitemtags=y
|showforms=y
|generatetranslationkeys=y
|displayname=Cave Vines
|spritetype=block
|nameid=cave_vines
|blocktags=cave_vines,lush_plants_replaceable
|form=block
}}
{{ID table
|displayname=Cave Vines Plant
|spritetype=block
|nameid=cave_vines_plant
|blocktags=cave_vines,lush_plants_replaceable
|form=block
}}
{{ID table
|displayname=Glow Berries
|spritetype=item
|nameid=glow_berries
|itemtags=fox_food
|form=item
|foot=1}}

{{el|be}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|generatetranslationkeys=y
|displayname=Cave Vines
|nameid=cave_vines
|spritetype=block
|id=577}}
{{ID table
|displayname=Cave Vines Body With Berries
|nameid=cave_vines_body_with_berries
|spritename=lit-cave-vines-plant
|spritetype=block
|id=630}}
{{ID table
|displayname=Cave Vines Head With Berries 
|spritename=lit-cave-vines
|nameid=cave_vines_head_with_berries
|spritetype=block
|id=631}}
{{ID table
|displayname=Glow Berries
|spritetype=item
|nameid=glow_berries
|form=item
|id=638
|foot=1}}

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

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

==History==
{{History||October 3, 2020|link={{ytl|DWZIfsaIgtE|t=1781}}|[[File:Cave Vines Plant JE1 BE1.png|32px]] [[File:Cave Vines Plant (berries) JE1 BE1.png|32px]] [[File:Cave Vines (head) JE1 BE1.png|32px]] [[File:Cave Vines (berries) JE1 BE1.png|32px]] Cave vines (named as glow berries) are shown as part of lush caves at [[Minecraft Live 2020]].}}
{{History|java}}
{{History||1.17|snap=21w05a|[[File:Glow Berries JE1 BE1.png|32px]] Added glow berries.
|[[File:Cave Vines Plant JE1 BE1.png|32px]] [[File:Cave Vines Plant (berries) JE1 BE1.png|32px]] [[File:Cave Vines (head) JE1 BE1.png|32px]] [[File:Cave Vines (berries) JE1 BE1.png|32px]] Added cave vines.}}
{{History|||snap=21w11a|Renamed from "cave vines head" and "cave vines body" to "cave vines" and "cave vines plant", respectively.
|The IDs have also changed.
|Cave vines now always give 14 light, regardless of the type of part.
|Now slow down the player.
|Can now be climbed.}}
{{History|||snap=21w13a|Glow berries now generate as loot in [[mineshaft]] [[Minecart with Chest|chest minecarts]].}}
{{History||1.18|snap=Experimental Snapshot 1|With the implementation of cave biomes including lush caves, caves vines can now generate in normal worlds.}}
{{History|||snap=21w37a|Cave vines stop growing if [[shears]] are used on the tip.}}
{{History|||snap=21w41a|[[File:Cave Vines Plant JE2.png|32px]] [[File:Cave Vines Plant (berries) JE2.png|32px]] Changed cave vines plant texture.}}
{{History||1.19|snap=22w13a|Glow Berries may now be found in [[ancient city]] [[chest]]s.}}

{{History|bedrock}}
{{History||Caves & Cliffs (experimental)|link=Bedrock Edition 1.17.0|snap=beta 1.16.220.52|[[File:Glow Berries JE1 BE1.png|32px]] Added glow berries.
|[[File:Cave Vines Plant JE1 BE1.png|32px]] [[File:Cave Vines Plant (berries) JE1 BE1.png|32px]] [[File:Cave Vines (head) JE1 BE1.png|32px]] [[File:Cave Vines (berries) JE1 BE1.png|32px]] Added cave vines.}}
{{History||1.17.0|snap=beta 1.16.230.54|Glow Berries now generate as loot in [[mineshaft]] [[Minecart with Chest|chest minecarts]].}}
{{History|||snap=beta 1.17.0.52|Glow Berries are now available without enabling [[experimental gameplay]].}}
{{History||1.17.20|snap=beta 1.17.20.20|Cave Vines can now be pollinated by [[bee]]s.}}
{{History||1.18.10|snap=beta 1.18.10.20|[[File:Cave Vines Plant JE2.png|32px]] [[File:Cave Vines Plant (berries) JE2.png|32px]] Changed cave vines plant texture.}}
{{History||1.19.20|snap=beta 1.19.20.20|Cave vines can now be destroyed by [[ravagers]].}}
{{History|foot}}

<gallery>
Lush_caves_overview_concept_art.jpg|Concept art for the lush caves and vegetation including Glow Berries.
JE_1.17_Development_Lush_Caves.jpg|A view of the lush caves with glow berries from Minecraft Live 2020.
Lushcaves_minecon.png|Lush cave in MINECON.
Cavesworkinprogress.jpg|A view of the lush caves with glow berries, tweeted by LadyAgnes.
Livestream_lush_cave.jpg|Another view of the lush caves with glow berries, in an interview with LadyAgnes.
Glow Berry Fox.jpg|A fox under a glow berry vine.
</gallery>

===Cave vines "item"===
{{:Technical blocks/Cave Vines}}

==Issues==
{{Issue list}}

==Trivia==
*They are the first item to be usable as both a food and a light source.

==Gallery==
<gallery>
Cave Vines (plant).png
Cave Vines (berries, plant).png
Cave Vines (head).png
Cave Vines (berries).png
Cave_Vines_Age2_(Possibility_pattern_1)_JE1.png|A possible pattern of the cave vines at Age 2.
Cave_Vines_Age2_(Possibility_pattern_2)_JE1.png|And another pattern.
</gallery>

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

[[Category:Food]]
[[Category:Plants]]
[[Category:Natural blocks]]
[[Category:Non-solid blocks]]
[[Category:Light sources]]
[[Category:Flammable blocks]]
[[Category:Climbable blocks]]

[[de:Leuchtbeeren]]
[[es:Bayas luminosas]]
[[fr:Baies lumineuses]]
[[it:Bacche luminose]]
[[ja:グロウベリー]]
[[pt:Bagas brilhantes]]
[[ru:Светящиеся ягоды]]
[[zh:发光浆果]]</li></ul>
pre1Added functions.
pre3Commands are no longer allowed to begin with a / (forward slash)
Comments can now only be preceded with #; using // is no longer allowed
pre4Added new arguments to the /function command: [if|unless] [selector]
pre6Skipped functions (when a conditional fails) are now considered failures when used in commands.
1.13
{{Extension DPL}}<ul><li>[[Sugar|Sugar]]<br/>{{Item
| image = Sugar.png
| renewable = Yes
| stackable = Yes (64)
}}
'''Sugar''' is a [[food]] ingredient and [[brewing]] ingredient made from [[sugar canes]].

== Obtaining ==

=== Mob loot ===

[[Witch]]es have a chance of dropping 0–2 sugar upon death. This is increased by 1 per level of [[Looting]], for a maximum of 0–5 sugar.

=== Crafting ===
{{Crafting
 |head= 1
 |Sugar Cane
 |Output= Sugar
 |type= Material

}}
{{Crafting
 |Honey Bottle
 |Output= Sugar, 3
 |type= Material
 |foot= 1
}}

=== Compound creation ===

Sugar can be created from its base [[element]]s, using the [[compound creator]].{{only|bedrock|education}}

{| class="wikitable"
!Name
!Elements
!Example recipe
|- <!-- Temporarily using crafting grid as a substitute for the compound creator (template not yet available), since the layout is the same, even if the appearance is different -->
!Sugar
|6 Carbon<br>12 Hydrogen<br>6 Oxygen
|{{Crafting Table
|shapeless= 1
|A2=Carbon,6 |B2=Hydrogen,12 |C2=Oxygen,6
|Output=Sugar}}
|}

== Usage ==

=== Crafting ingredient ===

{{crafting usage}}

=== Brewing ingredient ===

{{Brewing
  |head=1
  |Sugar
  |Mundane Potion
  |base=Water Bottle
}}
{{brewing
  |foot=1
  |showname=1
  |Sugar
  |Potion of Swiftness
}}

=== Horses ===

Sugar can be fed to [[horse]]s to heal {{hp|1}}, speed growth by 30 seconds, and increase taming probability by 3%.

== Achievements ==
{{load achievements|The Lie}}

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

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|notshowbeitemforms=y
|shownumericids=y
|showforms=y
|generatetranslationkeys=y
|displayname=Sugar
|spritetype=item
|nameid=sugar
|id=416
|form=item
|foot=1}}

== Video ==

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

== History ==

{{History|java beta}}
{{History||1.2|[[File:Sugar JE1 BE1.png|32px]] Sugar has been introduced as an ingredient for [[cake]].}}
{{History|java}}
{{History||1.0.0|snap=Beta 1.9 Prerelease 2|Sugar is now used to craft [[fermented spider eye]]s.}}
{{History|||snap=Beta 1.9 Prerelease 3|Sugar can now be [[brewing|brewed]] in a [[water bottle]] to create a [[Mundane Potion]], or in an [[Awkward Potion]] to create a [[Potion of Swiftness]].}}
{{History||1.4.2|snap=12w37a|Sugar is now used to make [[pumpkin pie]].}}
{{History|||snap=12w38b|[[Witch]]es can now [[drops|drop]] sugar.}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 353.}}
{{History||1.14|snap=18w43a|[[File:Sugar JE2 BE2.png|32px]] The texture of sugar has been changed.}}
{{History||1.15|snap=19w34a|Sugar can now can be created using 1 [[honey bottle]].}}

{{History|pocket alpha}}
{{History||v0.2.0|[[File:Sugar JE1 BE1.png|32px]] Added sugar. It is currently unobtainable and serves no purpose.}}
{{History||v0.3.0|Sugar is now [[craft]]able using [[sugar cane]].}}
{{History||v0.7.0|Sugar is now used to craft [[cake]].}}
{{History||v0.8.0|snap=build 1|Sugar is now used to craft [[pumpkin pie]].}}
{{History||v0.12.1|snap=build 1|Sugar has been added to the [[creative]] [[inventory]].|Sugar is now used to craft [[fermented spider eye]]s.
|Sugar can now be used for [[brewing]], to get mundane [[potion]]s and potions of [[Swiftness]].}}
{{History||v0.14.0|snap=build 1|Added [[witch]]es, which can [[drops|drop]] sugar upon [[death]].}}
{{History||v0.15.0|snap=build 1|Sugar can now be used to feed [[horse]]s, which can increase their temper, heal them, and speed up the growth of foals.}}
{{History|bedrock}}
{{History||1.4.0|snap=beta 1.2.20.1|Sugar can now be created using 6 Carbon, 12 Hydrogen, and 6 Oxygen in the [[compound creator]].}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Sugar JE2 BE2.png|32px]] The texture of sugar has been changed.}}
{{History||1.14.0|snap=beta 1.14.0.1|Sugar can now be created using 1 [[honey bottle]].}}

{{History|console}}
{{History||xbox=TU1|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|[[File:Sugar JE1 BE1.png|32px]] Added sugar.
|Sugar is used to craft [[cake]].}}
{{History||xbox=TU7|Sugar is now used to craft [[fermented spider eye]]s.|Sugar can now be [[brewing|brewed]] in a [[water bottle]] to create a [[Mundane Potion]], or in an [[Awkward Potion]] to create a [[Potion of Swiftness]].}}
{{History||xbox=TU14|ps=1.04|Sugar is now used to make [[pumpkin pie]].}}
{{History||xbox=TU19|xbone=CU7|ps=1.12|wiiu=Patch 1|switch=1.0.1|[[Witch]]es can now [[drops|drop]] sugar.}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Sugar JE2 BE2.png|32px]] The texture of sugar has been changed.}}

{{History|New 3DS}}
{{History||0.1.0|[[File:Sugar JE1 BE1.png|32px]] Added sugar.}}
{{History|foot}}

== Issues ==
{{issue list}}

== External Links ==
*[https://www.minecraft.net/en-us/article/taking-inventory--sugar Taking Inventory: Sugar] – Minecraft.net on January 27, 2022

{{Items}}

[[cs:Cukr]]
[[de:Zucker]]
[[es:Azúcar]]
[[fr:Sucre]]
[[hu:Cukor]]
[[it:Zucchero]]
[[ja:砂糖]]
[[ko:설탕]]
[[nl:Suiker]]
[[pl:Cukier]]
[[pt:Açúcar]]
[[ru:Сахар]]
[[th:น้ำตาล]]
[[uk:Цукор]]
[[zh:糖]]
[[Category:Renewable resources]]
[[Category:Brewing recipe]]</li><li>[[Beetroot Seeds|Beetroot Seeds]]<br/>{{Block
| group = Age 0
| 1-1 = Beetroots Age 0.png
| 1-2 = Beetroots Age 0 BE.png
| group2 = Age 1
| 2-1 = Beetroots Age 1.png
| 2-2 = Beetroots Age 1 BE.png
| group3 = Age 2
| 3-1 = Beetroots Age 2.png
| 3-2 = Beetroots Age 2 BE.png
| group4 = Age 3
| 4-1 = Beetroots Age 3.png
| 4-2 = Beetroots Age 3 BE.png
|image=Beetroot Seeds JE2 BE2.png
|transparent=Yes
|light=No
|tool=Any
|renewable=Yes
|stackable=Yes (64)
|flammable=No
|lavasusceptible=No
}}
'''Beetroot seeds''' are items that can be used to plant beetroot crops.

'''Beetroot crops''' are planted in [[farmland]] and used to grow [[beetroot]] and beetroot seeds.

== Obtaining ==

=== Natural generation ===
[[Village]] farms have a chance of growing beetroot. The exact chance depends on the village:

{| class="wikitable"
! Village style !! Chance
|-
| {{EnvSprite|desert-village}} Desert || 20%
|-
| {{EnvSprite|plains-village}} Plains || 5%
|}

=== Breaking ===
Harvesting fully-grown beetroot yields from 1 to 4 seeds per crop harvested ({{frac|2|5|7}} seeds per crop harvested on average). The [[Fortune]] enchantment can be used to improve the drop rate.

=== Chest loot ===
{{LootChestItem|beetroot-seeds}}

=== Trading ===

Beetroot seeds are sold by [[wandering trader]]s for one [[emerald]].

== Usage ==

=== Farming ===
Beetroot seeds can be placed on [[farmland]]. After being placed, it goes through four stages of growth. When fully grown it can be broken to produce beetroot seeds and beetroots.

<!-- Java Edition only? -->While beetroot crops have only four growth stages compared to eight for [[wheat]], [[carrot]]s, and [[potato]]es, each growth tick has a {{frac|1|3}} chance of not advancing the growth stage and therefore beetroot grows slightly faster than other crops.

Crops grow faster if the farmland they are planted in is [[Farmland#Hydration|hydrated]]. One application of [[bonemeal]] has a 75% chance of advancing growth by one stage. This is less effective than for other crops: an average of {{frac|5|1|3}} are needed to fully grow beetroot compared to {{frac|2|2|7}} for other crops.

=== Breeding ===
Like other [[seeds]], beetroot seeds can be used to [[breed]] [[chicken]]s, lead chickens around, and make baby chickens grow up faster by 10% of the remaining time.

=== Taming ===

Like other seeds, beetroot seeds can be used to tame [[parrot]]s.

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

=== Trading ===
[[Wandering trader]]s may offer to sell beetroot seeds for one emerald.

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

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showblocktags=y
|showforms=y
|generatetranslationkeys=y
|displayname=Beetroots
|spritetype=block
|nameid=beetroots
|blocktags=bee_growables, crops
|form=block}}
{{ID table
|displayname=Beetroot Seeds
|spritetype=item
|nameid=beetroot_seeds
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|generatetranslationkeys=y
|displayname=Beetroots
|spritetype=block
|nameid=beetroot
|id=244
|form=block
|itemform=item.beetroot}}
{{ID table
|displayname=Beetroot Seeds
|spritetype=item
|nameid=beetroot_seeds
|id=295
|form=item
|foot=1}}

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

== Advancements ==
{{load advancements|A Seedy Place}}

== History ==
{{History|java}}
{{History||1.9|snap=15w31a|[[File:Beetroot Seeds JE1 BE1.png|32px]] Added beetroot seeds.
|[[File:Beetroots Age 0 JE1.png|32px]] [[File:Beetroots Age 1 JE1.png|32px]] [[File:Beetroots Age 2 JE1.png|32px]] [[File:Beetroots Age 3 JE1.png|32px]] Added beetroot crops.
|Beetroot seeds can be found in [[end city]] [[chest]]s.
|Beetroot plants naturally generate in [[village]] farms.
|[[Villager]]s are able to harvest beetroot crops, but they are not yet able to pick up the seeds and plant them.}}
{{History|||snap=15w38a|The [[drop]] chances have been greatly improved from the average {{frac|4|5}} per beetroot crop harvested to 2.
|Villagers are now able to pick up and plant beetroot seeds.}}
{{History|||snap=15w44a|Beetroots now generate in [[dungeon]] and [[mineshaft]] chests.}}
{{History||1.11|snap=16w39a|Beetroot seeds are now found in the new [[woodland mansion]] chests.}}
{{History||1.12|snap=17w18b|Placing a beetroot seeds in farmland now gives the player the "A Seedy Place" [[advancement]].{{verify}}}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this item's numeral ID was 458 and block's numeral ID was 244.}}
{{History||1.14|snap=18w43a|[[File:Beetroot Seeds JE2 BE2.png|32px]] The texture of beetroot seeds has been changed.
|[[File:Beetroots Age 0 JE2.png|32px]] [[File:Beetroots Age 1 JE2.png|32px]] [[File:Beetroots Age 2 JE2.png|32px]] [[File:Beetroots Age 3 JE2.png|32px]] The textures of beetroot crops have been changed.}}
{{History|||snap=18w49a|Beetroot seeds can now be found in chests in [[snowy tundra]] village houses.}}
{{History|||snap=19w03a|Placing beetroot seeds into the new [[composter]] has a 10% chance of raising the compost level by 1.}}
{{History|||snap=19w05a|Beetroot seeds now have a 30% chance of increasing the compost level in a composter.
|Added [[Wandering Trader|wandering trader]]s, which sell beetroot seeds.}}
{{History||1.15|snap=19w34a|[[Bee]]s can now pollinate beetroot crops.}}
{{History||1.17|snap=21w13a|[[File:Beetroots Age 0 JE3.png|32px]] [[File:Beetroots Age 1 JE3.png|32px]] [[File:Beetroots Age 2 JE3.png|32px]] [[File:Beetroots Age 3 JE3.png|32px]] The "crop" template model has changed such that pixels appear in the same physical positions on opposite sides of texture planes, changing the beetroot crop's appearance in the process.<ref>{{bug|MC-199242|||Fixed}}</ref>}}
{{History||1.18|snap=Pre-release 5|[[File:Beetroot Seeds JE3.png|32px]] The texture of beetroot seeds has been changed.}}
{{History||1.20|snap=23w12a|Beetroot seeds can now be found in [[suspicious gravel]] and [[suspicious sand]] in [[trail ruins]].}}
{{History|||snap=23w16a|Beetroot seeds 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]]; beetroot seeds now are in the common loot.}}

{{History|pocket alpha}}
{{History||November 14, 2013|link=https://twitter.com/jbernhardsson/status/400902957782147072|[[Johan Bernhardsson]] previewed an image of beetroot seeds.}}
{{History||v0.8.0|snap=build 2|[[File:Beetroot Seeds JE1 BE1.png|32px]] Added Beetroots seeds.
|[[File:Beetroots Age 0 JE1 BE1.png|32px]] [[File:Beetroots Age 1 JE1 BE1.png|32px]] [[File:Beetroots Age 2 JE1 BE1.png|32px]] [[File:Beetroots Age 3 JE1 BE1.png|32px]]{{verify|Correct models?}} Added Beetroots crops.}}
{{History|||snap=build 3|Beetroots seeds now have a chance of dropping when tilling [[grass block]]s.}}
{{History||v0.11.0|snap=build 1|"Beetroots seeds" have been renamed to "Beetroot Seeds" and the capitalization has now also been fixed.<ref>{{bug|MCPE-7953|||Fixed}}</ref>}}
{{History||v0.12.1|snap=build 1|Beetroot seeds no longer have a chance of dropping when tilling [[grass block]]s.}}
{{History||v0.14.0|snap=build 1|Beetroot seeds can now be found in [[minecart with chest]]s inside of [[mineshaft]]s.}}
{{History||v0.16.2|Beetroot seeds can now be found in [[chest]]s inside the large house in [[ice plains]] and [[cold taiga]] [[village]]s.}}
{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|Beetroot seeds can now be found in the [[chest]]s of [[dungeon]]s and [[end city|end cities]].}}
{{History||1.1.0|snap=alpha 1.1.0.0|Beetroot seeds can now be found in [[woodland mansion]] chests.}}
{{History|bedrock}}
{{History||1.2.0|snap=beta 1.2.0.2|Beetroot seeds can now be found inside [[bonus chest]]s.
|Beetroot seeds can now be used to tame [[parrot]]s.}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Beetroot Seeds JE2 BE2.png|32px]] The texture of beetroot seeds has been changed.
|[[File:Beetroots Age 0 JE2.png|32px]] [[File:Beetroots Age 1 JE2.png|32px]] [[File:Beetroots Age 2 JE2.png|32px]] [[File:Beetroots Age 3 JE2.png|32px]]{{verify|Correct models?}} The textures of beetroot crops have been changed.
|Beetroot seeds are now [[trading|sold]] by the new [[wandering trader]]s.}}
{{History||1.11.0|snap=beta 1.11.0.1|Beetroot seeds can now be used to fill the [[composter]].
|Beetroot seeds can now be found in [[snowy tundra]] [[village]] house [[chest]]s.}}
{{History||1.14.0|snap=beta 1.14.0.1|[[Bee]]s can now pollinate beetroot crops.}}
{{History||?|[[File:Beetroots Age 0 BE.png|32px]] [[File:Beetroots Age 1 BE.png|32px]] [[File:Beetroots Age 2 BE.png|32px]] [[File:Beetroots Age 3 BE.png|32px]] Potato crop planes use a mapping that results in very unnatural mirroring when viewed from certain angles, such as northwest.<ref>{{bug|MCPE-146936}}</ref>}}

{{History|console}}
{{History||xbox=TU43|xbone=CU33|ps=1.36|wiiu=Patch 13|[[File:Beetroot Seeds JE1 BE1.png|32px]] Added beetroot seeds.
|[[File:Beetroots Age 0 JE1 BE1.png|32px]] [[File:Beetroots Age 1 JE1 BE1.png|32px]] [[File:Beetroots Age 2 JE1 BE1.png|32px]] [[File:Beetroots Age 3 JE1 BE1.png|32px]]{{verify|Correct models?}} Added beetroot crops.}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Beetroot Seeds JE2 BE2.png|32px]] The texture of beetroot seeds has been changed.
|[[File:Beetroots Age 0 JE2.png|32px]] [[File:Beetroots Age 1 JE2.png|32px]] [[File:Beetroots Age 2 JE2.png|32px]] [[File:Beetroots Age 3 JE2.png|32px]]{{verify|Correct models?}} The textures of beetroot crops have been changed.}}

{{History|New 3DS}}
{{History||0.1.0|[[File:Beetroot Seeds JE1 BE1.png|32px]] Added beetroot seeds.
|[[File:Beetroots Age 0 JE1 BE1.png|32px]] [[File:Beetroots Age 1 JE1 BE1.png|32px]] [[File:Beetroots Age 2 JE1 BE1.png|32px]] [[File:Beetroots Age 3 JE1 BE1.png|32px]]{{verify|Correct models?}} Added beetroot crops.}}
{{History|foot}}

== Issues ==

{{issue list}}

== Gallery ==

<gallery>
Beetrootstwitpic.png|The first image released of beetroot seeds.
Village Wheat Beetroot Farm.png|Beetroots generated in a [[village]].
File:Beetroot farm.png|A beetroot garden.
</gallery>

== References ==
<references />

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

[[Category:Plants]]
[[Category:Food]]
[[Category:Generated structure blocks]]
[[Category:Non-solid blocks]]

[[cs:Semínka červené řepy]]
[[es:Semillas de remolacha]]
[[fr:Graines de betterave]]
[[it:Semi di barbabietola]]
[[ja:ビートルートの種]]
[[ko:비트 씨앗]]
[[nl:Bietenzaden]]
[[pl:Nasiona buraka]]
[[pt:Sementes de beterraba]]
[[ru:Семена свёклы]]
[[th:เมล็ดบีตรูท]]
[[zh:甜菜种子]]</li></ul>
17w43aCustom functions have been moved into data packs.
17w45aFunctions are now completely parsed and cached on load.
17w49bFunction can now be tagged.
Functions tagged in minecraft:tick now run every tick in the beginning of the tick.

Issues

Issues relating to "Function (Java Edition)" are maintained on the bug tracker. Report issues there.

References

Advertisement