#Dragon Egg Datapack
1 messages · Page 1 of 1 (latest)
this is the thing ive done so far
it shows up in data pack list but doesnt do anything

what can i start with
The notice isn't there just to look fancy
i understand that and i didnt know that you cant send zip files here
i just joined the server
the contents of the relevant files
(as the notice already says)
I won't download a random file from a stranger
mb dont have to be so harsh about it tho
yea sorry
It's a bit annoying since we added the notice just to prevent this from happening
But I get that if you're new you might not notice it
i dont really understand with which file to start with so ill reply to the files with the things inside of them and from there it could be possible to break down if the issue is in them or if even there is actual function to begin with
am i good to send them?
execute in minecraft:overworld positioned 0 80 0 run summon item ~ ~ ~ {Item:{id:"minecraft:dragon_egg",Count:1b}}
tellraw @a {"text":"The Dragon Egg has abandoned the player and seeks a new owner!","color":"light_purple"}```
function dragon:spawn_egg
tellraw @a {"text":"The Dragon Egg has abandoned the player and seeks a new owner!","color":"light_purple"}```
execute in minecraft:overworld positioned 0 80 0 run summon item ~ ~ ~ {Item:{id:"minecraft:dragon_egg",Count:1b}}
execute as @a[nbt={Inventory:[{id:"minecraft:dragon_egg"}]}] run function dragon:check_egg
dont flame me i tried to use ai at start because i didnt know what to start with
😭
never made datapacks because i never really needed them
really no clue how they work
I notice that you specify "1" as the quantity for the /clear and /summon commands; just so you know, if the number isn't specified, it defaults to 1 automatically. It’s really a matter of preference: personally, I leave it out in those cases to keep the code cleaner.
i guess but its still not working
tried rejoining
and still had the egg
nor it respawned the egg too
It looks like practically the same function, I don't understand what you're getting at.
thats why i said i used ai mostly 😭 i really didnt know what to start with since ive never made datapacks
usually i found them
but this one was not so lucky for me
Yes, because unless I am mistaken, you never detect the player's disconnection.
whats needed to detect that?
What is your main objective ? What do you ultimately want to achieve with this once the project is finished? Is it simply to ensure that if a player disconnects while carrying the dragon_egg, it appears at coordinates 0 y 0 in the overworld?
i want to keep the egg in cycle since it gives buffs to the player who carries the egg if a player would log off with the egg there would be no egg to chase after then
so removing it from player and respawning is what im trying to achive here
I know there is one, but I don't remember what it's made of.
Ah, okay, I see.
You can therefore run a looping function that checks if the player has a dragon_egg in their inventory, if they do and they disconnect, remove the dragon_egg and spawn a new one. To detect the player disconnecting, you can use the custom scoreboard variable custom:leave_game.
ill try something but i believe i will fail because this made 0 sense to me ill be honest 😭
i would try paper as i know somewhat on skript but im forced to use fabric right now
What do you mean, Fabric? Fabric is for mods, isn't it?
paper is paper it has skript plugin thingy
fabric doesnt
I could give you the code if you like it wouldn't take me much more than ten minutes but the goal is for you to understand what you are doing, so that you can code without help later on.
I code using Visual Studio.
i mean i dont really want to waste your time 😭
If I am trying to help you, it is because I have the time, in reality, I will spend more time explaining it to you than actually performing the technical work itself. I often ask for help, and when someone steps in to assist me, they do so of their own free will just as I am doing now.
sure
it would help i often check other files for examples and hope i get somewhere with them
sometimes it helps
Basically, to detect a player disconnecting, you do so within a function that runs in a loop :
execute if score @s leave_game matches 1 run clear @s dragon_egg
execute if score @s leave_game matches 1 run function namespace:spawn_dragon_egg
execute if score @s leave_game matches 1 run scoreboard players reset @s
Yes, that's how I started.
this goes in check_egg function am i right?
And in a function that runs when the mod starts up, you create the scoreboard, because it doesn't exist until then. Since leave_game is just a scoreboard name (a variable), you need to create that variable first so it gets recognized.
What does check_egg do?
i guess this one but as you said it doesnt really do much 😭
or thats what i understood
Yes, if you wish, my code can be set up to run in a loop (though you will need to configure this yourself, as a standard function only runs when manually triggered; you must specify which functions start when the world loads and which ones run every tick).
Each line checks if the player has a leave_game score of 1 (since a player's leave_game score increases by 1 when they leave the game).
The code first removes the egg from the player, then executes the function you configured (such as the one for spawning in the overworld), and finally resets the score so it is ready to detect the player's next disconnection.
No, the function here would be different the function triggered would be check_egg instead of spawn_dragon_egg but since check_egg already removes the egg from the player, you should remove the /clear command from the spawn_dragon_egg function.
on configuring im good somehow
Great 👍
is there any docs that also explain more about datapacks how to make them and stuff?
You can find lots of useful tutorials on YouTube.
thank you!
No problem
im lost ill be honest
Ahhh
sorry man 😭
No problem
the ai isnt helping kinda or im just stupid likely that
im not asking it to make me the datapack directly @stark glen what im asking it is what and how is supposed to be done
Can you explain what exactly you want to accomplish and how far you got again rq?
not very far because im still lost and im likely not doing something correctly
So what is your goal?
seek help on how to make the datapack thats why im here in general
BuT wHaT eXaCtLy To YoU wAnT tO dO
ight bro if you dont want to help you didnt have to reply to this thread i just sense you are here to clown on me or something
all i did was join and seek for help and you here seem to have a hard time with it so far interactions with you havent been the nicest
sorry, idk why I was so rude at first, but I really just want to help you
im new to datapacks no clue how or what is going on with them i practically know nothing about them
used ai to make the dragon egg respawn datapack (not dircetly) i was just asking what i need to do
but of course it is ai making the datapack and i didnt know that ai cant do that
So you tried using AI and it didn't work
but it was my first idea to go to
and now you want to make it yourself?
That's a cool mindset
lemme read the post description rq
cant really do that i dont know anything about datapacks how they act and what sort of code they go with
Here's a simple guide to get started