Jump to content

[1.10.2]Red Tearstone Ring


sknif

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.