Implement entity attribute for gliding flight#3192
Conversation
Last commit published: 389d905780c0980a509c20f82e58506583c057be - version: PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name = "Maven for PR #3192" // https://github.com/neoforged/NeoForge/pull/3192
url = uri("https://prmaven.neoforged.net/NeoForge/pr3192")
content {
includeModule("net.neoforged", "neoforge")
includeModule("net.neoforged", "testframework")
}
}
}MDK installationIn order to setup a MDK using the latest PR version, run the following commands in a terminal. mkdir NeoForge-pr3192
cd NeoForge-pr3192
curl -L https://prmaven.neoforged.net/NeoForge/pr3192/net/neoforged/neoforge/26.1.2.69-beta-pr-3192-feat-26.1-gh-46-gliding-flight-attribute/mdk-pr3192.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zipTo test a production environment, you can download the installer from here. |
You should implement it as a replacement of the component and make the component provide the attribute using the |
|
Good, because that's what I do now. 😄 |
This PR resolves #46 by implementing a new entity attribute
neoforge:gliding_flight, which enables or disables elytra/gliding flight.For interoperability with the
minecraft:glidercomponent, which is what the elytra item uses, this PR changes that component to add the entity attribute instead of being itself the grantee of gliding flight capability.This means that the entity attribute fully controls whether an entity can fly by gliding or not.
Items which have an attribute modifier granting the
neoforge:gliding_flightattribute will be ticked for damage, the same way that equipped items with theminecraft:glidercomponent would be.I'm not entirely sure if we should be implementing this attribute in replacement of the
glidercomponent, but this does give the feature of being able to deny elytra flight forcibly. I leave it to reviewers and other interested people to debate the overall merits of this PR.To test this PR, give yourself the following items:
/give @s minecraft:stick[minecraft:attribute_modifiers=[{id:"neo:test",type:"neoforge:gliding_flight",slot:"any",operation:"add_value",amount:1}]]/give @s minecraft:blaze_rod[minecraft:attribute_modifiers=[{id:"neo:test",type:"neoforge:gliding_flight",slot:"any",operation:"add_multiplied_total",amount:-1}]]Wearing an elytra or holding the stick grants gliding flight. Holding the blaze rod will forcibly take away elytra flight, even if you hold the flight-stick, wear the elytra, and/or are already gliding.