#datapack help

1 messages · Page 1 of 1 (latest)

stark elbow
#

So like some guy assigned me to make some datapack for him and i genuinely have no clue how to go about doing this so could someone please help me with this and tell me if its possible with datapacks?
where every 24 hrs someone gets a new bounty
and if u kill this bounty you get some type of reward
no clue how to implement this, someone pls help

silver charm
#

Yes it is possible

#

For the time thing it depends a bit on how you want to define "every 24 hours". You could have it reset at the same time every Minecraft day, after 24000 game ticks which is equivalent to a full day/night cycle without sleeping, after 24000 game ticks but only while the player is online, or after an actual 24 real life hours has elapsed. Which you go with will determine how you check the condition, so can't really make progress there without that decision made.

Either way, whenever that condition is met, you simply run a function that randomly selects between all the available targets, probably via a score, and assigns that score to the player's target score.

To detect if they killed that target, you probably need a player_killed_entity advancement for each possible target, which includes a condition that checks if the player actually has that corresponding target score. If they do, the advancement can be granted when they kill that target, and run a reward function that does whatever you want the reward to be

stark elbow
#

im kinda new to this

#

so like

#

idk

silver charm
#

Unfortunately that doesn't really help me help you

#

I'm not sure why you were assigned to make a data pack when you don't know how to make data packs, but I'd recommend first starting with our beginner's guide

rustic fossilBOT
silver charm
#

That'll give you some foundational knowledge, and then you can ask more specific questions about the high-level explanation I gave so I can elaborate on what you don't understand

#

"I don't understand any of it" doesn't really give me anything to work with

stark elbow
#

yeah i know the types of files and stuff

#

but idk how to code it

#

also how do i even start

silver charm
#

By deciding how you want to handle the time...

stark elbow
#

so 24 real life hours for each new one

#

sorry im kinda new to this

stark elbow
#

also second part idk how to do this one
every 10 minutes the hunter gets a ping of how many blocks from the target they are

velvet kelp
#

the new update releases tommorow

#

it adds world clocks

#

that handles your time problem

#

then

#

you would tag @r with bounty

#

then use a seperate world clock to ping the hunter, using a storage or scoreboard you calculate distance and put it in either a title or an actionbar

#

then upon killing them use an achievement to detect and give a loot table

stark elbow
#

ok

#

Does this work with both the 24 hours and 10 minutes?

velvet kelp
#

yes

stark elbow
#

Ok