-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Condition "Name" of certain items in player's inventory is broken when item have lore #4054
Comments
Please fill in the entire format:
|
DescriptionWhen you have a script that count all items with a certain name into an inventory, the name condition isn't considered if the item have lore on it. I'll send you the script that i've done. You can try it yourself, it works, does not send any errors. Steps to ReproduceUse condition named item into a player's inventory, like that: Expected BehaviorAll items with the name should have been counted, with or without lores. Actual BehaviorOnly items without lores are counted Errors / ScreenshotsNone, because there is no errors. Server Information
Additional ContextI use this script, you can use it too and see what happens.
|
However, there is a little change between 2.5.3 and 2.6.0. |
Okay, so it works as expected on 2.6? |
Nope, only the "Remove all diamonds ..." has been solved on 2.6.0 That means 50% of the post has been solved with the 2.6.0 |
Bump? |
@APickledWalrus pinging you since this is related to item comparisons |
This is because ExprAmountOfItems uses ItemType#isOfType(ItemStack). It should probably use a comparator instead where the ItemStack is the first argument and ItemType is the second argument (ItemStack comes first as we are verifying that it has at least the same qualities at the ItemType, but that it may also have more). Ideally we could improve the situation of comparing items in ItemType directly (it's not really logical to have the important item comparisons in the comparators class) but because of how tied together these methods are with blocks and everything it becomes very difficult in terms of preventing bugs and making sure everything works the same. I will add this to #4162 with the comparators fix as that will be the quickest for the time being (it is not a necessarily bad fix either). |
Should be resolved in the PR shown above. If anyone reading this tests the nightly build, please leave feedback/problems there :) |
Description
When you have a script, the all item's name check (or certains items name) into an inventory, the Name condition is considered as false if the item have lore on it.
However, it works if the item does not have any lores.
I'll send you the script that i've done. You can try it yourself, it works, does not send any errors.
But if your named item have a lore, then it's not counted into the condition, even if the name is the same.
On the code above, it count all the diamonds named "&f&lDiamant épuré" into player's inventory and removes them.
Afterwards, it gives to the player, the number of the items removed, to another item type.
It's an echange with NameCondition on items...
BUT! If the diamonds (On the script) have a lore, then, they are not counted into "{_diampur}", even if the name is still "&f&lDiamant épuré"
Without lore on the items, it works.
With lore, it's not working.
Skript version: 2.5.3
Minecraft version: 1.16.5
The text was updated successfully, but these errors were encountered: