#Dragon Egg Datapack

1 messages · Page 1 of 1 (latest)

coral lilyBOT
brisk summit
coral lilyBOT
brisk summit
#

it shows up in data pack list but doesnt do anything

stark glen
brisk summit
stark glen
brisk summit
#

i just joined the server

stark glen
#

the contents of the relevant files

#

(as the notice already says)

#

I won't download a random file from a stranger

brisk summit
#

mb dont have to be so harsh about it tho

stark glen
#

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

brisk summit
#

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?

brisk summit
# brisk summit
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"}```
brisk summit
# brisk summit
function dragon:spawn_egg
tellraw @a {"text":"The Dragon Egg has abandoned the player and seeks a new owner!","color":"light_purple"}```
brisk summit
# brisk summit

execute in minecraft:overworld positioned 0 80 0 run summon item ~ ~ ~ {Item:{id:"minecraft:dragon_egg",Count:1b}}

brisk summit
# brisk summit

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

summer island
brisk summit
#

tried rejoining

#

and still had the egg

#

nor it respawned the egg too

summer island
brisk summit
#

usually i found them

#

but this one was not so lucky for me

summer island
brisk summit
summer island
#

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?

brisk summit
#

so removing it from player and respawning is what im trying to achive here

summer island
summer island
#

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.

brisk summit
#

i would try paper as i know somewhat on skript but im forced to use fabric right now

summer island
#

What do you mean, Fabric? Fabric is for mods, isn't it?

brisk summit
#

fabric doesnt

summer island
#

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.

brisk summit
#

i mean i dont really want to waste your time 😭

summer island
# brisk summit 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.

brisk summit
#

sometimes it helps

summer island
#

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

summer island
brisk summit
summer island
#

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?

brisk summit
#

or thats what i understood

summer island
#

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.

summer island
brisk summit
summer island
brisk summit
#

is there any docs that also explain more about datapacks how to make them and stuff?

summer island
#

You can find lots of useful tutorials on YouTube.

brisk summit
#

thank you!

summer island
#

No problem

summer island
#

Ahhh

brisk summit
summer island
#

No problem

brisk summit
#

the ai isnt helping kinda or im just stupid likely that

latent muskBOT
brisk summit
#

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

stark glen
brisk summit
stark glen
#

So what is your goal?

brisk summit
stark glen
#

BuT wHaT eXaCtLy To YoU wAnT tO dO

brisk summit
#

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

stark glen
#

sorry, idk why I was so rude at first, but I really just want to help you

brisk summit
#

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

stark glen
#

So you tried using AI and it didn't work

brisk summit
stark glen
#

and now you want to make it yourself?

#

That's a cool mindset

#

lemme read the post description rq

brisk summit
stark glen
#

Here's a simple guide to get started

latent muskBOT
stark glen
#

Try to understand the basics

#

and come back then