Minecraft Wiki
Advertisement
Information icon
This feature is exclusive to Java Edition. 

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.

Usage

To utilize functions, the text files must first be placed into a top-level folder within [WORLD_NAME]/data/functions[upcoming] or into [WORLD_NAME]/datapacks/[DATA_PACK_NAME]/data/[NAMESPACE]/functions.‌[upcoming: Lua error in Module:Version_link at line 112: attempt to concatenate local 'text' (a nil value).] For single player, the world folders can be found in .minecraft/saves. For multiplayer, functions must be placed in every world folder that wants to utilize them. 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 functions/custom/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 circumvents this by updating the command environment.

For example:

1.12

execute @a ~ ~ ~ function foo:bar

foo:bar

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

1.13

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>
/gamerule gameLoopFunction[upcoming]
  • Runs a function every tick.
  • The commands in the function are run through the server.
    • The coordinates from which the "server" executes commands are (0, 0, 0).
  • If multiple functions need to be looped, it is possible to insert function commands into this looped function file, put function commands in those functions, etc.
  • Usage: /gamerule gameLoopFunction <namespace:path/to/function/file>
  • To stop the loop just point gameLoopFunction to a non-existing function: /gamerule gameLoopFunction -, this value is also the default.

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‌[upcoming: Lua error in Module:Version_link at line 112: attempt to concatenate local 'text' (a nil value).]

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

release
1.12
{{Extension DPL}}<ul><li>[[Melon Slice|Melon Slice]]<br/>{{Dungeons hatnote|type=consumable|Melon}}
{{Item
| title = Melon Slice
|typeimage=Melon Slice.png
| renewable = Yes
| heals = {{hunger|2}}
| stackable = Yes (64)
}}
A '''melon slice'''{{efn|Known as '''Melon Slice''' {{in|java}} and '''Melon''' {{in|bedrock}}.}} is a [[food]] item that can be eaten by the [[player]].

== Obtaining ==

=== Block loot ===

{{see also|Tutorials/Pumpkin and melon farming|title1 = Pumpkin and melon farming}}

Melon slices can be obtained by breaking (harvesting) [[melon]]s using any [[tool]] or by hand. [[Axe]]s, followed by [[sword]]s, are the fastest tools for harvesting melons.  A melon drops 3–7 melon slices, when broken; by hand, using a [[tool]], or after being broken by the movement of a [[piston]], with an average of 4.64 slices per melon.

Breaking a melon with a tool enchanted with [[Fortune]] increases the potential number of drops by 1 slice per level, up to a maximum of 9 slices.

== Usage ==

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

To eat a melon slice, 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]].

=== Crafting ingredient ===

{{crafting usage}}

=== Composting ===
Placing a melon slice into a [[composter]] has a 50% chance of raising the compost level by 1.

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

== Data values ==

=== ID ===

{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Melon Slice
|spritetype=item
|nameid=melon_slice
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|showaliasids=y
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|spritename=melon-slice
|displayname=Melon
|spritetype=item
|nameid=melon_slice
|aliasid=melon
|id=272
|form=item
|translationkey=item.melon.name
|foot=1}}

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

== History ==
{{History|java beta}}
{{History||1.8|snap=Pre-release|[[File:Melon Slice JE1 BE1.png|32px]] Added melons.}}
{{History|java}}
{{History||1.0.0|snap=Beta 1.9 Prerelease 4|Melons are now used in the [[crafting]] recipe of [[glistering melon]]s.}}
{{History|||snap=Beta 1.9 Prerelease 5|Melons once again drop the correct number of slices.}}
{{History||1.3.1|snap=12w21a|Melons can now be [[trading|bought]] from farmer [[villager]]s, at 5–8 melon slices for 1 [[emerald]].}}
{{History||1.7.2|snap=13w37a|Block ID 105, [[melon stem]], has been removed from the {{cmd|give}} [[commands|command]].}}
{{History||1.8|snap=14w02a|[[Villager]]s no longer [[trading|sell]] melons. They now buy [[melon]]s instead.}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 360.}}
{{History|||snap=18w20b|"Melon" has been renamed to "Melon Slice."
|The ID of melon slices has been changed from <code>melon</code> to <code>melon_slice</code>.}}
{{History||1.14|snap=18w43a|[[File:Melon Slice JE2 BE2.png|32px]] The texture of melon slices has been changed.}}
{{History|||snap=19w03a|Placing a melon slice into the new [[composter]] has a 20% chance of raising the compost level by 1.}}
{{History|||snap=19w05a|Melon slices now have a 50% chance of increasing the compost level in a composter by 1.}}

