Minecraft Wiki
Advertisement
Information icon
This feature is exclusive to Bedrock Edition. 
Move arrows
It has been suggested that this page be moved to Bedrock Edition function(s) or Consistency with other articles that have a Java and bedrock variant; plural should be discussed.
If this move affects many pages or may potentially be controversial, do not move the page until a consensus is reached.
 [discuss]
When moving, be sure to use the appropriate tool instead of simply copying and pasting the page's contents, to preserve edit history.
This article is about functions in Bedrock Edition. For functions in Java Edition, see Function (Java Edition). For the command, see Commands/function.

Functions allow players to run lists of commands using text files with the extension .mcfunction. This page covers how to use functions in Bedrock Edition.

Usage

Text files must be placed into a top-level folder named "functions" within a behavior pack: [behavior_pack]/functions

Subfolders and namespacing

Subfolders can be added to this folder to serve as namespaces.

For example: running the function sub/foo runs the file located at [behavior_pack]/functions/sub/foo.mcfunction.

/reload

Note: Currently /reload reloads only functions that already exist at the time the game is launched, meaning changes can be made to existing functions but the game must be restarted for newly added functions. This may change in future updates of Minecraft.

Success results:

Upon successfully running a function, a message displays in chat: "Executed [amount] Command(s) from function [function file directory]." In version 1.12.0 this is "Successfully executed [amount] function entries."

Function syntax

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 #.

min_engine_version

Functions require a minimum engine version specified in the pack manifest.json file.

This field determines which version of a command to run. The number specified here should match the version number of the game. For example, lets say that /fill was changed in 1.9.0. If your behavior pack has "min_engine_version": [1, 8, 0] and runs a function that contains /fill, it runs the older version of fill (as if the version was still 1.8.0).

Manifest example

{
    "format_version": 1,
    "header": {
        "description": "Function worldedit",
        "name": "Function worldedit",
        "uuid": "11111111-1111-1111-1111-111111111111",
        "version": [1, 8, 1],
        "min_engine_version": [1, 8, 0]
    },
    "modules": [
        {
            "description": "",
            "type": "data",
            "uuid": "22222222-2222-2222-2222-222222222222",
            "version": [1, 8, 1]
        }
    ]
}

Simple function example

test.mcfunction

title @p title Test
setblock ~ ~2 ~ diamond_ore
say Test
#this is a comment

More complex function example

BuildHut.mcfunction - this function builds a basic stone and wood house around you. Note that because the function runs commands in order, the glass windows and wooden door replace the stone walls created by the first command.

fill ~-2 ~-1 ~-2 ~2 ~2 ~2 stonebrick 0 hollow
fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 planks
fill ~ ~ ~2 ~ ~ ~2 wooden_door 1
fill ~-2 ~1 ~ ~-2 ~1 ~ glass
fill ~2 ~1 ~ ~2 ~1 ~ glass
fill ~ ~1 ~-2 ~ ~1 ~-2 glass

Running a function

Functions attempt to run all commands within a single tick, including the commands of nested functions called within another function.

Limits

A single function call runs up to 10,000 commands (including calls to other functions, i.e. recursion).

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.
  • Usage: /function <path/to/function/file>

History

Bedrock Edition
1.8.0
{{Extension DPL}}<ul><li>[[:Category:Planned items|Category:Planned items]]<br/>All pages relating to items that have been officially announced, but are not yet in the game.

__EXPECTUNUSEDCATEGORY__
[[Category:Items]]
[[Category:Planned]]

[[pt:Itens planejados]]</li><li>[[Dragon's Breath|Dragon's Breath]]<br/>{{Item
| image = Dragon's Breath.png
| renewable = Yes
| stackable = Yes (64)
| rarity = Uncommon
}}

The '''dragon's breath''' is a [[brewing]] item that is used solely to make [[lingering potion]]s.

== Obtaining ==

The dragon's breath can be obtained by scooping  up the [[ender dragon]]'s breath attack or the purple [[area effect cloud|effect clouds]] caused by [[dragon fireball]]s in an empty [[glass bottle]].

== Usage ==

=== Brewing ingredient ===

Dragon's breath may be added to any splash potion to upgrade it to a lingering potion, which can be used to create a lasting [[Lingering Potion#Area Effect Cloud|area effect cloud]], or to craft [[Arrow#Tipped arrows|tipped arrows]].
{{brewing
  |name=[[Lingering Potion]]
  |showname=1
  |Dragon's Breath
  |Any Lingering Potion
  |base=Any Splash Potion}}

When put 2 or more dragon's breath in the brewing stand, after the brewing process, a glass bottle will drop as an [[Item (entity)|entity]]. However, if put only 1 dragon's breath in the brewing stand, after the brewing process, the glass bottle is consumed and cannot be retrieved.<ref>{{bug|MC-259583}}</ref>

== Sounds ==
{{Edition|Java}}:
{{Sound table
|sound=Bottle fill dragon breath1.ogg
|sound2=Bottle fill dragon breath2.ogg
|subtitle=Bottle fills
|source=neutral
|description=Filling a glass bottle with dragon's breath
|id=item.bottle.fill_dragonbreath
|translationkey=subtitles.item.bottle.fill
|volume=1.0
|pitch=1.0
|distance=16
|foot=1}}

{{Edition|Bedrock}}:
{{Sound table
|type=bedrock
|sound=Bottle fill dragon breath1.ogg
|sound2=Bottle fill dragon breath2.ogg
|source=sound
|description=When a bottle is filled with dragon's breath
|id=bottle.dragonbreath
|volume=0.7<wbr>{{Until|BE 1.20.40}}<br>1.0<wbr>{{Upcoming|BE 1.20.40}}
|pitch=1.0
|foot=1}}

== Achievements ==

{{Load achievements|You Need a Mint}}

== Advancements ==
{{load advancements|You Need a Mint}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Dragon's Breath
|spritetype=item
|nameid=dragon_breath
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Dragon's Breath
|spritetype=item
|nameid=dragon_breath
|id=560
|form=item
|foot=1}}

