[SPIGOT-7315] Bed placement duplicates crops if cancelled Created: 24/Mar/23  Updated: 25/Dec/24  Resolved: 07/Apr/23

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Jikoo Assignee: Marvin Rieple
Resolution: Fixed Votes: 0
Labels: Beds, crops, duplication, plugin, spigot

Attachments: PNG File javaw_2023-03-24_14-16-42.png    
Issue Links:
Duplicate
is duplicated by SPIGOT-7329 Cancelling BlockPlaceEvent and placin... Closed
Version: This server is running CraftBukkit version 3697-Spigot-6ad4b93-9381350 (MC: 1.19.4) (Implementing API version 1.19.4-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

Simple listener for reproduction:

@EventHandler(ignoreCancelled = true)
private void onMultiPlace(@NotNull BlockMultiPlaceEvent event) {
  event.setCancelled(true);
} 
  1. Create an enclosed farming plot to block sky light - underground, in a house, etc.
  2. Plant crops
  3. Remove all light sources
  4. Attempt to place a bed adjacent to a crop
  5. Cancel BlockMultiPlaceEvent

The crops drop items as if broken in addition to being restored to their previous unbroken state.

Tried to play around with it to see where the issue was. The adjacent crop blocks are already Material.AIR and the corresponding ItemSpawnEvent has been fired by the time the BlockMultiPlaceEvent is fired. The blocks are then reset to crops after the event has been completed and cancelled. Other multi-block items do not appear to be affected, only beds. The crops themselves do not seem to be affected by physics - crops adjacent to the affected one are not affected.

This has apparently been around since 1.16 at least:

https://github.com/TechFortress/GriefPrevention/issues/2027

https://github.com/BG-Software-LLC/SuperiorSkyblock2/issues/1600

https://www.spigotmc.org/resources/beddupefix.105189/



 Comments   
Comment by Marvin Rieple [ 07/Apr/23 ]

Made a PR for this: craftbukkit#1168

Generated at Sat Apr 05 10:05:02 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.