Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Does EntityBurnBySunlightEvent sounds workable?


poopoodice
 Share

Recommended Posts

Hello!

As title, I have an idea about "EntityBurnBySunlightEvent", which is triggered when entities like zombies, skeletons, and phantoms tries to burn under sunlight.

I also noticed they are hard coded into each of their own

livingTick()

which means if the event is added, I will either trigger the event in every entity class that burns, or add a method in LivingEntity (since not every entity that burns are MonsterEntity). For example:

public void setBurnBySunlight(int ticks)
{
    ticks = ...EntityBurnBySunlightEvent(this, ticks);
    this.setFire(ticks);
}

call this, instead of directly call setFire() in their livingTick()

 

The EntityBurnBySunlightEvent will have two parameters: (LivingEntity) and (Ticks to burn), and will be located in 

net.minecraftforge.event.entity.living.LivingEvent

The user can modify the ticks that the entity given is going to burn, which allows the user to set it to 0 in order to prevent the burning of entity from happening.

This will be helpful for people that wants to cancel the burn update from the sunlight, by not affecting the burn effect from other sources.

Any suggestions for this? Thanks :)

Edited by poopoodice
Link to comment
Share on other sites

Isn't this already handled by LivingDamageEvent in some capacity? All you are doing is negating fire damage on the specific entity. My issues is that it's called every frame which would be already handled in some capacity by LivingUpdateEvent. Technically, I could just check if the entity is on fire and if it's daylight during this event and remove the fire effect. This negates the whole purpose of creating this event as otherwise it's just more processing time for the calls to go through synchronously.

Also, if the event were to be called, it would be handled by ZombieEntity#shouldBurnInDay or an extra condition in PhantomEntity#livingTick for example.

Link to comment
Share on other sites

The problem is that will remove the fire effect even if the effect is not caused by the sunlight.

 

The purpose of this event is to allow user to modify the duration of the effect caused by the sunlight, and not to remove it as the source of the fire can be lava, enchantments, flint and steel...etc.

And if like you said if you check it in the LivingUpdateEvent, and manually put out the fire if the entity is in daylight, they can literally swim in lava, or walk on fire without getting burned, which is not desired.

Thanks for the reply.
 

