Paper icon indicating copy to clipboard operation
Paper copied to clipboard

BlockDestroyEvent doesn't fire for a lot of redstone blocks

Open JHarris12345 opened this issue 1 year ago • 3 comments

Expected behavior

The BlockDestoryEvent fires when a block is broken and causes another block to break due to it (like breaking the block a redstone torch is sitting on). However, it doesn't fire for a lot of redstoen components like repeaters, redstone, comparators etc. It DOES fire for redstone torches though

Observed/Actual behavior

It should fire for all redstone components and blocks that break due to it

Steps/models to reproduce

Place a block, place redstone on top, break the block and the redstone will drop but won't fire the BlockDestroyEvent

Plugin and Datapack List

[13:05:17 INFO]: - AdvancedAchievements, AdvancedArmorStands, AdvancedEnchantments, BlockLocker, Brewery, BuycraftX, ChestShop, ChestShop-LegacyIds, Chunky, Citizens [13:05:17 INFO]: ClearLag, *Commander, CoreProtect, DeluxeMenus, DespawnSpy, DetrimUtils, EnchantGui, Essentials, EssentialsAntiBuild, EssentialsGeoIP [13:05:17 INFO]: EssentialsProtect, EssentialsSpawn, ExploitFixer, FarmLimiter, FeatherBoard, floodgate, GPFlags, GriefPrevention, GSit, HamsterAPI [13:05:17 INFO]: HolographicDisplays, ICClass, IllegalStack, InsanityChat, InsanityCore, InsanityCrates, InsanityDuels, InsanityMinions, InsanityModeration, InsanityShops [13:05:17 INFO]: InsanityStacker, InsanityWarps, KixsAutoAnnouncerPremium, LibsDisguises, LuckPerms, MineableSpawners, Multiverse-Core, MyCommand, OpenInv, PartyChat [13:05:17 INFO]: PlaceholderAPI, PlayerParticles, PlayerVaults, PlugManX, ProtocolLib, PyroFishingPro, PyroFishingPro, PyroLib, PyroLib, *RedstoneClockDetector [13:05:17 INFO]: RestrictedCreative, Sentry, SeparateInventories, spark, StableMaster, StellarTags, TAB, TradeSystem, Vault, ViaBackwards [13:05:17 INFO]: ViaRewind, ViaVersion, VoidGen, Votifier, VotingPlugin, Vulcan, WildTools, WorldEdit, WorldGuard, WorldGuardExtraFlags [13:05:17 INFO]: zAuctionHouseV3

Paper version

[13:08:29 INFO]: This server is running Paper version git-Paper-318 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 9271ee7) You are running the latest version

Other

No response

JHarris12345 avatar Jun 11 '24 12:06 JHarris12345

Able to reproduce on Paper version 1.20.6-138-master@906df69 (2024-06-10T06:32:15Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)

All rail blocks also fail to fire the destroy event.

rymiel avatar Jun 11 '24 13:06 rymiel

The reason this is happening is that the event is called in Level#destroyBlock. However, when redstone wire/repeaters/rails are broken, Level#removeBlock is called instead (so event is not fired.)

Would it be better to change the removeBlock calls to destroyBlock or to add the event calls to these locations?

EDIT: Reading the javadocs for the event, it states:

This event is associated with the game playing a sound effect at the block in question, when something can be described as "intend to destroy what is there"

There is no sound played for these blocks when broken. So is this expected behavior?

ploppyperson avatar Jun 17 '24 11:06 ploppyperson

I think at least having an event to listen for these would be helpful. In my opinion, putting it as a blockdestroyevent makes most sense

JHarris12345 avatar Jun 17 '24 13:06 JHarris12345