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
Last seen on 04:59, 15. Oct 2019
Joined Feb 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Probably a bug. Try remaking…
Wed, 10/09/2019 - 01:57

Probably a bug. Try remaking that mod element.
Try making another one and add back in it the custom code. If it works without the custom code, it should with it. Otherwise, your code might have an error somewhere in it or something that interferes with your procedure.
(You could look up packets in mc, I remember them being linked to stuff like this.)

Try swapping do Sent to chat…
Wed, 10/09/2019 - 10:53

Try swapping

do Sent to chat to all players "DebugMessage"      

and

do Deal 1 damage to provided entity.

order and try if anything changes.

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

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Works: https://pasteboard.co…
Wed, 10/09/2019 - 11:42

Works: https://pasteboard.co/IBabWln.png

Doesn't work: https://pasteboard.co/IBacd0C.png

I did some additional testing:

Inside of the crucial If statement I put:

1. Send to chat to all players "DebugMessage'

2. Send message to provided Entity "DebugMessagePrivate" (don't show in action bar)

3. Play at xyz sound, lvl pitch

4. Add 1 (item) to provided entityplayers inventory

5. Set food level of provided entity to 2

6. Deal 1 damage to provided entity (yet again)

7. Set entity number nbt tag to 0

8. Set entity health to entity health -1

Of the ones being executed were: 1, 4, 5, 7. All the other ones failed to do anything.

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

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
(Swapping it around or…
Wed, 10/09/2019 - 11:49

(Swapping it around or removing the debug message entirely didn't work as I originally tried it out without debug message.)

Could this possibly be a server, client side of issue? I'd be really confused as things worked inside the first picture linked above. But when it comes to sending the player a message, the "Send message to provided Entity "DebugMessagePrivate" (don't show in action bar)" doesn't work, but the global one does.

It also appears that it doesn't fail to get the player dependency, as it managed to put stuff in my inventory and set my food level to a lower value.

Why do I always run into the weird stuff xD

It could be that On Player…
Wed, 10/09/2019 - 11:50

It could be that On Player Tick Update. is server side only, in fact I am quite sure it is. Sending chat to the player is client-side action, though.

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

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
The more that I think of it,…
Wed, 10/09/2019 - 12:03

The more that I think of it, the less server-side could have anything to do with it as deal damage to provided entity did work in the other procedure.

The only possible thing that I can think of causing this is: https://mcreator.net/forum/53067/safety-measure-or-bug-procedure-doesnt-execute-code

The procedure on player tick is twice the size of what is shown in the image. Additionally there's a second on player tick procedure that is the same size as it. Or at best, having 2 different player tick procedures may cause interference with certain code blocks, but I'm just guessing at that point

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

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
OMG KLEMEN I FOUND IT!!!!…
Wed, 10/09/2019 - 12:13

OMG KLEMEN I FOUND IT!!!!

Okey so it's definitely interference between having 2 player tick procedures. I created a new workspace and created 2 On Player Tick procedures:

Procedure Logic 1: Counter with the deal 1 damage.

Procedure Logic 2: Set a useless nbt tag to 0

If you put Procedure Logic 1 inside of the first created OnPlayerTick and the Procedure Logic 2 inside of the second created OnPlayerTick procedure mod element, then everything will work, however, if you place Procedure logic 2 inside of the 2nd OnPlayerTick procedure and Procedure logic 1 inside of the first created OnPlayerTick, the deal damage stops working!

YASSS

 

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

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
So the bug formulation: Any…
Wed, 10/09/2019 - 12:25

So the bug formulation:

Any replicas of a global trigger will cause selective Code Blocks to break that are placed inside of them, that would have worked had they been placed in the first created global trigger.

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

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
There's more to the issue:…
Wed, 10/09/2019 - 13:20

There's more to the issue:

1st Procedure = On Player Tick: Counter

2nd Procedure = On Player Tick: Useless

Damage does work

------------------------------------------------------------------------------------------------

Changing 1st Procedure to  On Player joins world: Useless

Changing 2nd Procedure to On Player Tick: Counter (Thus making this the first On Player Tick)

Damage will NOT work!

------------------------------------------------------------------------------------------------

Deleting Procedure 1 

Keeping 2nd Procedure to On Player Tick: Counter

Damage will NOT work!

------------------------------------------------------------------------------------------------

Having both deleted procedure 1 and 2, and creating a new procedure On Tick Update: Counter

Damage does work.

I'm so weirded out by this.

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

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Additionally, if you create…
Wed, 10/09/2019 - 13:27

Additionally, if you create a procedure (On some global trigger) and then create the On Player Tick, it doesn't matter whether it's a replica or not. If the procedure is a global trigger and is not the first global trigger created inside of your workspace, specific Code Blocks of which some mentioned above will lose any functionality.

But I think I've caught on on how this bug behaved by now...