Topic category: User side tutorials
I see that there are not any tutorials here in this forum section, most are topics asking help. I will try to make some tutorials of how to do things, and doing them properly. Here is my first tutorial.
Have you ever thought that creating a zombie that burns at day with a procedure was simple? I thought also that but I see I were wrong?
This tutorial will aim to be simple and have the best results as possible inside that simplicity. (This tutorial will only teach you how to do the zombie update tick procedure)
Let's start:
Step 1:
Obviously, the first thing we have to do is checking if the zombie it's actually on the surface or at least can see the sky. Let's do it:
Step 2:
After that, we should check if it's actually daytime and if it's not raining or thundering. Let's put the corresponding blocks:
To make external inputs, rightclick on an block like "and" and then click external inputs.
Step 3:
We need also to check if the zombie isn't in water. We need 4 checkings, 2 for flowing water and 2 for still water. Each one for the above half and below half of the zombie.
Step 4:
Also we need to check if the entity is actually burning, because if we don't check that, the fire will resetted and the zombie will get damage faster. (When the mob starts to ingnite, it automatically gets a first damage, so if it resets constantly, it will get damage constantly)
Then also we need to check if the provided world is not remote. If you don't put that, you can get errors such as the zombe getting ignited at night, but doesn't taking any fire damage, etc.
Then set the provided entity on fire to 5 seconds, you can change those seconds if you want, 5 works fine for me at least.
Step 5:
Then, return to the can see the sky condition, and place inside it, just after the day and rain conditions, the following conditions. First check if it's raining or thundering. Then if it's not the provided world remote and finally, extinguish the entity. Just like the image:
Result:
So, the result will be something like the following image:
Hope this helps anyone, I know this code can be better, but it should work as a base.
Anyways, thank you very much for reading and see you in the next tutorial or thing. Bye!
Or you could just give it a zombie AI
@Wes lol but ai bases limit custom mobs
You can just give to your mob the Restrict Sun AI block. it's working also. xD
Nice tutorial :)
I think that checking for water is useless, because the fire automatically gets extinguished in water (but I'm not sure because not checking for it could cause more lag and glitches)
Restrict Sun, bwahah
Last time I checked Restrict Sun didn't work. It only made the mob run away from sunlight (as I recall)
@RaolTheBest, Restrict Sun does what you said, mob runs away from sun.
Checking water is important because if you don't check it, when the mob enters the water, it starts extinguishing and burning a lot fast and doing horrible sounds. I tested this way and works just perfect, I think, It may need some additional thing, but it's not really necessary :)
Ok :)
This works but when the mob enters the water it extinguishes very fast. How can you fix that?
nvm I fixed it, sorry