#datapack help

1 messages · Page 1 of 1 (latest)

golden windBOT
jade smelt
#

Sure, have you ever made a datapack?

wind crane
#

ive made a few

#

simple ones

#

thank you

jade smelt
#

give me some time xD

wind crane
#

take your time

#

i will take 30 minutes for a cigar myself brb

jade smelt
#

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 /damage command to deal fire damage and using the equipment component 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
wind crane
#

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

jade smelt
#

it's a mod

#

not a datapack

wind crane
#

datapack using the mod?

jade smelt
#

but If you want to use it's feature you can do that easily

wind crane
#

to do the same thing but easier

jade smelt
#

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:

  1. Create a load function and in there add a scoreboard objective with the dummy trigger. This scoreboard will be used to track if the block got placed successfully
  2. create an advancement that triggers every tick. I recommend using https://misode.github.io/advancement/
  3. that advancement should reward function that revokes the tick advancement so it can be triggered again next tick
  4. 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
  5. 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
  6. now create a normal tick function and add it to minecraft's tick tag (you can't use schedules here I believe)
  7. 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)
wind crane
#

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

jade smelt
wind crane
#

yeah i agree

#

sorry

#

do you mind helping me with how to do the tick thing you mentioned?

jade smelt
#

Yea sure

#

uuhg I mean I want to help you :P

wind crane
#

thanks

#

dang

#

lol

jade smelt
#

Ok so you create a basic datapack with a data folder and a pack.mcmeta https://minecraft.wiki/w/Pack.mcmeta

Minecraft Wiki

The pack.mcmeta file is used to define metadata of a resource pack or data pack. The presence of this file identifies a directory or ZIP archive file as a resource pack or data pack.

#

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

wind crane
#

well turns out that potion effect has no fire overlay..

wind crane
#

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?

#

🙏

lean geyserBOT
wind crane
# lean geyser

chatgpt has helped me make them successfully many times

serene scroll
#

||just like the examples you gave||

wind crane
serene scroll
#

Sure

wind crane
#

thanks

serene scroll
#

A: load.json is directly in the minecraft namespace

#

(for 2.zip)

#

and what version is this for

wind crane
#

1.20.1 forge

#

where should it be?

#

load.json

serene scroll
#

C: if you place and remove lava in the same tick you wont catch fire

wind crane
#

so everything

serene scroll
#

D: load and tick_start are empty

serene scroll
#

you should look at the datapack starters guide

wind crane
#

am i asking too much if i ask if youd be willing to correct it for me?

serene scroll
lean geyserBOT
wind crane
#

im aware. just a favor if you dont mind

serene scroll
serene scroll
wind crane
#

alright

golden windBOT
golden windBOT