Skip to content

NullPointerException in KegBlockEntity.updateTemperature() - repeatable crash on world load #150

Description

@Kerolite

Environment:

  • Minecraft: 1.20.1, Forge: 47.4.20
  • Brewin' And Chewin': 1.20.1-3.2.1
  • Minimal reproduction: fresh creative world with ONLY Forge, MixinExtras (dependency), Farmer's Delight (dependency), and Brewin' And Chewin' - no other mods.

Steps to reproduce:

  1. Create a new world with the minimal mod list above.
  2. Place a Keg block.
  3. Wait for it to tick (crashes almost immediately, ~15 seconds / 300 game ticks in).
  4. Game crashes with a NullPointerException.

Crash cause:
NPE in KegBlockEntity.lambda$updateTemperature$8 (KegBlockEntity.java:497), inside a stream calling BlockStateBase.is(TagKey) on a neighboring block state. This calls Holder$Reference.is(), which fails on Objects.requireNonNull() - the Holder being checked is null/unbound.

Extensive testing performed (all crashes identical before narrowing down):
Originally encountered in a heavily modded pack (100+ mods). Progressively ruled out every external factor:

  1. Removed unrelated mods (Project: Edgerunner, etc.) → same crash.
  2. Broke the original Keg, placed a new one elsewhere → same crash (not corrupted block data).
  3. Removed "Cocktails Delight" compat addon → same crash.
  4. Removed ModernFix + Ferrite Core (blockstate/tag caching mods) → same crash, with the crashing line's mixin chain reduced to vanilla.
  5. Finally reproduced on a brand new world with only Forge + required dependencies → identical crash, confirming this is a bug entirely internal to Brewin' And Chewin', unrelated to any mod interaction, world corruption, or caching mixin.

Attached:
crash-2026-08-19_01.12.50-server.txt

Suggested fix direction:
Add a null-check/defensive guard around the tag lookup in updateTemperature() (KegBlockEntity.java:497), since the underlying Holder reference for the block/tag being checked appears to be null in certain (currently unclear) conditions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions