Posted January 20, 20232 yr Hey I'm back again, so I have been working on a mod and while doing so have encountered several issues and difficult things to code the hardest that the people and I have thought about was basically freezing time for everything besides the player. I just started working on this and this is the code I've got for it so far so any help would be huge and greatly appreciated and I am modding for 1.18. AttributeModifier timestop = new AttributeModifier(UUID.fromString("ce90df2c-feb2-4fb9-b98f-666a26458ed2"), "time_stop", 25.0D, AttributeModifier.Operation.ADDITION); public class FreezeEntities { public static void freezeAllEntities() { MinecraftForge.EVENT_BUS.register(new Object() { @SubscribeEvent public void onEntityTick(TickEvent.WorldTickEvent event) { if (event.phase == TickEvent.Phase.END) { for (Entity entity : event.world.getEntities(null, null)) { entity.setNoGravity(true); entity.lerpMotion(0, 0, 0); } } } }); } }
January 20, 20232 yr While this stops the entity movement, it doesn't stop an entity from ticking which means the logic is still happening. I think in 1.18 you could use the LivingUpdateEvent to cancel living entity logic, but for all other entities, you would need to use some kind of injection into the entity to achieve the desired result most likely.
January 20, 20232 yr Author 5 minutes ago, ChampionAsh5357 said: While this stops the entity movement, it doesn't stop an entity from ticking which means the logic is still happening. I think in 1.18 you could use the LivingUpdateEvent to cancel living entity logic, but for all other entities, you would need to use some kind of injection into the entity to achieve the desired result most likely. so what I'm trying to do is stop all entity movement and make knockback and damage stack but allow the player to move this does help tho so thanks
January 20, 20232 yr Author ok this might sound dumb but I'm unsure of how to cancel the living entity's logic using LivingUpdateEvent. could I get some help on this
January 20, 20232 yr https://github.com/MinecraftForge/EventBus/blob/84663719be842aedaddabf9cd8d46a2450959c9d/src/main/java/net/minecraftforge/eventbus/api/Event.java#L77 Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.