Started by
The Ult1mate Guy
on
Topic category: Help with MCreator software
I am aware of the velocity XYZ pieces, however I have no idea how to check if one or more of them are >0, seeing as there's no "and/or" logic type. Any help is appreciated!
There is in the logic section.
Also, I suggest getting common velocity vectors length using Pythagorean theorem extended for 3 dimensions.
I suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei
So after tripe-checking I can't find the "and/or" statement. I found "and" and "or," but not "and/or."
Unfortunately I have no idea what you mean by "getting common velocity vectors length using Pythagorean theorem extended for 3 dimensions."
And I don't immediately see anything in the playlist that would help figure out if a mob is walking.
You use both blocks together.
IF(( x velocity > 0 )AND (y velocity > 0) AND (y velocity > 0)
Put multiple of the blocks together.
The issue with that is then the game checks if all velocities are >0, as opposed to at least one; it looks for the entity moving diagonally and jumping.
Then change the AND to OR.
IF(( x velocity > 0 )OR (y velocity > 0) OR (z velocity > 0)
//do stuff
Well now I made a "and/or" by literally mixing the "and" and "or" boxes, and it almost works
Now I just need to figure out why adding a do/while loop breaks the game...
Don't use a loop if you want to check if the entity is moving every second.
If the you are trying to check if the player is moving use the global trigger "on player tick update".
Then remove the loop and use an if statement.
You won't need the loop statement because it is being called every second (tick but let's not get technical).
If it is a custom entity use the entity trigger on entity tick update doing the same steps as above.
Right, I got that
I almost got this working now
it seems to only activate once the entity is stopped now, as opposed to when it moves, in other words the opposite of what I'm looking for
But good progress!
I think I have a guess as to what is the issue, just need to figure out how to fix it
Since it's getting called every tick, the animation resets and looks like it's not playing, but when it stops (and thus the if is no longer true), it stops resetting and plays the animation properly
Yep, that's definitely it. I swapped the do from playing an animation to dropping an item and the entity started spewing them anytime it moved.
So now I need to figure out how to prevent it from being constantly called if an animation is already playing
if entity is moving AND logic nbt tag "animation_active" = false{
set logic nbt tag "animation_active" to true.
play animation
}
if NOT entity is moving {
set logic nbt tag "animation_active" to false
}
The "moving" part is the code I showed you before that I didn't want to write again.
You might need to make a timer to loop your animation while walking.
Never used GeckoLib but the should loop : true box should work/
Yeah, that's worked so far, now all I need to do is figure out how to stop the animation without playing a new one.
Currently the mob performs the animation and it loops until I "place click" (not hit) the mob, causing it to activate another procedure and play a non-looping animation (which I intend to be part of the final product) which cancels the looped one. Forcing another animation to play if entity moving is false prevents the other procedure from working.
A timer could be useful, but I'm not sure how to do so.
Might be on to something, I'll update in a bit
IT WORKS!