1
Can Someone Help Me?
I have this datapack, which what it does is that when a player dies the message appears on the screen and the "Death Train" begins, which is a storm which cannot be removed.
And the problem I have is that it gives a lot of lag and I don't know how to optimize / fix it.
Somebody could help me?
Thanks ^^
The datapack:
https://www.mediafire.com/file/pklptpz05kvnzp4/Death_Train_%2528abrir%2529.rar/file
Create an account or sign in to comment.
5
1
I just learn something yesterday and thought of you. If you haven't figured anything out yet, I may have another solution.
load.json value will be "death_train:load"
Create a load.mcfunction file in your nameSpace function folder.
The load.mcfunction will have these 2 commands:
function init
function tick
Now create a tick.mcfunction file.
The tick.mcfunction will have these 2 commands:
schedule function tick 3t append
function death_train:loop
This will cause the tick.mcfunction file to run every 3 ticks instead of every tick, eliminating the need for the tick.json file while also freeing up some ticks to help your data pack keep pace.
load.json value will be "death_train:load"
Create a load.mcfunction file in your nameSpace function folder.
The load.mcfunction will have these 2 commands:
function init
function tick
Now create a tick.mcfunction file.
The tick.mcfunction will have these 2 commands:
schedule function tick 3t append
function death_train:loop
This will cause the tick.mcfunction file to run every 3 ticks instead of every tick, eliminating the need for the tick.json file while also freeing up some ticks to help your data pack keep pace.
1
If you want to optimize your packs to max, you should learn some of the tips like selector orders and such. Especially the usage of predicates rather than combining many if, unless in 1 command line to keep your tick folder as clean as possible.
Also, it is very important to branch your commands. Instead of running commands with same if conditions, make it run a function instead, then run the commands on that function. This way you will only run 1 command
Also, it is very important to branch your commands. Instead of running commands with same if conditions, make it run a function instead, then run the commands on that function. This way you will only run 1 command
1
I am new to data file but will give my thoughts anyway.
First, If this is for 1.16.5, change the pack_format in the pack.mcmeta file to 6 instead of 5. Change it to 7 if running it in snapshot.
Next, all that code in your loop.mcfunction file is running 20 times a second. Learn what predicates are and make predicate json files for as much of this as you can.
I ran snapshot with your data pack and it worked fine for me. All I edited was the pack.mcmeta file so it would run on snapshot.
First, If this is for 1.16.5, change the pack_format in the pack.mcmeta file to 6 instead of 5. Change it to 7 if running it in snapshot.
Next, all that code in your loop.mcfunction file is running 20 times a second. Learn what predicates are and make predicate json files for as much of this as you can.
I ran snapshot with your data pack and it worked fine for me. All I edited was the pack.mcmeta file so it would run on snapshot.
1
Sure
1
version: 1.16.5 ^^