https://github.com/offsetmods538/loot-table-modifier
Makes it possible to modify instead of replace loot tables through datapacks.
https://github.com/offsetmods538/loot-table-modifier
Last synced: 3 months ago
JSON representation
Makes it possible to modify instead of replace loot tables through datapacks.
- Host: GitHub
- URL: https://github.com/offsetmods538/loot-table-modifier
- Owner: OffsetMods538
- License: mit
- Created: 2024-12-14T09:35:15.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-03-16T11:29:15.000Z (4 months ago)
- Last Synced: 2025-03-16T12:27:49.892Z (4 months ago)
- Language: Java
- Size: 77.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Loot Table Modifier
[](https://discord.offsetmonkey538.top/)
[](https://modrinth.com/mod/loot-table-modifier)
[](https://modrinth.com/mod/fabric-api)Allows datapacks (and thus mods as well) to add to loot tables, instead of just overwriting them.
Also provides a datagen provider for creating loot table modifiers in mods.
A modifier json file includes two components:
1. `"modifies"` - string or array, which defines the loot tables to modify. For example `"minecraft:entities/creeper"` or `"minecraft:chests/abandoned_mineshaft"`
2. `"pools"` - array of loot pools. This works exactly the same as the `"pools"` in a vanilla loot table, thus you can generate a loot table online with a tool like [misode.github.io](https://misode.github.io/loot-table/) and copy over the `"pools"` from the generated json. (I may fork it and add a generator for specifically this mod in the future™)
An example json file:
```json5
// example_pack/data/example/loot-table-modifier/loot_modifier/drop_tnt.json
{
// Can also be a single identifier without an array
// "modifies": "minecraft:entities/creeper",
"modifies": [
"minecraft:entities/creeper",
"minecraft:entities/zombie"
],
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 1.0,
"min": 0.0
},
"function": "minecraft:set_count"
}
],
"name": "minecraft:tnt"
}
],
"rolls": 1.0
}
]
}
```Depend on inside mod:
```groovy
repositories {
// ...
maven {
name = "OffsetMods538"
url = "https://maven.offsetmonkey538.top/releases"
content {
includeGroup "top.offsetmonkey538.loottablemodifier"
}
}
}dependencies {
// ...
modImplementation "top.offsetmonkey538.loottablemodifier:loot-table-modifier:1.0.1+1.21.1"
}
```