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.

location aware block-break-speed / hardness through event?

Featured Replies

Posted

Hi all,

 

I'm trying to add a semi-block-protection feature to my mod.  The idea is that there will be a control block/TE in an area, which will 'reinforce' blocks in its chunk (or otherwise designated bounds).  This will be based on a teams system, where players not on the controlling team for the chunk/controlled area will have a much harder time breaking blocks within that designated area.

 

(the goal is for siege warfare -- to remove the ability to just pick-axe through your enemies defenses in mere seconds -- but not completely remove the ability to break, merely make it take longer...tunneling should be a valid tactic, but not the _only_ tactic as it currently is )

 

Setting up the control block/TE is fairly simple/standard stuff...where I'm getting stuck is dynamically altering the block-hardness or break speed of the player -- based on location --. 

 

I see there is the BreakSpeed event...which does pass a player reference, however, it does not give any target block location reference.  Is there a super-secret hidden event that I'm not seeing that contains this information, or should I re-ray-trace to get the target block?

 

Has anyone else done a similar feature without resorting to a core-mod?

 

Thanks in advance,

 

Shadowmage

You don't need a coremod :)

You can raytrace, of course, but you can also:

EntityPlayerMP#theItemInWorldManager

would give all the information you want on the currently damaged block by corresponding player.

  • Author

Thanks for the info -- I will take a look into this shortly, it sounds like that may just be the missing link I was looking for :)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.