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.

Featured Replies

Posted

I found 2 ways of doing this but they both seem the wrong way. I made my own stat system with nbt on items and if player has a total of say 50 dmg, i want the weapon to do 50 dmg. Here are the 2 ways i did this that i think are wrong

 

firstly i tried just setting mob health but that has issues, the mobs don't drop any items then. 

 

secondly, i tried using the attackentityfrom method and making it unique so i can identify it and not make an infinite loop, but this looks like a disaster in the making

 

		if (event.getSource().isDamageAbsolute())return;		

		event.getEntityLiving().attackEntityFrom(event.getSource().setDamageIsAbsolute(), combinedDMG);
		
		event.setCanceled(true);

 

Am i missing the true way of doing this? And no i can't just change the dmg of items, there is crit chance, lifesteal etc to calculate too. 

 

EDIT I THINK I FIGURED IT OUT, sec

Edited by robertx555

  • Author

Can close the thread, i read some other thread here 

 

the suggestion to  open type hierarchy made me realize LivingDamageEvent event exists and that i can change the amount there with setamount!

 

There is a class called ForgeHooks that contains all the events 

Edited by robertx555

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.