#Tick function not working
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
1.21 renamed many folders that make up a Minecraft datapack, breaking virtually all datapacks from prior versions. Now, all folders which previously had plural names, except tags, now have singular names.
Below is a list of all folder names changed in 1.21:
structures -> structure
advancements -> advancement
recipes -> recipe
loot_tables -> loot_table
predicates -> predicate
item_modifiers -> item_modifier
functions -> function
tags/functions -> tags/function
tags/items -> tags/item
tags/blocks -> tags/block
tags/entity_types -> tags/entity_type
tags/fluids -> tags/fluid
tags/game_events -> tags/game_event
If you use items anywhere in your pack, you will also have to update them to the new component system which replaces NBT for items
yeah i did that for some of them
i shortened functions to function
& all the other thigns
i updated all the things
the tick function still doesnt owrk
Can you please show us your tick function?
ill js send it
like it appears
when doing /function phazics:tick
but its not happening every tick
Ah, let's see the tick function tag then
not atm
Let's start there
What should I be looking for?
Any errors or warnings related to your pack or functions
Have you tried putting a say command in your tick function?
yep
And?
It doesn't work
Hm
You're sure this pack is the one you're actually testing in-game with? You didn't leave it on your desktop or something?
nope
Then there's not really a reason the tick function wouldn't be running 🤷♂️ Your tag is correct, your folders are correct, there's no syntax error
I know Kano said not to, but could you send the pack?
I'm sure it's something dumb and silly.
did you find anything?
@open sequoia
I'm looking through it rn
It's probably because you are checking for item nbt, but in 1.21 you need to use components.
I'm guessing these commands would throw an error if you tried to run them in the chat.
how would i fix that easily
But the function shows up when they use /function
Hmm
and when i did
I would have thought the same thing but if it were a syntax error preventing the whole thing from running, it shouldn't appear in chat at all
I loaded the pack in a new world, and it works perfectly fine
interesting
Have you tried restarting the world?
Does it work?
Yes, good idea.
Okay, this may sound stupid, but are you on the right Minecraft version?
Any mods?
lunar client
Could be that, Lunar is super weird
Try in vanilla
yeah ill try it in vanilla
nope
doesnt work
im on 1.21
When I try and do the /function phazics:dagger_craft (when holding should give you speed) it doesn't work. No mods, correct version, right nbt things & right items
The folder is in the datapacks folder
Well that's a result of the component changes
We're not worried about that right now, the tick function is what's important
Yes, but I used that to test if the tick function was working
Well don't, cause it's not gonna work regardless 😅
and I updated the components via McStacker
Ah, if you already did that then let's see what you have
There we go, so the tick function is working
now how would i update this
execute as @a[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{dragon:1b}}]}] at @s run function phazics:dragon/effect
to the new component system
I thought you said you did already? 😅
The dragon:1b, if you converted it correctly, is now inside the custom data component, so you'll need to check the path components:{"minecraft:custom_data":{dragon:1b}}
ok
That's from memory so it may not be 100% accurate
But I'd also recommend changing this to an execute if items ... command, as that'll make it even easier to check the components of the item in that slot, or indeed, use a predicate
That's also not to mention that optimizing your tick function will not only improve performance, but make updating most everything a lot easier for you
yea i was a bit lazy while making it
wasn't really focusing on optimizitation
just getting it done
Once you're familiar with the concepts, writing optimized code is actually a lot lazier 😄
If your question is resolved, that's great to hear! Make sure to run /resolve or click the Resolve Question button. Otherwise, feel free to continue asking for help! :D