Hue Cycler

Share scripts you wrote for Denizen-Bukkit here!
Post Reply
jumpsplat120
New
New
Posts: 6
Joined: June 24th, 2020, 6:05 pm

Hue Cycler

Post by jumpsplat120 » June 28th, 2020, 2:09 pm

1.16 brought with is some pretty neat changes, such as the nether getting reworked. But you know what's even better than all of that? Access to the full gamut of rainbow colors! May I introduce...

HUE CYCLER



The following code is a single line script; therefore It should be incredibly simple to follow use. All you need to do is use a loop with a saved color to cycle through the hue!

The following code snippet is an example of using the script:

Code: Select all

 - define color <color[255,0,0]>
    - repeat 100:
        - actionbar <[text].color[<[color]>]>
        - wait .02t
        - define color <[color].with_hue[<[color].hue.add[15]>]>
In the second define tag, the first value is your color you wish you change, and the second is the value you are changing the color by. I found that changing the value by around 15, and adding a .02t wait provides a nice smooth color change, but feel free to lower that value to slow down the change, or remove the wait to speed it up.

IMPORTANT: This script can be quite heavy, due to needing to be called a lot to be useful. Consider using it sparingly.

Here's a quick gif demonstration of the script in action (using the effect to this extent did reduce TPS, really only used for example)

https://i.imgur.com/44P4a9m.mp4

EDIT: Bigger header
Last edited by jumpsplat120 on July 5th, 2020, 4:00 pm, edited 5 times in total.

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 282
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Hue Cycler

Post by mcmonkey » June 29th, 2020, 10:04 am

the ColorTag.hue tag exists, which seems like it should be used here.
I added ColorTag.with_hue (and several related tags) to make using that here easier.
Denizen lead developer. On Discord as mcmonkey#6666.

jumpsplat120
New
New
Posts: 6
Joined: June 24th, 2020, 6:05 pm

Re: Hue Cycler

Post by jumpsplat120 » June 30th, 2020, 2:46 pm

Awesome, that tag was so helpful! Thanks so much.

Post Reply

Who is online

Users browsing this forum: mcmonkey and 1 guest