#I am trying to follow along the tutorial from the wiki, but something isn't working

1 messages · Page 1 of 1 (latest)

hot sky
#

I am currently just starting out on making a datapack, and I am following the tuorial from the wiki: https://datapack.wiki/guide/getting-started

I am using fabric 1.21.8 version
I was able to get the first function to work (/function example:hello_world) but I can't get the looping functions to work. (both say Hi, and the arrow stuck in the ground)

Need someone to tell me where I messed up. I'm not sure how to share my code though.

Datapack Wiki

Learn how to create a Minecraft datapack with our beginner's guide. This step-by-step tutorial will help you understand the basics of datapack creation, even if you have little coding knowledge. Start enhancing your Minecraft experience today!

slow cape
#

you didnt add your function to the tick function tag then

#

does it work when you manually run the function thats supposed to loop?

hot sky
#

no, none of the looping does anything

#

how do I add the tick function tag? is that in the tick.json?

slow cape
#

can you show what you have in your loop function?

hot sky
#

should I just copy and paste it?

slow cape
#

yeah sure

#

put ``` before and after it on new lines

hot sky
#

execute as @e[type=arrow,nbt={inGround:1b}] at @s run say I'm an arrow, I'm in the ground!

slow cape
#

and it doesnt say this when theres an arrow?

hot sky
#

correct

slow cape
#

have you tried just running say to see if it loops

hot sky
#

yes, I tried it when it was say Hi

#

but it never looped

slow cape
#

then you probably still didnt add it to the tick tag correctly

hot sky
#
  "values": ["example:loop"]
}```
#

this is my tick.json

#

am I missing it

slow cape
#

and your namespace is called example?

#

weird..

#

maybe im misunderstanding it but this should definitely work

hot sky
#

thats what I thought too

#

Im just following the tutorial line by line

slow cape
#

and it shows up in /function right? whats your path to the tick.json?

hot sky
#

data/minecraft/tags/function/tick.json

slow cape
#

scratches head

#

maybe im overlooking something

#

youll have to wait for someone elses help sorry eugh

hot sky
#

no problem. Im willing to wait as long as it takes to learn how to code

gray heath
#

is there any more datapacks in this world? if so, try disabling them

hot sky
#

No, I made a new world on 1.21.8 just to make the datapack

rare bridge
#

Can you send the whole pack zip here?

hot sky
rare bridge
#

Just to confirm, you are able to run the loop function in chat?

hot sky
#

would that be /function example:loop?

rare bridge
#

Mhm

rare bridge
# hot sky

Though this pack doesn't seem to have a working loop function, it just has hs in there

hot sky
#

let me try it again to test

#

It shows the function example:loop when I type /function

#

but nothing happens

rare bridge
#

Show what's in your loop function currently? Cause this pack just has
hs in there

hot sky
#

execute as @e[type=arrow,nbt={inGround:1b}] at @s run say I'm an arrow, I'm in the ground!

#

that is in loop.mcfunction

rare bridge
#

Okay, and I know you said you tested it before, but trying putting just a say command in there, and show your work when you do

hot sky
#

can do

rare bridge
#

The tick Json is fine, so if you can run the function from chat, there's no reason it shouldn't be running every tick period. It may just not be behaving as you expect

hot sky
#

so I replace the previous line with say Hi

#

correct?

rare bridge
#

Mhm

#

And then use /reload in game

hot sky
#

I ran that function, and nothing happened

#

though, after reloading, shouldn't it say in chat: reloaded!

#

or no

rare bridge
#

You ran the loop function from chat?

hot sky
#

yes

rare bridge
hot sky
#

it did not do anything

rare bridge
hot sky
rare bridge
#

Send your current pack again.

hot sky
#

okay

#

replaced execute as @e[type=arrow,nbt={inGround:1b}] at @s run say I'm an arrow, I'm in the ground! with say Hi

rare bridge
#

I think you are editing something different than what you think you're editing. This loop function is empty

hot sky
#

am I doing something wrong

rare bridge
#

I don't know, I can only operate on what I can see, and the data pack you just sent has nothing in its loop function

hot sky
#

im not sure if its gone through yet, but I sent a picture. This is the loop function spot right?

#

under loop.mcfunction

rare bridge
#

I see the picture, yes. That doesn't change anything though

#

Clearly there is some kind of disconnect between what you're editing and what you're sending me, which suggests there's a disconnect between what you're editing and what you're testing in-game

#

Seeing a screenshot of what you are editing doesn't change that

hot sky
#

oh I see

#

that's weird

#

what do you think I should do?

rare bridge
#

Try starting over. Fresh world, fresh data pack, make sure you open the right data pack in VSCode

hard moss
#

Did you turn on autosave for VSCode? If not, the file won't update in real-time

hot sky
#

Autosave was not on, so I just turned it on. I have been using Ctrl+S to save it. However, even with auto save im still having the same issue where its not saving it in game, but it is in VS code

hot sky
#

I made a new world, and im still having the same issue with the code

rare bridge
#

I'm afraid I don't know what to tell you, there's something up with your setup that I'm not able to diagnose; it's outside the purview of data packs and just comes down file management

hot sky
#

Is there a resource that would help me figure that out? Maybe a VS code setup tutorial or something?

hard moss
#

I don't know if we have any resources for that here, but I've seen some very good videos on how to set up datapacks with VSCode

#

Your problem reminds me of one I had when I first started making datapacks, but I can't quite remember how I solved it...

hot sky
#

Well it’s good to know I’m not going crazy. 😂
If you have any specific creators I can watch please lmk, otherwise I’ll just start looking it up

#

Do you guys want me to keep this post open so I can share what was wrong whenever I figure it out?

livid tiger
#

I think you might make it a little easier for yourself if you start by just putting the folder of your datapack in the datapacks folder of a test world.

For early development/testing I often prefer doing this as it requires as few steps as possible for changes in my datapack to take effect.

For a typical minecraft installation on windows this would mean your project would be located in C:\Users\<YOUR_USERNAME>\AppData\Roaming\.minecraft\saves\<YOUR_SAVE_NAME>\datapacks\<YOUR_DATAPACK_ROOT> with the root folder containing the data folder and pack.mcmeta, but you seem to have that part covered given your correctly structured .zip archives.

slow cape
#

i think the logical question can be "do other people's datapacks work in your world?"

livid tiger
#

Yeah it could very well be a fabric issue, although I usually run datapacks just fine with fabric (there could be a mod interferring however)

hot sky
#

Im using modrinth as my launcher, and I made a new instance with no mods just to test the datapack

#

after looking into vs code possible setup issues, I couldn't find any issues

#

and the datapack did work originally, it was just the loop function that I had issue with