2

Datapack functions do not work

KateGirlSK's Avatar KateGirlSK12/7/23 4:41 pm history
2 emeralds 269 7
12/10/2023 1:44 pm
A Lost Boy's Avatar A Lost Boy
I created my first new datapack for the version 1.19.2: Blessed Mode [​difficulty]. I created functions in it. When I started minecraft and put the datapack in the world in singleplayer, not a single function that I have in the datapack worked. I tried both /reload and /datapack and it didn't work. So I used the command /function to give one function at a time whether it goes and each function went one by one. I also have load and tick json on the datapack and I have a well-written basis in them. I have the following written in load.mcfunction:

# initialize mined oak wood
scoreboard objectives add mined_oak_wood minecraft.mined:minecraft.oak_log
scoreboard players set @a mined_oak_wood 0
# initialize crafting table
scoreboard objectives add crafting_table minecraft.used:minecraft.crafting_table
scoreboard players set @a crafting_table 0
#initialize timer
scoreboard objectives add effect_timer dummy
scoreboard players set TIMER effect_timer 0
# initialize mined with wood pickaxe
scoreboard objectives add stone_mined_with_wooden_pickaxe minecraft.mined:minecraft.stone_with_wooden_pickaxe
scoreboard players set @a stone_mined_with_wooden_pickaxe 0
# initialize golden apple
scoreboard objectives add used_golden_apple minecraft.used:minecraft.golden_apple
scoreboard players set @a used_golden_apple 0

function blessedmode:blessedmode
schedule function blessedmode:apply_effects 2400
schedule function blessedmode:golden_apple_effect 4800
schedule function blessedmode:stone_mining_effect 6000

And here is tick.mcfunction:

# Increasing the value of the time scoreboard in each tick (20 ticks is 1 second)
scoreboard players add TIMER effect_timer 1
# Time check every 30 minutes (30 minutes = 30 * 60 seconds = 1800 seconds)
execute if score TIMER effect_timer matches 1800 run function blessedmode:ApplyEffects
execute as @a[​scores={stone_mined_with_wooden_pickaxe=1..}] run function blessedmode:stone_mining_effect


I do not know what to do. I wouldn't want to put a datapack after every /function command, but for everything to go normally datapack. That if I put a datapack in the world and when I do something (eg: if I eat food, it will add one heart to my heart bar) it will go and I don't have to give commands to the functions. For more than a day I have been looking for the problem, where it is, how to fix it, but I don't know where it is. I read the pages, looked at the forums to see if I could find something similar on YouTube, but I couldn't find anything. Help me with this problem, pls. I will be happy for any help, big or small. If you want, I will also send you pictures of my functions that I have on the datapack.
Posted by KateGirlSK's Avatar
KateGirlSK
Level 30 : Artisan Miner
23

Create an account or sign in to comment.

7

imalittlhigh
12/08/2023 6:21 am
Level 62 : High Grandmaster Sweetheart
imalittlhigh's Avatar
Issues vscode tells me:

tick: blessedmode:ApplyEffects should be blessedmode:apply_effects

stone_mining_effect: stone_mining_effect: heart_particle is not an entity type

oak_wood_effect: wrong namespace for function called

load: minecraft.mined:minecraft.stone_with_wooden_pickaxe - idk if thats a 1.19 thing, but that doesnt appear to exist

kill_mob: missing int in front of force

golden_apple_effect: wrong namespace for function called

Also: just semantics, but you dont need to put "true"/"false" in "

From what i can see, get a code editor that recognizes mcfunction code and youll have less problems ^^
1
imalittlhigh
12/08/2023 6:14 am
Level 62 : High Grandmaster Sweetheart
imalittlhigh's Avatar
im not rly getting what ur exact problem is. Your functions ALL work when executed ingame? with /function?
Just load and tick functions dont trigger when u enter the world or do /reload?

If thats the case I have encountered that aswell. I dont rly know why it happens, but re-creating the functions (also the minecraft .jsons) [​deleting them and making new file] if that doesnt work, try making functions with other names and use them.

Could also be an issue with too many functions running in one tick (altho i doubt thats it)

If the load funciton runs, but tick doesnt, try scheduling tick from load and dont include it in the tick.json

If that doesnt help, no clue what the problem is
1
A Lost Boy
12/07/2023 5:04 pm
Level 31 : Artisan Magical Boy
A Lost Boy's Avatar
can you post a direct download link? might have to see the file structure in its entirety to really pinpoint the problem, because everything seems fine...
Also what I do is make a function that tells the player "Successfully initialized" just so you can save time when using /reload
1
KateGirlSK
12/07/2023 5:07 pm
Level 30 : Artisan Miner
KateGirlSK's Avatar
here is download link my datapack: https://www.planetminecraft.com/data-pack/blessed-mode-difficulty-1-19-x/


look on my fuctions on my datapack, pls
1
A Lost Boy
12/07/2023 5:22 pm
Level 31 : Artisan Magical Boy
A Lost Boy's Avatar
The functions initialize_crafting_table and initialize_golden_apple do not appear to exist.
1
KateGirlSK
12/07/2023 6:55 pm
Level 30 : Artisan Miner
history
KateGirlSK's Avatar
Ok, and where else am I wrong? I don't have anything to write in load.mcfunction or tick.mcfunction, because I have a lot of functions and I did not write or add much to load and tick if I made so many functions
1
A Lost Boy
12/10/2023 1:44 pm
Level 31 : Artisan Magical Boy
A Lost Boy's Avatar
I think you did everything else right, but I'm not completely sure. Sorry for the late reply.
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome