Grief Prevention

Grief Prevention

1M Downloads

Withers do not destroy blocks around them when hit.

ghostlyscythe opened this issue · 21 comments

commented

Observed Behavior

A wither spawned in an unprotected area, below sea level with not destroy the surrounding blocks around it when attacked.

The wither will however destroy blocks in the same location with its skull throwing.

By testing with events the relevant event being thrown is:

For wither skulls being shot the event is: 

@EventHandler
public void on (EntityExplodeEvent event) {
    if (event.getEntity().getType() == EntityType.WITHER_SKULL) {
        System.out.println("I shot a skull");
    }
}

For the wither breaking surrounding blocks when being attacked the event is:

@EventHandler
public void on (EntityChangeBlockEvent event){
    if (event.getEntity().getType() == EntityType.WITHER) {
        System.out.println("I destroyed blocks.");
    }
}

@

Expected Behavior

That when my players hit the wither while being under sea level and outside of a claim, the wither will then break the blocks around it.

Reproduction steps

Download GriefPrevention.
Run the Server.
Go to Y = 0 just to be sure you are under sea level.
Spawn the wither.
Punch the wither.

Then disable GriefPrevention.
Punch the wither.

https://streamable.com/rsoobp

Video was too long to upload normally.

Stack trace or error log

There is no error log.

Server version

[02:55:26 INFO]: Current: git-Purpur-1957 (MC: 1.19.4)*
Previous: git-Purpur-1916 (MC: 1.19.3)
* You are running the latest version

GriefPrevention version

> version GriefPrevention
[02:57:49 INFO]: GriefPrevention version 16.18

Configuration

# Default values are perfect for most servers.  If you want to customize and have a question, look for the answer here first: http://dev.bukkit.org/bukkit-plugins/grief-prevention/pages/setup-and-configuration/

