- Add `ItemFilter.hasComponent()
- Add
.replaceLoot(filter, lootEntry, preserveCount, preserveComponentTypes)action to allow preserving certain component types when replacing loot
- Update to KubeJS 7.2
- Fix internal access to private constructor
SetComponentsFunction
- Refactor different
ItemFiltersinto own classes
- Added some access to private fields
- Added
getPools,modifyPool,getPool,modifyPoolByName,getPoolByNameto loot tables - Added
hasItemfor pools and grouped loot entries
- Added
matchAnyInventorySlot(itemFilter)andmatchAnyHotbarSlot(itemFilter)
- Fix loot modification being skipped when loot table doesn't contain any entries
- Fix
printmethod for loot tables. Will now print the entries correctly. - Fix
matchCustomConditionandjsonFunctionusing wrong codec.
- Remove
addItemfor loot pools. Prefer to useaddEntry - Deprecate
addTypeModifierinLootJS.modifiersand will be removed in future updates, useaddTableModifierwith a LootType instead. - Deprecate
modifyLootTypeTablesinLootJS.lootTablesand will be removed in future updates, usemodifyLootTableswith a LootType instead.
- Fix
.createin loot tables event
- Bump kubejs version
- Add quick way to negate simple
ItemFilters like tag or id filter by using!, e.g.!#c:tools - Fix regex handling with id filters
- Rename
removeGlobalModifiertoremoveGlobalModifiersinLootJS.modifiersevent.
Fixes
- Fix error
Tag does not existwhen using ItemPredicates with tags
Changes
- New wiki https://docs.almostreliable.com/lootjs/
- Now on
neoforge - Added
LootJS.loot_tablesevent for direct loot table modification - Add
LootBucketas wrapper class for loot for easier execute some helper functions LootEntrydoes not only represent single items anymore. It now represents all different loot entries vanilla minecraft has.LootEntry.of(item): Single itemLootEntry.empty(): Empty entryLootEntry.tag(tag): Tag entryLootEntry.reference(lootTable): Reference to another loot table. For example,LootEntry.reference("minecraft:chests/abandoned_mineshaft")LootEntry.alternative(lootEntries...): Alternative lootLootEntry.sequence(lootEntries...): Sequence lootLootEntry.group(lootEntries...): Grouped loot
- Changes to
LootJS.modifiersevent:- Loot modifiers are not executed in order anymore. It will now work like a loot table. First check for conditions and if it contains matching loot, then apply all actions and then apply loot functions.
addLootTableModifier,addLootTypeModifier,addBlockLootModifier,addEntityLootModifierrenamed intoaddTableModifier,addTypeModifier,addBlockModifier,addEntityModifier.functions(itemFilter, (f) => {})removed. Better to just usegroupnow- Added
.group((group) => {...})or.group(itemFilter, (item) => {...}). Second one will pre-filter current loot for further modifications..group()can use.rolls(numberprovider)to execute the group multiple times
.pool()now actually consumes a vanillaLootPool- Removed
addWeightedLoot(), use.pool()instead now matchLootrenamed intocontainsLoot.dropExperiencecan now use a number provider instead of a fixed amountLootContextJSwrapper removed. UsingLootContextinstead but added all helper methods fromLootContextJStoo
- Renamed some loot functions
- Renamed some loot conditions
- Changes to
ItemFilter:.hasEnchantments(...)only works for item enchantments now. Forstoredenchantments use.hasStoredEnchantments(...)- Removed some filters as they are no longer needed with the new data components.
- Renamed
ALWAYS_TRUEintoALLandALWAYS_FALSEintoNONE
- Added
vault,block_useandshearingLootType - And probably more stuff I may missed, sorry! :D Feel free to ask in our discord.
Added
- Added
randomTableBonus(enchantment, chances)for vanillastable_bonuscondition

