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.

Chewiie88

Members
  • Joined

  • Last visited

Everything posted by Chewiie88

  1. Thanks grand_mind1! I checked BreakEvent more and found how to do it. Now my code works and i can move on to the next stage to creating this mod. Thanks alot!
  2. @grand_mind1 What im planing on doing is this. When the player digs dirt he gets x amount of xp depending on what tool he has. So what i was thinking first was to do a if statement on what tool the player using when he breaks the block. That part works. then in lets say if if(hand.getItem() == Items.wooden_shovel){ } I put an if statement on the different blocks and from there i send do the exp calculation of how mutch exp the player gets. But the problem is i dont know how i should get what type of block the player breaks. So i thought that if i check then use the ItemPickupEvent to check what item the player picked up. But i can be on the complete wrong way on coding this. There might be a easier way of doing this. Hope i explained good on what i was coding and what i have problem with.
  3. Hello. I been working on a code all day and looking up information about modding in forge. I run in to a problem and i dont know can i have 2 @SubscribeEvent methods in the same class? what im doing is a way to check if the player breaks a block and the what tool the player use. After that i want to check what item the player gets so i can set what exp he will get from it. Im working on a Adveture mod and im adding skills for mining, lumbering e.t.c Do i have to have 2 methods? Feels wrong. I want to do the check what block the player picksup in my onBlockBreak method. I feel lost at the moment any ideas? if you want to see my code just ask and i add it. No code is needed just a hint of direction so i can find out more about forge and learn more.
  4. Thanks for the help got it to work!
  5. Hello. Im new to mc modding and i run in to a problem. Cant find a function for when a player breaks a block. If im not wrong i have to lock for a break block event. If anyone know something about it im greatfull. Dont need full code for it just help to the right direction.

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.