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 183261a031a2a0b6b95dbb983236cee3cd3a0398..9dae07b1f1e18cbc86d64e5f793a5eb1685c2f7b 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -1292,7 +1292,7 @@ public abstract class Mob extends LivingEntity implements Targeting { RandomSource randomsource = world.getRandom(); this.getAttribute(Attributes.FOLLOW_RANGE).addPermanentModifier(new AttributeModifier("Random spawn bonus", randomsource.triangle(0.0D, 0.11485000000000001D), AttributeModifier.Operation.MULTIPLY_BASE)); - if (randomsource.nextFloat() < 0.05F) { + if (randomsource.nextFloat() < world.getLevel().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 c9559508d8962b891b5aca3a7ee1138b935a078b..a673ae630a0551fb242d920470c9165f4531f5fb 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -158,8 +158,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;