Skript

Skript

743k Downloads

"item with custom model data" expression is broken? (for oraxen items only)

Saros-6585 opened this issue ยท 4 comments

commented

Skript/Server Version

[17:40:06 INFO]: [Skript] Server Version: 1.20.6-2218-ec1b4fa (MC: 1.20.6)
[17:40:06 INFO]: [Skript] Skript Version: 2.8.6 (skriptlang-github)
[17:40:06 INFO]: [Skript] Installed Skript Addons:
[17:40:06 INFO]: [Skript]  - skript-placeholders v1.6.0 (https://github.com/APickledWalrus/skript-placeholders)
[17:40:06 INFO]: [Skript]  - skript-yaml v1.5
[17:40:06 INFO]: [Skript]  - SkBee v3.5.2 (https://github.com/ShaneBeee/SkBee)
[17:40:06 INFO]: [Skript] Installed dependencies:
[17:40:06 INFO]: [Skript]  - Vault v1.7.3-CMI

Bug Description

Skript can't detect 'item with custom model data'.

Expected Behavior

It must be detect item's custom model data.

Steps to Reproduce

command /test:
    trigger:
        set {_test} to paper with custom model data 000001
        if player's inventory contains {_test}:
            send "test1: %amount of {_test} in player's inventory%" to player
        else:
            send "test2" to player

It can't detect "paper with custom model data ~"

Errors or Screenshots

No error on console and when reload skript too.

Other

custom model data item made by Oraxen.
so if I put custom model data directly into the basic item, skript catch it, but Oraxen's item does not.

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

Have you tried this? set {_test} to paper with custom model data "000001"

It output error("000001" is not a number).
should I parsed as integer? it's same. doesn't work.

commented

Have you tried this? set {_test} to paper with custom model data "000001"

commented

if its working with normal items but not with oraxen its likely that oraxen adds some sort of nbt to the item that your {_test} variable doesn't have (which is normal for such plugins to do). you should compare full nbt of item and see whats off

I recommend using skript-reflect and oraxen API to get an item by ID and then compare them

not a skript issue

commented

As eren said, this is an item comparison problem. You're telling Skript to look for plain paper with a specific custom model data, while the item you're truly searching for contains more special information. Since Skript currently searches for (mostly) exact matches, it doesn't treat the items with extra info as matches. Instead, you'll want to either a) look for the exact item with all the special info or b) loop over the items yourself and search for a certain attribute specifically.