Skip to content

fix: stop entities from changing road blocks without road flags - #4971

Open
TheMeinerLP wants to merge 1 commit into
IntellectualSites:mainfrom
TheMeinerLP:fix/entity-block-change-on-road
Open

TheMeinerLP wants to merge 1 commit into
IntellectualSites:mainfrom
TheMeinerLP:fix/entity-block-change-on-road

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Member

Overview

On an area without any entry under road.flags (which is what a freshly created area has: road.flags: {}), a wither destroys the road, the plot walls and the ground of unowned plots. The blocks drop as items. Claimed plots next to it stay intact.

This was reproduced in game on 7.6.1 with the default configuration. With any single entry under road.flags the same wither destroyed nothing.

The reason is the check for entity block changes outside of owned plots. It only refused the change when the area has road flags and entity-change-block is false among them. Without road flags the check never applied, although the default of entity-change-block is false and plots without the flag already refuse such changes. #4527 introduced this check with the default in mind; the case of no road flags at all slipped through.

Related: #4049.

What changed

Entity block changes outside of owned plots are now refused unless the area's road flags set entity-change-block to true. Areas that already have road flags behave as before.

The decision moved into PlotFlagUtil.mayEntityChangeBlockOnRoad so that it can be tested; the listener calls it.

Side effect

On areas without road flags, other entities no longer change blocks on roads, walls and unowned plots either: sheep eating grass, endermen, silverfish, villagers harvesting, zombies breaking doors, ravagers, turtle eggs. Servers that want this can set entity-change-block: true under road.flags. Falling blocks, players and projectiles are handled before this check and are not affected.

Tests

Four cases for the decision: no road flags, road flags with the flag false, with the flag true, and a stored true while road flags are off. With the previous condition the two cases without road flags fail.

Not part of this change

  • Other handlers follow the same "no road flags means allowed" pattern (for example redstone, wind charges, sign editing and item drops on roads). They are left as they are.
  • Why new areas end up with an empty road.flags section instead of the intended default entry.
  • Not covered by a test: the call in the listener itself; the Bukkit module has no tests and a PlotArea cannot be created without a running platform.

A wither could destroy roads, walls and the ground of unowned plots on
areas that have no road flags configured, because entity block changes
outside of owned plots were only refused when road flags were present.
They are now refused unless the road flags set entity-change-block to
true, as plots without the flag already do.
@TheMeinerLP
TheMeinerLP requested a review from a team as a code owner November 26, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant