BUG: Certain Procedure Blocks lose all functionality in Additional Global Triggers.

Started by StellaeLux on Wed, 10/09/2019 - 00:27

Topic category: Bugs and solutions

Last seen on 06:32, 15. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
BUG: Certain Procedure Blocks lose all functionality in Additional Global Triggers.
Wed, 10/09/2019 - 13:31 (edited)

There are only a few times where I start questioning whether programming languages are actually unambiguous or not.

In this case I created a procedure:

On Player Tick Update.

"Some code"

If (condition) is true

     do Sent to chat to all players "DebugMessage"

     do Deal 1 damage to provided entity.

"More code"

So I basically debugged to check whether the procedure would reach the Deal Damage and as I play tested, yes it did! Every 5 seconds I got the message "DebugMessage". However no damage was dealt...

Inside of this procedure I'm mostly setting and checking NBT tags with somewhere a "Set Entity Health to 0" down the road that does not trigger under any normal circumstance.

To check whether it was possible to use Deal [] damage to entity in On Player Tick Update, I recreated it in a different workspace:

if number nbt tag Counter < 1000

increment nbt tag Counter

else

deal 1 damage to provided entity

send message to all

set nbt tag Counter to 0

And as I originally expected, but were now surprised by, it worked!

So in both cases, I know for a FACT that the if statement in which the deal x damage to entity has returned true as I received the chat message, yet in my original workspace it failed to do any damage.

Does anyone know how to solve this or is this a bug?

Edited by StellaeLux on Wed, 10/09/2019 - 13:31
Thank you for your research…
Wed, 10/09/2019 - 18:12

Thank you for your research on the bug!

I have made one procedure that prints aaa to chat and one that prints bbb to chat using player tick and both worked. Also this: https://www.minecraftforge.net/forum/topic/62662-1122-solved-is-it-okay-to-subscribe-to-same-event-twice/

So I am not sure yet why this is happening.

It could be that setting NBT of entity on tick cancels the current tick.

Last seen on 06:32, 15. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Hey, I forgot to add this…
Wed, 10/09/2019 - 18:30

Hey, I forgot to add this because I had to go, but in my simplified version when testing the bug the "Send message to provided entity" also worked, just like it did for you. I'll try to make a short compact video showing all the strange behaviours and see if you manage to replicate the result.

I can replicate the result,…
Wed, 10/09/2019 - 18:49

I can replicate the result, but I think it has to do with NBT tag manipulation altering tick of entity.

Last seen on 06:32, 15. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Wait, so you managed to get…
Wed, 10/09/2019 - 19:57

Wait, so you managed to get it to fail certain procedure blocks?

Because I'd be damned, when I tried recreating the bug from a new workspace the second time... and nothing worked! And by that I mean, everything worked! I'm so confused. No matter what I do manages to break my new workspace. Even copying over my entire player tick from my main workspace works fine in the new one.

This is so strange as when I discovered the bug in my main workspace and tried replicating it in my second workspace, it exactly broke in the way I expected, and broke even further as described in my later comments.

So how on earth were you able to replicate my result if even I am unable to do so now xD

Last seen on 06:32, 15. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Also, you are right about…
Wed, 10/09/2019 - 19:58

Also, you are right about the interference thingy. Even though my test workspace made it appear very so, my main workspace is still being broken by this bug despite it all being in 1 player tick now.

Last seen on 06:32, 15. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Okey Klemen, I'm perplexed…
Wed, 10/09/2019 - 20:20

Okey Klemen, I'm perplexed.

So this bug first of all managed to break certain code blocks in my main work space. I had some suspicions that it might have had to do something with the fact that I had 2 player updates. Then when testing it inside of a testingworkspace, it showed me exactly what I thought was going to happen (to some degree) and only worked when placed in the original On Player Tick... It then broke even further. Then when trying to fix it in my main workspace according to what I thought I just learned about the bug, it managed to repair nothing!

Not only that but after coming back and wanting to film how to replicate the bug, I managed to NOT replicate it at all in a new workspace! Then after checking my testing workspace, stuff was even repaired there as well xD

THEN it still managed to break my main workspace... so after 20 more minutes of fiddling while recording trying to break it, nothing happened and as I just posted the above comments, my main workspace is also "repaired" with only changing my code back to the state it was at when I showed that screenshot! (removing the play sound, set food lvl etc).

This bug comes and goes. My workspace is in the exact same state as it was in while it was broken. Yet now magically it managed to do everything just fine.

I'm perplexed. The only things I feel sure of is that the type of Code Blocks that break are very consistent: (player health setting, dealing damage, playing sound, etc)

I hope this bug stays away now my workspace has been fixed magically...

I replicated it with NBT…
Wed, 10/09/2019 - 20:43

I replicated it with NBT tags. I am not sure why this is happening, but it must be something related to how player tick event works. I suggest you to try to find another way to achieve what you are trying to do as this is most likely how it is for the tick update event.

If you manage to replicate…
Wed, 10/09/2019 - 20:45

If you manage to replicate it again, please send the workspace so I can check it :) There have been some strange procedure bug reports lately and they might be connected. Thanks!

Last seen on 06:32, 15. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I remember suggesting this:…
Wed, 10/09/2019 - 20:47

I remember suggesting this: https://mcreator.net/forum/52579/calling-procedure-block-procedure-item (Advanced Procedures Procedure call + passing dependencies) and forgetting when I would ever need it. Now I remembered xD

Possibly, being able to call another procedure and passing on the entity dependency would allow one to deal 1 damage through that way instead.

Passing dependencies like…
Wed, 10/09/2019 - 20:49

Passing dependencies like entity will be quite complex in client to server scenarios so I will see if this can be added and how soon ;)