Minecraft Data Packs / Server Utility

Entity Freeze (Decreases Lag: ~200% Tick Speed!)

  • check_circle Functions
  • 14,230 views, 3 today
  • 1,552 downloads, 0 today
  • 30
  • 22
  • 24
Bertiecrafter's Avatar Bertiecrafter
Retired Moderator
Level 70 : Legendary Engineer
781

Increases Tick Speed to ~200%


This datapack freezes all entities (that support it), until a player gets within 32 blocks, it's that simple.

What is Tick Speed?
There are two measurements of speed in Minecraft: FPS and TPS.
  • FPS stands for "Frames Per Second". It's purely graphical and although it will decrease if there is a lot to render, it's not directly related to how much Minecraft is struggling to keep up. A low FPS typically results in movement lag.
  • TPS stands for "Ticks Per Second". Minecraft runs at 20 ticks per second, but Minecraft can't keep up when a lot of computations need to happen. This results in lower ticks per second and is often experienced as block lag, lag spikes, chat lag, damage lag, food consumption lag and other kinds of technical lag.

This datapack boosts tick speed, by decreasing the amount of calculations required for the Mob AI. It's inspired by Minecraft Bedrock Edition, where the Render Distance is also separated from the Simulation Distance.

How do you know it works?
Press ALT+F3 while in the game. Two graphs should pop up, FPS is on the left, TPS is on the right. I put my render distance at 32 chunks and got like 65ms per tick average. The average is at the top of the right graph ("avg: ##"). After installing the datapack, this drops to around 30ms per tick. Remember that Minecraft runs at 20 FPS (= 50ms/tick), so with me being at only 30ms/tick, I was able to play minecraft without tick lag.

Side Effects
Mobs won't respond if they are out of range and this might break the immersion a bit. You can't shoot mobs from >32 blocks away. This might sound annoying, but remember that ranged mobs like skeletons and ghasts can't attack you from >32 blocks away either.
There is an exclusion list in data/bertiecrafter/tags/entity_types/entity_freeze/excluded.json. You can add any mob type there. Let me know if I missed an obvious one that everyone would want to have excluded by default.

Default Excluded Mobs
  • Ender Dragons
  • Withers
  • Elder Guardians
  • Ghasts
  • Phantoms
  • Wandering Traders
  • Trader Llamas
  • Any other entity that is not a mob (e.g. Items or Ender Crystals). This cannot be changed.

Also note that mobs will remain frozen if only players in spectator mode are nearby.

Admin Functions
The following admin functions starting with "/function bertiecrafter:entity_freeze/admin/" are available:
  • kill_all_items: Kills all items (obviously)
  • kill_all_non_player: Kills all non-player entities
  • revive: If for some reason some entities end up permanently frozen, use this to revive them. It revives all mobs within 16 blocks.
  • stats: Print some awesome statistics to chat. It tells you exactly how many mobs are frozen and how many aren't. It also gives you the percentage of frozen mobs.

Uninstalling
Because this datapack alters entities, it's difficult to fully uninstall the datapack without side effects. I did supply a function that attempts to revive all mobs.

Uninstall Instructions (also in uninstall.txt)
If you were to delete this datapack right away, all frozen mobs would remain frozen.

In order to unfreeze mobs, do the following:
- Go into data/bertiecrafter/functions/entity_freeze
- Rename tick.mcfunction to something else (E.g: "tick-active.mcfunction")
- Rename uninstall.mcfunction to tick.mcfunction
- Run this command for yourself to enable logging:
/tag @s add bcef_log
- As entities get loaded, they will unfreeze and a message will be printed in chat.
- Leave this for a couple of days while playing. After a while, if you get almost no messages anymore, you can remove the tag and delete this datapack.
/tag @s remove bcef_log
- Frozen entities can still be killed in creative mode after this datapack is uninstalled. It's easiest to just leave the uninstall function active a little longer though.




Install Instructions
This is a datapack, it can easily be used in any world or server without any difficulties.
Simply drop the downloaded zip file in the "datapacks" folder of your world save (<world>/datapacks).
Then open your world and do
/reload

In case the datapack doesn't automatically get enabled, run:
/datapack enable "file/[​datapack folder name].zip"

I encountered a bug! What do I do now?

