/
block_broken advancement triggerinsanelib:enchant_with_treasure
allow_curses and allow_treasure to ignore_curses and ignore_treasuresSerializableMobEffectInstanceinsanelib:enchantability item componentmerge_components array for item_components
ObjTag to use dynamic registriesJsonFeature#loadAndReadJson overloads for specifying the registryILGsonHelper and validators)insanelib:replace_loot — replaces items in a loot table with another item, optionally copying components (durability, enchantments) and scaling the count
{
"type": "insanelib:replace_loot",
"conditions": [...],
"original_item": "minecraft:iron_sword",
"replacement_item": "minecraft:diamond_sword",
"copy_components": true,
"count_multiplier": 1.0
}
insanelib:inject_loot_table — injects the contents of another loot table into the current one
{
"type": "insanelib:inject_loot_table",
"conditions": [...],
"loot_table": "minecraft:chests/simple_dungeon"
}
insanelib:drop_multiplier — multiplies the count of matching items in loot
{
"type": "insanelib:drop_multiplier",
"conditions": [...],
"item": "minecraft:wheat",
"multiplier": 2.0
}
insanelib:loot_purger — removes or damages items based on distance from world spawn; useful for progressive loot difficulty
{
"type": "insanelib:loot_purger",
"conditions": [...],
"end_range": 5000,
"start_range": 0,
"multiplier_at_start": 0.0,
"apply_to_damageable": false,
"blacklisted_items_tag": "insanelib:loot_purger_blacklist",
"blacklisted_entity_type_tag": "insanelib:loot_purger_entity_blacklist"
}
Items are progressively purged the closer to spawn the loot generates. At start_range the survival chance is multiplier_at_start, at end_range it is 1. apply_to_damageable damages items proportionally instead of removing them.insanelib:disenchant — removes enchantments from all items; enchanted books become plain books
{
"type": "insanelib:disenchant",
"conditions": [...],
"blacklisted_items_tag": "insanelib:disenchant_blacklist"
}
insanelib:enchant_randomly_weightless — enchants an item with a given number of random enchantments, each chosen with equal probability (no weight). Supports books.
{
"function": "insanelib:enchant_randomly_weightless",
"conditions": [...],
"count": 2,
"max_lvl": false,
"treasure": false
}
count: number of enchantments to apply (supports number providers). max_lvl: always apply the maximum level. treasure: allow treasure enchantments (tag minecraft:treasure).insanelib:enchant_with_treasure — applies a single random treasure enchantment to the item. Supports books.
{
"function": "insanelib:enchant_with_treasure",
"conditions": [...],
"ignore_curses": false,
"ignore_treasures": false
}
ignore_curses: exclude curse enchantments (tag minecraft:curse). ignore_treasures: exclude non-curse treasure enchantments.insanelib:block_tag_match — passes if the broken block is in the given tag (returns true if no block state is in context)
{ "condition": "insanelib:block_tag_match", "block_tag": "minecraft:logs" }
insanelib:killer_has_advancement — passes if the killing player has completed the given advancement
{ "condition": "insanelib:killer_has_advancement", "advancement": "minecraft:story/mine_diamond" }
insanelib:non_player_arised_drop — passes if the drop was not caused by a player, explosion, or tool (i.e. natural mob death without a player killer)
{ "condition": "insanelib:non_player_arised_drop" }
ItemComponentsReloadListener.PROGRAMMATIC_PROVIDERS to change stacks programmaticallyInsaneLib.ONE_DECIMAL_FORMATTERMCUtils.computeFoodFormula using EvalExfeature_enabled neoforge condition and loot conditionPlayerUseItemMovSpeedEvent and PlayerSprintEventClientUtils/insanelib command, but, more importantly, added a new subcommand get_data_components
/insanelib get_data_components <item> you can get a list of all the data components that are currently applied to the itemitem_components)
remove_components, a list of components to remove from the itempriority, integer value. When multiple json target the same item, components are merged — higher priority wins per component type.data/<namespace>/item_definitions/strong_diamond_sword.json will make diamond swords have 50 Attack Damage and 2000 durability{
"item": "minecraft:diamond_sword",
"components": {
"minecraft:max_damage": 2000,
"minecraft:attribute_modifiers": {
"modifiers": [
{
"type": "minecraft:generic.attack_damage",
"id": "minecraft:attack_damage",
"amount": 50.0,
"operation": "add_value",
"slot": "mainhand"
}
]
}
}
}
ObjTagValue.LIST_TYPEIdTagValue as ObjTagValueObjTag#asHolderMCUtils.createPotionStackFromEffectInstancesILModConfig to prevent having to create a config class each mod
public static ILModConfig CONFIG;
public YourMod(IEventBus modEventBus, ModContainer modContainer) {
CONFIG = new ILModConfig(MOD_ID, ModConfig.Type.COMMON, modEventBus,
Modules::init, InsaneLib.class.getClassLoader());
modContainer.registerConfig(ModConfig.Type.COMMON, CONFIG.spec, MOD_ID + "/common.toml");
}
ILModConfig constructor
public static ILModConfig CONFIG;
public YourMod(IEventBus modEventBus, ModContainer modContainer) {
CONFIG = new ILModConfig(location("main"), "Main", ModConfig.Type.COMMON, modEventBus,
Modules::init, InsaneLib.class.getClassLoader());
modContainer.registerConfig(ModConfig.Type.COMMON, CONFIG.spec, MOD_ID + "/common.toml");
}
Features in single module mods can now omit the module parameter in @LoadFeaturePort to 1.21.1
This version contains most of the player features (missing Better Falling Blocks) + everything needed to make MPR work.
spawn_type tag, neoforge already does that with neoforge:spawn_type NBT Tag