Item Stages

Item Stages

20M Downloads

Handle equipment separately from inventory. Add a system for exceptions when using broad conditions.

Umbreona opened this issue ยท 2 comments

commented

i was wondering if you could add a feature where the player would be able to have armor in their inventory (say they found some diamond armour in a dungeon) but they cant equip it unless they have the right stage. then they can use it later on when they are a higher stage.
was also wondering if there was a way to add all the items from a mod to a stage then clear select items under a tag like i can do with recipe stages

// mods.recipestages.Recipes.setRecipeStageByMod("dragonage", "iceandfire");
// mods.recipestages.Recipes.clearRecipeStage(tag:items:forge:bronzeagetag);
// mods.recipestages.Recipes.clearRecipeStage(tag:items:forge:silveragetag);

commented

Splitting up inventory and equipment slots makes sense, I will add this to my TODO list for the next update.

was also wondering if there was a way to add all the items from a mod to a stage then clear select items under a tag like i can do with recipe stages

You can stage all items from a mod using this. There is no way to remove a specific entry from this, or create a restriction as the modid is checked on-demand rather than building a list of all possible items. The recommended way to do what you would like is to create a new item tag with all the items you specifically want and then stage that instead using this. This is fairly trivial with the tools CraftTweaker provides however I have had a lot of people ask about it so I am going to look into ways to make this even more simple.

commented

As of b3ee4cd you can now handle equipment separately from the inventory.

import mods.itemstages.ItemStages;

// Players can equip iron chestplates but not hold them in the inventory.
val one = ItemStages.restrict(<item:minecraft:iron_chestplate>, "one");
one.preventEquipment(false);

// Players can have iron helmets in their inventory but not their equipment.
val two = ItemStages.restrict(<item:minecraft:iron_helmet>, "two");
two.preventInventory(false);

As of 605565e you can now create exclusion filters. If an item matches the exclusion filter it will NOT be stages.

// Stages all items from "minecraft" except for sticks.
ItemStages.createModRestriction("minecraft", s => <item:minecraft:stick>.matches(s), "one");