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

    • hi i made the accesstransformer.cfg file with the text it needs for what im doing, but i dont know how to refresh the gradle project, in eclipse you right click in the project, gradle and refresh gradle project but im using intellij and all the tutorials for accesstransformers are made for eclipse #AbstractClientPlayerEntity public net.minecraft.client.entity.player.AbstractClientPlayerEntity field_175157_a # playerInfo #NetworkPlayerInfo public net.minecraft.client.network.play.NetworkPlayerInfo field_187107_a # playerTextures public net.minecraft.client.network.play.NetworkPlayerInfo field_178864_d # playerTexturesLoaded public net.minecraft.client.network.play.NetworkPlayerInfo func_178841_j()V # loadPlayerTextures public net.minecraft.client.network.play.NetworkPlayerInfo field_178867_a # gameProfile  
    • i wrote the accessmodifier thing, refreshed the build.gradle file and even restarted my idle but it didnt worked, i checked the location of where the .cfg file should be but there is nothing(src/main/resources/META-INF/accesstransformer.cfg), there is only the mods.toml
    • Did you had a look at the link to the Forge doc I attached?
    • I have a server on Forge, no mods installed, version 1.16.5.  If I try to do any update on a new release the placed block values randomize.  Basically, the grass turns to rail road tracks, horses are dolphins grazing grass, chickens are fish sliding around on the grass, and the ender dragon is raining fire and hell down on the world.  It's a interesting take on the game.  However, you can't play this scrambled mess.  The block will look correct in your hand, but once place it's anyone's guess what it becomes. There is literally zombie army's marching single file LOL...So the server is currently stuck on 1.16.5 and I can't update it basically.  If I reload my backup to the version 1.16.5 all order is restored.   I have updated my account, java, and reinstalled Minecraft.  Single player works fine on new world creations....it's just this server and trying to update.  It has been updated many times in the past, as it's a couple years old...any suggestions?
    • I know this is basic java knowledge but PLEASE tell me a solution, i already learned java but i never imagined how i can use public, private and protected(obviusly i use them but i dont know how to connect private fieds so my class) im BEGGING YOU tell me how, i tried some tutorials of how to access to private fields but it wasnt helpful
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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