Egg Spawner-like item spawns many entities instead of one

Started by CrazyMew37 on

Topic category: Troubleshooting, bugs, and solutions

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Egg Spawner-like item spawns many entities instead of one

Hello, I'm currently struggling with making up an egg item to use for a certain entity. This item is unique as it's craftable and has a unique appearance (One that I will show later on). This is one of the first times I've coded, and I have no clue how to fix this issue: These code blocks cause the entity to spawn rapidly, forcing me to close Minecraft and restart a world fresh. How should I fix this?

 

Here is the code I've put down.

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think I have an idea as to…
Mon, 07/11/2022 - 15:42

I think I have an idea as to how it can be fixed (although idk if it would work well on multiplayer servers with this mod)

 

Step #1 - Make a new variable (you can find the variable tab from the picture below)

variable

Step #2 - make the variable type "logic" and variable scope "PLAYER_PERSISTENT"

 

Step #3 - Implement the variable in the following way:

variable2

That way you can add a cooldown for your procedure, and hopefully fix the issue.