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 want to create the Red Tearstone Ring from Dark Souls 1 using the Baubles API. This is what the Ring does: Increase the attack rating of equipped weapons by 50% when the player's health is under 20%.  Baubles gives me this method

	/**
	 * This method is called once per tick if the bauble is being worn by a player
	 */
	public void onWornTick(ItemStack itemstack, EntityLivingBase player) {		
	}

I have a few questions:

How do i get the damage of the equipped weapon? How do I modify that? Does that work for bows, too?

Edited by sknif

Use AttributeModifiers to modify the damage. This won't work for bows so you'll have to find a workaround (unless bow damage is influenced by the players attack damage which I don't think it is).

Developer of Levels and Lost Eclipse

  • Author

Like this?

 

player.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).applyModifier(redTearstoneRingBuff);

AttributeModifier redTearstoneRingBuff = new AttributeModifier(UUID.fromString("e6107045-134f-4c54-a645-75c3ae5c7a27"), "redTearstoneRingBuff", 0.5, 1);

 

Edited by sknif

  • Author

The

onWornTick

method from Baubles applies the modifer in a loop which leads to a crash, because you can't apply a modifier that already is applied. Can you test for a certain modifier?

Check to see if the modifier is applied - if not, apply it, else, don't. Remove it in the onUnequipped method.

Developer of Levels and Lost Eclipse

  • Author

how can i check it though?

edit: found this

	public boolean isBuffed(EntityLivingBase player) {
		if(getAtAtr(player).getModifiersByOperation(1).contains(RED_TEARSTONE_RING_BUFF) == true) {
			return true;
		}else {
			return false;
		}
	}

hope this works

edit2: it works :D thank you

Dos someone have an idea for a bow work-around?

Edited by sknif

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.