Skip to content
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

NBT-based ItemTypes are not properly compared on 2.7 #5693

Closed
1 task done
sovdeeth opened this issue May 13, 2023 · 4 comments
Closed
1 task done

NBT-based ItemTypes are not properly compared on 2.7 #5693

sovdeeth opened this issue May 13, 2023 · 4 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@sovdeeth
Copy link
Member

sovdeeth commented May 13, 2023

Skript/Server Version

[17:09:11 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[17:09:11 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[17:09:11 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[17:09:11 INFO]: [Skript] Server Version: git-Paper-471 (MC: 1.19.4)
[17:09:11 INFO]: [Skript] Skript Version: 2.7.0-dev-nightly-ef9f3ee7 (skriptlang-nightly)
[17:09:11 INFO]: [Skript] Installed Skript Addons: None
[17:09:11 INFO]: [Skript] Installed dependencies:
[17:09:11 INFO]: [Skript]  - WorldGuard v7.0.8-beta-01+cbb2ba7

(This is a nightly of the current master branch, but I also tested on 2.7-beta2)

Bug Description

ItemTypes that rely on NBT tags (itemmeta?), like potions, tipped arrows, goat horns, and fireworks do not seem to work in comparisons. Any potion is considered to be a fire resistance potion, or a water bottle, no matter its true effect.

Expected Behavior

These aliases should behave properly in item comparisons. Fire resistance potions are not strength potions.

Steps to Reproduce

command /test-potions:
    trigger:
        set {_fire-resist} to type of potion of fire resistance
        set {_water-breathing} to type of water breathing potion
        set {_water-bottle} to type of water bottle
        send "%{_fire-resist}% is %{_fire-resist}%: %true if {_fire-resist} is {_fire-resist} else false%"
        send "%{_fire-resist}% is %{_water-breathing}%: %true if {_fire-resist} is {_water-breathing} else false%"
        send "%{_fire-resist}% is %{_water-bottle}%: %true if {_fire-resist} is {_water-bottle} else false%"
        send "%{_water-bottle}% is %{_water-breathing}%: %true if {_water-bottle} is {_water-breathing} else false%"

Errors or Screenshots

image

Other

Notably, removing type of seems to make everything work. However, this impacts things like if tool is a water bottle.

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
@Fusezion
Copy link
Contributor

what's the nightly? the comparison of 2 literals?

@sovdeeth
Copy link
Member Author

what's the nightly? the comparison of 2 literals?

The current master branch, like I said.

@Fusezion
Copy link
Contributor

Fusezion commented May 13, 2023

Seems to be non literals only also
image

Retest using literals
image

@sovdeeth
Copy link
Member Author

Seems to be non literals only also image

Retest using literals image

Yes that's what I was trying to get across in the Other section.

@APickledWalrus APickledWalrus self-assigned this May 13, 2023
@APickledWalrus APickledWalrus added investigating The core developers are currently investigating this issue. Usually used for complex cases. bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). and removed investigating The core developers are currently investigating this issue. Usually used for complex cases. labels May 13, 2023
@APickledWalrus APickledWalrus added the PR available Issues which have a yet-to-be merged PR resolving it label May 13, 2023
@TheLimeGlass TheLimeGlass added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Projects
None yet
Development

No branches or pull requests

4 participants