== History ==
{{History|java}}
{{History||1.9|snap=15w33a|[[File:Dragon's Breath JE1 BE1.png|32px]] Added dragon's breath.}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 437.}}
{{History||1.14|snap=18w43a|[[File:Dragon's Breath JE2 BE2.png|32px]] The texture of dragon's breath has been changed.}}

{{History|pocket}}
{{History||1.0.0|snap=alpha 0.17.0.1|[[File:Dragon's Breath JE1 BE1.png|32px]] Added dragon's breath.}}
{{History|bedrock}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Dragon's Breath JE2 BE2.png|32px]] The texture of dragon's breath has been changed.}}

{{History|console}}
{{History||xbox=TU46|xbone=CU36|ps=1.38|wiiu=Patch 15|switch=1.0.1|[[File:Dragon's Breath JE1 BE1.png|32px]] Added dragon's breath.}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Dragon's Breath JE2 BE2.png|32px]] The texture of dragon's breath has been changed.}}

{{History|3ds}}
{{History||1.7.10|[[File:Dragon's Breath JE1 BE1.png|32px]] Added dragon's breath.}}
{{History|foot}}

== Issues ==
{{issue list}}

== Trivia ==
* If the dragon's breath is used in a [[crafting]] recipe (using a [[mod]] or a [[data pack]]), it becomes an empty bottle instead of being entirely consumed.

== References ==
{{reflist}}

==External Links==
*[https://www.minecraft.net/en-us/article/dragon-s-breath Taking Inventory: Dragon's Breath] – Minecraft.net on June 9, 2023

{{Items}}

[[Category:Renewable resources]]

[[de:Drachenatem]]
[[fr:Souffle de dragon]]
[[it:Soffio di drago]]
[[ja:ドラゴンブレス]]
[[ko:드래곤의 숨결]]
[[nl:Drakenadem]]
[[pl:Oddech smoka]]
[[pt:Bafo do dragão]]
[[ru:Драконье дыхание]]
[[zh:龙息]]
[[Category:Brewing recipe]]</li></ul>
?Added function files.
Function files are available only in behavior packs.
1.13.0
{{Extension DPL}}<ul><li>[[Nether Brick|Nether Brick]]<br/><!--Please do not change "nether brick" to "Nether brick". According to style guide, item names are not proper nouns and should not be capitalized.-->
{{about|the item|the block|Nether Bricks}}
{{Item
| title = Nether Brick
| image = Nether Brick.png
| renewable = Yes
| stackable = Yes (64)
}}

A '''nether brick''' is an [[item]] made by [[smelting]] [[netherrack]] in a [[furnace]], and is used to craft the [[Nether Bricks|nether bricks]] block and its variants. 

== Obtaining ==
=== Smelting ===
Nether brick can be smelted from netherrack.
{{smelting
  |Netherrack
  |Nether Brick
  |0,1
}}

=== Bartering ===
[[Piglin]]s may [[barter]] 2 to 8 nether bricks when given a [[gold ingot]].

== Usage ==
=== Crafting ingredient ===

{{crafting usage|Nether Brick}}

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

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Nether Brick
|spritetype=item
|nameid=netherbrick
|id=523
|form=item
|foot=1}}

== History ==

{{History|java}}
{{History||1.5|snap=13w01a|[[File:Nether Brick JE1 BE1.png|32px]] Added nether brick items.}}
{{History||1.10|snap=16w20a|Nether brick items can now be used to craft [[red nether bricks]].}}
{{History||1.13|snap=17w47a|The ID of nether bricks has been changed from <code>netherbrick</code> to <code>nether_brick</code>.
|Prior to [[1.13/Flattening|''The Flattening'']], this [[item]]'s numeral ID was 405.}}
{{History||1.14|snap=18w43a|[[File:Nether Brick JE2 BE2.png|32px]] The texture of nether bricks has been changed.}}
{{History||1.16|snap=20w07a|Nether bricks now have a {{frac|10|109}} (~9.17%) chance of being given by the new [[piglin]]s when [[bartering]], in a stack size of 1–4.}}
{{History|||snap=20w09a|Nether bricks now have a {{frac|20|226}} (~8.84%) chance of being given by piglins when bartering, in a stack size of 1–5.}}
{{History|||snap=20w10a|Nether bricks now have a {{frac|40|411}} (~9.73%) chance of being given by piglins when bartering, in a stack size of 4–16.}}
{{History||1.16.2|snap=20w28a|Nether bricks now have a {{frac|40|459}} (~8.71%) chance of being given by piglins when bartering, in a stack size of 2–8.}}

{{History|pocket alpha}}
{{History||v0.6.0|[[File:Nether Brick JE1 BE1.png|32px]] Added nether brick items.}}
{{History||v0.16.0|snap=build 5|Added nether brick items to the [[Creative]] [[inventory]].<ref name="missing brick">{{Bug|MCPE-16556}}</ref>}}
{{History|pocket}}
{{History||1.1.3|snap=alpha 1.1.3.0|Nether brick items are now used to craft [[red nether bricks]].}}
{{History|bedrock}}
{{History||1.9.0|snap=beta 1.9.0.0|Nether brick items are now used to craft nether brick [[fence]]s.}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Nether Brick JE2 BE2.png|32px]] The texture of nether bricks has been changed.}}
{{History||1.16.100|snap=beta 1.16.100.50|Nether bricks now can be used as fuel for a [[furnace]].<ref>{{bug|MCPE-114216}}</ref>}}
{{History|||snap=beta 1.16.100.54|Nether bricks now have a {{frac|40|459}} (~8.71%) chance of being given by piglins when bartering, in a stack size of 2–8 to match {{el|Java}}.}}
{{History||1.18.30|snap=beta 1.18.30.26|Nether bricks can no longer be used as fuel in a furnace.}}

{{History|console}}
{{History||xbox=TU9|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|[[File:Nether Brick JE1 BE1.png|32px]] Added nether brick items.}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Nether Brick JE2 BE2.png|32px]] The texture of nether bricks has been changed.}}

{{History|New 3DS}}
{{History||0.1.0|[[File:Nether Brick JE1 BE1.png|32px]] Added nether brick items.}}
{{History|foot}}

== Issues ==

{{issue list}}

== References ==

{{reflist}}

{{items}}

[[cs:Netheritová cihla]]
[[de:Netherziegel (Gegenstand)]]
[[es:Ladrillo del Nether]]
[[fr:Brique du Nether]]
[[hu:Alvilági tégla]]
[[ja:ネザーレンガ (アイテム)]]
[[ko:네더 벽돌 (아이템)]]
[[lzh:焱界磚]]
[[nl:Netherbaksteen (voorwerp)]]
[[pl:Netherowa cegła]]
[[pt:Tijolo do Nether]]
[[ru:Адский кирпич (предмет)]]
[[uk:Пекельна цегла (предмет)]]
[[zh:下界砖]]
[[Category:Renewable resources]]</li><li>[[Phantom Membrane|Phantom Membrane]]<br/>{{Item
| title = Phantom Membrane
| image = Phantom Membrane.png
| renewable = Yes
| stackable = Yes (64)
}}

'''Phantom membranes''' are items obtained from killing [[phantom]]s. They are used to repair [[elytra]] and brew [[Potion of Slow Falling|potions of Slow Falling]].

== Obtaining ==

=== Mob loot ===
[[Phantom]]s drop 0–1 phantom membrane when killed by a [[player]] or tamed [[wolf]]. [[Looting]] increases the maximum drops by 1 per level, for a maximum of 4 with Looting III.

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

Tamed [[cat]]s have a 70% chance to bring the player a gift when they wake up from a [[bed]], and the gift has a 3.22% chance to be a phantom membrane.

== Usage ==
=== Repairing ===

Phantom membranes can be used in an [[anvil]] to repair [[elytra]], restoring 108 durability points (25% of the pair's total durability) per membrane while preserving their [[enchantments]].

{| class="wikitable" data-description="Repairing elytra"
! scope="col" style="width:64px;" | Name
! Ingredients
! [[Anvil]] usage
|-
! scope="row" style="text-align: center;" | '''Elytra'''
| [[Elytra]] +<br>[[Phantom Membrane]]
| style="width: 260px; padding: 1px;" | {{Anvil| title = Elytra|Input1=Damaged Elytra|Input2=Phantom Membrane, 2|Output=Elytra}}
|-
|}

=== Brewing ingredient ===

Phantom membranes are used to [[brewing|brew]] [[Potion of Slow Falling|slow falling potions]] from an [[awkward potion]].

{{Brewing
 |Phantom Membrane
 |Potion of Slow Falling
 |showname=3
}}

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

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Phantom Membrane
|spritetype=item
|nameid=phantom_membrane
|id=574
|form=item
|foot=1}}

== History ==

{{History|java}}
{{History||1.13|snap=18w14a|[[File:Phantom Membrane JE1 BE1.png|32px]] Added phantom membranes.}}
{{History||1.14|snap=18w44a|Tamed [[cat]]s now have a chance to give the [[player]] phantom membranes as [[Cat#Gifts|gifts]].}}
{{History|||snap=19w08a|[[File:Phantom Membrane JE2 BE2.png|32px]] The texture of phantom membranes has now been changed.}}

{{History|bedrock}}
{{History||1.6.0|snap=beta 1.6.0.5|[[File:Phantom Membrane JE1 BE1.png|32px]] Added phantom membranes.}}
{{History||1.8.0|snap=beta 1.8.0.8|Tamed [[cat]]s now have a chance to give the [[player]] phantom membranes as gifts.}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Phantom Membrane JE2 BE2.png|32px]] The texture of phantom membranes has now been changed.}}

{{History|console}}
{{History||xbox=TU69|ps=1.76|wiiu=Patch 38|[[File:Phantom Membrane JE1 BE1.png|32px]] Added phantom membranes.}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|[[File:Phantom Membrane JE2 BE2.png|32px]] The texture of phantom membranes has now been changed.}}
{{History|foot}}

== Issues ==
{{issue list}}

== References ==
{{reflist}}

== External Links ==
*[https://www.minecraft.net/en-us/article/taking-inventory--phantom-membrane Taking Inventory: Phantom Membrane] – Minecraft.net on August 2, 2019

{{items}}

[[de:Phantomhaut]]
[[fr:Membrane de Phantom]]
[[ja:ファントムの皮膜]]
[[ko:팬텀 막]]
[[pl:Błona fantoma]]
[[pt:Membrana de phantom]]
[[ru:Мембрана фантома]]
[[th:เนื้อเยื่อแฟนท่อม]]
[[uk:Перетинка фантома]]
[[zh:幻翼膜]]
[[Category:Renewable resources]]
[[Category:Brewing recipe]]</li></ul>
beta 1.13.0.1Function files are now visible in command list.
Advertisement