mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Special mobs naturally spawn
This commit is contained in:
committed by
granny
parent
25c3e2dd6c
commit
0a29e9cd1c
@@ -0,0 +1,22 @@
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -934,9 +_,18 @@
|
||||
&& this.random.nextDouble() < currentDifficultyAt.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
|
||||
&& !this.getBlockState(blockPos.below()).is(Blocks.LIGHTNING_ROD);
|
||||
if (flag) {
|
||||
+ // Purpur start - Special mobs naturally spawn
|
||||
+ net.minecraft.world.entity.animal.horse.AbstractHorse entityhorseskeleton;
|
||||
+ if (purpurConfig.zombieHorseSpawnChance > 0D && random.nextDouble() <= purpurConfig.zombieHorseSpawnChance) {
|
||||
+ entityhorseskeleton = EntityType.ZOMBIE_HORSE.create(this, EntitySpawnReason.EVENT);
|
||||
+ } else {
|
||||
+ entityhorseskeleton = EntityType.SKELETON_HORSE.create(this, EntitySpawnReason.EVENT);
|
||||
+ if (entityhorseskeleton != null) ((SkeletonHorse) entityhorseskeleton).setTrap(true);
|
||||
+ }
|
||||
+ // Purpur end - Special mobs naturally spawn
|
||||
SkeletonHorse skeletonHorse = EntityType.SKELETON_HORSE.create(this, EntitySpawnReason.EVENT);
|
||||
if (skeletonHorse != null) {
|
||||
- skeletonHorse.setTrap(true);
|
||||
+ //skeletonHorse.setTrap(true); // Purpur - Special mobs naturally spawn - moved up
|
||||
skeletonHorse.setAge(0);
|
||||
skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||
this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
Reference in New Issue
Block a user