Skip to content

Implement entity attribute for gliding flight#3192

Open
sciwhiz12 wants to merge 2 commits into
neoforged:26.1.xfrom
sciwhiz12:feat/26.1/GH-46-gliding-flight-attribute
Open

Implement entity attribute for gliding flight#3192
sciwhiz12 wants to merge 2 commits into
neoforged:26.1.xfrom
sciwhiz12:feat/26.1/GH-46-gliding-flight-attribute

Conversation

@sciwhiz12
Copy link
Copy Markdown
Member

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:glider component, 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_flight attribute will be ticked for damage, the same way that equipped items with the minecraft:glider component would be.


I'm not entirely sure if we should be implementing this attribute in replacement of the glider component, 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:

  • A stick which grants gliding flight: /give @s minecraft:stick[minecraft:attribute_modifiers=[{id:"neo:test",type:"neoforge:gliding_flight",slot:"any",operation:"add_value",amount:1}]]
  • A blaze rod which forcibly takes away gliding flight: /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.

@sciwhiz12 sciwhiz12 added enhancement New (or improvement to existing) feature or request 26.1 Targeted at Minecraft 26.1 labels May 26, 2026
@neoforged-pr-publishing
Copy link
Copy Markdown

neoforged-pr-publishing Bot commented May 27, 2026

  • Publish PR to GitHub Packages

Last commit published: 389d905780c0980a509c20f82e58506583c057be - version: 26.1.2.69-beta-pr-3192-feat-26.1-gh-46-gliding-flight-attribute

PR Publishing

The artifacts published by this PR:

Repository Declaration

In 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 installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr3192.
On Powershell you will need to remove the -L flag from the curl invocation.

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.zip

To test a production environment, you can download the installer from here.

@Shadows-of-Fire
Copy link
Copy Markdown
Contributor

I'm not entirely sure if we should be implementing this attribute in replacement of the glider component

You should implement it as a replacement of the component and make the component provide the attribute using the ItemAttributeModifiersEvent.

@sciwhiz12
Copy link
Copy Markdown
Member Author

Good, because that's what I do now. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

26.1 Targeted at Minecraft 26.1 enhancement New (or improvement to existing) feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[1.20.x] Elytra Flight Attribute

2 participants