promotional bannermobile promotional banner

Variable Spawner Hardness

Make Minecraft spawners harder to break depending on your difficulty.

File Details

1.21.10-1.4.6-forge

  • R
  • Oct 27, 2025
  • 5.71 KB
  • 183
  • 1.21.10
  • Forge

File Name

VariableSpawnerHardness-1.21.10-1.4.6-forge.jar

Supported Versions

  • 1.21.10

Curse Maven Snippet

Forge

implementation "curse.maven:variable-spawner-hardness-400396:7156081"
Curse Maven does not yet support mods that have disabled 3rd party sharing

Learn more about Curse Maven

Ported to 1.21.10, performance improvements.

  • Using a switch that returns constant values is faster than indexing on mutable array contents (the array itself was static final, but there's currently no public API way of telling the JVM that the array contents won't change - JDK internals have `@Stable` but can't use it in this mod)
  • Grab level data once to reduce the number of untrusted final field reads (level#getDifficulty calls level#getLevelData)