[TUTORIAL] Making a flying armor 2022.x - Forge 1.18.2 - Look at the comments for updates up to 2023.x 1.20.1

Started by __SK__ on

Topic category: User side tutorials

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[TUTORIAL] Making a flying armor 2022.x - Forge 1.18.2 - Look at the comments for updates up to 2023.x 1.20.1
Sat, 05/04/2024 - 01:18 (edited)

I tried to make it as simple as possible, it does require to lock the code.

  1. Create your default or custom 3d armor
  2. Modify the desired settings
  3. Save
  4. Now lock the code
  5. 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

Edited by __SK__ on Sat, 05/04/2024 - 01:18
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thanks  
Sat, 12/09/2023 - 15:20

thanks

 

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
so I can't figure out how or…
Sat, 12/23/2023 - 15:38

so I can't figure out how or where to put the code, can you help me?, here is the code:

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
by the way , im on mcreator…
Sat, 12/23/2023 - 15:57

by the way , im on mcreator 2023.3

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey, sorry to bother. I was…
Tue, 12/26/2023 - 05:54

Hey, sorry to bother. I was hoping you could point me in the right direction about something related to this.

I'm pretty new to Mcreator, but I'm hoping to add a parasail like item which could be used more midway though the game as a 'worse elytra' to break your fall or float down a mountain and such.

Do you know if it's possible to put elytra like properties on a held item and how I'd do that?

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
is there a way to do this in…
Sun, 03/17/2024 - 11:59

is there a way to do this in mcreator (2021.3)?

for 1.16.5.

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@thatdudepeter For 1.16.5…
Mon, 03/18/2024 - 08:32

@thatdudepeter

For 1.16.5 you do not need to code it, there was a plugin someone else created and I saved it for my backups ...

Here is the post link: ( https://mcreator.net/comment/212147 )

======================================================

Just in case, this is an updated link for the Fly Procedures plugin.

https://www.mediafire.com/folder/b1m79pxiqga0a/elytra_flying_plugin_mcreator (just verified - 3/18/2024, and the link workd as expected)

=================Important info============================

*** THESE ARE MY BACKUP PLUGIN FILES - I DID NOT CREATE THE PLUGIN ***

{
  "id": "fly_procedures",
  "minversion": 202000539514,
  "info": {
      "name": "Fly Procedures",
      "version": "1.2",
      "author": "MrScautHD", <<<<<<<<<<<<<<<<<This is the author
      "description": "This plugin add procedures to check is player flying"
  }
}

Only tested on MCreator 2021.2, for a 1.16.5 workspace. 

=================Important info============================

Have fun.

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It is not working for me but…
Sat, 04/06/2024 - 00:05

It is not working for me but I think I might be putting the code in the wrong place because I keep getting an error about it. 

I'm using 2023.4 btw

https://imgur.com/a/GcG3rpE

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Im also doing a 1.20.1 mod…
Sat, 04/06/2024 - 00:22

Im also doing a 1.20.1 mod if that helps too

 

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is a slight change for…
Wed, 04/10/2024 - 19:48

There is a slight change for 2023.3+.

Look at the if statement, it had a change from:

.level 

to:

.level()

This is the updated code. Copy and paste them, but if you like try to understand them:

	//ENABLE ELYTRA FLYING

    @Override
    public boolean canElytraFly(ItemStack stack, LivingEntity entity) {
        return true;
    }

    @Override
    public boolean elytraFlightTick(ItemStack stack, LivingEntity entity, int flightTicks)
    {
        if (!entity.level().isClientSide && (flightTicks + 1) % 20 == 0) { //HERE IS THE .level THAT CHANGED TO .level() 
            //set stack.hurtAndBreak from 1 (default value - breakable) to 0 (unbreakable)
            stack.hurtAndBreak(0, entity, e -> e.broadcastBreakEvent(net.minecraft.world.entity.EquipmentSlot.CHEST));
        }
        return true;
    }

    protected boolean onGround;
    public void setOnGround(boolean p_20181_) {
        this.onGround = p_20181_;
    }

    public boolean isOnGround() {
        return this.onGround;
    }

 

Also, double check the imports (verify them at the top fo the code):

import net.minecraft.world.entity.LivingEntity;//THIS IMPORT MIGHT BE REQUIRED

 

When done, remember to save and lock your code for this item.

Best wishes, have fun!

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I cannot tell you how happy…
Thu, 04/11/2024 - 23:30

I cannot tell you how happy I am that you helped me. Thank you so much. You are a genius. Also the import wasn't required for the code.

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
doesnt work :/ it tells me …
Mon, 04/29/2024 - 16:27

doesnt work :/ it tells me "error: method does not override or implement a method from a supertype" for the 2 @override in the code

https://imgur.com/a/qVlNL6m


 

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Simple fix, there is a…
Tue, 04/30/2024 - 01:48

Simple fix, there is a little confusion on the code's placement. You are trying to apply it on the renderer

but it should be placed in the item itself

Remember to lock and save the code.