I test all my creations, but bugs happen no matter how long you test something. Whenever someone experiences a bug, I do my best to fix the issue. You can help me by providing any useful information. You can never give me enough information, but please send it in a DM instead of placing it in the comments. You can still place a one-liner in the comments stating the issue to make the community aware, but that alone isn't enough to help me fix the issue.
  • Checklist: Are you using the right version? Did you do /reload after dropping the datapack in? After /reload, does the datapack show up green in /datapack list?
  • What is the issue? Does the datapack not seem to be working at all or is there a specific feature you are having issues with?
  • What happened? Please give me all the steps needed to reproduce the issue. The faster I can experience it, the faster I can solve it.
  • What did you expect to happen instead? This helps me understand your point of view and determine if the issue described is actually the issue I need to fix. The bug you are experiencing could just be a side effect of something else that doesn't behave as expected.

Entity Freeze (Decreases Lag: ~200% Tick Speed!) Minecraft Data Pack
CompatibilityMinecraft 1.15
Tags

1 Update Logs

More excluded mobs + Admin functions! : by Bertiecrafter 03/08/2020 5:19:53 pmMar 8th, 2020

- Added a couple more mobs to the excluded list
- Only mobs are targeted now
- Added a couple cool admin functions
- Fixed a bug involving spectators

See description for more info! =)

Create an account or sign in to comment.

04/15/2020 5:24 pm
This reply was removed by the poster or a moderator.
Bertiecrafter
04/16/2020 1:59 am
Level 70 : Legendary Engineer
Bertiecrafter's Avatar
Why would you want to anyways? It breaks, because functions refer to other functions by file name.
2
supersaiyansubtlety
03/25/2020 1:44 am
Level 1 : New Miner
supersaiyansubtlety's Avatar
One more thing: would it be possible to disable/enable the radius-mob-freezing functionality via trigger?
Enabling the feature only sometimes could be useful when trying to fix lag issues or when running the game faster than 20tps (with carpet mod). I believe this could also help with unistallation, as players could disable the radius feature, visit everywhere they think mobs might be frozen (as mobs would still un-freeze when the radius feature is disabled), and then uninstall the datapack.
1
Bertiecrafter
03/25/2020 3:05 pm
Level 70 : Legendary Engineer
Bertiecrafter's Avatar
The current version does not allow this. Spectators don't revive mobs, so that could be used to simulate what you would like to see. There are uninstall instructions that basically do what you described (see description of this video). It's basically disabling the freeze function and reviving any mob that gets loaded in while the uninstall function is active.
1
supersaiyansubtlety
03/25/2020 1:36 am
Level 1 : New Miner
supersaiyansubtlety's Avatar
It would probably be good to add blazes to the default list as they agro from quite far away.
1
Bertiecrafter
03/25/2020 3:02 pm
Level 70 : Legendary Engineer
Bertiecrafter's Avatar
They don't when frozen. If you can't attack a mob due to them being frozen, they can't attack you either.
1
supersaiyansubtlety
03/25/2020 4:57 pm
Level 1 : New Miner
supersaiyansubtlety's Avatar
Yes, I just mean that it makes blazes much less threatening if they freeze outside the radius. Basically I think they should be included for the same reasons as ghasts.
1
Bertiecrafter
03/26/2020 3:12 pm
Level 70 : Legendary Engineer
Bertiecrafter's Avatar
I don't think that should be a default setting. Feel free to modify the excluded list as explained in the description!
1
koalas
03/04/2020 11:38 am
Level 1 : New Miner
history
koalas's Avatar
Is this datapack fully compatible with 1.16 (or the latest snapshot 20w09)?
Because we are using this datapack with others on a 20w09 snapshot server and we noticed that everything seems to work fine (the entities get frozen correctly) but mobs seems to not spawn (in already loaded chunk)

(we don't know for sure if it's this datapack or others or the snapshot himself but i just wanted to ask and since we host the server with aternos we can't change view distance of the server and i checked that the gamerule was true)



And i suggest adding in the excluded list (by default):

The phantom as sometimes they just stay frozen in the sky,
The wandering trader + the trader llamas as it usually spawn away from the player and i belive can only spawn once a time

Anyway really good data pack keep the good work and ty
3
Bertiecrafter
03/06/2020 1:04 am
Level 70 : Legendary Engineer
history
Bertiecrafter's Avatar
Mobs will only spawn if the current amount isn't past a certain cap. So if mobs are frozen and enough have spawned, no new ones will spawn. This is unlikely though, since using this data pack doesn't cause more mobs to be roaming the world. There shouldn't be an increase in mobs because of this datapack.

This datapack does not directly affect mob spawning in any way either, so I think it's caused by something else.

Thank you for suggesting those mobs!
I'll add them, the ones in my comment to XanmanAR and others soon to the list.

Also thank you for the kind words =)
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome