Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Color of block

Open jurajplayercze opened this issue 2 years ago • 2 comments

Skript/Server Version

Skript 2.7
Server 1.19.2, also tested 1.18.2

Bug Description

Whole example does not work https://skripthub.net/docs/?id=945

When i try to get color of wool, or shulker box, or whatever, it doesn't return any color. Also i am not able to set color of those blocks, as mentioned in official example

Expected Behavior

Return color / set the color of block

Steps to Reproduce

I am on colored wool/shulker box

execute effect command !broadcast color of targeted block !set color of targeted block to blue

Errors or Screenshots

No errors

Other

No response

Agreement

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

jurajplayercze avatar May 06 '23 12:05 jurajplayercze

Sadly, seems like Colorable interface no longer support most of blocks like clay/wool etc. they're marked as deprecated, not sure when this was changed probably after ID change (API deprecated at 1.14 )

I couldn't find anyway of getting color of blocks through API, the only way I can think of doing that is extracting the color from the Material name and this can also support setting.

AyhamAl-Ali avatar May 12 '23 12:05 AyhamAl-Ali

A switch would be most efficent for checking manually, but obviously there are a lot of things that have colour (candles, glass, panes, wool, wool carpets, dyes, boxes, etc.) Fortunately, I think all of the material names currently start with their colour so you could check that instead, but it sounds like you'll still need a switch or to use tags to make sure they're the right sort of item to have a colour.

Moderocky avatar May 12 '23 12:05 Moderocky