/
Integrates Minecraft's attribute system with Cobblemon.
Things such as catch chance, shiny chance, and experience earned per battle can be modified.
Mostly intended for use with Accessories or Curios, though the attributes do apply when on pieces of armor. (but not tools)
If I ever truly decide to stop being lazy I'll port it over to forge as well.
Free for use whereva.
Current Attributes Supported:
class MudkipCharm() : AccessoryItem(
Item.Settings().component(
DataComponentTypes.ATTRIBUTE_MODIFIERS as ComponentType<AttributeModifiersComponent>,
AttributeModifiersComponent.builder()
.add(
Registries.ATTRIBUTE.getEntry(TrainerAttributes.TYPED_SPAWN_CHANCE_ATTRIBUTE.getAttributeOfType(
ElementalTypes.FIRE
)),
EntityAttributeModifier(
TrainerAttributes.TYPED_SPAWN_CHANCE_ATTRIBUTE.getIdentifierOfTypedAttribute(ElementalTypes.FIRE),
5.50,
EntityAttributeModifier.Operation.ADD_MULTIPLIED_BASE
),
AttributeModifierSlot.ANY
)
.add(
Registries.ATTRIBUTE.getEntry(TrainerAttributes.TYPED_BONUS_IVS_ATTRIBUTE.getAttributeOfType(
ElementalTypes.WATER
)),
EntityAttributeModifier(
TrainerAttributes.TYPED_BONUS_IVS_ATTRIBUTE.getIdentifierOfTypedAttribute(ElementalTypes.WATER),
5.0,
EntityAttributeModifier.Operation.ADD_VALUE
),
AttributeModifierSlot.ANY
)
.add(
Registries.ATTRIBUTE.getEntry(TrainerAttributes.STAT_BONUS_IVS_ATTRIBUTE.getAttributeOfStat(Stats.HP)),
EntityAttributeModifier(
TrainerAttributes.STAT_BONUS_IVS_ATTRIBUTE.getIdentifierOfStatAttribute(Stats.HP),
5.0,
EntityAttributeModifier.Operation.ADD_VALUE
),
AttributeModifierSlot.ANY
)
.add(
Registries.ATTRIBUTE.getEntry(TrainerAttributes.BONUS_IVS_ATTRIBUTE),
EntityAttributeModifier(
TrainerAttributesLib.getIdentifier("bonus_ivs"),
5.0,
EntityAttributeModifier.Operation.ADD_VALUE
),
AttributeModifierSlot.ANY
)
.add(
Registries.ATTRIBUTE.getEntry(TrainerAttributes.CATCH_CHANCE_BOOST_ATTRIBUTE),
EntityAttributeModifier(
TrainerAttributesLib.getIdentifier("catch_chance_boost"),
0.05,
EntityAttributeModifier.Operation.ADD_MULTIPLIED_BASE
),
AttributeModifierSlot.ANY
)
.add(
Registries.ATTRIBUTE.getEntry(
TrainerAttributes.TYPED_CATCH_CHANCE_BOOST_ATTRIBUTE.getAttributeOfType(ElementalTypes.WATER)
),
EntityAttributeModifier(
TrainerAttributes.TYPED_CATCH_CHANCE_BOOST_ATTRIBUTE.getIdentifierOfTypedAttribute(ElementalTypes.WATER),
0.10,
EntityAttributeModifier.Operation.ADD_MULTIPLIED_BASE
),
AttributeModifierSlot.ANY
)
.build()
)
) {
}
![[Cobblemon] TrainerAttributesLib](/_next/image?url=%2Fapi%2Fproxy-image%3Furl%3Dhttps%253A%252F%252Fcdn.modrinth.com%252Fdata%252FP7tBjBML%252F1b1b9581b6b3724e60b2dd46c7468871f9994126.png&w=256&q=75)
Integrates Minecraft's attributes with Cobblemon.