Topic category: User side tutorials
Today i was trying to make a quicksand for my mod, and like a normal person, i searched on internet to see if had some post about that, that could help me, and i didn't find anything.
So, after some tests, i finally reached a way to make a quicksand, that only suffocates you if you is submerged, because this was a problem on other topics that try to help making a quicksand. My procedure is not perfect, but works very well. So let's start the tutorial.
It's very simple, first of all create your block and check the box "can walk through the block?" in properties.
After that, all we need to do is make a procedure in the trigger "when entity collides in the block". Just copy this procedure from the image.
Basically what this procedure makes is, when the block quicksand is y+1 of the player and the player is touching the ground, then he takes damage. It is necessary because if your quicksand have only two of height, you will only take damage if you are submerged, because you will need to be touching the ground and have the quicksand above you.
But, how quicksand can have more than 2 blocks of height, then we will need to do just one more thing, that is, making you take damage if the quicksand is y+2 of the player.
Like that, the player will start take damage after his feet touch the 3rd block bellow him, that also makes him only take damage if he was submerged.
the "set event/target entity in cobweb for one tick", that can be found in "entity management" make your block act like a cobweb for entities.
For me i needed to make every arthropod creature don't interact with the block, that is the first part of the procedure, because they were crashing my game when this type of entity were on the block.
I don't know if all of you understood how it works, but i hope yes, I'm learning english yet, so, if i made some mistake, sorry about that.