The 1.21.11 branch has now been merged, thanks to all who tested and contributed to it!
See minecraft.wiki Environment Attributes and Timelines for exact format details.
Environment attributes bring a pretty notable breaking change to the Biome and DimensionType API (many fields have changed, all of the removed fields are now configured via Environment Attributes as well as many new options).
Both Biome.Builder and DimensionType.Builder have a new setAttribute(EnvironmentAttribute<T>, T) to override a single attribute. Biome additionally has an option to modify an inherited attribute (reminder: attributes are merged with their parent) via modifyAttribute(EnvironmentAttribute<T>, Modifier<T, Arg>, Arg). The available modifiers for a given attribute can be observed in the operators argument of the EnvironmentAttributeTypes initializers. For example, when modifying a boolean typed attribute, the BOOLEAN_OPERATORS are available (AND, NAND, OR, NOR, XOR, XNOR).
Timelines are a system for applying Environment Attribute modifiers to a dimension interpolated over time. You can choose the period and add keyframes to apply modifiers over time with configurable interpolation function.
Timelines must be registered in their registry (MinecraftServer#getTimelineRegistry), and then may be added to a DimensionType as a registry tag.
An example of some of these APIs is available below.
var myDimension = DimensionType.builder()
.setAttribute(EnvironmentAttribute.SKY_COLOR, new Color(0x77aaff))
.setAttribute(EnvironmentAttribute.CLOUD_COLOR, new AlphaColor(0xFFFF0000))
.setAttribute(EnvironmentAttribute.FOG_START_DISTANCE, 0f)
.setAttribute(EnvironmentAttribute.FOG_END_DISTANCE, 1000f)
.build();
var myBiome = Biome.builder()
// Force the cloud height to be 45 when in this biome no matter the dimension type configuration
.setAttribute(EnvironmentAttribute.CLOUD_HEIGHT, 45f)
// Enable bees stay in hive ONLY if the parent (dimension) is also enabled
.modifyAttribute(EnvironmentAttribute.BEES_STAY_IN_HIVE,
EnvironmentAttribute.Modifier.Boolean.AND,
true)
.build();
var myTimeline = Timeline.builder()
.periodTicks(24000) // 1 day
.tracks(Map.of(
// Move cloud height up by 20 at 12000 and then back to 0 with interpolation
EnvironmentAttribute.CLOUD_HEIGHT, new Timeline.Track<>(
EnvironmentAttribute.Modifier.Float.ADD,
List.of(
new Timeline.Keyframe<>(0, 0f),
new Timeline.Keyframe<>(12000, 20f),
new Timeline.Keyframe<>(24000, 0f)
),
EaseFunction.IN_OUT_CUBIC
)
))
.build();This API is probably non-final (Mojang has also labelled this system experimental), expect some tweaks and improvements over time.
- (Zombie) Nautilus, Camel Husk, and Parched are now spawnable with the associated
EntityTypeandNautilusMeta/ZombieNautilusMeta/CamelHuskMeta/ParchedMeta. - New data components are
USE_EFFECTS,MINIMUM_ATTACK_CHARGE,DAMAGE_TYPE,ATTACK_RANGE,PIERCING_WEAPON,KINETIC_WEAPON,SWING_ANIMATION, andZOMBIE_NAUTILUS_VARIANT. - The new stab attack (also can be used for click detection) can be observed via the new
PlayerStabEvent.
- Transfers are now supported (#2484) thanks to @mudkipdev
- Absolute and relative block batches now provide their inverse in the callback function (when inverse is calculated) (#2981) thanks to @TropicalShadow
- Removed previously deprecated Auth related classes (
MojangAuth,VelocityProxy, andBungeeCordProxy). - Minestom now provides the common set of easing functions in the
Easeutil class.
- Correctly processing entity passenger/vehicle offsets remain as TODO items from 1.20.6.
- API to send and automatically wait for code of conduct acceptance from 1.21.9.