GriefPrevention:
  SeaLevelOverrides:
    world: -1
    world_nether: -1
    world_the_end: -1
    buildworld: -1
    cubeworld: -1
    challengeworld: -1
  Claims:
    Mode:
      challengeworld: Disabled
      buildworld: Disabled
      world_nether: Survival
      world_the_end: Survival
      cubeworld: Survival
      world: Survival
    PreventGlobalMonsterEggs: true
    PreventTheft: true
    ProtectCreatures: true
    PreventButtonsSwitches: true
    LockWoodenDoors: true
    LockTrapDoors: true
    LockFenceGates: true
    EnderPearlsRequireAccessTrust: true
    RaidTriggersRequireBuildTrust: true
    ProtectHorses: true
    ProtectDonkeys: true
    ProtectLlamas: true
    InitialBlocks: 2000
    Claim Blocks Accrued Per Hour:
      Default: 500
    Max Accrued Claim Blocks:
      Default: 10000000
    Accrued Idle Threshold: 0
    AccruedIdlePercent: 0
    AbandonReturnRatio: 1.0
    AutomaticNewPlayerClaimsRadius: 10
    AutomaticNewPlayerClaimsRadiusMinimum: 0
    ExtendIntoGroundDistance: 10
    MinimumWidth: 5
    MinimumArea: 100
    MaximumDepth: -100
    InvestigationTool: STICK
    ModificationTool: GOLDEN_SHOVEL
    Expiration:
      ChestClaimDays: 14
      UnusedClaimDays: 21
      AllClaims:
        DaysInactive: 60
        ExceptWhenOwnerHasTotalClaimBlocks: 10000
        ExceptWhenOwnerHasBonusClaimBlocks: 5000
      AutomaticNatureRestoration:
        SurvivalWorlds: false
    AllowTrappedInAdminClaims: false
    MaximumNumberOfClaimsPerPlayer: 0
    CreationRequiresWorldGuardBuildPermission: true
    VillagerTradingRequiresPermission: true
    CommandsRequiringAccessTrust: /sethome
    DeliverManuals: true
    ManualDeliveryDelaySeconds: 30
    RavagersBreakBlocks: true
    FireSpreadsInClaims: false
    FireDamagesInClaims: false
    LecternReadingRequiresAccessTrust: true
  Spam:
    Enabled: false
    LoginCooldownSeconds: 60
    LoginLogoutNotificationsPerMinute: 5
    ChatSlashCommands: /me;/global;/local
    WhisperSlashCommands: /tell;/pm;/r;/whisper;/msg
    WarningMessage: Please reduce your noise level.  Spammers will be banned.
    BanOffenders: true
    BanMessage: Banned for spam.
    AllowedIpAddresses: 1.2.3.4; 5.6.7.8
    DeathMessageCooldownSeconds: 120
    Logout Message Delay In Seconds: 0
  PvP:
    RulesEnabledInWorld:
      world: true
      world_nether: true
      world_the_end: true
      buildworld: true
      cubeworld: true
      challengeworld: true
    ProtectFreshSpawns: true
    PunishLogout: false
    CombatTimeoutSeconds: 5
    AllowCombatItemDrop: false
    BlockedSlashCommands: /home;/vanish;/spawn;/tpa
    ProtectPlayersInLandClaims:
      PlayerOwnedClaims: true
      AdministrativeClaims: false
      AdministrativeSubdivisions: false
    AllowLavaDumpingNearOtherPlayers:
      PvPWorlds: true
      NonPvPWorlds: false
    AllowFlintAndSteelNearOtherPlayers:
      PvPWorlds: true
      NonPvPWorlds: false
    ProtectPetsOutsideLandClaims: true
  Economy:
    ClaimBlocksMaxBonus: 0
    ClaimBlocksPurchaseCost: 0.0
    ClaimBlocksSellValue: 0.0
  ProtectItemsDroppedOnDeath:
    PvPWorlds: true
    NonPvPWorlds: true
  BlockLandClaimExplosions: true
  BlockSurfaceCreeperExplosions: true
  BlockSurfaceOtherExplosions: true
  LimitSkyTrees: false
  LimitTreeGrowth: false
  PistonMovement: EVERYWHERE_SIMPLE
  PistonExplosionSound: true
  FireSpreads: true
  FireDestroys: true
  AdminsGetWhispers: true
  AdminsGetSignNotifications: true
  VisualizationAntiCheatCompatMode: false
  SmartBan: true
  Mute New Players Using Banned Words: true
  MaxPlayersPerIpAddress: 3
  SilenceBans: true
  Siege:
    Worlds: []
    BreakableBlocks:
    - GRASS_BLOCK
    - DIRT
    - COBBLESTONE
    - OAK_PLANKS
    - SPRUCE_PLANKS
    - BIRCH_PLANKS
    - JUNGLE_PLANKS
    - ACACIA_PLANKS
    - DARK_OAK_PLANKS
    - SAND
    - GRAVEL
    - GLASS
    - GRASS
    - FERN
    - DEAD_BUSH
    - WHITE_WOOL
    - ORANGE_WOOL
    - MAGENTA_WOOL
    - LIGHT_BLUE_WOOL
    - YELLOW_WOOL
    - LIME_WOOL
    - PINK_WOOL
    - GRAY_WOOL
    - LIGHT_GRAY_WOOL
    - CYAN_WOOL
    - PURPLE_WOOL
    - BLUE_WOOL
    - BROWN_WOOL
    - GREEN_WOOL
    - RED_WOOL
    - BLACK_WOOL
    - SNOW
    - GLASS_PANE
    DoorsOpenDelayInSeconds: 300
    CooldownEndInMinutes: 60
  EndermenMoveBlocks: false
  SilverfishBreakBlocks: false
  CreaturesTrampleCrops: false
  RabbitsEatCrops: true
  HardModeZombiesBreakDoors: false
  Database:
    URL: ''
    UserName: ''
    Password: ''
  UseBanCommand: false
  BanCommandPattern: ban %name% %reason%
  Advanced:
    fixNegativeClaimblockAmounts: true
    ClaimExpirationCheckRate: 60
    OfflinePlayer_cache_days: 90
  Abridged Logs:
    Days To Keep: 7
    Included Entry Types:
      Social Activity: true
      Suspicious Activity: true
      Administrative Activity: false
      Debug: false
      Muted Chat Messages: false

Plugin list

[03:37:28 INFO]: Bukkit Plugins: (33):
[03:37:28 INFO]:  - BarrelSorting, BeeSafety, BigDoggo, Challengeworld, CoreProtect, CropNoTrample, Cube, DeathPoint, DiscordSRV, ElytraSafety
[03:37:28 INFO]:  floodgate, Geyser-Spigot, GriefPrevention, LuckPerms, MobShop, MoreMobHeads, NBTAPI, NewPlayers, Noaivillager, PerPlayerLoot
[03:37:28 INFO]:  PlugManX, Recipy, SheepNoEat, Silkables, Simpleton, SmoothSleep, spark, ViaBackwards, ViaVersion, WorldEdit
[03:37:28 INFO]:  WorldGuard, WorldUnloader, Zombiechange

Running without GriefPrevention

  • I attempted running the server without GriefPrevention installed.
  • The problem does not occur when GriefPrevention is removed from the server.

Running with only GriefPrevention

  • I attempted running only GriefPrevention on the server.
  • The issue still occurs when GriefPrevention is the only plugin running.

Running on a fresh, clean server installation

  • I attempted testing for the issue on a new server.
  • The issue still occurs on a new server.

Using unmodified client

  • I attempted testing for the issue with the vanilla client.
  • The issue still occurs when using the vanilla client.

We appreciate you taking the time to fill out a bug report!

  • I searched for similar issues before submitting this bug report.
