From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Ben Kerllenevich Date: Mon, 30 Nov 2020 11:40:11 -0500 Subject: [PATCH] Changeable Mob Left Handed Chance diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java index 83fb51ad723f06d002f31bd1caefb778f057a5ad..48fbb4344587be603e921ebf3f0f0e8b0dc44972 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -1229,7 +1229,7 @@ public abstract class Mob extends LivingEntity { @Nullable public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) { this.getAttribute(Attributes.FOLLOW_RANGE).addPermanentModifier(new AttributeModifier("Random spawn bonus", this.random.nextGaussian() * 0.05D, AttributeModifier.Operation.MULTIPLY_BASE)); - if (this.random.nextFloat() < 0.05F) { + if (this.random.nextFloat() < this.level.purpurConfig.entityLeftHandedChance) { // Purpur this.setLeftHanded(true); } else { this.setLeftHanded(false); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index 63212c3d00a4aabb9f14b50016f43aa9e1f10249..367ce7f6003be23ffe2228e26365cb894089d4b4 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -150,8 +150,10 @@ public class PurpurWorldConfig { } public int entityLifeSpan = 0; + public float entityLeftHandedChance = 0.05f; private void entitySettings() { entityLifeSpan = getInt("gameplay-mechanics.entity-lifespan", entityLifeSpan); + entityLeftHandedChance = (float) getDouble("gameplay-mechanics.entity-left-handed-chance", entityLeftHandedChance); } public boolean infinityWorksWithoutArrows = false;