
Surprising Loot
Surprising Loot transforms ordinary treasure hunting into an exciting adventure with unexpected twists! This configurable modification adds an element of surprise when opening loot containers.
When a player first opens a chest or other container tied to a specific loot table, there's a configurable chance that hostile mobs will spawn nearby. This makes every exploration of temples, dungeons, and other locations truly thrilling and unpredictable.
The mod works with both vanilla chests and containers from other modifications, and is fully compatible with Lootr.
Creating Custom Events
You can create datapacks to define unique surprise events. An example configuration file is located at:
data/surprisingloot/loot_events/example.json
Here's an example setup:
{
"loot_table": "minecraft:chests/jungle_temple",
"check_range": 3,
"chance": 1,
"spawn_times": 3,
"entity_pool": [
{
"weight": 2,
"entity_type": "minecraft:zombie",
"nbt": "{CustomName:'\"Gift\"',CustomNameVisible:1b,Health:2.0f,Attributes:[{Name:\"generic.max_health\",Base:50.0}]}"
},
{
"weight": 1,
"glowing": true,
"entity_type": "minecraft:bat"
}
]
}
Configuration Parameter Description
loot_table
— the loot table ID this event applies tocheck_range
— search radius for suitable spawn positions (in blocks)chance
— probability of successful mob spawn for each attempt (from 0.0 to 1.0)spawn_times
— number of spawn attempts when the event is triggeredentity_pool
— list of possible entities to spawn with weighted selectionweight
— higher values increase the probability of selecting this entryentity_type
— entity ID to spawnnbt
(optional) — NBT data string to customize the entityglowing
(optional) — iftrue
, the entity will spawn with the glowing effect