Closed h0sk1 closed 2 months ago
Hello, can you please include the script that you are using to create this restriction?
Hello, can you please include the script that you are using to create this restriction?
Yes. of course!
I ve changed the file format, because i cant attach file with format .zs
@h0sk1 Sorry it took me a bit to look at this. There are a few issues with your script.
1) You have minercraft
instead of minecraft
in that script. Not sure if that's intentional or not, but I changed it to minecraft
in my script so I could test it with vanilla.
2) CraftTweaker ingredients are damage sensitive by default so your script is only matching the default damage state. You can use the anyDamage
method to accept any damage value.
Here is a working script where the diamond sword acts like your example, and the golden sword works with any damage value.
import mods.itemstages.ItemStages;
ItemStages.restrict(<item:minecraft:diamond_sword>, "one").preventPickup(false).preventInventory(false);
ItemStages.restrict(<item:minecraft:golden_sword>.anyDamage(), "two").preventPickup(false).preventInventory(false);
@Darkhax I just didnt find it in the documentation for the mod. It s working! Thanks for the help!
Minecraft Version
1.19.2
Mod Version
5.1.4
Mod Loader
Forge
What environment are you running the mod in?
Dedicated Server
Issue Description
Function "restrict" is not working with damaged items. Could it be that tag "Damage" depends seperately from other tags?
Damaged diamond sword has tag "Damage". It ignored by the function "restrict"