#datapack help
1 messages · Page 1 of 1 (latest)
Sure, have you ever made a datapack?
give me some time xD
Ok so sadly enough there isn't really a good way to put the player on fire, the damage can be applied easily but showing the overlay is the problem.
- You could summon a fireball above the player's head moving downwards rapidly
summon minecraft:small_fireball ~ ~2.1 ~ {Motion:[0b, -10b, 0b]}but that deals knockback and doesn't burn very long. - Burning arrows are also an option but similar to the fireball method
- A different method (and probably the best one) is to use a ticking advancement to place a lava block a the player's head and remove it in the same tick in a normal ticking function. This will not visually show the lava block but it will run the burning effects. The side effect is that this doesn't work when there is a block (like tall grass or a door) at the player's head
- The last method I can come up with is to make the burning effect from scratch, using the
/damagecommand to deal fire damage and using theequipmentcomponent of the helmet to show a fire overlay, this overlay can then be animated by continuously modifying the player's helmet. This is a lot more complicated code wise
Lets do the lava method
Just tell me what to do
copy and hold what youre writing i found something that might help
theres a potion effect
that sets you on fire
datapack using the mod?
but If you want to use it's feature you can do that easily
to do the same thing but easier
yea sure
just give the effect when the player is in the nether inside your tick function
Anyways it took me a long time so here is the lava method:
- Create a load function and in there add a scoreboard objective with the
dummytrigger. This scoreboard will be used to track if the block got placed successfully - create an advancement that triggers every tick. I recommend using https://misode.github.io/advancement/
- that advancement should reward function that revokes the tick advancement so it can be triggered again next tick
- in that function, set that scoreboard objective (from step 1) for this player to 0 for the current player to indicate that the block hasn't been placed yet
- check if the player is in the nether and if the block at the player's head is air, if so, set the score (from step 1 again) to 1 and place the lava block
- now create a normal tick function and add it to minecraft's
ticktag (you can't use schedules here I believe) - in that tick function, clear the lava block around the player that placed the block successfully (and thus for the players that have a score of 1)
thank you
ill keep it as a back up but it happens that the mod i just discovered will knock 2 birds with one stone for me so i will be using it
ok no problem at all, would have been nice if you'd found out a little earlier 😅
yeah i agree
sorry
do you mind helping me with how to do the tick thing you mentioned?
Ok so you create a basic datapack with a data folder and a pack.mcmeta https://minecraft.wiki/w/Pack.mcmeta
then you create your namespace folder in data/<your_namespace_folder_here>
in data/<your_namespace>/function you create a .mcfunctionfile and for now put a say hi command in there to test it
in data/minecraft/tags/function you create a file called tick.json and in there you add your function namespace:your_function_name as a value https://minecraft.wiki/w/Tag
now when you do /reloadyou should see [Server]: hi spammed in the chat
well turns out that potion effect has no fire overlay..
hey so i copy and pasted your instructions into chatgpt and i ended up with two datapacks and neither work.. can you take a look at them?
🙏
chatgpt has helped me make them successfully many times
||it can get some things right, but it's not reliable in many cases||
||just like the examples you gave||
i can attest to that
but can you see what it messed up in the packs above?
Sure
thanks
A: load.json is directly in the minecraft namespace
(for 2.zip)
and what version is this for
B: there are tick functions that dont even have a tick.json and instead have a tick start function
C: if you place and remove lava in the same tick you wont catch fire
so everything
D: load and tick_start are empty
pretty much yeah
you should look at the datapack starters guide
am i asking too much if i ask if youd be willing to correct it for me?
The help channels are primarily for helping the person achieve their goal, not for doing it for them, if you want someone to do it you should look at #1344762180989489252
(but fair warning not much happens there)
im aware. just a favor if you dont mind
or use the beginners guide :)
I dont have the time to do this, hence why I pointed you to #1344762180989489252
alright