Event can now spawn 1-3 creepers

This commit is contained in:
O-01-67 2022-10-04 10:14:36 -04:00 committed by GitHub
parent 72fa413db2
commit 932e6d2e68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -189,7 +189,9 @@ function updateCreeperPreferences() { //Creeper setting handler
if(settings.creeperSpawning) { //If the setting is on
if(typeof(randomEvents.creeper) !== "function") { //add the event if it's missing
randomEvents.creeper = function() {
for(i = 0; i < 1; i++) { //dummy for to break
var amount = Math.floor((Math.random() * 3)+1); //1-3
//In worldgen worlds, you can expect about half of this because about half of the world is pixels in it.
for(i = 0; i < amount; i++) { //dummy for to break
if(settings.creeperSpawning) { //setting validation
// random x between 1 and width-1
var x = Math.floor(Math.random()*(width-1))+1;
@ -237,7 +239,8 @@ spawnCreepers = ["creeper","angelic_creeper","bombing_creeper","hell_creeper"];
if(settings.creeperSpawning) { //creeper spawning option
randomEvents.creeper = function() {
for(i = 0; i < 1; i++) { //dummy for to break
var amount = Math.floor((Math.random() * 3)+1); //1-3
for(i = 0; i < amount; i++) { //dummy for to break
if(settings.creeperSpawning) { //setting validation
// random x between 1 and width-1
var x = Math.floor(Math.random()*(width-1))+1;