-
Couldn't load subscription status.
- Fork 0
Resource Generator
The Resource Generator contains information about potential loot that can be generated each resource generation cycle. There are several built-in resource generators; see each entry for usage and details.
Create a JSON file located at data/[namespace]/axolootl/resource_generators/[path].json where [namespace]:[path] is the ID of the Resource Generator. Names must be lowercase and contain no spaces.
The following data is required for all resource generators.
-
type(namespaced ID)- The registry ID of the Resource Generator
Many Resource Generator JSONs require Item Stacks. In most cases, the entire Item Stack can be defined, or for an Item Stack with one item and no NBT data, the item ID is sufficient.
The following are equivalent:
"item": "minecraft:bread"
"item": {
"id": "minecraft:bread",
"Count": 1
}
Many Resource Generator JSONs require weighted lists of varying types. Weighted Lists are a list of Weighted Entry objects. The probability of each entry is entry weight / total weight
-
weight(number) Required- The entry weight. Must be greater than
0.
- The entry weight. Must be greater than
-
data(object) Required- Some object JSON values. For example, an Item Stack weighted list requires either the item ID or an object with
idandCount
- Some object JSON values. For example, an Item Stack weighted list requires either the item ID or an object with
"weighted_list": [
{
"weight": 3, # the weight of the first entry
"data": "minecraft:bread" # an item stack data entry, for example
},
{
"weight": 1, # the weight of the second entry
"data": { # an item stack data entry, for example
"id": "minecraft:bread",
"Count": 2
}
}
]
Generates no items.
[none]
The following Resource Generator generates nothing.
{
"type": "axolootl:empty"
}
References another registered Resource Generator
-
id(namespaced ID) Required- The Resource Generator ID
The following Resource Generator generates the same items as the Resource Generator at data/axolootl/axolootl/resource_generators/stone.json
{
"type": "axolootl:reference",
"id": "axolootl:stone"
}
Selects a single Item Stack from a list of one or more Item Stacks.
-
item(Item Stack|Weighted List) Required- A single Item Stack or a Weighted List of Item Stacks
The following Resource Generator generates 1 bread.
{
"type": "axolootl:item",
"item": "minecraft:bread"
}
The following Resource Generator has a 2/3 chance to generate 1 bread and a 1/3 chance to generate 5 bread.
{
"type": "axolootl:item"
"item": [
{
"weight": 2,
"data": "minecraft:bread"
},
{
"weight": 1,
"data": {
"id": "minecraft:bread",
"Count": 5
}
}
]
}
Selects a single item from an item tag.
-
tag(namespaced ID) Required- The Item Tag ID
The following Resource Generator generates a random item from the forge:rods/wooden item tag.
{
"type": "axolootl:tag",
"tag": "forge:rods/wooden"
}
Contains one or more block states and generates the same items that would result from breaking the block with an optional tool.
-
tool(Item Stack) Optional- The item to simulate breaking a block. Defaults to no item.
-
block_provider(Block State Provider) Required- The Block State Provider to determine which block to simulate. For best results, use
"minecraft:simple_state_provider"or"minecraft:weighted_state_provider"
- The Block State Provider to determine which block to simulate. For best results, use
The following Resource Generator generates the same loot that would drop when breaking a gravel block with a stone shovel that is enchanted with Fortune I.
{
"type": "axolootl:block",
"tool": {
"id": "minecraft:stone_shovel",
"Count": 1,
"tag": {
"Enchantments": [
{
"id": "minecraft:fortune",
"lvl": 1
}
]
}
},
"block_provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:gravel"
}
}
}
Rolls an entity death loot table.
Contains the Loot Table ID and an Item Stack to display when summarizing loot drops. This is necessary because loot tables are a "black box" and the result items cannot be known ahead of time.
The Loot Table Entry can be defined by a single Loot Table ID (which will display a stone sword) or a combination of Loot Table ID and the icon to display.
-
id(namespaced ID) Required- The Loot Table ID
-
display(Item Stack) Optional- The Item Stack to show the player when summarizing resource generator results
-
loot_table(Loot Table Entry|Weighted List) Required- A single Loot Table Entry or a Weighted List of Loot Table Entries
The following Resource Generator generates random loot from the Creeper loot table with the default icon.
{
"type": "axolootl:mob",
"loot_table": "minecraft:entities/creeper"
}
The following Resource Generator generates random loot from the Creeper loot table with a display icon of a creeper head.
{
"type": "axolootl:mob",
"loot_table": {
"id": "minecraft:entities/creeper",
"display": "minecraft:creeper_head"
}
}
The following Resource Generator has a 3/5 chance to generate random loot from the Creeper loot table and 2/5 chance to generate random loot from the Yellow Sheep loot table.
{
"type": "axolootl:mob",
"loot_table": [
{
"weight": 3,
"data": {
"id": "minecraft:entities/creeper",
"display": "minecraft:creeper_head"
}
},
{
"weight": 2,
"data": "minecraft:entities/sheep/yellow"
}
]
}
Contains a Weighted List of Resource Generator references or definitions. One Resource Generator is chosen at random to generate items.
-
rolls(number) Optional- The number of times to randomly select and apply a resource generator. Defaults to
1
- The number of times to randomly select and apply a resource generator. Defaults to
-
pool(Weighted List) Required- A Weighted List of Resource Generator IDs or definitions
The following Resource Generator has a 3/5 chance to generate bread, 1/5 chance to generate an item from the "minecraft:fishes" tag, and 1/5 chance to generate nothing.
{
"type": "axolootl:select",
"pool": [
{
"weight": 3,
"data": {
"type": "axolootl:item",
"item": "minecraft:bread"
}
},
{
"weight": 1,
"data": {
"type": "axolootl:tag",
"tag": "minecraft:fishes"
}
},
{
"weight": 1,
"data": "axolootl:empty"
}
]
}
Contains a Holder Set of Resource Generator references or definitions and combines the results.
The following Resource Generator generates random loot from the Creeper loot table and 4 experience bottles.
{
"type": "axolootl:and",
"values": [
{
"type": "axolootl:mob",
"loot_table": {
"id": "minecraft:entities/creeper",
"display": "minecraft:creeper_head"
}
},
{
"type": "axolootl:item",
"item": {
"id": "minecraft:experience_bottle",
"Count": 4
}
}
]
}