Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

NightBlood

Members
  • Joined

  • Last visited

  1. Hey, Im kinda new to forge modding and I was wondering which is the best way to implement a timer within a HarvestDropsEvent and a RightClickItem Events Ive been using a java.util.TimerTask but it has had ticks sync issues. I know this might be something simple but I havent been able to figure that out, thanks in advance. Edit: Code added. I just need the EntityFallingBlock to spawn every X seconds without using a java.util.TimerTask the way a Bukkit.getScheduler().sheduleSyncRepeatingTask for Spigot does. Error: Description: Exception in server tick loop java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442) at java.util.HashMap$KeyIterator.next(HashMap.java:1466) at net.minecraft.entity.EntityTracker.tick(EntityTracker.java:295) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:854) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) at java.lang.Thread.run(Thread.java:748) Code: int i2 = 0; int max = 5; timer.schedule(new TimerTask() { @Override public void run() { if (i2 >= max) this.cancel(); if (i2 >= max) return; i2++; EntityFallingBlock tnt = new EntityFallingBlock(world, pos.getX()+0.5, pos.getY()+10, pos.getZ()+0.5, Blocks.TNT.getDefaultState()); tnt.fallTime = 1; world.spawnEntity(tnt); } }, 0, 500);

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.