Edited by poopoodice
Link to comment
Share on other sites

  • 3 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • It was fine yesterday and then randomly last night stopped working.    Crash Report: ---- Minecraft Crash Report ---- // Ooh. Shiny. Time: 1/24/22 11:44 AM Description: Unexpected error java.lang.NullPointerException: Unexpected error     at blusunrize.immersiveengineering.common.blocks.IETileProviderBlock.func_220071_b(IETileProviderBlock.java:378) ~[?:?] {re:classloading}     at net.minecraft.block.AbstractBlock$AbstractBlockState.func_215685_b(AbstractBlock.java:543) ~[?:?] {re:mixin,re:classloading,pl:mixin:APP:immersiveengineering.mixins.json:coremods.AbstractBlockStateMixin,pl:mixin:A}     at net.minecraft.block.AbstractBlock$AbstractBlockState.func_196952_d(AbstractBlock.java:539) ~[?:?] {re:mixin,re:classloading,pl:mixin:APP:immersiveengineering.mixins.json:coremods.AbstractBlockStateMixin,pl:mixin:A}     at baritone.hl.h(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.hl.c(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.hl.b(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.hl.b(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.el.a(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.el.a(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.hd.a(Unknown Source) ~[?:1.6.2] {re:classloading}     at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:890) ~[?:1.8.0_74] {}     at baritone.hd.a(Unknown Source) ~[?:1.6.2] {re:classloading}     at net.minecraft.client.Minecraft.handler$zbd000$runTick(Minecraft.java) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:immersiveengineering.mixins.json:accessors.client.MinecraftAccess,pl:mixin:APP:mixins.baritone.json:MixinMinecraft,pl:mixin:APP:create.mixins.json:ShaderCloseMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1448) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:immersiveengineering.mixins.json:accessors.client.MinecraftAccess,pl:mixin:APP:mixins.baritone.json:MixinMinecraft,pl:mixin:APP:create.mixins.json:ShaderCloseMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:953) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:immersiveengineering.mixins.json:accessors.client.MinecraftAccess,pl:mixin:APP:mixins.baritone.json:MixinMinecraft,pl:mixin:APP:create.mixins.json:ShaderCloseMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:immersiveengineering.mixins.json:accessors.client.MinecraftAccess,pl:mixin:APP:mixins.baritone.json:MixinMinecraft,pl:mixin:APP:create.mixins.json:ShaderCloseMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:184) ~[1.16.5-forge-36.0.1.jar:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_74] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_74] {}     at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_74] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) ~[forge-1.16.5-36.0.1.jar:36.0] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {re:classloading}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {re:classloading} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at blusunrize.immersiveengineering.common.blocks.IETileProviderBlock.func_220071_b(IETileProviderBlock.java:378) ~[?:?] {re:classloading}     at net.minecraft.block.AbstractBlock$AbstractBlockState.func_215685_b(AbstractBlock.java:543) ~[?:?] {re:mixin,re:classloading,pl:mixin:APP:immersiveengineering.mixins.json:coremods.AbstractBlockStateMixin,pl:mixin:A}     at net.minecraft.block.AbstractBlock$AbstractBlockState.func_196952_d(AbstractBlock.java:539) ~[?:?] {re:mixin,re:classloading,pl:mixin:APP:immersiveengineering.mixins.json:coremods.AbstractBlockStateMixin,pl:mixin:A}     at baritone.hl.h(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.hl.c(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.hl.b(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.hl.b(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.el.a(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.el.a(Unknown Source) ~[?:1.6.2] {re:classloading}     at baritone.hd.a(Unknown Source) ~[?:1.6.2] {re:classloading}     at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:890) ~[?:1.8.0_74] {}     at baritone.hd.a(Unknown Source) ~[?:1.6.2] {re:classloading}     at net.minecraft.client.Minecraft.handler$zbd000$runTick(Minecraft.java) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:immersiveengineering.mixins.json:accessors.client.MinecraftAccess,pl:mixin:APP:mixins.baritone.json:MixinMinecraft,pl:mixin:APP:create.mixins.json:ShaderCloseMixin,pl:mixin:A,pl:runtimedistcleaner:A} -- Affected level -- Details:     All players: 2 total; [ClientPlayerEntity['Ougghhha'/8061, l='ClientLevel', x=834.77, y=65.00, z=-1531.00], RemoteClientPlayerEntity['Mukashushki'/62, l='ClientLevel', x=834.15, y=64.58, z=-1530.13]]     Chunk stats: Client Chunk Cache: 2209, 1681     Level dimension: minecraft:overworld     Level spawn location: World: (-64,64,80), Chunk: (at 0,4,0 in -4,5; contains blocks -64,0,80 to -49,255,95), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)     Level time: 294753 game time, 469401 day time     Server brand: forge     Server type: Non-integrated multiplayer server Stacktrace:     at net.minecraft.client.world.ClientWorld.func_72914_a(ClientWorld.java:617) ~[?:?] {re:mixin,re:classloading,xf:OptiFine:default,xf:fml:xaerominimap:xaero_clientworldclass,xf:fml:xaeroworldmap:xaero_wm_clientworldclass}     at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2024) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:immersiveengineering.mixins.json:accessors.client.MinecraftAccess,pl:mixin:APP:mixins.baritone.json:MixinMinecraft,pl:mixin:APP:create.mixins.json:ShaderCloseMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:628) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:immersiveengineering.mixins.json:accessors.client.MinecraftAccess,pl:mixin:APP:mixins.baritone.json:MixinMinecraft,pl:mixin:APP:create.mixins.json:ShaderCloseMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:184) ~[1.16.5-forge-36.0.1.jar:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_74] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_74] {}     at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_74] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) ~[forge-1.16.5-36.0.1.jar:36.0] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {re:classloading}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {re:classloading} -- System Details -- Details:     Minecraft Version: 1.16.5     Minecraft Version ID: 1.16.5     Operating System: Mac OS X (x86_64) version 10.16     Java Version: 1.8.0_74, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 598046936 bytes (570 MB) / 2147483648 bytes (2048 MB) up to 2147483648 bytes (2048 MB)     CPUs: 4     JVM Flags: 8 total; -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     ModLauncher: 8.0.9+86+master.3cf110c     ModLauncher launch target: fmlclient     ModLauncher naming: srg     ModLauncher services:          /mixin-0.8.2.jar mixin PLUGINSERVICE          /eventbus-4.0.0.jar eventbus PLUGINSERVICE          /forge-1.16.5-36.0.1.jar object_holder_definalize PLUGINSERVICE          /forge-1.16.5-36.0.1.jar runtime_enum_extender PLUGINSERVICE          /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE          /forge-1.16.5-36.0.1.jar capability_inject_definalize PLUGINSERVICE          /forge-1.16.5-36.0.1.jar runtimedistcleaner PLUGINSERVICE          /mixin-0.8.2.jar mixin TRANSFORMATIONSERVICE          /OptiFine_1.16.4_HD_U_G7_5.jar OptiFine TRANSFORMATIONSERVICE          /forge-1.16.5-36.0.1.jar fml TRANSFORMATIONSERVICE      FML: 36.0     Forge: net.minecraftforge:36.0.1     FML Language Providers:          javafml@36.0         minecraft@1     Mod List:          forge-1.16.5-36.0.1-client.jar                    |Minecraft                     |minecraft                     |1.16.5              |DONE      |NOSIGNATURE         Farmers-Delight-Mod-1.16.4.jar                    |Farmer's Delight              |farmersdelight                |1.16.3-0.2.4b       |DONE      |NOSIGNATURE         AmbientSounds_v3.1.4_mc1.16.4.jar                 |Ambient Sounds                |ambientsounds                 |3.0.3               |DONE      |NOSIGNATURE         ImmersiveEngineering-1.16.4-4.1.2-129.jar         |Immersive Engineering         |immersiveengineering          |1.16.4-4.1.2-129    |DONE      |44:39:94:cf:1d:8c:be:3c:7f:a9:ee:f4:1e:63:a5:ac:61:f9:c2:87:d5:5b:d9:d6:8c:b5:3e:96:5d:8e:3f:b7         pamhc2trees-1.16.3-1.0.1.jar                      |Pam's HarvestCraft 2 Fruit Tre|pamhc2trees                   |1.0.1               |DONE      |NOSIGNATURE         BiomesOPlenty-1.16.4-13.0.0.440-universal.jar     |Biomes O' Plenty              |biomesoplenty                 |1.16.4-13.0.0.439   |DONE      |NOSIGNATURE         pamhc2crops-1.16.3-1.0.2.jar                      |Pam's HarvestCraft 2 Crops    |pamhc2crops                   |version             |DONE      |NOSIGNATURE         SimpleCoreLib-1.16.4-2.0.4.3.jar                  |SimpleCoreLib                 |simplecorelib                 |1.16.4-2.0.4.3      |DONE      |NOSIGNATURE         CreativeCore_v2.0.10_mc1.16.4.jar                 |CreativeCore                  |creativecore                  |2.0.0               |DONE      |NOSIGNATURE         jei-1.16.4-7.6.1.74.jar                           |Just Enough Items             |jei                           |7.6.1.74            |DONE      |NOSIGNATURE         JustEnoughCalculation-1.16.5-3.8.1.jar            |Just Enough Calculation       |jecalculation                 |3.8.1               |DONE      |NOSIGNATURE         simplefarming-1.16.4-1.3.5.jar                    |Simple Farming                |simplefarming                 |1.16.4-1.3.5        |DONE      |NOSIGNATURE         ProjectE-1.16.5-PE1.0.1B.jar                      |ProjectE                      |projecte                      |PE1.0.1B            |DONE      |NOSIGNATURE         pamhc2foodextended-1.16.3-1.0.4.jar               |Pam's HarvestCraft 2 Food Exte|pamhc2foodextended            |version             |DONE      |NOSIGNATURE         Inventory-Tweaks-Renewed-Mod-1.16.4.jar           |Inventory Tweaks Renewed      |invtweaks                     |1.16.4-1.0.1        |DONE      |NOSIGNATURE         SpartanShields-1.16.4-2.1.1.jar                   |Spartan Shields               |spartanshields                |2.1.1               |DONE      |NOSIGNATURE         create-mc1.16.5_v0.3.1c.jar                       |Create                        |create                        |mc1.16.5_v0.3.1c+151|DONE      |NOSIGNATURE         Xaeros_Minimap_21.12.5_Forge_1.16.5.jar           |Xaero's Minimap               |xaerominimap                  |21.12.5             |DONE      |NOSIGNATURE         pamhc2foodcore-1.16.3-1.0.2.jar                   |Pam's HarvestCraft 2 Food Core|pamhc2foodcore                |version             |DONE      |NOSIGNATURE         XaerosWorldMap_1.20.0_Forge_1.16.5.jar            |Xaero's World Map             |xaeroworldmap                 |1.20.0              |DONE      |NOSIGNATURE         1.16.3SecurityCraftv1.8.20.1.jar                  |SecurityCraft                 |securitycraft                 |v1.8.20.1           |DONE      |NOSIGNATURE         TravelersBackpack-1.16.4-5.3.8.jar                |Traveler's Backpack           |travelersbackpack             |5.3.8               |DONE      |NOSIGNATURE         SereneSeasons-1.16.4-4.0.0.87-universal.jar       |Serene Seasons                |sereneseasons                 |1.16.4-4.0.0.87     |DONE      |NOSIGNATURE         obfuscate-0.6.2-1.16.3_1.jar                      |Obfuscate                     |obfuscate                     |0.6.2               |DONE      |e1:59:1a:56:ec:97:b3:d0:b3:4b:25:06:1f:83:b0:f4:fd:0c:24:e3:6d:ea:94:b1:9f:22:b0:38:13:60:88:ea         vehicle-mod-0.45.2-1.16.3.jar                     |MrCrayfish's Vehicle Mod      |vehicle                       |0.45.2              |DONE      |NOSIGNATURE         SpartanWeaponry-1.16.4-2.1.0-beta-4.jar           |Spartan Weaponry              |spartanweaponry               |2.1.0 beta 4        |DONE      |NOSIGNATURE         MrCrayfishs-Furniture-Mod-1.16.4.jar              |MrCrayfish's Furniture Mod    |cfm                           |7.0.0-pre19         |DONE      |NOSIGNATURE         baritone-standalone-forge-1.6.2.jar               |Baritone                      |baritoe                       |1.6.2               |DONE      |NOSIGNATURE         ImmersivePetroleum-1.16.4-3.1.0-2.jar             |Immersive Petroleum           |immersivepetroleum            |3.1.0-2             |DONE      |NOSIGNATURE         forge-1.16.5-36.0.1-universal.jar                 |Forge                         |forge                         |36.0.1              |DONE      |22:af:21:d8:19:82:7f:93:94:fe:2b:ac:b7:e4:41:57:68:39:87:b1:a7:5c:c6:44:f9:25:74:21:14:f5:0d:90         Aquaculture-1.16.4-2.1.12.jar                     |Aquaculture 2                 |aquaculture                   |1.16.4-2.1.12       |DONE      |NOSIGNATURE         SimpleOres2-1.16.4-2.4.3.10.jar                   |Simple Ores                   |simpleores                    |1.16.4-2.4.3.10     |DONE      |NOSIGNATURE     Crash Report UUID: d7306cab-60a6-4cb9-95cb-031bd8f653d7     Launched Version: 1.16.5-forge-36.0.1     Backend library: LWJGL version 3.2.1 build 12     Backend API: Intel(R) Iris(TM) Plus Graphics 640 GL version 2.1 INTEL-16.5.7, Intel Inc.     GL Caps: Using framebuffer using ARB_framebuffer_object extension     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'forge'     Type: Client (map_client.txt)     GPU Warnings: version: 2.1     Graphics mode: fast     Resource Packs: Bridge Scrims Overlay, ! Yusei Fudo 1k     Current Language: English (US)     CPU: 4x Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz     OptiFine Version: OptiFine_1.16.4_HD_U_G7     OptiFine Build: 20210221-012854     Render Distance Chunks: 5     Mipmaps: 4     Anisotropic Filtering: 1     Antialiasing: 0     Multitexture: false     Shaders: null     OpenGlVersion: 2.1 INTEL-16.5.7     OpenGlRenderer: Intel(R) Iris(TM) Plus Graphics 640     OpenGlVendor: Intel Inc.     CpuCount: 4
    • I see. It says that enqueue is not necessary. I was wondering if I had to call the event again somewhere. I was able to call the existing health and see that the two rows of stats are displayed! Thank you Luis.
    • Note: I am new to modding for Minecraft.   I am trying to recreate a time travel dimension, I guessed it uses custom dimensions so that's why it is about dimensions. The effect I am trying to achieve Now I made two dimensions, Past far and past.   Now past is like the overworld, and Past far is a stone/rock-like version of the past. But past is not like the overworld in any way. how can I achieve this? Also, I have looked on google on how to do this but there is only one post and that is about version 1.7.10. I am not sure but since 1.16.5 I think you have to use JSON files.       Thanks.
    • assemblylinemachines needs to update for the new Forge version.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.