Topic category: Help with Minecraft modding (Java Edition)
Hi, so i've made an entity that is attacking players etc... But I want it to spawn only one of it in a day between the 3 day and the 10 day. I cant figure out a way to do this and any help would be really appreciated. Here are the screenshots (click to see):
So if you have made it this far and looked trough all the screenshots, wow, also here is a more in depth of what I want to do. So I want the entity to spawn one of it in a day between the third day and the tenth day of the world. I also want it to spawn near the player on the surface. I tried making something that randomize which day it is gonna be (for testing I set it to the first or first day), I also tried making it so it only randomize when it first creates the world and not everytime when the world gets loaded. I tried making so that if there are more than one of the entity spawned in it stop spawning them but it didnt work so I just moved it down the screen.
I've got something going I think but I dont know how I can spawn it in using this. If I somehow can please tell me it would make it so much easier. Here is the screenshot:
https://imgur.com/L0IXvY6
Now I've got this but I dont know where will it spawn, or even if it will. I want it to like spawn near the player at the surface or at the player if it isn't possible.
https://imgur.com/30SgKBO
YES!!! I did it!! Now one znibsss will spawn at the player at the given time! I just need one more thing going tho... I want to randomly choose when will it spawn (which day) only when the world gets created, not everytime someone joins the world.
https://imgur.com/uPpFUx8
use a variable (global map i believe) and set it on when the world is created (via a global trigger in a procedure when world is loaded), and set it so that if the variable is on when the procedure is ran (I.E. every time besides the first time the world is loaded), the spawning choose procedure WONT happen
Okay so what type of variable? Any type as long as it is globalmap?
Can you show me an exemple/tutorial? I can't find when the world is created
I find a way to do that but in a different way now I only have one problem. When I choose a random number between 1 and 1 for testing purposes so the first day a znibsss (the custom entity) spawns on the player. But when I put something like 0 and 1 or 3 and 10 etc... It doesn't work! I think it might be a bug this time, not my fault because I have no idea why it isn't working that way. I have yet again screenshot I'm gonna be providing:
imgur.com/OtYfRMS
imgur.com/aPWeYX4
imgur.com/ZFWAVTO
I fixed it, I just changed "Random number between min: 3 and max: 10 included" to "Random number between min: 3 and max : 10 included"