Skript

Skript

743k Downloads

holder of inventory returning as blockstate

ShaneBeee opened this issue ยท 2 comments

commented

Skript/Server Version

[21:15:28 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[21:15:28 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[21:15:28 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[21:15:28 INFO]: [Skript] Server Version: git-Paper-423 (MC: 1.20.4)
[21:15:28 INFO]: [Skript] Skript Version: 2.8.2 (selfbuilt-unknown)
[21:15:28 INFO]: [Skript] Installed Skript Addons: 
[21:15:28 INFO]: [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[21:15:28 INFO]: [Skript]  - SkBee v3.2.1 (https://github.com/ShaneBeee/SkBee)
[21:15:28 INFO]: [Skript]  - SkMaze v1.1.0
[21:15:28 INFO]: [Skript] Installed dependencies: 
[21:15:28 INFO]: [Skript]  - Vault v1.7.3-b131
>

Bug Description

when using code such as holder of inventory it's returning a BlockState, but Skript doesn't allow the use of blockstate anywhere.

Expected Behavior

Holder should return a block

Steps to Reproduce

test the code:

on inventory close:
	send "Location: %location of holder of event-inventory%"

get error:

[21:16:28 INFO]: Line 3: (test.sk)
[21:16:28 INFO]:     holder of event-inventory is not a location
[21:16:28 INFO]:     Line: send "Location: %location of holder of event-inventory%"

I was given this issue by someone else, they asked me to report it.
I have confirmed it is in fact an issue.
They informed me that this USED to work in a previous version of Skript but recently broke.

Errors or Screenshots

No response

Other

No response

Agreement

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

This should be handled by the InventoryHolder -> Block converter, I wonder why it's not working.
#6171 might be related.

commented

Yes it seems that since ExprLocation is a WrapperExpression for Location, it relies on the input to be converted to a Location automatically. Since InventoryHolders can only be converted to Entity or Block, and not chained, this means ExprLocation won't work for InventoryHolders.
Personally, I think relying on converters is a bad design for ExprLocation.