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.

virtualoxygen

Members
  • Joined

  • Last visited

Everything posted by virtualoxygen

  1. Ah ok, so in my case, litTime could be hardcoded becuase it is not depending on a fuel type.
  2. Hi, I was just responding to your other comment. Ok, I changed it to this. Is this what you mean? @SubscribeEvent public static void countTicks(TickEvent.WorldTickEvent event) {... On saving the ticks: I know its not the right way and only works for one block. Its meant for testing only at the moment. I will have a read thru the capabilties in the link you provided. I also had a look at the Furnace and BlockEntity, but find it hard to understand how the FurnaceTicker is working. (I'm fairly new to the minecraft codebase). Anyways thanks for the help.
  3. @SubscribeEvent public static void countTicks(TickEvent event){ if(!ticking) return; ticks++; if(ticks == 100){ // do stuff and reset } } Ok, thank you. I managed to get it to work with the above code. I could not find `LevelTickEvent` in the codebase. Not sure if its the same as `TickEvent`
  4. Hi, I'm trying to set (reset) a blockstate after a certain amount of ticks. I can't seem to find any examples on how ticks are used in general. The below method is for an item. If a block is clicked with the item, it changes the block to another one. I want to implement a timer that resets this block to its original state. @Override public InteractionResult useOn(UseOnContext pContext) { if (!pContext.getLevel().isClientSide()) { BlockPos positionClicked = pContext.getClickedPos(); BlockState originalBlockState = pContext.getLevel().getBlockState(positionClicked); pContext.getLevel().setBlock(pContext.getClickedPos(), Blocks.PUMPKIN.defaultBlockState(), 3); // TODO reset to originalBlock after ticks (e.g. 10 seconds) } return super.useOn(pContext); } A little code snippet or a pointer to a few examples would be very helfpful.

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.