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

%entitytype% may return null #6541

Open
1 task done
Anarchick opened this issue Apr 7, 2024 · 1 comment
Open
1 task done

%entitytype% may return null #6541

Anarchick opened this issue Apr 7, 2024 · 1 comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. up for debate When the decision is yet to be debated on the issue in question

Comments

@Anarchick
Copy link

Anarchick commented Apr 7, 2024

Skript/Server Version

[12:53:00 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[12:53:00 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[12:53:00 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[12:53:00 INFO]: [Skript] Server Version: git-Paper-450 (MC: 1.20.4)
[12:53:00 INFO]: [Skript] Skript Version: 2.8.4 (skriptlang-github)
[12:53:00 INFO]: [Skript] Installed Skript Addons:
[12:53:00 INFO]: [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[12:53:00 INFO]: [Skript]  - Skript-Packet v2.2.1 (www.github.com/Anarchick/skript-packet)
[12:53:00 INFO]: [Skript] Installed dependencies: None

Bug Description

%entitytype% may return null.

Expected Behavior

Return Skript EntityType or SimpleEntityData

Steps to Reproduce

# test1(pig)
function test1(t: entitytype):
	broadcast "> %{_t}%" # output pig

# test2(pig)
function test2(t: object):
	broadcast "> %{_t}%" # output <none>

# test2(type of pig)
function test2(t: object):
	broadcast "> %{_t}%" # output pig

Errors or Screenshots

No response

Other

I was trying to add support for %entitytype% on Skript-Packet ExprNMS But when I execute the command nms of pig it return null.

protected Object @NotNull [] get(@NotNull Event e) {
        final Object obj = expr.getSingle(e);
        System.out.println("obj = " + obj); // output null when trying %entitytype%

Agreement

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

sovdeeth commented Apr 7, 2024

This is likely trying to use an event-entity and converting it to an entitytype. However, whatever event-entity is provided is not a pig, so pig is not set. Therefore, its entity type is also not set.

I would think this is a bug, but I'm not sure how to properly address it. Perhaps (i can't find it right now) the issue/pr suggesting that we force the use of event- would solve this confusion, but again, not sure if that's an appropriate response.
Would love more opinions.

@sovdeeth sovdeeth added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. up for debate When the decision is yet to be debated on the issue in question labels Apr 7, 2024
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. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. up for debate When the decision is yet to be debated on the issue in question
Projects
None yet
Development

No branches or pull requests

2 participants