{{History|pocket alpha}}
{{History||v0.5.0|[[File:Melon Slice JE1 BE1.png|32px]] Added melons. 
|Melons restore {{health|2}} each, rather than {{hunger|2}}.}}
{{History||v0.12.1|snap=?|Added Melon slice to the Creative inventory.}}
{{History|||snap=build 1|Melons now restores [[hunger]] instead of [[health]].
|Melons can no longer be obtained from [[nether reactor]]s.}}
{{History|pocket}}
{{History||1.1.0|snap=alpha 1.1.0.3|[[Breaking]] a [[melon]] with [[shears]] now always yields 9 melons.}}
{{History|bedrock}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Melon Slice JE2 BE2.png|32px]] The texture of melons has been changed.}}
{{History||1.11.0|snap=beta 1.11.0.1|Melons can now be used to fill up [[composter]]s.}}
{{History|||snap=beta 1.11.0.4|Melons can now be [[trading|sold]] to farmer [[villager]]s.}}
{{History||1.16.0|snap=beta 1.16.0.57|[[Trading]] has been changed, melon slices can no longer be sold to farmer villagers.}}
{{History||1.16.100|snap=beta 1.16.100.56|The ID of melon slices has been changed from <code>melon</code> to <code>melon_slice</code>.}}

{{History|console}}
{{History||xbox=TU5|xbone=CU1|ps=1.0|wiiu=Patch 1|[[File:Melon Slice JE1 BE1.png|32px]] Added melons.}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Melon Slice JE2 BE2.png|32px]] The texture of melons has been changed.}}

{{History|new 3ds}}
{{History||0.1.0|[[File:Melon Slice JE1 BE1.png|32px]] Added melons.}}
{{History|foot}}

== Issues ==
{{issue list}}

== See also ==
* [[Pumpkin]]
* [[Glistering Melon Slice]]

== Notes ==
{{fnlist}}

{{Items}}

[[Category:Plants]]

[[cs:Meloun]]
[[de:Melone]]
[[es:Rodaja de sandía]]
[[fr:Tranche de pastèque]]
[[hu:Dinnye Szelet]]
[[ko:수박]]
[[nl:Meloenschijf]]
[[pl:Arbuz]]
[[pt:Fatia de melancia]]
[[ru:Ломтик арбуза]]
[[zh:西瓜片]]
[[Category:Food]]
[[Category:Renewable resources]]</li><li>[[Fire Charge|Fire Charge]]<br/>{{ItemEntity
|image=Fire Charge.png
|invimage=Fire Charge
|durability=
|renewable=Yes
|stackable=Yes (64)
|networkid='''[[JE]]''': 64
}}

'''Fire charges''' are items that can be {{control|used}} as a single-use version of a [[flint and steel]] or shot as a [[small fireball]] from a [[dispenser]].

== Obtaining ==
=== Chest loot ===
{{LootChestItem|fire-charge}}

=== Crafting ===
{{Crafting
|Blaze Powder
|Coal; Charcoal
|Gunpowder
|Output= Fire Charge, 3
|type= Miscellaneous
}}

=== Bartering ===
[[Piglin]]s may [[barter]] 1 fire charge when given a [[gold ingot]].

== Usage ==
[[File:Natural Fire Charge.png|200px|thumb|Dispensing Fire Charge]]

Fire charges can be used as ammunition for [[dispenser]]s, or as a substitute for [[flint and steel]].

When used, it instantly places a [[fire]], similar to flint and steel. The fire charge is consumed in the process. It can prime [[TNT]], light [[Nether portal|nether portals]], [[Campfire|campfires]], [[Candle|candles]], [[Cake|cakes with candles]] and [[creeper]]s{{only|JE}} like flint and steel.

When a fire charge is fired from a dispenser, it shoots a [[small fireball]].

=== Crafting ingredient ===

{{crafting usage}}

== Sounds ==
{{edition|java}}:
{{Sound table
|rowspan=4
|sound=Ghast fireball4.ogg
|subtitle=Ghast shoots
|source=hostile
|description=When a fireball is shot by a ghast
|id=entity.ghast.shoot
|translationkey=subtitles.entity.ghast.shoot
|volume=10.0
|pitch=0.8-1.2
|distance=16 {{verify}}}}
{{Sound table
|subtitle=Blaze shoots <ref group=sound name=LousyEvents>{{Bug|MC-98316||Wrong subtitles caused by missing distinction}}</ref>
|source=hostile
|description=When a fire charge is fired from a dispenser or a blaze
|id=entity.blaze.shoot|idnote=<ref group=sound name=LousyEvents/>
|translationkey=subtitles.entity.blaze.shoot|translationkeynote=<ref group=sound name=LousyEvents/>
|volume=2.0
|pitch=0.8–1.2
|distance=32}}
{{Sound table
|subtitle=Fireball whooshes
|source=block
|description=When a fire charge is used by hand
|id=item.firecharge.use|idnote=<ref group=sound name=nounderscore>{{bug|MC-177457}}</ref>
|translationkey=subtitles.item.firecharge.use|translationkeynote=<ref group=sound name=nounderscore/>
|volume=1.0
|pitch=0.8-1.2
|distance=16}}
{{Sound table
|subtitle=Fireball whooshes
|source=hostile
|description=When a fire charge is used to light a creeper
|id=item.firecharge.use|idnote=<ref group=sound name=nounderscore/>
|translationkey=subtitles.item.firecharge.use|translationkeynote=<ref group=sound name=nounderscore/>
|volume=1.0
|pitch=0.8-1.2
|distance=16
|foot=1}}

{{edition|bedrock}}:
{{Sound table
|type=bedrock
|sound=Ghast fireball4.ogg
|source=hostile
|description=When something shoots or uses a fire charge
|id=mob.ghast.fireball
|volume=1.0
|pitch=1.0
|foot=1}}

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

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|showaliasids=y
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Fire Charge
|spritetype=item
|nameid=fire_charge
|aliasid=fireball
|id=509
|form=item
|translationkey=item.fireball.name
|foot=1}}

