By Murble
#210314 Short version:
Make it so when a spawner spawns all the Pokémon it can at a time, it pauses the tick counter for when it is about to spawn another.

Long version:
So, I should start by explaining my goal. I made a quick datapack that just replaces mob spawners with the pixelmon spawner within a radius of the player using the /fill ... replace ... command. I am going to use this with the lost cities mod to make it so aggressive Pokémon spawn from spawners within the cities giving it the idea that humans used to live in cities but Pokémon took over. The player is able to go into these aggressive cities and grab loot out of the buildings while fighting off Pokémon. I have a "preset" spawner block which I saved the NBT Tags for which has all the settings set up on the spawners that spawn.

So, I have all that set up and it is working. Spawners are getting replaced and Pokémon are spawning. However, I came across a problem with the spawning of aggressive Pokémon. My problem is that the spawner is continuously going through ticks getting ready to spawn a Pokémon. This is a problem since if the player spends too long in battle, when he ends the fight a new Pokémon will near instantly spawn, starting another fight immediately.

So, the suggestion I would like to make to fix this is for a pause spawning feature. This would have it so the spawner will continue to spawn Pokémon till it hits its max number of spawned Pokémon. When it does, it will stop waiting for ticks until it reaches a number of Pokémon left.

For instance, you can have the max Pokémon set to 10 and the pause until number Pokémon set to 5. So, when the spawner is first placed, it will continue spawning Pokémon until it hits 10. When it does, it will trigger a flag or bool which says to stop spawning. When the number of Pokémon tied to that spawner hits 5 or under, it will unflag the pauseSpawner bool and resume spawning till it hits 10 again.

I don't know how well I explained that so I will try and say it in code which hopefully your programmers will understand.
Excuse my pseudo-code I don't know how to program in minecraft and only know C# instead of Java nor have I looked at what your guys code is so I can make proper references, but it will look something like this:
Code: Select allvar tickRate = 40; // How many ticks till a pokemon spawns
var curTicks = 0; // How many ticks have went by. When this hits the tickRate a pokemon spawns
var pauseSpawner = false; // Does what it says
var currentNumberOfPokemon = 0; // How many Pokemon currently tied to the spawner
var maxNumberOfPokemon = 10; // What it says
var pauseUntilNumberOfPokemon = 5; // The number it will wait to unpause for

Within the Tick method (I don't know what it is)
{
     if(pauseSpawner == false && currentNumberOfPokemon >= maxNumberOfPokemon)
     {
          pauseSpawner = true;
     }

     if(pauseSpawner == true && currentNumberOfPokemon <= pauseUntilNumberOfPokemon)
     {
          curTicks = 0; // Just to ensure the number of ticks when unpaused will start from 0
          pauseSpawner = false;
     }
     else if(pauseSpawner == false)
     {
          curTicks += 1;
          if(curTicks >= tickRate)
          {
               SpawnPokemon(); // Or whatever your method is to spawn in a pokemon from the spawner
               currentNumberOfPokemon += 1;
               curTicks = 0;
          }
     }
}


Then all you have to do is make it so it subtracts 1 from currentNumberOfPokemon when one is defeated in battle. Also, you'd have to make sure in the spawners settings that the variable pauseUntilNumberOfPokemon is not greater then maxNumberOfPokemon.

By Murble
#210317 I feel I did an awful job describing what my problem is, so I made a quick video to show it off a bit better... maybe, IDK. I'm not a YouTuber so don't judge me.
https://youtu.be/liMv9LzjbU4
Now, this problem is especially bad if spawning more then a max of one pokemon at a time.
This honestly makes aggressive spawners near impossible to use due to them being inconsistent and locking the player in a permanent battle.

Now that I think about it I should of posted this in an issues or bugs forum
By Murble
#210318 Nevermind, I came across a problem in what I was doing anyways.
I was able to do /fill ~ ~ ~ ~ ~ ~ pixelmon:pixelmon_spawner 0 replace {NBT Tags}
However, minecraft in 1.12 didn't allow tile entities to replace specific blocks, so I can't even do what I wanted.
Though this issue with the spawner is still annoying anyways if I wanted to make a map.
JOIN THE TEAM