Topic category: User side tutorials
I tried to make it as simple as possible, it does require to lock the code.
- Create your default or custom 3d armor
- Modify the desired settings
- Save
- Now lock the code
- Copy the following and paste it right before the last "}" in the code
@Override public boolean canElytraFly(ItemStack stack, net.minecraft.world.entity.LivingEntity entity) { return true; } @Override public boolean elytraFlightTick(ItemStack stack, net.minecraft.world.entity.LivingEntity entity, int flightTicks) { if (!entity.level.isClientSide) { int nextFlightTick = flightTicks + 1; if (nextFlightTick % 10 == 0) { if (nextFlightTick % 20 == 0) { stack.hurtAndBreak(1, entity, e -> e.broadcastBreakEvent(net.minecraft.world.entity.EquipmentSlot.CHEST)); } entity.gameEvent(net.minecraft.world.level.gameevent.GameEvent.ELYTRA_FREE_FALL); } } return true; }
=============SPECIAL NOTE================
If needed set stack.hurtAndBreak from 1 (default value - breakable) to 0 (unbreakable)
=============SPECIAL NOTE================
Congratulations, now your armor (chestplate) will act just like an elytra ... and still have armor properties.
If you still have doubts, watch the following ...
NOTE: Apologies for the image hosting issues, one of my server admins decided to rearrange the content in it causing mapping issues.
Please ... (right click and save for future reference)
Results ...
Take off
Landing
With some creativity you could add a tick to the chestplate ... adding an additional chestplate that will switch while in air for a winged model, making it cool and more enjoyable to watch.
I would gladly like to see screenshots of your creations.
Have fun
There was a typo in the spelling using a translator ;)
Please understand "Elitra" as "Elytra."
@dkrdjdi
OMG!! you are awesome.
It works pretty well like this and it's so easy to set.
Thanks you so much :D
First of, thank you very much; This helped a ton.
I got it to work by now and all with my own model, so on and now i wonder what i would have to do/how i have to set it up that my custom Elytra-Armor will also spread its wings when i lift off.
If this is a dumb question please forgive me, i basically went from "How do i add a mod" to "I want my modelled armor to work with Elytra" in a week since i somehow made minecraft modding my current hyper fixation.
Thanks in advance!
@tinymutelizard look into gekolib for animations, you would have to make them custom to your model
Can OP update the code for 2025.1 please? This code dkrdjdi posted does not work correctly, it makes it so anytime you are not on the ground the elytra activates, and even seems to reactivate each tick after you do land.
I used code and on compilation its says this error: level has private access in Entity
What should I do to fix the issue?