My Skeleton spawner won't work (2024)

Hello,

To take up the above message, if this is the problem, you need to create custom spawners, to do this I invite you to take a look at the NMS and more specifically the class "MobSpawnerAbstract" My Skeleton spawner won't work (1)

NMS is complicated at first, but you can do a lot of nice things.

Code (Text):

public void c() {
if (!h()) {
this.e = this.d;
} else {
BlockPosition blockposition = b();
if ((a()).isClientSide) {
double d0 = (blockposition.getX() + (a()).random.nextFloat());
double d1 = (blockposition.getY() + (a()).random.nextFloat());
double d2 = (blockposition.getZ() + (a()).random.nextFloat());
a().addParticle(EnumParticle.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]);
a().addParticle(EnumParticle.FLAME, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]);
if (this.spawnDelay > 0)
this.spawnDelay--;
this.e = this.d;
this.d = (this.d + (1000.0F / (this.spawnDelay + 200.0F))) % 360.0D;
} else {
if (this.spawnDelay == -1)
i();
if (this.spawnDelay > 0) {
this.spawnDelay--;
return;
}
boolean flag = false;
for (int i = 0; i < this.spawnCount; i++) {
NBTTagCompound nbttagcompound = this.spawnData.b();
NBTTagList nbttaglist = nbttagcompound.getList("Pos", 6);
World world = a();
int j = nbttaglist.size();
double d3 = (j >= 1) ? nbttaglist.f(0) : (blockposition.getX() + (world.random.nextDouble() - world.random.nextDouble()) * this.spawnRange + 0.5D);
double d4 = (j >= 2) ? nbttaglist.f(1) : (blockposition.getY() + world.random.nextInt(3) - 1);
double d5 = (j >= 3) ? nbttaglist.f(2) : (blockposition.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * this.spawnRange + 0.5D);
Entity entity = ChunkRegionLoader.a(nbttagcompound, world, d3, d4, d5, false);
if (entity == null)
return;
int k = world.a(entity.getClass(), (new AxisAlignedBB(blockposition.getX(), blockposition.getY(), blockposition.getZ(), (blockposition.getX() + 1), (blockposition.getY() + 1), (blockposition.getZ() + 1))).g(this.spawnRange)).size();
if (k >= this.maxNearbyEntities) {
i();
return;
}
EntityInsentient entityinsentient = (entity instanceof EntityInsentient) ? (EntityInsentient)entity : null;
entity.setPositionRotation(entity.locX, entity.locY, entity.locZ, world.random.nextFloat() * 360.0F, 0.0F);
if (entityinsentient == null || (entityinsentient.P() && entityinsentient.canSpawn())) {
if (this.spawnData.b().d() == 1 && this.spawnData.b().hasKeyOfType("id", 8) && entity instanceof EntityInsentient)
((EntityInsentient)entity).prepare(world.D(new BlockPosition(entity)), null);
if (entity.world.spigotConfig.nerfSpawnerMobs)
entity.fromMobSpawner = true;
if (!CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
ChunkRegionLoader.a(entity, world, CreatureSpawnEvent.SpawnReason.SPAWNER);
world.triggerEffect(2004, blockposition, 0);
if (entityinsentient != null)
entityinsentient.doSpawnEffect();
flag = true;
}
}
}
if (flag)
i();
}
}
}

My Skeleton spawner won't work (2024)
Top Articles
Latest Posts
Article information

Author: Aron Pacocha

Last Updated:

Views: 6720

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.