making mobs burning in sunlight work correctly?

Started by SleepyWhirl on

Topic category: Help with MCreator software

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
making mobs burning in sunlight work correctly?

sup,

 

i havent seen a single good answer on my search for a way to do this, so i wanted to ask my self in case someone has figured it out by now.

im trying to make my monsters burn in the sun like normal vanilla mobs, and doing that is quite simple, you really only need something like this:

(minus the extinguish probably) and it works as youd expect...untill it doesnt. the mob does burn when exposed to sunlight like its supposed to, only issue is that if its night time the entity still burns. maybe a visual glitch? or something else entirely, but this ruins the entire thing from start to finish, making it look as if they burn 24/7. example:

now the only other way i could imagine how someone could do this is by doing a procedure like below, but the issue with that would be is that the visual burning effect would not be there so the entity would just start randomly having a mean case of the pains and then die which would look very strange in game. so tell me, is there any other way this could somehow work that wouldnt look jarring? and i dont think placing fire underneath the entity every tick is a good way of doing it, just saying. heres the example i mentioned:

i would appreciate some methods of doing this in the comments if yall know any. have a good day

 

-salami

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Your code looks like it…
Sat, 10/14/2023 - 13:51

Your code looks like it ought to work, my only thought is that the duration might be stacking. (It's setting the entity on fire for ten seconds every update tick, and adding to the duration instead of resetting it, like potion effects.) I'm not totally sure how fire duration works, just a possibility. You could try adding an if-bracket to check if the entity is already on fire.

Alternatively, if you just classify your entity as an 'undead' type mob, it should burn in Daylight normally. I think. There should be an option for this in the entity settings, but again, not totally sure if this property carries over.

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
good thought actually, imma…
Sat, 10/14/2023 - 18:35

good thought actually, imma try and tinker around with the fire duration a bit and maybe try the undead setting just for good measure too. if it works or if i find a different way to do it ill post my findings here, thank ya!

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
alright so here's my new…
Sun, 10/15/2023 - 10:21

alright so here's my new findings. i have fixed the rapid damage that the entity takes by the fire to the normal amount, the theory that it might be stacking the fire was correct, so that's nice. the entity was already set to undead in the hopes that it would catch fire it self but that setting seems to be entirely reserved for enchantment effects like smite. restrict sun is to this day falsely advertised and does in fact not set the entity on fire and instead simply makes them stay in the shade at day, not seek shade, just stay in it if they were already inside of it, which sorta works for now. the main issue of this entire thing is still there though, at night time the monster still has a visual effect of being on fire at all times when it is exposed to the sky only. here's the fix to the stacking at least:

any other ideas of how this issue might be able to be fixed? there is like 0 tutorials or helpful advice out there for this issue so it makes me wonder what other people do with their undead entities that somehow works, just let them not burn in daylight?

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
bumping this again
Mon, 10/16/2023 - 10:42

bumping this again

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Are they actually burning at…
Mon, 10/16/2023 - 11:47

Are they actually burning at night, or is the visual fire just remaining after they've stopped burning? I'll admit I've never made undead that burn before, and I'm surprised it's an issue. There should also be an 'extinguish entity' function that you could trigger on update tick if the time changes to night, though you'll probably want to only trigger it once, right when the time changes, so that it doesn't extinguish things the player sets on fire. 

If you're still running into trouble, you could maybe try looking into commands for dealing with fire. Sometimes brute forcing stuff with commands does, weirdly, work better than using code. I'm not sure what you'd use to reference fire though, I assume it's some sort of data tag.

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah its only the visual…
Tue, 10/17/2023 - 15:23

yeah its only the visual effect that keeps persisting at night, they do not actually take damage, so its a really weird issue. ive already tried the extinguish option and it doesnt yield any sort of changes. ill try and see if i can somehow call a command that sets the entity on fire at day time instead of using the method ive been using. personally i find it strange that this isnt a build in feature, its claimed to be with "restrict sun" but it does as i already said nothing but make the entity attempt to stay in the shade if its already inside of it. ill post my findings or any updates here if i find something new, thank you for the reply!

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah its only the visual…
Mon, 11/27/2023 - 00:51

yeah its only the visual effect that keeps persisting at night

 It sounds like the client side is operating on the wrong day time? Try using a NOT'd "is provided world client side" block.

e.g. If NOT is provided world client side THEN set entity on fire

 

Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
https://imgur.com/a/39oGUZ2…
Wed, 06/26/2024 - 01:41

https://imgur.com/a/39oGUZ2

Ok if anyone else is having trouble with the "is day in the provided world" just use the game time to check for day and night that fixed it for me also check if the mob is in water or rain so it doesn't try to ignite it while its wet.

Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
https://imgur.com/gallery…
Wed, 06/26/2024 - 06:08

https://imgur.com/gallery/mcreator-burn-custom-mobs-code-snippet-fixed-Su3Nxx1
 

Ok ignore what I did earlier it only works for the first day then stops working this version works you just need to add do in server side world for the flames and ur good I even waited several days in game and it works I also got rid of the water check because I completely forgot that the check was in the original game lmao.