[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

Last seen on 04:46, 27. Apr 2024
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
Thu, 03/21/2024 - 20:08 (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 ...

(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 Thu, 03/21/2024 - 20:08
Last seen on 04:46, 27. Apr 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@JaBaconator - Awesome,…
Sat, 08/26/2023 - 20:02

@JaBaconator - Awesome, great news.

Last seen on 00:26, 24. Feb 2024
Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you so much for this…
Sat, 09/02/2023 - 01:18

Thank you so much for this code, it has been really helpful, but unfortunately, this no longer works on version 2023.3, would you be able to update it to this version? I would try and figure it out myself but I don't know Java. Thank you!

Last seen on 04:46, 27. Apr 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@PhatBoi6841 I just tested…
Tue, 09/05/2023 - 02:01

@PhatBoi6841

I just tested it in 2023.3 (Forge 1.20.1) ... works with no issues. Same as before, paste this code right before the last   }

Also, don't forget to lock the code after saving the changes. Have fun!


@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_GLIDE);
}
}
return true;
}
Last seen on 00:26, 24. Feb 2024
Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're right it works just…
Wed, 09/06/2023 - 00:08

You're right it works just fine, I don't know what was wrong with it when I tired and it didn't work, I know there was a tiny mcreator update that came out within the last couple days, I wonder if that was the issue, but either way thank you for the reply and support!

Last seen on 04:46, 27. Apr 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@PhatBoi68419 There are lots…
Wed, 09/06/2023 - 16:22

@PhatBoi68419

There are lots of changes on every update, Forge changed a lot of things for this new version. Anyways, glad it works. If you or anyone else experiences issues on future updates ... let me know, I will do my best to help. By the way, this code also works if you are creating Geckolib animated armors.

Well, happy modding.

Last seen on 01:38, 19. Apr 2024
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
can you please give us an…
Sun, 09/17/2023 - 23:49

can you please give us an example on where to put it i am so confused trying to get this to work

Last seen on 01:38, 19. Apr 2024
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
this procedure will add fire…
Mon, 09/18/2023 - 00:23

this procedure will add fire work functionallity whenever the procedure is ran. i have it hooked up to a keybined

Last seen on 04:46, 27. Apr 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Dratic95   The example is in…
Mon, 09/18/2023 - 23:42

Dratic95

 

The example is in the first gif ...
If you still have doubts, watch the following ...

Sorry, but for your second post ...  the image is cannot be seen/found.

Last seen on 01:38, 19. Apr 2024
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(No subject)
Tue, 09/19/2023 - 00:08

Last seen on 04:46, 27. Apr 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That is great, I took the…
Tue, 09/19/2023 - 20:07

That is great, I took the liberty of reposting it ... making it visible here (in MCreator site).

 

Last seen on 04:46, 27. Apr 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Double checking your…
Tue, 09/19/2023 - 20:26

Double checking your suggestion, it will work for any elytra flying. It could possibly be adjusted adding ...

 

&& {this-armor on chest}

Last seen on 01:38, 19. Apr 2024
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yes. i only made this in…
Tue, 09/19/2023 - 22:49

yes. i only made this in like five minutes for my blue beetle mod i am working on right now. the blue beetle mod give you the ability to elytra fly when you have the scarab equiped. i just made an adjustment so it only worked when the scarab was active. also they reason it is multiplied by 2 is when you do it with out the multiplacation on just the base it moves you forward about half a block

Last seen on 01:38, 14. Jan 2024
Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You said that this works on…
Sat, 09/30/2023 - 16:45

You said that this works on geckolib animated models, can you make a quick tutorial?, because it doesn't weem to work for me

Last seen on 18:05, 28. Oct 2023
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have a issue how can i get…
Sun, 10/01/2023 - 06:14

I have a issue how can i get this to work server side? It works fine client side. Im using 2023.1 btw.