Good Evening.
So i have this fairly simple code made yet it still does this thing that it somehow spawns more mobs than it should, might something please help me out by explaining this?
EDIT: To explain it a bit more - There are mobs spawned that dont exactly need to be there. They can spawn only if the location value is set, but the code calls for them to spawn only if a player logs in. But they still duplicate.
I am on 1.8.9 currently.
Every time the server starts it loads this:
So it basically clears out all the entity's from the map.
This is the code where when a player joins a server, it spawns the animal:
The code above is used to spawn the specific animal on player login, since i want mobs per player count
Basically canceling out the mob spawn if it isn't spawned on a player login.
What might be the error here?
I have this little code used for AntiSpamboting, is it somehow bugging the the code above?
Here:
I am totally lost on this and i cant figure it out, could somebody please help figure why this is still making more then PER player mob count?
Thanks if anybody is willing to waste a bit of their time to help out!
[doublepost=1498559593,1498554487][/doublepost]The problem is - it is impossible to delete entities that are in unloaded chunks, thats the answer to my problem. Thank you Blueyescat... :/
So i have this fairly simple code made yet it still does this thing that it somehow spawns more mobs than it should, might something please help me out by explaining this?
EDIT: To explain it a bit more - There are mobs spawned that dont exactly need to be there. They can spawn only if the location value is set, but the code calls for them to spawn only if a player logs in. But they still duplicate.
I am on 1.8.9 currently.
Every time the server starts it loads this:
code_language.skript:
on skript load:
loop all entities:
delete loop-entity
So it basically clears out all the entity's from the map.
This is the code where when a player joins a server, it spawns the animal:
code_language.skript:
on join:
set {player.join.horse::%player%} to false
while {player.join.horse::%player%} is false:
set {_loc::horse} to location at random number between {@min.x} and {@max.x}, 0, random number between {@min.z} and {@max.z}
loop blocks above {_loc::horse}:
if loop-block and block above loop-block are air:
if block below loop-block is grass:
set {_loc::horse} to location of loop-block
set {respawn.horse::%location of loop-block%} to location of loop-block
spawn 1 horse at location of {_loc::horse}
clear {_loc::horse}
delete {respawn.horse::%location of loop-block%}
set {player.join.horse::%player%} to true
code_language.skript:
on spawn of horse:
set name of horse to "{@horse}"
loop blocks in radius 2:
if {respawn.horse::%location of loop-block%} is set:
stop
delete entity
What might be the error here?
I have this little code used for AntiSpamboting, is it somehow bugging the the code above?
Here:
code_language.skript:
on connect:
if {join.%player%} exists:
set {_czas} to difference between {join.%player%} and now
if {_czas} is less than 60 seconds:
stop
set {join.%player%} to now
kick the player due to "&f&lLudzu ielogojies velreiz! &2SpamBotu parbaude!"
I am totally lost on this and i cant figure it out, could somebody please help figure why this is still making more then PER player mob count?
Thanks if anybody is willing to waste a bit of their time to help out!
[doublepost=1498559593,1498554487][/doublepost]The problem is - it is impossible to delete entities that are in unloaded chunks, thats the answer to my problem. Thank you Blueyescat... :/