#Ive been working on this datapack for over a month
1 messages · Page 1 of 1 (latest)
💬 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
do you have a pack.mcmeta? if so, what are it's contents?
pacl mcmeta?
the contents are
Void_unriv
inside that is data
inside that is Random items
Inside that is advancements and functions
inside advancements is triggers which reads as {
"criteria": {
"trigger": {
"trigger": "minecraft:tick"
}
},
"rewards": {
"function": "random_items:give_items"
}
}
that is my function folder
i need the pack.mcmeta file that is in the root project of your datapack
there is no pack mcmeta
thats the issue
look here under "contents https://minecraft.wiki/w/Data_pack
The data pack system provides a way for players to further customize their Minecraft experience. Data packs can be used to override or add new advancements, dimensions, functions, loot tables, predicates, item modifiers, recipes, structures, tags, damage types, world generation settings, and biomes without any code modification.
<@&935561184806060073>
Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)
have ya checked the logs?
The logs are where Minecraft displays errors when something goes wrong and can thus help you gain information about why something isn't working for you!
To open the logs:
- Enable logs in the Minecraft Launcher
- Start your game (or restart it if you already have an open instance)
- Enjoy spotting errors getting much easier!
You can't use capital letters
the foldere names all have ccapital letters
spaces are also not valid
Void_unriv/data/Random Items/select_item.mcfunction.txt:
scoreboard players set @a[distance=..30, scores={random_items=1..}] selected_items 0
execute as @a[distance=..30, scores={random_items=1..}] run scoreboard players add @a[distance=..10, scores={random_items=1..}] selected_items 1
Missing metadata in pack file/Void_unriv (4).zip
oh yeah
your pack.mcmeta is a txt file
Oh
and so are all the other files
how do i fix that
one sec
I feel stupid now o_o lol
fair enough
just make sure you turn on that setting so that you can see the actual file name extensions in the file explorer
but yeah you need to make sure that all files and folders have no spaces, no capital letters, and aren’t .txt
then you should be good to go
Void_unriv/data/Random Items/Functions/give_selected_items.mcfunction.mcfunction:
execute as @a[distance=..30, scores={random_items=3, selected_items=3}] run function random_items:give_selected_item
#1193304263556870244 message
that’s just a viewer so we can look in the zip you sent without needing to download it ourselves
Ohhhh
Ok
I appreciate all the help guys this is for a friend who is trying to make his first youtube video
Just wanted to say thank you 😄
no problem :)
That's what we're here for
lmk if you find the problem 😭
the problem is this lol
Really I thought i fixed it
can you screenshot this line?
it should be world/datapacks/<the datapack>/data
<the datapack> can in theory be a zip, but you ziped it so the zip contains a folder, and that folder contains data and pack.mcmeta
you would have to zip it so inside the zip is just data and pack.mcmeta, not a folder which contains those two
Ok the pack is on now
does it show up if you run /datapack list enabled?
its supposed to give every player 3 random items every minute
the idea was spawning on one piece of bedrock and then every player tries to survive with 3 items every minute
hmm
oh i see
two of your functions aren't in the functions folder
these four
all functions need to be in functions folder otherwise Minecraft doesnt bother reading them
yeah
just reload
is there any red text in the logs?
Might have done :P
If you just want to give them 3 completely random items you can do that with a loot table
Bit simpler. You'd need to generate a loot table which gives a random item from a list of items, because youd be there forever if you did it by hand
but then you just need to run /loot give @s loot random_item:whatever to get a random item
So how would I go about pulling this off? and at the point just redo the pack?
do you just want to give all players 3 random items every minute? or is there more to it
Nope thats it
one which does the giving of items, and one which tells the other one to run every minute
so i can remove the trigger json?
yeah
you can remove everything except init.mcfunction, because you only need that to tell the other function to run
just create it again
now i dont suppose you'd know how to generate a loot table very easily right
scoreboard objectives add timed_items dummy
scoreboard objectives add random_items dummy
Youd be right 😮
ill do it for ya
Just curious for future refrences
was there a source for this or did you already make it?
because that was fast 😮
I wrote a very short program just then to generate it myself. I got a list of all the items from a library by HeDeAn
Woah sounds badass man one day I hope to be as good as that
just copy and paste this in data/random_item/loot_tables/random.json
(Discord hides most of the file so make sure you download it, open it, and copy it all from there)
Ok gotcha
Wait i dont put it in functions?
intresting
theres so much to learn lmao
indeed
a loot table is basically a file which you can use to generate a set of items
you can actually change the amount of items it generates by changing this line at the top. I suggest you change 1 to 3
lmk when you're done because im kinda overwhelming you with information right now lol
nah its fine
this is the easy part
you need to create another mcfunction file (in the functions folder), call this something like every_minute.mcfunction
in this function we want to give all players the 3 items, then tell Minecraft to run itself again in one minute
Ok mmhmm
so when the function is run for the first time it creates a loop
loot give @a loot random_item:random
schedule function random_item:every_minute 60s```
that's the commands you'll want
is that it 😮
for this function yes
in init.mcfunction all you need is function random_item:every_minute
then the final thing
is to make init.mcfunction run when you /reload
so every time you /reload it will start the loop
Ohhh Ok
you can do this by creating a file in data/minecraft/tags/functions/load.json, and putting this in it:json { "values":[ "random_items:init" ] }
then you should be finally done
oh ok
(data should contain random_items already)
in data create the minecraft folder, in the minecraft folder create the tags folder, in the tags folder create the functions folder, in the functions folder create load.json and put that code i sent in it
sure
is there a way to add a custom command so it runs init when typed /start lucky_void
Just curious
if that was possible and easy to do
You can't add custom commands with datapacks. The closest we have is /trigger start or /function random_items:start
But right now it starts automatically when you run /reload
yep
Well I really really appreciate it
make sure you test it first to make sure it works
just reload
/reload should run the init function automatically because of the load.json thingy we just added
Void_unriv/data/random_items/functions/init.mcfunction:
function random_item:every_minute```
oh thats my bad
i said to put random_item instead of random_items
in every_minute.mcfunction
change that and it should be fine
oh so just add a s
ok
it doesnt appear to auto give every 60s like you had tried to make
it does give the items now thou 😄
send the new zip rq
Void_unriv/data/random_items/functions/init.mcfunction:
function random_items:every_minute```
urle 2
k
Ignore this C:\Users\PC\AppData\Local\Temp\mcworld-13896809138572996272
that works
maybe 59 seconds would work
Ive been making a new world
lol you dont need to do that
just put the folder in one world and edit the folder
how do I find the world ;-;
in minecraft, click on world -> edit -> open world folder