
Improve Loot Support for Entities without Vanilla Loot Tables
Closed this issue · 2 comments
I'm very likely missing something here, but are there mob capture cards that you can get which don't drop any loot at all? I killed a roving pillager and it dropped a capture card, and I've got it in a monster plains iron-tier farm with a luck enhancement and a sword enhancement, and it's run through several cycles and I've yet to get anything from it. I can't think of another kind of farm that would be more fitting to a pillager, so I'm not sure if pillagers just don't have loot tables or if I'm missing something.
Thanks for the feedback!
As you correctly pointed out, Pillagers don’t really have a proper loot table. Their default loot file looks like this:
{
"type": "minecraft:entity",
"random_sequence": "minecraft:entities/pillager"
}
In contrast, a typical entity loot table looks more like this:
{
"type": "minecraft:entity",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 0.0,
"max": 2.0
},
"add": false
},
{
"function": "minecraft:looting_enchant",
"count": {
"type": "minecraft:uniform",
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:arrow"
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 0.0,
"max": 2.0
},
"add": false
},
{
"function": "minecraft:looting_enchant",
"count": {
"type": "minecraft:uniform",
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:bone"
}
],
"rolls": 1.0
}
],
"random_sequence": "minecraft:entities/skeleton"
}
With the latest update, I’ve introduced support for alternative loot tables, which allows me to define custom loot even for entities that don’t have proper loot definitions in vanilla or other mods.
I’ll go ahead and add an alternative loot table for the Pillager.
If there are other entities you'd like to see drop loot, feel free to let me know!