Skip to content

Conversation

@Warriorrrr
Copy link
Member

This was likely broken in 1.21.11 with the addition of the burn_in_daylight entity tag, isSunSensitive is now unused by vanilla. This PR overrides the isSunBurnTick similar to how it's done for phantoms and skeletons already.

@Warriorrrr Warriorrrr requested a review from a team as a code owner January 3, 2026 14:14
@Warriorrrr Warriorrrr added type: bug Something doesn't work as it was intended to. scope: api labels Jan 3, 2026
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Jan 3, 2026
kennytv
kennytv previously approved these changes Jan 3, 2026
@Warriorrrr Warriorrrr added type: feature Request for a new Feature. and removed type: bug Something doesn't work as it was intended to. labels Jan 4, 2026
@Warriorrrr Warriorrrr changed the title Fix Zombie#setShouldBurnInDay not being respected Add Mob burnInDaylight API Jan 4, 2026
@Warriorrrr
Copy link
Member Author

This PR has pivoted a bit, since what mobs burn in daylight is now dependent on a tag and no longer hardcoded, I've opted to move the methods to the Mob interface and use TriStates. Because of that this now also covers zombie nautili and zombie horses, and allows entities that normally don't burn in daylight to do so.


@Override
public boolean burnsInDaylight() {
return this.getHandle().burnInDaylightOverride.toBooleanOrElse(this.getHandle().getType().is(EntityTypeTags.BURN_IN_DAYLIGHT));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this method take the monsters burn environment into account?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe another method for consider that? (in any case this need to be mention in docs?)
or a separate PR for checks environment values and refer to that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's fine as long as it's documented. There's already an upcoming environment attribute api for later. Maybe the method should be named canBurnsInDaylight or something too.

Copy link
Member Author

@Warriorrrr Warriorrrr Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to also check the environment attribute now, in my eyes this method is supposed to reliably answer "would this mob normally burn if it was exposed to daylight" which relies on the attribute as well.

I do like the current name already, canBurnsInDaylight sounds a bit too similar to isBedWorks for my liking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: api type: feature Request for a new Feature.

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

4 participants