Posted October 9, 201410 yr I've been trying to figure out how to get a "Star Catcher" to work, where it drops an item downwards X amount of ticks. I've managed to get it to drop the item. but I can get it to increment a variable very tick, then when variable is = to Y, reset variable and do something. Here is my code (The code that drops the item isn't included, but if it was, it would be under tickEnd): public void tickStart(EnumSet<WorldTickEvent.Type> type, Object... tickData) { } public EnumSet<WorldTickEvent.Type> ticks() { return EnumSet.of(WorldTickEvent.Type.WORLD); } public void tickEnd(EnumSet<WorldTickEvent.Type> type, Object... tickData) { if(currentTick/20 < 15 || isLesserStarReady == false) { currentTick++; System.out.println("BlockTick!"); }else if(currentTick/20 >= 15) { System.out.println("Star Ready!"); isLesserStarReady = true; } } Please help? glubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglub.
October 9, 201410 yr Which version is this? Because in newer versions you have to subscribe to a tick event. http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
October 9, 201410 yr Author 1.7.10. I know that I need to subscribe, but I dont know how I'm supposed to, and apparently I'm also supposed to register a tick handler. glubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglub.
October 9, 201410 yr public class Ticker{ @SubscribeEvent public void worldTick(TickEvent.WorldTickEvent event) { if (event.phase == TickEvent.Phase.END){ do_something(); } } } FMLCommonHandler.instance().bus().register(new Ticker());
October 9, 201410 yr Author On 10/9/2014 at 8:43 AM, MultiMote said: public class Ticker{ @SubscribeEvent public void worldTick(TickEvent.WorldTickEvent event) { if (event.phase == TickEvent.Phase.END){ do_something(); } } } FMLCommonHandler.instance().bus().register(new Ticker()); Thanks! glubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglubglub.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.