I was bored one day and made something that allows, well, the cycling of an item in an inventory, and the slot. Code: /** * * @author ralitski & calebbfmv * Nifty little thing for cycling through inventory crap. * is very fancy * [fanciness level: very] */ public class CycleItems extends BukkitRunnable{ private int index; private ItemStack[] items; private int slot; private Inventory inv; private Plugin plugin; private void next(){ index ++; index %= this.items.length; } public ItemStack get(){ return items[this.index]; } public ItemStack prev() { return this.items[(this.items.length + this.index - 1) % this.items.length]; } /** * @pararm plugin Your plugin * @param inv The inventory * @param slot the Placement in the inv * @param delay Time between displays * @param item The items to be cycled. */ public CycleItems(Plugin plugin, Inventory inv, int slot, long delay, ItemStack... item){ this.plugin = plugin; this.inv = inv; this.slot = slot; this.index = 0; this.items = item; inv.setItem(this.slot, this.get()); this.runTaskTimer(this.plugin, delay, delay); } @Override public void run() { next(); ItemStack item = this.inv.getItem(this.slot); if(item == null || this.prev().equals(item)) { this.inv.setItem(this.slot, this.get()); } } } Simply to use: Code: new CycleItems(this, player.getInventory(), 31, 10, new ItemStack(Material.APPLE), new ItemStack(Material.BONE)); Enjoy, or not, just for fun.
calebbfmv neat, could come in handy if someone wants to do one of those things where they make an animation in an items lore using ASCII characters
Thank you sir for giving me an ingenious idea (creating something like the idea behind this resource)
Goblom No but I was thinking, combining this, with the ImgSender UTIL, you could create full blown movies!
Yup! telnet towel.blinkenlights.nl Sad that I have this remembered from like 2004 when I first saw it.