Darkhax-Minecraft / ItemStages

Allows items to be put into stages.
GNU Lesser General Public License v2.1
7 stars 18 forks source link

1.18 Version's lack of documentation #94

Closed neos0 closed 7 months ago

neos0 commented 8 months ago

I'd like to disable the feature that drops unfamiliar items from the inventory. In older version this could be done in the config file, but the 1.18 version doesn't even generate a config file anymore. Is there a way to disable it from scripts?

Darkhax commented 7 months ago

You can find the full documentation for this mod in the example scripts. You're looking for this part.

// By default items are restricted to the greatest degree possible however you
// may want to ease certain parts of the restriction. For example you may want
// to prevent a player from using an item but allow them to keep it in their 
// inventory. This can be done by setting preventInventory to false.
val two = ItemStages.restrict(<item:minecraft:diamond>, "adv_two");
two.preventInventory(false);   // Allows item to be kept in inventories.
two.preventAttacking(false);   // Allows item to be used as a weapon.
two.preventPickup(false);      // Allows item to be picked up.
two.preventUsing(false);       // Allows item to be used (left/right click).
two.setHiddenInJEI(false);     // Allows item to be visible in JEI.