Need help with custom entity spawn

Started by znibsss on

Topic category: Help with modding (Java Edition)

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Need help with custom entity spawn

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):

https://imgur.com/14V0MPN

https://imgur.com/tHWi03x

https://imgur.com/t2E8Lkt

https://imgur.com/ajVwBl9

https://imgur.com/kkjiFdE

https://imgur.com/ShHZjb4

https://imgur.com/cqC3ki8

https://imgur.com/eMK2dKC

https://imgur.com/ma2xbcW

https://imgur.com/JavNg8J

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.

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've got something going I…
Tue, 10/31/2023 - 00:15

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

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Now I've got this but I dont…
Tue, 10/31/2023 - 13:37

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

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
YES!!! I did it!! Now one…
Tue, 10/31/2023 - 15:41

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

Last seen on 20:42, 24. Jun 2024
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
use a variable (global map i…
Tue, 10/31/2023 - 19:44

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

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay so what type of…
Tue, 10/31/2023 - 21:11

Okay so what type of variable? Any type as long as it is globalmap?

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you show me an exemple…
Tue, 10/31/2023 - 21:13

Can you show me an exemple/tutorial? I can't find when the world is created

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I find a way to do that but…
Tue, 10/31/2023 - 21:20

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:

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I fixed it, I just changed …
Tue, 10/31/2023 - 21:32

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"