Topic category: Troubleshooting, bugs, and solutions
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?
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.
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 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 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!
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 entity will be quite complex in client to server scenarios so I will see if this can be added and how soon ;)
Oh I'll find how to replicate this bug again, don't you worry. This slippery thing won't escape me a second time xD I'll have my vengeance
I have noticed a lot of the similar situations and can confirm that this is not some specific to his/her situation type of bug.
Temperature, seasons, magic and thirst bars from a yet to be released mod all rely heavily on a player tick system and things started breaking and I was SO confused why.
Well, in general, using player tick update too much or for any heavy tasks is not recommended as it can mess with Minecraft internals due to tick taking too long.
I managed to return my workspace in its broken state again (:
Is there any way of privately linking my workspace (.mcreator file) so no one can download it yet?
You can upload it to say Mediafire and send the link on our contact form: https://www.pylo.co/contact
But please zip the entire workspace folder, not just export it so I can get as close as possible to your state of the workspace.
Please tell me which mod elements to check and how to see the problem too. Thanks!
CAPTCHA validation error: unknown CAPTCHA session ID. Contact the site administrator if this problem persists.
When using the https://www.pylo.co/contact link.
I hope I provided all the info that you need!
Strange, I think we got the email. Will check it out.
If you got the same result as I described in the mail regarding Steak oddly fixing the issue. I also found out that (cooked) sheep flesh did the same, and thus assuming all vanilla food types (when eaten in the dimension), which completely doesn't make sense, but I thoroughly tested it and I keep being able to reproduce that exact same result. (It might take 4 debug messages before the damage starts beginning)