Horrible, horrible lag

Started by mrem on Fri, 02/05/2021 - 18:52

Topic category: Help with modding (Java Edition)

Last seen on 03:48, 17. Feb 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Horrible, horrible lag
Fri, 02/05/2021 - 18:52

I opened bug #872 "Armor enchantments cause severe lag" (https://github.com/MCreator/MCreator/issues/872) and after their inability to fix the bug they decided to close it and send me here.

 

To give some background, the plan was to make a simple mod that added armor and weapons buff enough for players to stand a chance against the dragons in the mods "Ice and Fire" and "WyrmRoost."  My thinking was something along the lines of the Ultimate Armor from Orespawn (back in the 1.7.10 days).   This armor was enchanted with Protection, Blast Protection, Fire Protection and Projectile Protection, less than the total number of enchantments that Ultimate Armor had. 

 

It doesn't matter what level the enchantments are at: 3, 5, 10, 15, or 20, the end result is always UNPLAYABLE Lag. 

Please see video at the link: https://youtu.be/PfbDYtuXkMw

 

My event trigger components can be seen at: https://user-images.githubusercontent.com/48491179/106971066-00263980-6…

I believe this is a bug.  KlemenDEV disagrees. Whatever it is, I ask for your help in solving it.

 

Thanks in advance,

M

 

 

If you do any complicated…
Sat, 02/06/2021 - 16:42

If you do any complicated stuff in any tick update, there will be lag, there is no way around this.

Last seen on 03:48, 17. Feb 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
As I pointed out, back in 1…
Sat, 02/06/2021 - 17:25

As I pointed out, back in 1.7.10 Orespawn had an armor set called Ultimate Armor that had 2 more enchantments than what I'm attempting and it suffered no lag.  We still play 1.7.10 to day because of Orespawn.

Last seen on 03:48, 17. Feb 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I removed half of the…
Sat, 02/06/2021 - 17:52

I removed half of the enchantments (Blast and Projectile Projection) and still suffer the lag.

Last seen on 03:48, 17. Feb 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Here is the Orespawn…
Sat, 02/06/2021 - 18:00

Here is the Orespawn Ultimate Armor enchantments for comparison: https://user-images.githubusercontent.com/48491179/106961948-2c39be80-6…

 

The armor set I'm trying to create in MCreator has two (2) enchantments: Protection and Fire Protection and still lags the game out horribly.

Last seen on 03:48, 17. Feb 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
So Klemen, Is there some…
Sun, 02/07/2021 - 20:42

So Klemen, Is there some reason why he could do this without lag in 1.7.10 that is fundamentally different than MC 1.16.4?

Last seen on 15:34, 19. Nov 2021
Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
If you want to add it to…
Mon, 02/08/2021 - 11:19

If you want to add it to armor, you have to add an "In inventory tick" procedure by code.

Last seen on 03:48, 17. Feb 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Luis, this post, and this…
Mon, 02/08/2021 - 13:54

Luis, this post, and this forum, are about using MCreator software.

Last seen on 13:38, 7. May 2022
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
wait... what? did you just…
Mon, 02/08/2021 - 14:20

wait... what? did you just make a procedure that uses a global trigger of "when item is crafted", and you put that procedure in your adamant armor pieces' tick event, that gets executed EACH TICK? I believe Klemen was right in saying that what you were doing is complicated: the game might be having a hard time dealing with all that enchanting stuff happening each tick, it's just inappropriate, given that trigger, I guess.

try making 4 global procedures with the same global trigger "item is crafted". basically, the same procedure as the one that you showed in https://user-images.githubusercontent.com/48491179/106971066-00263980-6703-11eb-9690-70a95dc6abfd.png. but just change each one to the proper armor items (e.g. one procedure for when your helmet is crafted, one for chestplate,...), then apply the enchantments you wanna apply to the crafted armor item.

 

tl;dr: the reason your game's lagging might be because you used a procedure with a global trigger on your armor's tick update. try fixing this just as I've aforementioned if that's the case.

Last seen on 03:48, 17. Feb 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Sajevius, the structure used…
Mon, 02/08/2021 - 18:36

Sajevius, the structure used at the image link is what I was instructed to do by Klemen, although his original instruction had the "provided itemstack" component replaced with an empty one.

Conceptually, I think I understand what you're saying (change the global procedure "when item is crafted" so that it's not in a tick event) -- just not sure that I know *where* to put that new global procedure in MCreator.

I'll try hitting the green "+" and select procedure and name it "AdamantHelmetWhenCreated," and use the same procedure/component structure, then do the same for the other three armor pieces.

How do I "attach it" in MCreator so that it functions properly in game?

Thanks in advance,

M

 

Last seen on 03:48, 17. Feb 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I tried it as spoken above -…
Mon, 02/08/2021 - 21:56

I tried it as spoken above -- success!  No lag!  It seems that MCreator's default of putting enchantments in the tick event is what was causing the issue.

When the items are pulled out of creative, they seem to lack enchantments.  Enchantments are had when crafted in survival/hardcore.

Thank you!  You are awesome!

 

Last seen on 13:38, 7. May 2022
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
thanks for the compliment!…
Tue, 02/09/2021 - 02:23

thanks for the compliment! and you're welcome :)

now, go forth and beat those IaF & WyrmRoost dragons!

Last seen on 03:48, 17. Feb 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Sajevius, a final request…
Tue, 02/09/2021 - 18:41

Sajevius, a final request please:  In creative mode their are no enchantments on the armor.  While filming our test of the mod, I (in creative mode) couldn't give my son (he was in survvial mode) the enchanted armor.  I had to give him the ingots and let him craft a set to get the enchantments.  Is there any way to fix this in MCreator? 

Last seen on 13:38, 7. May 2022
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
An easy (yet a bit tedious)…
Thu, 02/11/2021 - 06:06

An easy (yet a bit tedious) solution for that is to make another procedure w/ a global trigger of "Entity picks up item". the only problem, though, is that if you directly get the armor pieces from their respective creative tab, they won't get any enchantment/s. you would need to drop the armor pieces from your inventory first, and when you pick them up, they'll get the enchantments you specified. 

entity picks up armor piece

(note that I had to split the procedure into 4, as they would not fit in a single screenshot when combined in a single procedure. I made other procedures like this for the chest, legs, and boots while I was testing this, but in reality, you can combine them all into a single procedure)

idk... this is the only solution I found, but I hope you're ok with that

Last seen on 03:48, 17. Feb 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thank you  
Fri, 02/12/2021 - 17:48

Thank you