1

Can Someone Help Me?

FroerkbrEea's Avatar FroerkbrEea3/18/21 11:58 am
1 emeralds 124 5
3/26/2021 2:31 pm
GamerGrumpa's Avatar GamerGrumpa
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
Posted by FroerkbrEea's Avatar
FroerkbrEea
Level 1 : New Miner
1

Create an account or sign in to comment.

5

1
03/26/2021 2:31 pm
Level 1 : New Miner
GamerGrumpa
GamerGrumpa's Avatar
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.
1
03/20/2021 10:51 pmhistory
Level 75 : Legendary Creator
Wyvernity
Wyvernity's Avatar
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
1
03/18/2021 2:18 pm
Level 1 : New Miner
GamerGrumpa
GamerGrumpa's Avatar
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.
1
03/18/2021 12:54 pm
Level 19 : Journeyman Artist
3XX3
3XX3's Avatar
Sure
1
03/18/2021 11:59 am
Level 1 : New Miner
FroerkbrEea
FroerkbrEea's Avatar
version: 1.16.5 ^^
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome