Added the ability to make animated items in a GUI menu.
First you must implement IAnimatable, and then you can implement animations as follows:
There are some other methods you have to implement. The only notable one is getAnimationInterval, which determines the length of time between each frame. It is measured in ticks.
Code (Java):
@Override
public
void setItems
(
)
{
// Create animated item using builtins
AnimatedItem item
=
new AnimatedItem
(
11,
/* slot */
new ItemStack
(Material.
DIAMOND
),
/* Base Item */
this
)
;
BuiltinAnimation.
flashingItem
(item,
"Hello World!",
"&c",
"&4"
)
;
// This will create an animation where the name of the item will flash between red and dark red
// Animating using frames
item
=
new AnimatedItem
(
12,
new ItemStack
(Material.
DIAMOND
),
this
)
;
item.
addFrame
(
"&cHello!"
)
;
item.
addFrame
(
"&aI am"
)
;
item.
addFrame
(
"&6&lANIMATED!!!!"
)
;
// You can also animate lore using ComplexAnimatedItem
ComplexAnimatedItem itemComplex
=
new ComplexAnimatedItem
(
13, Material.
EMERALD,
this
)
;
// Lore frames require and ENTIRE set of lore, however there are some helper functions to make it easier
itemComplex.
addLoreFrame
(
"&6Line one"
)
;
itemComplex.
addCopyOfLastFrame
(
)
;
itemComplex.
addLineLast
(
"&6Frame two. Now there's a second line"
)
;
itemComplex.
addCopyOfLastFrame
(
)
;
itemComplex.
addLineLast
(
"&6Frame three. Now there's a third line"
)
;
// There's a lot you can do with this. Have fun!
}