commented

thanks, interesting it uses that event instead of explosion.

commented

No problem, Will it be likely this gets changed? ^^

commented

Even though I've marked this for v17, I'll accept any PR to fix this in v16 too.

commented

This isn't a GriefPrevention bug. I am running 16.18.1 with default configuration and the Wither and Wither Skeleton's are causing damage to the terrain.

Please note: Wither skulls only break blocks with a blast resistance of less than 1. This means most blocks underground won't break. This is a list https://minecraft.fandom.com/wiki/Explosion#Blast_resistance. The only exception to this is if the wither can't find an entity to shoot at, it will then start shooting the blue wither skull which breaks any block that isn't unbreakable. This was all tested in Vanilla singleplayer as well as a server running GriefPrevention (Source: https://minecraft.fandom.com/wiki/Wither#Wither_Skull).

commented

I don't do contact via Discord. Feel free to make a longer post or record a video.

What I'm telling you is that the bug report is filed about a very specific behavior of withers which GP is absolutely blocking. You don't appear to understand the behavior being discussed, and that's okay, but this is absolutely a replicable bug despite other correct behaviors existing.

If it helps you, here is the line in NMS where the EntityChangeBlock is called by the wither boss. You can locate this in your local copy to understand the behavior better.
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/nms-patches/net/minecraft/world/entity/boss/wither/EntityWither.patch#78

The wiki is not a completely accurate source of information. Trust but verify.

commented

image