=== Entity data ===
{{main|Small Fireball#Entity data}}

== Achievements ==
{{Load achievements|Into the Nether}}

== Advancements ==
{{load advancements|We Need to Go Deeper}}

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

== History ==
{{for|information pertaining to smallmfireballs (which fire charges produce when shot from a dispenser)|Small Fireball#History}}
{{History|java}}
{{History||1.0.0|snap=Beta 1.9 Prerelease|[[File:Fire Charge JE1 BE1.png|32px]] Added the fire charge texture. It is currently only used by [[fireball]]s and [[small fireball]]s, both of which are entities, and is not used by any items.}}
{{History||1.2.1|snap=12w04a|Added fire charges, which use the above texture. They can be crafted only with [[coal]].}}
{{History|||snap=12w05a|Fire charges can now be crafted with charcoal.}}
{{History||1.4.2|snap=12w38b|The [[sound]] when using the fire charge has now been changed; it now uses the same sound as [[flint and steel]].}}
{{History||1.4.6|snap=12w49a|Fire charges can now be used to craft [[Firework Rocket|fireworks]].}}
{{History||1.8|snap=14w31a|The sound when using fire charges to set fire has now been changed; it now uses the same sound as when fired from [[dispenser]]s.}}
{{History||1.9|snap=15w33c|Fire charges now appear purple and explode with [[dragon's breath]] when fired from dispensers. Whether a true dragon fireball entity is created or if this effect is purely visual is unknown.}}
{{History|||snap=15w44b|Fire charges once again appear as [[small fireball]]s when fired from dispensers.}}
{{History||1.11|snap=16w40a|The <code>life</code> tag is no longer used for anything, but still saved/read.{{info needed|Is this even relevant to the fire charge, or is it a remnant from the blaze page or something?}}}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 385.}}
{{History||1.14|snap=18w43a|[[File:Fire Charge JE2 BE2.png|32px]] The texture of fire charges has now been changed.}}
{{History||1.15|snap=19w42a|Dispensed fire charges{{info needed|as in the fireball, or a dispenser facing straight into a campfire?}} can now light campfires.}}
{{History||1.16|snap=20w07a|Fire charges have a {{frac|5|109}} (~4.59%) chance of being given by the new [[piglin]]s when [[bartering]], in a stack size of 1.}}
{{History|||snap=20w09a|Fire charges now have a {{frac|20|226}} (~8.85%) chance of being given by piglins when bartering, in a stack size of 1–5.}}
{{History|||snap=20w10a|Fire charges now have a {{frac|40|411}} (~9.73%) chance of being given by piglins when bartering, in a stack size of 1–5.}}
{{History|||snap=20w11a|Fire charges now have a {{frac|40|417}} (~9.59%) chance of being given by piglins when bartering, in a stack size of 1–5.}}
{{History|||snap=20w13a|Fire charges now have a {{frac|40|424}} (~9.43%) chance of being given by piglins when bartering, in a stack size of 1–5.}}
{{History|||snap=20w16a|Fire charges now generate in [[ruined portal]] chests.}}
{{History|||snap=20w20a|Fire charges now have a {{frac|40|423}} (~9.46%) chance of being given by piglins when bartering, in a stack size of 1–5.}}
{{History||1.16.2|snap=20w28a|Fire charges now have a {{frac|40|459}} (~8.71%) chance of being given by piglins when bartering, in a stack size of 1.}}
{{History||1.19.3|snap=Pre-release 2|Fire charges can now be {{control|use|text=used}} to forcibly detonate [[creeper]]s.<ref>{{bug|MC-185618|||Fixed}}</ref>}}
{{History||1.19.4|snap=23w06a|Added the [[fire charge]] to the "Ingredients" tab in the creative inventory.}}

{{History|pocket alpha}}
{{History||v0.15.0|snap=build 1|[[File:Fire Charge JE1 BE1.png|32px]] Added fire charges.}}
{{History|bedrock}}
{{History||1.2.0|snap=beta 1.2.0.2|Fire charges can now be used to craft [[firework star]]s.}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Fire Charge JE2 BE2.png|32px]] The texture of fire charges has now been changed.}}
{{History||1.16.0|snap=beta 1.16.0.57|Fire charges can now be obtained from bartering with piglin.
|Fire charges can now be found in [[ruined portal]] chests.}}
{{History||1.16.100|snap=beta 1.16.100.56|The ID of fire charges has been changed from <code>fireball</code> to <code>fire_charge</code>.}}

{{History|console}}
{{History||xbox=TU9|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|[[File:Fire Charge JE1 BE1.png|32px]] Added fire charges.}}
{{History||xbox=TU31|xbone=CU19|ps=1.22|wiiu=Patch 3|Fire charges now make [[sound]]s when igniting [[block]]s.}}	
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Fire Charge JE2 BE2.png|32px]] The texture of fire charges has now been changed.}}

{{History|3ds}}
{{History||0.1.0|[[File:Fire Charge JE1 BE1.png|32px]] Added fire charges.}}
{{History|foot}}

== Issues ==
{{issue list}}

== Gallery ==
<gallery>
GodPortal.png|A fire charge found in a [[ruined portal]] chest, together with an [[enchanted golden apple]].
</gallery>

== See also ==
* [[Flint and Steel]]
* [[Dragon Fireball]]
* [[Ghast]]

== References ==
{{reflist}}

