Functions are stored inside .mcfunction files, which themselves are stored inside 'data packs'
Functions are then called with the following
/function customdev:functiondev
would call /datapacks/customdev/data/customdev/functions/functiondev.mcfunction
.mcfunction file
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.
Data Pack Usage
Data packs can be placed in the .minecraft/saves/(world)/datapacks folder of a world. Each data pack is either a sub-folder or a .zip file within the datapacks folder. After it is in the folder, a data pack will be enabled for that world.
Data packs will load their data based on the load order. This order can be seen and altered by using the /datapack command.
pack.mcmeta
A data pack is identified by Minecraft based on the presence of the pack.mcmeta file in the root directory of the data pack, which contains data in JSON format.
pack: Holds the data pack information.
pack_format: Pack version. Can be any number.
description: A description. This string must exist but can be empty. This description will show when hovering over the data pack in the data pack list.
Each advancement, function, loot table, structure, recipe and tag file can be placed directly in their respective folder but sub-folders are also allowed.
To execute a function every tick
To execute a function every tick you must tag the function with the "minecraft:tick" tag. To do this create the following tick.json
hey i have a problem with running my function i have everything right at least i think so its more a problem with the function itself. in the functions folder of my datapack i have my function and another one from some guy. the function of the other person can run with out a problem. but mine is not even beeing registert by the game
well i must say it is a pretty long function so maybe its that limitation but i put it the limit on max and its not running so that would be pretty weird.
start of function
#Clay run away made by Cunibon
#INSTALLATION: if you read this you downloaded this function put the hole folder in wich this text is into the functions folder of the world you want this to be in. The functions folder is in the data folder of your world. then grab a commandblock set it in repeat and always active (also put it in your spawn chunks so it works where ever you are.) then copy this in: "function Clay:Clay" congrats you installed the function have fun.
#EXPLANATION: To be able to use this function on a server you will need op. Grab a bat Spawn egg and name it "clay" if you spawn in the bat with this name a block will apear. the block will switch colors if you stand on it and at the end it will disapear. It can fore example be used for minigames. After a short amount of time the blocks will reapear.If you want to change the time it taks you will need to configurate the lines 15 and 16. change the number 100 to what ever number you want. Both nummbers will need to be the same. to get ride of them simply name a bat "STOP" and put it down next above the block. Then you can destroy the block.
#Blocks
#clay
scoreboard objectives add Tick dummy
execute as @e[name=clay,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"OnexOne",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=clay,type=bat] at @s run scoreboard players set @e[name=OnexOne,type=armor_stand,distance=..1] Tick 49
kill @e[name=clay,type=bat]
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=OnexOne,type=armor_stand,distance=..1] Tick 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=OnexOne,type=armor_stand,distance=..1,scores={Tick=2..}] Tick 1
scoreboard players add @e[type=armor_stand,name=OnexOne,scores={Tick=1..}] Tick 1
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=3}] at @s run setblock ~ ~-1 ~ yellow_terracotta
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=6}] at @s run setblock ~ ~-1 ~ red_terracotta
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=9}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=9}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=50..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=50}] at @s run setblock ~ ~-1 ~ green_terracotta
scoreboard players set @e[name=OnexOne,type=armor_stand,scores={Tick=50..}] Tick 0
#brick
scoreboard objectives add brTick dummy
execute as @e[name=brick,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"bri",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=brick,type=bat] at @s run scoreboard players set @e[name=bri,type=armor_stand,distance=..1] brTick 249
kill @e[name=brick,type=bat]
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=bri,type=armor_stand,distance=..1] brTick 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=bri,type=armor_stand,distance=..1,scores={brTick=2..}] brTick 1
scoreboard players add @e[type=armor_stand,name=bri,scores={brTick=1..}] brTick 1
execute as @e[name=bri,type=armor_stand,scores={brTick=25}] at @s run setblock ~ ~-1 ~ mossy_stone_bricks
execute as @e[name=bri,type=armor_stand,scores={brTick=50}] at @s run setblock ~ ~-1 ~ cracked_stone_bricks
execute as @e[name=bri,type=armor_stand,scores={brTick=75}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=bri,type=armor_stand,scores={brTick=75}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=bri,type=armor_stand,scores={brTick=250..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[name=bri,type=armor_stand,scores={brTick=250}] at @s run setblock ~ ~-1 ~ stone_bricks
scoreboard players set @e[name=bri,type=armor_stand,scores={brTick=250..}] brTick 0
#obsidian
scoreboard objectives add obTick dummy
execute as @e[name=obsidian,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"Obsi",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=obsidian,type=bat] at @s run scoreboard players set @e[name=Obsi,type=armor_stand,distance=..1] obTick 599
kill @e[name=obsidian,type=bat]
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=Obsi,type=armor_stand,distance=..1] obTick 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=Obsi,type=armor_stand,distance=..1,scores={obTick=2..}] obTick 1
scoreboard players add @e[type=armor_stand,name=Obsi,scores={obTick=1..}] obTick 1
execute as @e[name=Obsi,type=armor_stand,scores={obTick=60}] at @s run setblock ~ ~-1 ~ stone
execute as @e[name=Obsi,type=armor_stand,scores={obTick=120}] at @s run setblock ~ ~-1 ~ cobblestone
execute as @e[name=Obsi,type=armor_stand,scores={obTick=180}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=Obsi,type=armor_stand,scores={obTick=180}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=Obsi,type=armor_stand,scores={obTick=600..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[name=Obsi,type=armor_stand,scores={obTick=600}] at @s run setblock ~ ~-1 ~ obsidian
scoreboard players set @e[name=Obsi,type=armor_stand,scores={obTick=600..}] obTick 0
#heal
scoreboard objectives add heal dummy
execute as @e[name=HEAL,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"SAT",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=HEAL,type=bat] at @s run scoreboard players set @e[name=SAT,type=armor_stand,distance=..1] heal 89
kill @e[name=HEAL,type=bat]
execute as @e[type=armor_stand,name=SAT,scores={heal=0}] at @s run effect give @a[distance=..1] minecraft:saturation 2 10 true
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=SAT,type=armor_stand,distance=..1] heal 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=SAT,type=armor_stand,distance=..1,scores={heal=2..}] heal 1
scoreboard players add @e[type=armor_stand,name=SAT,scores={heal=1..}] heal 1
execute as @e[name=SAT,type=armor_stand,scores={heal=10}] at @s run scoreboard players add @e[name=SAT,type=armor_stand,distance=..1] heal 1
execute as @e[name=SAT,type=armor_stand,scores={heal=30}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=SAT,type=armor_stand,scores={heal=30}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=SAT,type=armor_stand,scores={heal=90..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[type=armor_stand,name=SAT,scores={heal=90}] at @s run setblock ~ ~-1 ~ red_concrete
scoreboard players set @e[name=SAT,type=armor_stand,scores={heal=90..}] heal 0
#NoFallDamage
scoreboard objectives add fall dummy
execute as @e[name=BOOST,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"FALL",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=BOOST,type=bat] at @s run scoreboard players set @e[name=FALL,type=armor_stand,distance=..1] fall 89
kill @e[name=BOOST,type=bat]
execute as @e[type=armor_stand,name=FALL,scores={fall=0}] at @s run effect give @a[distance=..1] minecraft:resistance 15 255 true
execute as @e[type=armor_stand,name=FALL,scores={fall=0}] at @s run effect give @a[distance=..1] minecraft:speed 15 0 true
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=FALL,type=armor_stand,distance=..1] fall 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=FALL,type=armor_stand,distance=..1,scores={fall=2..}] fall 1
scoreboard players add @e[type=armor_stand,name=FALL,scores={fall=1..}] fall 1
execute as @e[name=FALL,type=armor_stand,scores={fall=10}] at @s run scoreboard players add @e[name=FALL,type=armor_stand,distance=..1] fall 1
execute as @e[name=FALL,type=armor_stand,scores={fall=30}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=FALL,type=armor_stand,scores={fall=30}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=FALL,type=armor_stand,scores={fall=90..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[type=armor_stand,name=FALL,scores={fall=90}] at @s run setblock ~ ~-1 ~ lime_concrete
scoreboard players set @e[name=FALL,type=armor_stand,scores={fall=90..}] fall 0
#levitation
scoreboard objectives add levi dummy
execute as @e[name=LEV,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"LEV",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=LEV,type=bat] at @s run scoreboard players set @e[name=LEV,type=armor_stand,distance=..1] levi 89
kill @e[name=LEV,type=bat]
execute as @e[type=armor_stand,name=LEV,scores={levi=0}] at @s run effect give @a[distance=..1] minecraft:levitation 3 2 true
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=LEV,type=armor_stand,distance=..1] levi 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=LEV,type=armor_stand,distance=..1,scores={levi=2..}] levi 1
scoreboard players add @e[type=armor_stand,name=LEV,scores={levi=1..}] levi 1
execute as @e[name=LEV,type=armor_stand,scores={levi=10}] at @s run scoreboard players add @e[name=LEV,type=armor_stand,distance=..1] levi 1
execute as @e[name=LEV,type=armor_stand,scores={levi=30}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=LEV,type=armor_stand,scores={levi=30}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=LEV,type=armor_stand,scores={levi=90..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[type=armor_stand,name=LEV,scores={levi=90..}] at @s run setblock ~ ~-1 ~ magenta_concrete
scoreboard players set @e[name=LEV,type=armor_stand,scores={levi=90..}] levi 0
#Allgemein
execute as @e[name=STOP,type=bat] at @s run kill @e[type=armor_stand,distance=..1]
kill @e[type=bat,name=STOP]
execute as @e[name=STOP!,type=bat] at @s run kill @e[type=armor_stand,distance=..10]
kill @e[type=bat,name=STOP!]
execute as @e[name=STOP!!,type=bat] at @s run kill @e[type=armor_stand,distance=..100]
kill @e[type=bat,name=STOP!!]
gamerule mobGriefing false
gamerule commandBlockOutput false
#Extra
#Nuke
scoreboard objectives add nuke dummy
scoreboard objectives add nuketake dummy
execute as @e[name=NUKE,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"NUKE",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=NUKE,type=bat] at @s run scoreboard players set @e[name=NUKE,type=armor_stand,distance=..1] nuke 1999
kill @e[name=NUKE,type=bat]
execute as @e[type=armor_stand,name=NUKE,scores={nuke=0}] at @s run scoreboard players add @p[distance=..1] nuketake 1
execute as @e[type=armor_stand,name=NUKE,scores={nuke=0}] at @s run give @p[distance=..1] firework_rocket{display:{Name:"NUKE"}} 1
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=NUKE,type=armor_stand,distance=..1] nuke 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=NUKE,type=armor_stand,distance=..1,scores={nuke=2..}] nuke 1
scoreboard players add @e[type=armor_stand,name=NUKE,scores={nuke=1..}] nuke 1
execute as @e[name=NUKE,type=armor_stand,scores={nuke=20}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=NUKE,type=armor_stand,scores={nuke=20}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=LEV,type=armor_stand,scores={levi=2000..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[type=armor_stand,name=NUKE,scores={nuke=2000..}] at @s run setblock ~ ~-1 ~ yellow_concrete
scoreboard players set @e[name=NUKE,type=armor_stand,scores={nuke=2000..}] nuke 0
execute as @e[type=fireworks_rocket] at @s run summon creeper ~0 ~1 ~0 {CustomName:"NUKE",CustomNameVisible:1,ExplosionRadius:100,Fuse:1,powered:1}
effect give @e[type=creeper,name=NUKE] minecraft:speed 120 10
execute as @e[type=fireworks_rocket] at @s run effect give @p[scores={nuketake=1..}] minecraft:invisibility 30 1
execute as @e[type=fireworks_rocket] run scoreboard players remove @e[scores={nuketake=1..}] nuketake 1
kill @e[type=fireworks_rocket]
#Fishing rod
execute as @e[name=unknown] at @s as @e[name=!unknown,distance=..1] at @s run summon minecraft:shulker_bullet ~ ~1 ~-2
execute as @e[name=unknown] at @s as @e[name=!unknown,distance=..1] at @s run summon minecraft:shulker_bullet ~ ~1 ~2
execute as @e[name=unknown] at @s as @e[name=!unknown,distance=..1] at @s run summon minecraft:shulker_bullet ~-2 ~1 ~
execute as @e[name=unknown] at @s as @e[name=!unknown,distance=..1] at @s run summon minecraft:shulker_bullet ~2 ~1 ~
execute as @e[name=unknown] at @s as @e[name=!unknown,distance=..1] at @s run summon minecraft:shulker_bullet ~ ~3 ~
execute as @e[name=!unknown] at @s run kill @e[name=unknown,distance=..1]
#Bow
scoreboard objectives add arrow dummy
execute as @e[type=arrow] run summon minecraft:snowball
scoreboard players set @e[type=arrow,nbt={inGround:1b}] arrow 1
kill @e[type=arrow,scores={arrow=1..}]
#Potion
execute as @e[name=entity.AreaEffectCloud.name] at @s run effect give @a[distance=..2] minecraft:slowness 1 5
execute as @e[name=entity.AreaEffectCloud.name] at @s run effect give @a[distance=..1] minecraft:slowness 1 10
execute as @e[name=entity.AreaEffectCloud.name] at @s run effect give @a[distance=..1] minecraft:jump_boost 1 250
#Equip
execute as @e[name=STUFF,type=bat] at @s run give @p stick{ench:[{id:"19",lvl:3}]} 1
execute as @e[name=STUFF,type=bat] at @s run give @p bow{Damage:0s}
execute as @e[name=STUFF,type=bat] at @s run give @p fishing_rod{Damage:0s}
execute as @e[name=STUFF,type=bat] at @s run give @p snowball 16
execute as @e[name=STUFF,type=bat] at @s run give @p lingering_potion{Potion:slowness} 1
execute as @e[name=STUFF,type=bat] at @s run give @p potion{Potion:strong_healing} 1
execute as @e[name=STUFF,type=bat] at @s run give @p ender_pearl 8
execute as @e[name=STUFF,type=bat] at @s run give @p arrow 64
execute as @e[name=STUFF,type=bat] at @s run replaceitem entity @p armor.head chainmail_helmet{Damage:0s}
execute as @e[name=STUFF,type=bat] at @s run replaceitem entity @p armor.chest chainmail_chestplate{Damage:0s}
execute as @e[name=STUFF,type=bat] at @s run replaceitem entity @p armor.legs chainmail_leggings{Damage:0s}
execute as @e[name=STUFF,type=bat] at @s run replaceitem entity @p armor.feet chainmail_boots{Damage:0s}
kill @e[type=bat,name=STUFF]
#ALL
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
kill @e[type=bat,name=ALL]
thats it i used a converter to get it from 1.12 to 1.13 so that might also be a problem i dont really know what has changed about all the commands so if someone could help me that would be very nice
The Meaning of Life, the Universe, and Everything.
Join Date:
1/26/2018
Posts:
48
Member Details
You need to make sure that it's in the right directory. The datapacks are broken down differently. So, you'll have one folder for customdev, which will contain the functions folder, and then the actual function
However, the minecraft one needs to be inside the /datapack/data/(datapack name)/ folder. The breakdown is as follows:
datapacks
->(name of datapack)
->data
pack.mcmeta
->(namespace)
->functions
(all mcfunction files)
->minecraft
->tags
->functions
tick.json
Notice how the folders for (namespace) and minecraft are inside the data folder, and both branch off differently.
Inside that tick.json file, you can reference the function you want to run every tick. But the folder structure HAS to be identical, or it won't work.
The minecraft:load tag does not seem to be working on Java Edition 1.13.1
I have a function that simply outfits the player with armor, I can call it successfully, but adding it to load.json does not run the function. I have used the same directory structure as shown above.
It 'obviously' does not need to run every tick. =)
The tag minecraft:load works. Minecraft load datapacks before loading players into world, so any commands in functions tagged minecraft:load can't affect players in the first load. Try /reload.
Many commands will be changing in 1.13. Here is a GitHub gist with the new syntax
https://gist.github.com/Dinnerbone/943fbcd763c19be188ed6b72a12d7e65
Functions are stored inside .mcfunction files, which themselves are stored inside 'data packs'
Functions are then called with the following
/function customdev:functiondev
would call /datapacks/customdev/data/customdev/functions/functiondev.mcfunction
.mcfunction file
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.
Data Pack Usage
Data packs can be placed in the .minecraft/saves/(world)/datapacks folder of a world. Each data pack is either a sub-folder or a .zip file within the datapacks folder. After it is in the folder, a data pack will be enabled for that world.
Data packs will load their data based on the load order. This order can be seen and altered by using the /datapack command.
pack.mcmeta
A data pack is identified by Minecraft based on the presence of the pack.mcmeta file in the root directory of the data pack, which contains data in JSON format.
pack: Holds the data pack information.
pack_format: Pack version. Can be any number.
description: A description. This string must exist but can be empty. This description will show when hovering over the data pack in the data pack list.
Example json
Each advancement, function, loot table, structure, recipe and tag file can be placed directly in their respective folder but sub-folders are also allowed.
To execute a function every tick
To execute a function every tick you must tag the function with the "minecraft:tick" tag. To do this create the following tick.json
C:\Path_to_Minecraft\world\datapacks\customdev\data\minecraft\tags\functions\tick.json
would call C:\Path_to_Minecraft\world\datapacks\customdev\data\customdev\functions\functiondev.mcfunction every tick
hey i have a problem with running my function i have everything right at least i think so its more a problem with the function itself. in the functions folder of my datapack i have my function and another one from some guy. the function of the other person can run with out a problem. but mine is not even beeing registert by the game
well i must say it is a pretty long function so maybe its that limitation but i put it the limit on max and its not running so that would be pretty weird.
start of function
#Clay run away made by Cunibon
#INSTALLATION: if you read this you downloaded this function put the hole folder in wich this text is into the functions folder of the world you want this to be in. The functions folder is in the data folder of your world. then grab a commandblock set it in repeat and always active (also put it in your spawn chunks so it works where ever you are.) then copy this in: "function Clay:Clay" congrats you installed the function have fun.
#EXPLANATION: To be able to use this function on a server you will need op. Grab a bat Spawn egg and name it "clay" if you spawn in the bat with this name a block will apear. the block will switch colors if you stand on it and at the end it will disapear. It can fore example be used for minigames. After a short amount of time the blocks will reapear.If you want to change the time it taks you will need to configurate the lines 15 and 16. change the number 100 to what ever number you want. Both nummbers will need to be the same. to get ride of them simply name a bat "STOP" and put it down next above the block. Then you can destroy the block.
#Blocks
#clay
scoreboard objectives add Tick dummy
execute as @e[name=clay,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"OnexOne",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=clay,type=bat] at @s run scoreboard players set @e[name=OnexOne,type=armor_stand,distance=..1] Tick 49
kill @e[name=clay,type=bat]
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=OnexOne,type=armor_stand,distance=..1] Tick 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=OnexOne,type=armor_stand,distance=..1,scores={Tick=2..}] Tick 1
scoreboard players add @e[type=armor_stand,name=OnexOne,scores={Tick=1..}] Tick 1
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=3}] at @s run setblock ~ ~-1 ~ yellow_terracotta
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=6}] at @s run setblock ~ ~-1 ~ red_terracotta
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=9}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=9}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=50..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[name=OnexOne,type=armor_stand,scores={Tick=50}] at @s run setblock ~ ~-1 ~ green_terracotta
scoreboard players set @e[name=OnexOne,type=armor_stand,scores={Tick=50..}] Tick 0
#brick
scoreboard objectives add brTick dummy
execute as @e[name=brick,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"bri",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=brick,type=bat] at @s run scoreboard players set @e[name=bri,type=armor_stand,distance=..1] brTick 249
kill @e[name=brick,type=bat]
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=bri,type=armor_stand,distance=..1] brTick 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=bri,type=armor_stand,distance=..1,scores={brTick=2..}] brTick 1
scoreboard players add @e[type=armor_stand,name=bri,scores={brTick=1..}] brTick 1
execute as @e[name=bri,type=armor_stand,scores={brTick=25}] at @s run setblock ~ ~-1 ~ mossy_stone_bricks
execute as @e[name=bri,type=armor_stand,scores={brTick=50}] at @s run setblock ~ ~-1 ~ cracked_stone_bricks
execute as @e[name=bri,type=armor_stand,scores={brTick=75}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=bri,type=armor_stand,scores={brTick=75}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=bri,type=armor_stand,scores={brTick=250..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[name=bri,type=armor_stand,scores={brTick=250}] at @s run setblock ~ ~-1 ~ stone_bricks
scoreboard players set @e[name=bri,type=armor_stand,scores={brTick=250..}] brTick 0
#obsidian
scoreboard objectives add obTick dummy
execute as @e[name=obsidian,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"Obsi",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=obsidian,type=bat] at @s run scoreboard players set @e[name=Obsi,type=armor_stand,distance=..1] obTick 599
kill @e[name=obsidian,type=bat]
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=Obsi,type=armor_stand,distance=..1] obTick 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=Obsi,type=armor_stand,distance=..1,scores={obTick=2..}] obTick 1
scoreboard players add @e[type=armor_stand,name=Obsi,scores={obTick=1..}] obTick 1
execute as @e[name=Obsi,type=armor_stand,scores={obTick=60}] at @s run setblock ~ ~-1 ~ stone
execute as @e[name=Obsi,type=armor_stand,scores={obTick=120}] at @s run setblock ~ ~-1 ~ cobblestone
execute as @e[name=Obsi,type=armor_stand,scores={obTick=180}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=Obsi,type=armor_stand,scores={obTick=180}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=Obsi,type=armor_stand,scores={obTick=600..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[name=Obsi,type=armor_stand,scores={obTick=600}] at @s run setblock ~ ~-1 ~ obsidian
scoreboard players set @e[name=Obsi,type=armor_stand,scores={obTick=600..}] obTick 0
#heal
scoreboard objectives add heal dummy
execute as @e[name=HEAL,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"SAT",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=HEAL,type=bat] at @s run scoreboard players set @e[name=SAT,type=armor_stand,distance=..1] heal 89
kill @e[name=HEAL,type=bat]
execute as @e[type=armor_stand,name=SAT,scores={heal=0}] at @s run effect give @a[distance=..1] minecraft:saturation 2 10 true
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=SAT,type=armor_stand,distance=..1] heal 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=SAT,type=armor_stand,distance=..1,scores={heal=2..}] heal 1
scoreboard players add @e[type=armor_stand,name=SAT,scores={heal=1..}] heal 1
execute as @e[name=SAT,type=armor_stand,scores={heal=10}] at @s run scoreboard players add @e[name=SAT,type=armor_stand,distance=..1] heal 1
execute as @e[name=SAT,type=armor_stand,scores={heal=30}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=SAT,type=armor_stand,scores={heal=30}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=SAT,type=armor_stand,scores={heal=90..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[type=armor_stand,name=SAT,scores={heal=90}] at @s run setblock ~ ~-1 ~ red_concrete
scoreboard players set @e[name=SAT,type=armor_stand,scores={heal=90..}] heal 0
#NoFallDamage
scoreboard objectives add fall dummy
execute as @e[name=BOOST,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"FALL",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=BOOST,type=bat] at @s run scoreboard players set @e[name=FALL,type=armor_stand,distance=..1] fall 89
kill @e[name=BOOST,type=bat]
execute as @e[type=armor_stand,name=FALL,scores={fall=0}] at @s run effect give @a[distance=..1] minecraft:resistance 15 255 true
execute as @e[type=armor_stand,name=FALL,scores={fall=0}] at @s run effect give @a[distance=..1] minecraft:speed 15 0 true
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=FALL,type=armor_stand,distance=..1] fall 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=FALL,type=armor_stand,distance=..1,scores={fall=2..}] fall 1
scoreboard players add @e[type=armor_stand,name=FALL,scores={fall=1..}] fall 1
execute as @e[name=FALL,type=armor_stand,scores={fall=10}] at @s run scoreboard players add @e[name=FALL,type=armor_stand,distance=..1] fall 1
execute as @e[name=FALL,type=armor_stand,scores={fall=30}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=FALL,type=armor_stand,scores={fall=30}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=FALL,type=armor_stand,scores={fall=90..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[type=armor_stand,name=FALL,scores={fall=90}] at @s run setblock ~ ~-1 ~ lime_concrete
scoreboard players set @e[name=FALL,type=armor_stand,scores={fall=90..}] fall 0
#levitation
scoreboard objectives add levi dummy
execute as @e[name=LEV,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"LEV",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=LEV,type=bat] at @s run scoreboard players set @e[name=LEV,type=armor_stand,distance=..1] levi 89
kill @e[name=LEV,type=bat]
execute as @e[type=armor_stand,name=LEV,scores={levi=0}] at @s run effect give @a[distance=..1] minecraft:levitation 3 2 true
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=LEV,type=armor_stand,distance=..1] levi 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=LEV,type=armor_stand,distance=..1,scores={levi=2..}] levi 1
scoreboard players add @e[type=armor_stand,name=LEV,scores={levi=1..}] levi 1
execute as @e[name=LEV,type=armor_stand,scores={levi=10}] at @s run scoreboard players add @e[name=LEV,type=armor_stand,distance=..1] levi 1
execute as @e[name=LEV,type=armor_stand,scores={levi=30}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=LEV,type=armor_stand,scores={levi=30}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=LEV,type=armor_stand,scores={levi=90..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[type=armor_stand,name=LEV,scores={levi=90..}] at @s run setblock ~ ~-1 ~ magenta_concrete
scoreboard players set @e[name=LEV,type=armor_stand,scores={levi=90..}] levi 0
#Allgemein
execute as @e[name=STOP,type=bat] at @s run kill @e[type=armor_stand,distance=..1]
kill @e[type=bat,name=STOP]
execute as @e[name=STOP!,type=bat] at @s run kill @e[type=armor_stand,distance=..10]
kill @e[type=bat,name=STOP!]
execute as @e[name=STOP!!,type=bat] at @s run kill @e[type=armor_stand,distance=..100]
kill @e[type=bat,name=STOP!!]
gamerule mobGriefing false
gamerule commandBlockOutput false
#Extra
#Nuke
scoreboard objectives add nuke dummy
scoreboard objectives add nuketake dummy
execute as @e[name=NUKE,type=bat] at @s run summon armor_stand ~ ~1 ~ {CustomName:"NUKE",NoGravity:1b,Marker:1b,Invisible:1b}
execute as @e[name=NUKE,type=bat] at @s run scoreboard players set @e[name=NUKE,type=armor_stand,distance=..1] nuke 1999
kill @e[name=NUKE,type=bat]
execute as @e[type=armor_stand,name=NUKE,scores={nuke=0}] at @s run scoreboard players add @p[distance=..1] nuketake 1
execute as @e[type=armor_stand,name=NUKE,scores={nuke=0}] at @s run give @p[distance=..1] firework_rocket{display:{Name:"NUKE"}} 1
execute as @e[type=!armor_stand] at @s run scoreboard players add @e[name=NUKE,type=armor_stand,distance=..1] nuke 1
execute as @e[type=!armor_stand] at @s run scoreboard players remove @e[name=NUKE,type=armor_stand,distance=..1,scores={nuke=2..}] nuke 1
scoreboard players add @e[type=armor_stand,name=NUKE,scores={nuke=1..}] nuke 1
execute as @e[name=NUKE,type=armor_stand,scores={nuke=20}] at @s run setblock ~ ~-1 ~ air
execute as @e[name=NUKE,type=armor_stand,scores={nuke=20}] at @s run playsound minecraft:block.anvil.break block @p
execute as @e[name=LEV,type=armor_stand,scores={levi=2000..}] at @s run playsound minecraft:entity.armorstand.fall block @p
execute as @e[type=armor_stand,name=NUKE,scores={nuke=2000..}] at @s run setblock ~ ~-1 ~ yellow_concrete
scoreboard players set @e[name=NUKE,type=armor_stand,scores={nuke=2000..}] nuke 0
execute as @e[type=fireworks_rocket] at @s run summon creeper ~0 ~1 ~0 {CustomName:"NUKE",CustomNameVisible:1,ExplosionRadius:100,Fuse:1,powered:1}
effect give @e[type=creeper,name=NUKE] minecraft:speed 120 10
execute as @e[type=fireworks_rocket] at @s run effect give @p[scores={nuketake=1..}] minecraft:invisibility 30 1
execute as @e[type=fireworks_rocket] run scoreboard players remove @e[scores={nuketake=1..}] nuketake 1
kill @e[type=fireworks_rocket]
#Fishing rod
execute as @e[name=unknown] at @s as @e[name=!unknown,distance=..1] at @s run summon minecraft:shulker_bullet ~ ~1 ~-2
execute as @e[name=unknown] at @s as @e[name=!unknown,distance=..1] at @s run summon minecraft:shulker_bullet ~ ~1 ~2
execute as @e[name=unknown] at @s as @e[name=!unknown,distance=..1] at @s run summon minecraft:shulker_bullet ~-2 ~1 ~
execute as @e[name=unknown] at @s as @e[name=!unknown,distance=..1] at @s run summon minecraft:shulker_bullet ~2 ~1 ~
execute as @e[name=unknown] at @s as @e[name=!unknown,distance=..1] at @s run summon minecraft:shulker_bullet ~ ~3 ~
execute as @e[name=!unknown] at @s run kill @e[name=unknown,distance=..1]
#Bow
scoreboard objectives add arrow dummy
execute as @e[type=arrow] run summon minecraft:snowball
scoreboard players set @e[type=arrow,nbt={inGround:1b}] arrow 1
kill @e[type=arrow,scores={arrow=1..}]
#Potion
execute as @e[name=entity.AreaEffectCloud.name] at @s run effect give @a[distance=..2] minecraft:slowness 1 5
execute as @e[name=entity.AreaEffectCloud.name] at @s run effect give @a[distance=..1] minecraft:slowness 1 10
execute as @e[name=entity.AreaEffectCloud.name] at @s run effect give @a[distance=..1] minecraft:jump_boost 1 250
#Equip
execute as @e[name=STUFF,type=bat] at @s run give @p stick{ench:[{id:"19",lvl:3}]} 1
execute as @e[name=STUFF,type=bat] at @s run give @p bow{Damage:0s}
execute as @e[name=STUFF,type=bat] at @s run give @p fishing_rod{Damage:0s}
execute as @e[name=STUFF,type=bat] at @s run give @p snowball 16
execute as @e[name=STUFF,type=bat] at @s run give @p lingering_potion{Potion:slowness} 1
execute as @e[name=STUFF,type=bat] at @s run give @p potion{Potion:strong_healing} 1
execute as @e[name=STUFF,type=bat] at @s run give @p ender_pearl 8
execute as @e[name=STUFF,type=bat] at @s run give @p arrow 64
execute as @e[name=STUFF,type=bat] at @s run replaceitem entity @p armor.head chainmail_helmet{Damage:0s}
execute as @e[name=STUFF,type=bat] at @s run replaceitem entity @p armor.chest chainmail_chestplate{Damage:0s}
execute as @e[name=STUFF,type=bat] at @s run replaceitem entity @p armor.legs chainmail_leggings{Damage:0s}
execute as @e[name=STUFF,type=bat] at @s run replaceitem entity @p armor.feet chainmail_boots{Damage:0s}
kill @e[type=bat,name=STUFF]
#ALL
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
execute as @e[name=ALL,type=bat] at @s run give @p bat_spawn_egg 1
kill @e[type=bat,name=ALL]
thats it i used a converter to get it from 1.12 to 1.13 so that might also be a problem i dont really know what has changed about all the commands so if someone could help me that would be very nice
doesn't work. I can call the tick function once in-game, but it doesn't loop.
This. I'm having this issue right now. And official documentation on how this works is still pretty light on info.
You need to make sure that it's in the right directory. The datapacks are broken down differently. So, you'll have one folder for customdev, which will contain the functions folder, and then the actual function
However, the minecraft one needs to be inside the /datapack/data/(datapack name)/ folder. The breakdown is as follows:
datapacks
Notice how the folders for (namespace) and minecraft are inside the data folder, and both branch off differently.
Inside that tick.json file, you can reference the function you want to run every tick. But the folder structure HAS to be identical, or it won't work.
Is the layout for loot_tables different? I mean is it the same from 1.12?
Don't pretend to be someone you aren't. Be yourself. Even if you try to be someone else ill knows its you. Your a terrible actor.
yo dude i want to make a block tag but it doesn't seem to work.. can you tell me where the new block tag feature should be?
Why this :
/function needed:buff
don't call this :
\datapacks\needed\data\adds\functions\buff.mcfunction
?????????????????????
The issue you have is you are not refferencing the name space of "add" your command should look like this
this should correct your issue. Hope this helps
So if I want to make many functions working every tick, what should I do?
I wrote a very basic datapack to get people started that loops a function (or functions) every tick
https://github.com/Veritas83/minecraft-1.13-function-loop
Simply add further function calls in /veritas0923/data/v0923/functions/gameloop.mcfunction
To remove my branding simply rename the 2 folders and edit the ticks.json to reference your new folder.
The minecraft:load tag does not seem to be working on Java Edition 1.13.1
I have a function that simply outfits the player with armor, I can call it successfully, but adding it to load.json does not run the function. I have used the same directory structure as shown above.
It 'obviously' does not need to run every tick. =)
My social Links:
The tag minecraft:load works. Minecraft load datapacks before loading players into world, so any commands in functions tagged minecraft:load can't affect players in the first load. Try /reload.
ewe
Thanks for that critical bit of information! None of the "normal" documentation sources mentioned that.
My social Links: