| 1 | package net.minecraft.world.entity.ai.attributes;
|
| 2 |
|
| 3 | import net.minecraft.core.Holder;
|
| 4 | import net.minecraft.core.Registry;
|
| 5 | import net.minecraft.core.registries.BuiltInRegistries;
|
| 6 | import net.minecraft.resources.Identifier;
|
| 7 |
|
| 8 | public class Attributes {
|
| 9 | public static final double DEFAULT_ATTACK_SPEED = 4.0;
|
| 10 | public static final Holder<Attribute> AIR_DRAG_MODIFIER = register(
|
| 11 | "air_drag_modifier", new RangedAttribute("attribute.name.air_drag_modifier", 1.0, 0.0, 2048.0).setSyncable(true)
|
| 12 | );
|
| 13 | public static final Holder<Attribute> ARMOR = register("armor", new RangedAttribute("attribute.name.armor", 0.0, 0.0, 30.0).setSyncable(true));
|
| 14 | public static final Holder<Attribute> ARMOR_TOUGHNESS = register(
|
| 15 | "armor_toughness", new RangedAttribute("attribute.name.armor_toughness", 0.0, 0.0, 20.0).setSyncable(true)
|
| 16 | );
|
| 17 | public static final Holder<Attribute> ATTACK_DAMAGE = register("attack_damage", new RangedAttribute("attribute.name.attack_damage", 2.0, 0.0, 2048.0));
|
| 18 | public static final Holder<Attribute> ATTACK_KNOCKBACK = register("attack_knockback", new RangedAttribute("attribute.name.attack_knockback", 0.0, 0.0, 5.0));
|
| 19 | public static final Holder<Attribute> ATTACK_SPEED = register(
|
| 20 | "attack_speed", new RangedAttribute("attribute.name.attack_speed", 4.0, 0.0, 1024.0).setSyncable(true)
|
| 21 | );
|
| 22 | public static final Holder<Attribute> BELOW_NAME_DISTANCE = register(
|
| 23 | "below_name_distance", new RangedAttribute("attribute.name.below_name_distance", 10.0, 0.0, 512.0).setSyncable(true)
|
| 24 | );
|
| 25 | public static final Holder<Attribute> BLOCK_BREAK_SPEED = register(
|
| 26 | "block_break_speed", new RangedAttribute("attribute.name.block_break_speed", 1.0, 0.0, 1024.0).setSyncable(true)
|
| 27 | );
|
| 28 | public static final Holder<Attribute> BLOCK_INTERACTION_RANGE = register(
|
| 29 | "block_interaction_range", new RangedAttribute("attribute.name.block_interaction_range", 4.5, 0.0, 64.0).setSyncable(true)
|
| 30 | );
|
| 31 | public static final Holder<Attribute> BOUNCINESS = register("bounciness", new RangedAttribute("attribute.name.bounciness", 0.0, 0.0, 1.0).setSyncable(true));
|
| 32 | public static final Holder<Attribute> BURNING_TIME = register(
|
| 33 | "burning_time", new RangedAttribute("attribute.name.burning_time", 1.0, 0.0, 1024.0).setSyncable(true).setSentiment(Attribute.Sentiment.NEGATIVE)
|
| 34 | );
|
| 35 | public static final Holder<Attribute> CAMERA_DISTANCE = register(
|
| 36 | "camera_distance", new RangedAttribute("attribute.name.camera_distance", 4.0, 0.0, 32.0).setSyncable(true)
|
| 37 | );
|
| 38 | public static final Holder<Attribute> EXPLOSION_KNOCKBACK_RESISTANCE = register(
|
| 39 | "explosion_knockback_resistance", new RangedAttribute("attribute.name.explosion_knockback_resistance", 0.0, 0.0, 1.0).setSyncable(true)
|
| 40 | );
|
| 41 | public static final Holder<Attribute> ENTITY_INTERACTION_RANGE = register(
|
| 42 | "entity_interaction_range", new RangedAttribute("attribute.name.entity_interaction_range", 3.0, 0.0, 64.0).setSyncable(true)
|
| 43 | );
|
| 44 | public static final Holder<Attribute> FALL_DAMAGE_MULTIPLIER = register(
|
| 45 | "fall_damage_multiplier",
|
| 46 | new RangedAttribute("attribute.name.fall_damage_multiplier", 1.0, 0.0, 100.0).setSyncable(true).setSentiment(Attribute.Sentiment.NEGATIVE)
|
| 47 | );
|
| 48 | public static final Holder<Attribute> FLYING_SPEED = register(
|
| 49 | "flying_speed", new RangedAttribute("attribute.name.flying_speed", 0.4, 0.0, 1024.0).setSyncable(true)
|
| 50 | );
|
| 51 | public static final Holder<Attribute> FOLLOW_RANGE = register("follow_range", new RangedAttribute("attribute.name.follow_range", 32.0, 0.0, 2048.0));
|
| 52 | public static final Holder<Attribute> FRICTION_MODIFIER = register(
|
| 53 | "friction_modifier", new RangedAttribute("attribute.name.friction_modifier", 1.0, 0.0, 2048.0).setSyncable(true)
|
| 54 | );
|
| 55 | public static final Holder<Attribute> GRAVITY = register(
|
| 56 | "gravity", new RangedAttribute("attribute.name.gravity", 0.08, -1.0, 1.0).setSyncable(true).setSentiment(Attribute.Sentiment.NEUTRAL)
|
| 57 | );
|
| 58 | public static final Holder<Attribute> JUMP_STRENGTH = register(
|
| 59 | "jump_strength", new RangedAttribute("attribute.name.jump_strength", 0.42F, 0.0, 32.0).setSyncable(true)
|
| 60 | );
|
| 61 | public static final Holder<Attribute> KNOCKBACK_RESISTANCE = register(
|
| 62 | "knockback_resistance", new RangedAttribute("attribute.name.knockback_resistance", 0.0, -2.0, 1.0)
|
| 63 | );
|
| 64 | public static final Holder<Attribute> LUCK = register("luck", new RangedAttribute("attribute.name.luck", 0.0, -1024.0, 1024.0).setSyncable(true));
|
| 65 | public static final Holder<Attribute> MAX_ABSORPTION = register(
|
| 66 | "max_absorption", new RangedAttribute("attribute.name.max_absorption", 0.0, 0.0, 2048.0).setSyncable(true)
|
| 67 | );
|
| 68 | public static final Holder<Attribute> MAX_HEALTH = register(
|
| 69 | "max_health", new RangedAttribute("attribute.name.max_health", 20.0, 1.0, 1024.0).setSyncable(true)
|
| 70 | );
|
| 71 | public static final Holder<Attribute> MINING_EFFICIENCY = register(
|
| 72 | "mining_efficiency", new RangedAttribute("attribute.name.mining_efficiency", 0.0, 0.0, 1024.0).setSyncable(true)
|
| 73 | );
|
| 74 | public static final Holder<Attribute> MOVEMENT_EFFICIENCY = register(
|
| 75 | "movement_efficiency", new RangedAttribute("attribute.name.movement_efficiency", 0.0, 0.0, 1.0).setSyncable(true)
|
| 76 | );
|
| 77 | public static final Holder<Attribute> MOVEMENT_SPEED = register(
|
| 78 | "movement_speed", new RangedAttribute("attribute.name.movement_speed", 0.7, 0.0, 1024.0).setSyncable(true)
|
| 79 | );
|
| 80 | public static final Holder<Attribute> NAME_TAG_DISTANCE = register(
|
| 81 | "name_tag_distance", new RangedAttribute("attribute.name.name_tag_distance", 64.0, 0.0, 512.0).setSyncable(true)
|
| 82 | );
|
| 83 | public static final Holder<Attribute> OXYGEN_BONUS = register(
|
| 84 | "oxygen_bonus", new RangedAttribute("attribute.name.oxygen_bonus", 0.0, 0.0, 1024.0).setSyncable(true)
|
| 85 | );
|
| 86 | public static final Holder<Attribute> SAFE_FALL_DISTANCE = register(
|
| 87 | "safe_fall_distance", new RangedAttribute("attribute.name.safe_fall_distance", 3.0, -1024.0, 1024.0).setSyncable(true)
|
| 88 | );
|
| 89 | public static final Holder<Attribute> SCALE = register(
|
| 90 | "scale", new RangedAttribute("attribute.name.scale", 1.0, 0.0625, 16.0).setSyncable(true).setSentiment(Attribute.Sentiment.NEUTRAL)
|
| 91 | );
|
| 92 | public static final Holder<Attribute> SNEAKING_SPEED = register(
|
| 93 | "sneaking_speed", new RangedAttribute("attribute.name.sneaking_speed", 0.3, 0.0, 1.0).setSyncable(true)
|
| 94 | );
|
| 95 | public static final Holder<Attribute> SPAWN_REINFORCEMENTS_CHANCE = register(
|
| 96 | "spawn_reinforcements", new RangedAttribute("attribute.name.spawn_reinforcements", 0.0, 0.0, 1.0)
|
| 97 | );
|
| 98 | public static final Holder<Attribute> STEP_HEIGHT = register(
|
| 99 | "step_height", new RangedAttribute("attribute.name.step_height", 0.6, 0.0, 10.0).setSyncable(true)
|
| 100 | );
|
| 101 | public static final Holder<Attribute> SUBMERGED_MINING_SPEED = register(
|
| 102 | "submerged_mining_speed", new RangedAttribute("attribute.name.submerged_mining_speed", 0.2, 0.0, 20.0).setSyncable(true)
|
| 103 | );
|
| 104 | public static final Holder<Attribute> SWEEPING_DAMAGE_RATIO = register(
|
| 105 | "sweeping_damage_ratio", new RangedAttribute("attribute.name.sweeping_damage_ratio", 0.0, 0.0, 1.0).setSyncable(true)
|
| 106 | );
|
| 107 | public static final Holder<Attribute> TEMPT_RANGE = register("tempt_range", new RangedAttribute("attribute.name.tempt_range", 10.0, 0.0, 2048.0));
|
| 108 | public static final Holder<Attribute> WATER_MOVEMENT_EFFICIENCY = register(
|
| 109 | "water_movement_efficiency", new RangedAttribute("attribute.name.water_movement_efficiency", 0.0, 0.0, 1.0).setSyncable(true)
|
| 110 | );
|
| 111 | public static final Holder<Attribute> WAYPOINT_TRANSMIT_RANGE = register(
|
| 112 | "waypoint_transmit_range", new RangedAttribute("attribute.name.waypoint_transmit_range", 0.0, 0.0, 6.0E7).setSentiment(Attribute.Sentiment.NEUTRAL)
|
| 113 | );
|
| 114 | public static final Holder<Attribute> WAYPOINT_RECEIVE_RANGE = register(
|
| 115 | "waypoint_receive_range", new RangedAttribute("attribute.name.waypoint_receive_range", 0.0, 0.0, 6.0E7).setSentiment(Attribute.Sentiment.NEUTRAL)
|
| 116 | );
|
| 117 |
|
| 118 | private static Holder<Attribute> register(final String name, final Attribute attribute) {
|
| 119 | return Registry.registerForHolder(BuiltInRegistries.ATTRIBUTE, Identifier.withDefaultNamespace(name), attribute);
|
| 120 | }
|
| 121 |
|
| 122 | public static Holder<Attribute> bootstrap(final Registry<Attribute> registry) {
|
| 123 | return MAX_HEALTH;
|
| 124 | }
|
| 125 | }
|
| 126 |
|