`@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
public void onEntityExplode(EntityExplodeEvent explodeEvent)
{
    this.handleExplosion(explodeEvent.getLocation(), explodeEvent.getEntity(), explodeEvent.blockList());
    GriefPrevention.instance.getLogger().log(Level.INFO, explodeEvent + " fired");

}

else if (event.getEntityType() == EntityType.WITHER) { GriefPrevention.instance.getLogger().log(Level.INFO, event + " noticed"); Claim claim = this.dataStore.getClaimAt(event.getBlock().getLocation(), false, null); if (claim == null || !claim.areExplosivesAllowed || !GriefPrevention.instance.config_blockClaimExplosions) { event.setCancelled(true); GriefPrevention.instance.getLogger().log(Level.INFO, event + " fired"); } }

I've got this and this is what it is showing. Note that I've got BlockSurfaceOtherExplosions: false which is allowing for the requirements that the reported requires in the first place.

commented

Again, you do not understand the behavior being discussed here. You're testing the skulls and initial explosion, not the anti-trap measure.

Spawn the wither in a small box. Punch the wither. Nearby blocks are broken in a box around the wither, except GP blocks that.

Simple reproduction listener for clarification:

  @EventHandler
  public void onEntityChangeBlock(EntityChangeBlockEvent event) {
    if (event.getEntityType() == EntityType.WITHER) {
      Bukkit.broadcastMessage("crunch time");
    }
  }

  @EventHandler
  public void onEntityExplode(EntityExplodeEvent event) {
    event.setCancelled(true);
  }

/e: my precious indentation

commented

This isn't a GriefPrevention bug. I am running 16.18.1 with default configuration and the Wither and Wither Skeleton's are causing damage to the terrain.

Please note: Wither skulls only break blocks with a blast resistance of less than 1. This means most blocks underground won't break. This is a list https://minecraft.fandom.com/wiki/Explosion#Blast_resistance. The only exception to this is if the wither can't find an entity to shoot at, it will then start shooting the blue wither skull which breaks any block that isn't unbreakable. This was all tested in Vanilla singleplayer as well as a server running GriefPrevention (Source: https://minecraft.fandom.com/wiki/Wither#Wither_Skull).

The wither boss (not the skulls it shoots) removes blocks within a certain range of it when damaged to prevent suffocation traps, etc. GP blocks this unless the wither is in a claim with claim explosions enabled. I believe this is the same issue as #730, whose OP closed without resolution.

commented

This isn't a GriefPrevention bug. I am running 16.18.1 with default configuration and the Wither and Wither Skeleton's are causing damage to the terrain.

Please note: Wither skulls only break blocks with a blast resistance of less than 1. This means most blocks underground won't break. This is a list https://minecraft.fandom.com/wiki/Explosion#Blast_resistance. The only exception to this is if the wither can't find an entity to shoot at, it will then start shooting the blue wither skull which breaks any block that isn't unbreakable. This was all tested in Vanilla singleplayer as well as a server running GriefPrevention (Source: https://minecraft.fandom.com/wiki/Wither#Wither_Skull).

The wither boss (not the skulls it shoots) removes blocks within a certain range of it when damaged to prevent suffocation traps, etc. GP blocks this unless the wither is in a claim with claim explosions enabled. I believe this is the same issue as #730, whose OP closed without resolution.

Yup, the "issue" is stating that it doesn't remove blocks in "claimless" areas (which is false).

I could easily replicate blocks being removed outside of claims with a default configuration, both with the wither initialisation phase and the looking for Entity/Living Entity Phase (above and below sea level).

commented

Yup, the "issue" is stating that it doesn't remove blocks in "claimless" areas (which is false).

I could easily replicate blocks being removed outside of claims with a default configuration, both with the wither initialisation phase and the looking for Entity/Living Entity Phase (above and below sea level).

Note the lack of block break noises and block break particles with GP installed. GP is blocking the EntityBreakBlockEvent fired by the wither itself.

/e: Here, the lines of code:

https://github.com/TechFortress/GriefPrevention/blob/de1e72d99353fec63e14a22c377890d406f1de4b/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java#L136-L143

GP always blocks all direct Wither boss damage outside of claims in worlds with claims enabled regardless of any other factors like Y level.

/e2: Should also note that to replicate you specifically have to cause damage to the wither. Just sitting there watching it in a tight space will not demonstrate this behavior, because the wither only "untraps" itself by destroying blocks when it takes damage.

commented

Im confused, you are both seemingly agreeing that its not a "bug" and yet it was just labelled as a confirmed bug.

commented

Im confused, you are both seemingly agreeing that its not a "bug" and yet it was just labelled as a confirmed bug.

No, I was trying to explain replication because it's a really niche weird behavior that gets further confused by the existence of blue skulls (which do work as expected). TreemanKing was claiming that that is not the case, so I verified in the game and code that it is.

commented

Ahhh well thank you, I did think i gave plenty of data and proof of the bug even supplying code for it. From what I can gather its not too much of a pain to fix ^^

commented

GP always blocks all direct Wither boss damage outside of claims in worlds with claims enabled regardless of any other factors like Y level.

Well it isn't occuring in my local and live server instances. Blocks are still breakable outside of claims.

/e: Here, the lines of code:

https://github.com/TechFortress/GriefPrevention/blob/de1e72d99353fec63e14a22c377890d406f1de4b/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java#L136-L143

This doesn't even get fired in the case of Withers. Only the EntityExplodeEvent does. I've just runned a debug. I can show you the logs if required.

/e this is the case for WITHER_SKULLS too since they are also a live entity.

GP always blocks all direct Wither boss damage outside of claims in worlds with claims enabled regardless of any other factors like Y level.

Only if the configuration is set.

/e2: Should also note that to replicate you specifically have to cause damage to the wither. Just sitting there watching it in a tight space will not demonstrate this behavior, because the wither only "untraps" itself by destroying blocks when it takes damage.

No it doesn't. It only destroys blocks with a blast resistance of less than 4 (dirt etc). Only time it will break deepslate is when it is looking for an entity to hit. Read the wiki reference that I have supplied. It untraps itself when it is looking for an entity...

commented

BlockSurfaceOtherExplosions: true
is within his config which is blocking the explosion event causing no damage to blocks. I don't know what you are trying to argue about. He is clearly specifying that he wants blocks to be explodable by the wither which this setting needs to be set as false. The "EntityChangeBlockEvent" code is redundant for withers and shouldn't be there in the first place.

commented

BlockSurfaceOtherExplosions: true is within his config which is blocking the explosion event causing no damage to blocks. I don't know what you are trying to argue about. He is clearly specifying that he wants blocks to be explodable by the wither which this setting needs to be set as false. The "EntityChangeBlockEvent" code is redundant for withers and shouldn't be there in the first place.

image

commented

Just add me on discord and I'll show you what I mean.

commented

He wants blocks in an unclaimed area to break. If he changes the required configuration setting, withers (and its skulls blue/normal) will be able to blow up blocks not in claims (ghostlyscythe has it set to true).

I don't understand why you refuse to agree with me on this but that's up to you if you go in a loop to try to fix a non-issue.

E/ Wither's also don't have an Anti Trap Measure

commented

https://minecraft.fandom.com/wiki/Wither

Upon taking damage, the wither breaks all blocks within a 3×4×3 area around it, including blast-resistant blocks like obsidian, crying obsidian, and ancient debris, dropping them as items if possible. The wither is the only mob in the game that can destroy obsidian.

(Doesn't have anti trap measure? ^^^^ From your favourite source. The wiki. Thoughts?)

commented

https://minecraft.fandom.com/wiki/Wither

Upon taking damage, the wither breaks all blocks within a 3×4×3 area around it, including blast-resistant blocks like obsidian, crying obsidian, and ancient debris, dropping them as items if possible. The wither is the only mob in the game that can destroy obsidian.

(Doesn't have anti trap measure? ^^^^ From your favourite source. The wiki. Thoughts?)

Oops, I forgot to read that one word. Now I look like a massive flog 🤡
Feel free to delete all the unnecessary comments...

commented

fix was merged in legacy