Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Item Attribute how to sort? [1.16.5]


Recommended Posts

I tried adding attributes to my items, but I can't understand how to sort the attributes correctly, it seems to be determined by UUID, but I can't understand his logic
this is my code snippet

			final UUID REACH_DISTANCE_MODIFIER = UUID.fromString("df4804ee-6484-4a75-aa0c-fe5713ecd704");
			final UUID ATTACK_DAMAGEMULTIPLY_MODIFIER = UUID.fromString("61885ceb-49c2-41ab-8fce-916f17ae055e");
			public Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlotType slot,
					ItemStack stack) {
						Multimap<Attribute,AttributeModifier> modifier = HashMultimap.create();
						if ( slot == EquipmentSlotType.MAINHAND){
							modifier.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(ATTACK_DAMAGEMULTIPLY_MODIFIER,"Weapon modifier",0.496, AttributeModifier.Operation.MULTIPLY_BASE));
							modifier.put(ForgeMod.REACH_DISTANCE.get(), new AttributeModifier(REACH_DISTANCE_MODIFIER,"Weapon modifier",2, AttributeModifier.Operation.ADDITION));
							modifier.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(ATTACK_DAMAGE_MODIFIER,"Weapon modifier", getAttackDamage(), AttributeModifier.Operation.ADDITION));
							modifier.put(Attributes.ATTACK_SPEED, new AttributeModifier(ATTACK_SPEED_MODIFIER,"Weapon modifier", -3.2 , AttributeModifier.Operation.ADDITION));

							return modifier;
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.

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.


  • Create New...

Important Information

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