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.

SrPatsu21

Members
  • Joined

  • Last visited

Everything posted by SrPatsu21

  1. I have a bug, every 20 ticks the program add mana, but it is happening twice and must happen only once. The code: @SubscribeEvent public static void onPlayerTick(TickEvent.PlayerTickEvent event) { if(event.side == LogicalSide.SERVER) { event.player.getCapability(PlayerManaProvider.PLAYER_MANA).ifPresent(mana -> { if(mana.getMana() < mana.getMaxMana() && (event.player.getCommandSenderWorld().getGameTime() % mana.getREGEN_TIME()) == 0) { //will be regen int add = (int) (mana.getMaxMana()*mana.getManaRegen()); mana.addMana(add); //xp to up mana.addMxp(add); //mana xp enough to up if(mana.getMxp() >= mana.getManaToUp()){ mana.manaUpProcess(); } //message event.player.sendSystemMessage(Component.literal("mana add "+mana.getMana()+ "/"+mana.getMaxMana()+ " mana xp:"+mana.getMxp()+" mana level:"+mana.getMl()+ " tick that happend:"+event.player.getCommandSenderWorld().getGameTime())); ModMessages.sendToPlayer(new ManaDataSyncS2CPacket(mana.getMana()), ((ServerPlayer) event.player)); } }); } } I put a message to be sent in the game. this is what I receive: [CHAT] mana add 4/400 mana xp:128 mana level:6 tick that happend:18080 [CHAT] mana add 8/400 mana xp:132 mana level:6 tick that happend:18080 [CHAT] mana add 12/400 mana xp:136 mana level:6 tick that happend:18120 [CHAT] mana add 16/400 mana xp:140 mana level:6 tick that happend:18120 Ass you see the last number is the tick and it is the same as the previous one. So it has a way to fix it without a var to verify if the tick is not the same? Observation: I already used "event.player.getRandom().nextFloat() < 0.005f" and and it won't work ass I want.

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.