== External Links ==
*[https://www.minecraft.net/en-us/article/taking-inventory-fire-charge Taking Inventory: Fire Charge] – Minecraft.net on January 11, 2019

{{Items}}

[[Category:Recipe using Charcoal]]

[[cs:Ohnivá koule]]
[[de:Feuerkugel]]
[[es:Carga ígnea]]
[[fr:Boule de feu]]
[[hu:Tűzgolyó]]
[[ja:ファイヤーチャージ]]
[[ko:화염구]]
[[nl:Vuurbal]]
[[pl:Ognista kula]]
[[pt:Bola de fogo]]
[[ru:Огненный шар]]
[[th:ลูกไฟ]]
[[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.
upcoming
1.13
{{Extension DPL}}<ul><li>[[White Dye|White Dye]]<br/>{{Item
| image = White Dye.png
| renewable = Yes
| stackable = Yes (64)
}}

'''White dye''' is a [[Dye#Primary|primary color dye]] similar to [[bone meal]].

== Obtaining ==
=== Crafting ===
{{Crafting
 |showname=0
 |Bone Meal
 |Output=White Dye
 |type=Material
 |head=1
}}
{{Crafting
 |Lily of the Valley
 |Output=White Dye
 |type=Material
 |foot=1
}}

=== Loot chest ===
{{#invoke:LootChest|base3|white-dye}}

== Usage ==

{{dye usage}}

=== Crafting ingredient ===

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

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

=== Trading ===

Apprentice-level shepherd villagers have a 20% chance to buy 12 white dye for an emerald.

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

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|showaliasids=y
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=White Dye
|spritetype=item
|nameid=white_dye
|aliasid=dye / 19
|id=410
|form=item
|translationkey=item.dye.white_new.name
|foot=1}}

== History ==

{{History|java}}
{{History||1.14|snap=18w43a|[[File:White Dye JE1 BE1.png|32px]] Added white dye.}}
{{History|||snap=18w44a|White dye can now change the text color on [[sign]]s to white.}}
{{History|||snap=19w05a|Added the [[wandering trader]], which sells white dye.}}
{{History|||snap=19w11a|White dye can now be [[trading|bought]] by shepherd villagers.}}
{{History||1.17|snap=20w45a|White dye can now be used to craft [[white candle]]s.}}
{{History|||snap=21w19a|White dyes can no longer be used to craft white candles.}}
{{History|||snap=Pre-release 1|White dye can once again be used to craft white candles.}}
{{History||1.20<br>(Experimental)|link=1.19.3|snap=22w42a|White dye can now change the text color on [[hanging sign]]s to white.}}
{{History||1.20|snap=23w12a|White dye can now be found in [[suspicious gravel]] and [[suspicious sand]] in [[trail ruins]].}}
{{History|||snap=23w16a|White dye no longer generates in [[suspicious sand]] in [[trail ruins]].|Due to the split of the archaeological loot tables for suspicious gravel within the [[trail ruins]]; white dye is now common loot.}}

{{History|bedrock}}
{{History||1.8.0|snap=beta 1.8.0.10|[[File:White Dye JE1 BE1.png|32px]] Added white dye.}}
{{History||1.9.0|snap=beta 1.9.0.0|Added [[flower|lilies of the valley]], which can be used to [[crafting|craft]] white dye.}}
{{History||1.11.0|snap=beta 1.11.0.4|White dye can now be [[trading|sold]] to shepherd [[villager]]s.}}
{{History||1.16.100|snap=beta 1.16.100.56|The ID of white dye has been changed from <code>dye/19</code> to <code>white_dye</code>.}}

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

== Issues ==
{{issue list}}


{{Items}}

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

[[de:Weißer Farbstoff]]
[[es:Tinte blanco]]
[[fr:Teinture blanche]]
[[ja:白色の染料]]
[[ko:하얀색 염료]]
[[pl:Biały barwnik]]
[[pt:Corante branco]]
[[zh:白色染料]]</li><li>[[Ice Bomb|Ice Bomb]]<br/>{{education feature}}
{{exclusive|bedrock|education}}
{{ItemEntity
|image=Ice Bomb.png
|renewable=No (unless [[Material Reducer]] is available)<!-- Well, CHO are everywhere in sugar and charcoal, and sodium is in cobblestone... -->
|stackable=Yes (16)
|size=Height: 0.25 Blocks<br>Width: 0.25 Blocks
}}
The '''ice bomb''' is an item that is used to freeze [[water]] into [[ice]].

== Obtaining ==

=== Lab Table ===

{| class="wikitable"
! Result
! Materials Needed
|-
!rowspan=2|{{slot|Ice Bomb}}<br>[[Ice Bomb]]
|{{slot|Sodium Acetate|link=Compound#List_of_compounds}}{{slot|Sodium Acetate|link=Compound#List_of_compounds}}{{slot|Sodium Acetate|link=Compound#List_of_compounds}}{{slot|Sodium Acetate|link=Compound#List_of_compounds}}
|-
|<center>[[Compound#List_of_compounds|Sodium Acetate]] x4</center>
|}

== Usage ==

Ice bombs can be thrown by {{control|using}} them, similar to an [[egg]]. They are affected by gravity.

Similar to [[ender pearl]]s, there is a short cooldown before the player can throw another ice bomb. The cooldown is shown in the hotbar by a white overlay that shrinks before the player is able to use it again.

Ice bombs explode upon hitting most blocks, including non-solid blocks, but not [[air]]. They also explode upon hitting other entities, but they do not deal damage, and unlike [[egg]]s and [[snowball]]s, the impact is not considered an attack and does no damage or knockback. When exploding, any [[water]] (including flowing water, but not [[waterlogged]] blocks) in a 3×3×3 cube around the ice bomb freezes into [[ice]]. Ice bombs can be used to contain and displace mobs in ice under water.

While endermen teleport away from arrows shot at them, they can be hit by ice bombs. 

Throwing an ice bomb while underwater encloses the player in [[ice]].

{| class="wikitable"
|+Ice bomb arrangement table
!y\x
!-2
!-1
!0
!1
!2
|-
!64
|Air
|Air
|Air
|Air
|Air
|-
!63
|Air
|Air
|Ice bomb
|Air
|Air
|-
!62
!Water
!Ice
!Ice
!Ice
!Water
|-
!61
!Water
!Ice
!Ice
!Ice
!Water
|-
!60
!Water
!Water
!Water
!Water
!Water
|}

== Sounds ==
{{Sound table
|type=bedrock
|sound=Zombie breaks door.ogg
|source=hostile
|description=When an ice bomb is created by a [[lab table]]
|id=mob.wither.break_block
|volume=0.5
|pitch=1.1/1.3}}
{{Sound table
|sound=Glass dig1.ogg
|sound2=Glass dig2.ogg
|sound3=Glass dig3.ogg
|source=block
|description=When an ice bomb impacts something
|id=random.glass
|volume=1.0
|pitch=1.4/1.6
|foot=1}}

== Data values ==
=== ID ===
{{ID table
|edition=bedrock
|firstcolumnname=Ice Bomb
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Item
|spritename=ice-bomb
|spritetype=item
|nameid=ice_bomb
|id=595
|form=item
|foot=1}}
{{ID table
|edition=bedrock
|firstcolumnname=Ice Bomb
|shownumericids=y
|generatetranslationkeys=y
|displayname=Entity
|spritename=ice-bomb
|spritetype=entity
|nameid=ice_bomb
|id=106
|foot=1}}

== History ==

{{History|bedrock}}
{{History||1.4.0|snap=beta 1.2.20.1|[[File:Ice Bomb BE1.png|32px]] Added ice bombs.}}

{{History|education}}
{{History||1.0.27|[[File:Ice Bomb BE1.png|32px]] Added ice bombs.}}
{{History|foot}}

== Trivia ==

* In real life, mixing a sufficient amount of sodium acetate in water does solidify it, but creates [[wikipedia:Sodium acetate#Heating pad|hot ice]] (sodium acetate trihydrate) instead of normal ice.

{{items}}
{{entities}}
{{Education Edition}}

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

[[pl:Lodowa bomba]]
[[de:Eisbombe]]
[[ja:氷の爆弾]]
[[ko:얼음 폭탄]]
[[lzh:冰丸]]
[[pt:Bomba de gelo]]
[[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