I have this little skript here to just change the color of a wool block when dye is clicked on it.
It works well with just comparing the name of the held item to a corresponding color on the list, however I'm running into the issue of some dye items not having their color in their name or being two words for a color(ie: light blue) ooor not matching their skript counterpart (ie: grey vs gray).
Any ideas on how I could make these dye items work without adding 14 extra lines of code to reference each one specifically?
The items that do not fit are cocoa beans, ink sack, bone meal, lapis lazuli, light blue and grey and light grey.
Using an "if" statement per item would work, but it's a lot of extra lines, and I havn't been able to think of a better way to handle this if one exists
It works well with just comparing the name of the held item to a corresponding color on the list, however I'm running into the issue of some dye items not having their color in their name or being two words for a color(ie: light blue) ooor not matching their skript counterpart (ie: grey vs gray).
Any ideas on how I could make these dye items work without adding 14 extra lines of code to reference each one specifically?
The items that do not fit are cocoa beans, ink sack, bone meal, lapis lazuli, light blue and grey and light grey.
Using an "if" statement per item would work, but it's a lot of extra lines, and I havn't been able to think of a better way to handle this if one exists
code_language.skript:
on rightclick with any dye:
if event-block is any wool block:
set {_tool} to "%player's tool%"
set {_dye::*} to {_tool} split at " "
add "green", "yellow", "red", "purple", "cyan", "pink", "lime", "magenta" and "orange" to {_colorlist::*}
loop {_colorlist::*}:
loop {_dye::*}:
if loop-value-1 = loop-value-2:
set {_final} to "%loop-value-1% wool block"
set block at event-location to "%{_final}%" parsed as item
remove 1 of the player's tool from player