The More RPG Library adds custom entity attributes that extend Minecraft’s attribute system. These attributes control various gameplay mechanics including fuse modifiers, status effect chances, and combat modifiers.
Overview
All attributes are registered as ClampedEntityAttribute instances with a base value, minimum value, and maximum value. They are tracked attributes, meaning their values are synchronized between server and client.
Source: net.more_rpg_classes.entity.attribute.MRPGCEntityAttributes
Attribute Registration
Attributes are registered using the following pattern:
private static RegistryEntry<EntityAttribute> register(
final String name,
double base,
double min,
double max
) {
EntityAttribute attribute = new ClampedEntityAttribute(
"attribute.name." + MOD_ID + '.' + name,
base,
min,
max
).setTracked(true);
return Registry.registerReference(
Registries.ATTRIBUTE,
Identifier.of(MOD_ID, name),
attribute
);
}
Source: MRPGCEntityAttributes.java:34-37
Combat Modifiers
DAMAGE_REFLECT_MODIFIER
Identifier.of("more_rpg_classes", "damage_reflect_modifier")
Base percentage value for damage reflection
Description: Modifier that controls the percentage of damage reflected back to attackers.
Source: MRPGCEntityAttributes.java:14
LIFESTEAL_MODIFIER
Identifier.of("more_rpg_classes", "lifesteal_modifier")
Base percentage value for lifesteal
Description: Modifier that controls the percentage of damage converted to healing on attacks.
Source: MRPGCEntityAttributes.java:15
RAGE_MODIFIER
Identifier.of("more_rpg_classes", "rage_modifier")
Base percentage value for rage generation/effectiveness
Description: Modifier that controls rage-related mechanics.
Source: MRPGCEntityAttributes.java:16
SPELL_VAMPIRE
Identifier.of("more_rpg_classes", "spell_vampire")
Base percentage value for spell vampirism
Description: Modifier that controls the percentage of spell damage converted to healing.
Source: MRPGCEntityAttributes.java:17
ARMOR_PIERCING
Identifier.of("more_rpg_classes", "armor_piercing")
Base percentage value for armor penetration
Maximum allowed value (capped at 200%)
Description: Controls the percentage of armor ignored when dealing damage.
Source: MRPGCEntityAttributes.java:31
TENACITY
Identifier.of("more_rpg_classes", "tenacity")
Base percentage value for crowd control resistance
Maximum allowed value (capped at 200%)
Description: Controls resistance to crowd control effects and their duration.
Source: MRPGCEntityAttributes.java:32
Fuse Modifiers
Fuse modifiers control the effectiveness of spell school-specific fuse mechanics.
AIR_FUSE_MODIFIER
Identifier.of("more_rpg_classes", "air_fuse_modifier")
Source: MRPGCEntityAttributes.java:18
ARCANE_FUSE_MODIFIER
Identifier.of("more_rpg_classes", "arcane_fuse_modifier")
Source: MRPGCEntityAttributes.java:19
EARTH_FUSE_MODIFIER
Identifier.of("more_rpg_classes", "earth_fuse_modifier")
Source: MRPGCEntityAttributes.java:20
FIRE_FUSE_MODIFIER
Identifier.of("more_rpg_classes", "fire_fuse_modifier")
Source: MRPGCEntityAttributes.java:21
FROST_FUSE_MODIFIER
Identifier.of("more_rpg_classes", "frost_fuse_modifier")
Source: MRPGCEntityAttributes.java:22
HEALING_FUSE_MODIFIER
Identifier.of("more_rpg_classes", "healing_fuse_modifier")
Source: MRPGCEntityAttributes.java:23
WATER_FUSE_MODIFIER
Identifier.of("more_rpg_classes", "water_fuse_modifier")
Source: MRPGCEntityAttributes.java:24
Status Effect Chance Attributes
These attributes control the percentage chance to apply various status effects on hit.
BURNING_CHANCE
Identifier.of("more_rpg_classes", "burning_chance")
Base chance percentage (100 = base, 200 = 100% guaranteed)
Maximum 200% (double the base chance)
Description: Controls the chance to apply burning effects on hit.
Source: MRPGCEntityAttributes.java:25
STAGGER_CHANCE
Identifier.of("more_rpg_classes", "stagger_chance")
Description: Controls the chance to apply the STAGGER status effect on hit.
Source: MRPGCEntityAttributes.java:26
STUN_CHANCE
Identifier.of("more_rpg_classes", "stun_chance")
Description: Controls the chance to apply stun effects on hit.
Source: MRPGCEntityAttributes.java:27
POISON_CHANCE
Identifier.of("more_rpg_classes", "poison_chance")
Description: Controls the chance to apply poison effects on hit.
Source: MRPGCEntityAttributes.java:28
FREEZE_CHANCE
Identifier.of("more_rpg_classes", "freeze_chance")
Description: Controls the chance to apply freeze effects on hit.
Source: MRPGCEntityAttributes.java:29
BLEEDING_CHANCE
Identifier.of("more_rpg_classes", "bleeding_chance")
Description: Controls the chance to apply the BLEEDING status effect on hit.
Source: MRPGCEntityAttributes.java:30
Usage Examples
Reading Attribute Values
// Get entity's lifesteal modifier
double lifesteal = entity.getAttributeValue(
MRPGCEntityAttributes.LIFESTEAL_MODIFIER
);
// Get armor piercing percentage
double armorPiercing = entity.getAttributeValue(
MRPGCEntityAttributes.ARMOR_PIERCING
);
Modifying Attributes
// Add a permanent +20% bleeding chance modifier
entity.getAttributeInstance(MRPGCEntityAttributes.BLEEDING_CHANCE)
.addPersistentModifier(new EntityAttributeModifier(
UUID.randomUUID(),
"bleeding_bonus",
20.0,
EntityAttributeModifier.Operation.ADD_VALUE
));
// Add a temporary damage reflection modifier
entity.getAttributeInstance(MRPGCEntityAttributes.DAMAGE_REFLECT_MODIFIER)
.addTemporaryModifier(new EntityAttributeModifier(
UUID.randomUUID(),
"temporary_reflection",
0.5, // +50%
EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL
));
Checking Attributes in Combat
// Example: Apply lifesteal healing
public void onEntityHit(LivingEntity attacker, LivingEntity target, float damage) {
double lifestealMod = attacker.getAttributeValue(
MRPGCEntityAttributes.LIFESTEAL_MODIFIER
);
// Convert modifier to actual lifesteal percentage
float lifestealPercent = (float)(lifestealMod / 100.0);
float healing = damage * lifestealPercent;
attacker.heal(healing);
}
Using with Custom Methods
// The getHighestDamageAttribute method uses these attributes
double highestDamage = CustomMethods.getHighestDamageAttribute(entity);
// Internally checks:
// - GENERIC_ATTACK_DAMAGE
// - Ranged weapon damage (if mod loaded)
// - Highest spell school power
Attribute Modifier Operations
Adds the modifier value directly to the base attribute value.Example: base: 100, modifier: +20 = 120
Multiplies the base value by (1 + modifier), applied before ADD_MULTIPLIED_TOTAL.Example: base: 100, modifier: 0.5 = 100 * 1.5 = 150
Multiplies the final value by (1 + modifier), applied last.Example: current: 150, modifier: 0.2 = 150 * 1.2 = 180
Percentage Value Interpretation
Most attributes use a base value of 100.0 representing 100%:
100.0 = 100% (normal/base value)
150.0 = 150% (+50% increase)
200.0 = 200% (double effectiveness)
50.0 = 50% (half effectiveness)
Exception: Modifiers are typically applied as percentages of the base value, not absolute values.
See Also