Maity
- Maity
- JIRAUSER701613
- Europe/Stockholm
- Yes
- No
The mushroom_grow_block blocltag does not contain dirt blocksThe "mushroom_grow_block" block tag does not contain dirt blocks
The "mushroom_grow_block"block tagdoes not contain dirt blocksThe block tag "mushroom_grow_block" does not contain dirty blocks
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then, if that entity is a player, check the item in its main hand.
Vanilla code (1.18.1)
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }Fixed code
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); }}public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then, if that entity is a player, check the item in its main hand.
Vanilla code (1.18.1)
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }publicstatic void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }Fixed code
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); }}public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then, if that entity is a player, check the item in its main hand.
Vanilla code (1.18.1)
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }Fixed code
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then
,if that entity is a player, check the item initsmain hand.
Vanilla code
(1.18.1)public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }Fixed code
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, they check the item in their main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }Fixed code:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, the
ycheck the item in theirmain hand.Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }Fixed code:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }Fixed code:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }Fixed code:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice. The Thorns enchantment may also work incorrectly, causing damage to the attacker twice.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }Fixed code:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice. The Thorns enchantment may also work incorrectly, causing damage to the attacker twice.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntitylivingEntity, Entityentity) { EnchantmentVisitorenchantmentVisitor = (enchantment,i) -> enchantment.doPostHurt(livingEntity, entity, i);if (livingEntity!= null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (entityinstanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntitylivingEntity, Entityentity) { EnchantmentVisitorenchantmentVisitor = (enchantment,i) -> enchantment.doPostAttack(livingEntity, entity, i); if (livingEntity!= null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } if (livingEntityinstanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } }Fixed code:
public static void doPostHurtEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor enchantmentVisitor = (enchantment, i) -> enchantment.doPostHurt(livingEntity, entity, i); if (entity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitorenchantmentVisitor = (enchantment,i) -> enchantment.doPostAttack(livingEntity, entity,i); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(enchantmentVisitor, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(enchantmentVisitor, livingEntity.getAllSlots()); } }Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice. The Thorns enchantment may also work incorrectly, causing damage to the attacker twice.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fixed code:
public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(livingEntity, entity, lvl); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(consumer, livingEntity.getAllSlots()); } }
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice. The Thorns enchantment may also work incorrectly, causing damage to the attacker twice.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl);if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fixed code:
public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(livingEntity, entity, lvl); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(consumer, livingEntity.getAllSlots()); } }Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice. The Thorns enchantment may also work incorrectly, causing damage to the attacker twice.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fixed code:
public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(livingEntity, entity, lvl); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, livingEntity.getMainHandItem()); } else if (livingEntity != null) { EnchantmentHelper.runIterationOnInventory(consumer, livingEntity.getAllSlots()); } }
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice. The Thorns enchantment may also work incorrectly, causing damage to the attacker twice.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fixed code:
public static void doPostDamageEffects(LivingEntity livingEntity, Entity entity) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(livingEntity, entity, lvl); if (livingEntity instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, livingEntity.getMainHandItem()); } elseif(livingEntity!=null) { EnchantmentHelper.runIterationOnInventory(consumer,livingEntity.getAllSlots()); } }Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice. The Thorns enchantment may also work incorrectly, causing damage to the attacker twice.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fixed code:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice. The Thorns enchantment may also work incorrectly, causing damage to the attacker twice.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fixed code:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player when they should not.
Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice. The Thorns enchantment may also work incorrectly, causing damage to the attacker twice.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1-1.20.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fixed code:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }
Enchantment::doPostHurt and Enchantment::doPostAttack are called twice for the player
when they should not.Due to this bug, the slow effect from the Bane of Arthropods enchantment is applied twice. The Thorns enchantment may also work incorrectly, causing damage to the attacker twice.
The problem is that EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects first check all items of the entity, and then if that entity is a player, these methods check the item in the main hand.
Vanilla code 1.18.1-1.20.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fix
ed code:public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }The Enchantment::doPostHurt and Enchantment::doPostAttack functions are called twice for the player causing some bugs.
- The Bane of Arthropods enchantment grants the Slow effect twice
- The Thorns enchantment deals damage to the attacker and the durability of the item with this enchantment twice.
The problem is that the EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects actually call these functions twice.
Vanilla code 1.18.1-1.20.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fix suggestion:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }
The Enchantment::doPostHurt and Enchantment::doPostAttack functions are called twice for the player causing some bugs.
- The Bane of Arthropods enchantment grants the Slow effect twice
- The Thorns enchantment deals damage to the attacker and the durability of the item with this enchantment twice.
The problem is that the EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects actually call these functions twice.
Vanilla code 1.18.1-1.20.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fix suggestion:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }
The Enchantment::doPostHurt and Enchantment::doPostAttack functions are called twice for the player causing some bugs.
- The Bane of Arthropods enchantment grants the Slow effect twice
- The Thorns enchantment deals damage to the attacker and the durability of the item with this enchantment twice.
The problem is that the EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects actually call these functions twice.
Vanilla code 1.18.1-1.20.1:
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fix suggestion
:public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }The Enchantment::doPostHurt and Enchantment::doPostAttack functions are called twice for the player causing some bugs.
- The Bane of Arthropods enchantment grants the Slow effect twice
- The Thorns enchantment deals damage to the attacker and the durability of the item with this enchantment twice.
The problem is that the EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects actually call these functions twice:
Vanilla code 1.18.1-1.20.1
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fix suggestion
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }
The Enchantment::doPostHurt and Enchantment::doPostAttack functions are called twice for the player causing some bugs.
- The Bane of Arthropods enchantment g
rants the Slow effect twice- The Thorns enchantment deals damage to the attacker and the durability of the item with this enchantment twice.
The problem is that the EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects actually call these functions twice:
Vanilla code 1.18.1-1.20.1
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fix suggestion
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }The Enchantment::doPostHurt and Enchantment::doPostAttack functions are called twice for the player causing some bugs.
- The Bane of Arthropods enchantment gives the Slowness effect twice
- The Thorns enchantment deals damage to the attacker and the durability of the item with this enchantment twice.
The problem is that the EnchantmentHelper::doPostHurtEffects and EnchantmentHelper::doPostDamageEffects actually call these functions twice:
Vanilla code 1.18.1-1.20.1
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }Fix suggestion
public static void doPostHurtEffects(LivingEntity defender, Entity attacker) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostHurt(defender, attacker, lvl); if (defender != null) { EnchantmentHelper.runIterationOnInventory(consumer, defender.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, defender.getMainHandItem()); } }public static void doPostDamageEffects(LivingEntity attacker, Entity target) { EnchantmentVisitor consumer = (enchantment, lvl) -> enchantment.doPostAttack(attacker, target, lvl); if (attacker != null) { EnchantmentHelper.runIterationOnInventory(consumer, attacker.getAllSlots()); } else if (attacker instanceof Player) { EnchantmentHelper.runIterationOnItem(consumer, attacker.getMainHandItem()); } }
World seed
8680357063582821254Create a world with this seed and you will immediately notice an error in the console.
Create a world with this seed and you will immediately notice an error in the console. 8680357063582821254
Create a world with this seed and you will immediately notice an error in the console. 8680357063582821254
Create a world with this seed and you will immediately notice an error in the console.
8680357063582821254
Create a world with this seed and you will immediately notice an error in the console.
8680357063582821254Possibly related to MC-125007 ?
1.19.4, mojmap
The modified motion packet is not always sent to the client on knockback because LivingEntity::knockback uses LivingEntity::hasImpulse instead of LivingEntity::hurtMarked. It seems that LivingEntity::hasImpulse does not guarantee that the packet will be sent, unlike LivingEntity::hurtMarked. See ServerEntity::sendChanges.
yarn 1.18.1 mappings
The problem is that LivingEntity.takeKnockback() doesn't always send the modified velocity packet to the client.
Vanilla uses the velocityDirty flag when it should use velocityModified.
Also, the takeShieldHit() and knockback() methods confuse the attacker and defender twice, causing the knockback to occur on wrong mob.
I'm not sure if this is a bug. Perhaps you haven't completed this feature, or perhaps it's really a bug, or maybe you don't want this feature/publish this feature for players and data pack creators.
Structure files have palettes. The only structure files that use palettes are shipwrecks. Palettes allow you to select a set of blocks for a structure, so that one structure can have several variations of the same block shape.
The problem is that palettes cannot be created in the game and the only way to create a palette is to edit the structure file manually. It seems like this has always been the case since the introduction of palettes.
But I noticed that the save functionality still exists, but it seems (I'm not sure) to be disabled.In `StructureTemplate::fillFromWorld` you need to remove 1 line of code: `this.palettes.clear()`, and then saving the same structure of the same shape but with different blocks will create a new palette.
I'm not sure this will work perfectly and I'm not sure if this is how you intended this feature
I'm not sure if this is a bug. Perhaps you haven't completed this feature, or perhaps it's really a bug, or maybe you don't want this feature/publish this feature for players and data pack creators.
Structure files have palettes. The only structure files that use multiple palettes are shipwrecks. Palettes allow you to select a set of blocks for a structure, so that one structure can have several variations of the same block shape.
The problem is that it is not possible to create a structure with multiple palettes in the game and the only way to do this is to edit the structure file manually. It seems like this has always been the case since the introduction of palettes.
But I noticed that the save functionality still exists, but it seems (I'm not sure) to be disabled. In `StructureTemplate::fillFromWorld` you need to remove 1 line of code: `this.palettes.clear()`, and then saving the same structure of the same shape but with different blocks will create a new additional palette.
I'm not sure this will work perfectly and I'm not sure if this is how you intended this feature.
I'm not sure if this is a bug. Perhaps you haven't completed this feature, or perhaps it's really a bug, or maybe you don't want this feature/publish this feature for players and data pack creators.
Structure files have palettes. The only structure files that use multiple palettes are shipwrecks. Palettes allow you to select a set of blocks for a structure, so that one structure can have several variations of the same block shape.
The problem is that it is not possible to create a structure with multiple palettes in the game and the only way to do this is to edit the structure file manually. It seems like this has always been the case since the introduction of palettes.
But I noticed that the save functionality still exists, but it seems (I'm not sure) to be disabled. In `StructureTemplate::fillFromWorld` you need to remove 1 line of code: `this.palettes.clear()`, and then saving the same structure of the same shape but with different blocks will create a new additional palette.
I'm not sure this will work perfectly and I'm not sure if this is how you intended this feature.
I'm not sure if this is a bug. Perhaps you haven't completed this feature, or perhaps it's really a bug, or maybe you don't want this feature/publish this feature for players and data pack creators.
Structure files have palettes. The only structure files that use multiple palettes are shipwrecks. Palettes allow you to select a set of blocks for a structure, so that one structure can have several variations of the same block shape.
The problem is that it is not possible to create a structure with multiple palettes in the game and the only way to do this is to edit the structure file manually. It seems like this has always been the case since the introduction of palettes.
But I noticed that the save functionality still exists, but it seems (I'm not sure) to be disabled. In StructureTemplate::fillFromWorld you need to remove 1 line of code: this.palettes.clear(), and then saving the same structure of the same shape but with different blocks will create a new additional palette.
I'm not sure this will work perfectly and I'm not sure if this is how you intended this feature.
I'm not sure if this is a bug. Perhaps you haven't completed this feature, or perhaps it's really a bug, or maybe you don't want this feature/publish this feature for players and data pack creators.
Structure files have palettes. The only structure files that use multiple palettes are shipwrecks.
Palettes allowyou toselect a set of blocks for a structure, so that one structure can have several variations of the same block shape.The problem is that it is not possible to create a structure with multiple palettes in the game and the only way to do this is to edit the structure file manually. It seems like this has always been the case since the introduction of palettes.
But I noticed that the save functionality still exists, but it seems (I'm not sure) to be disabled. In StructureTemplate::fillFromWorld you need to remove 1 line of code: this.palettes.clear(), and then saving the same structure of the same shape but with different blocks will create a new additional palette.
I'm not sure this will work perfectly and I'm not sure if this is how you intended this feature.
I'm not sure if this is a bug. Perhaps you haven't completed this feature, or perhaps it's really a bug, or maybe you don't want this feature/publish this feature for players and data pack creators.
Structure files have palettes. The only structure files that use multiple palettes are shipwrecks. Several palettes allow automatic selection of a set of blocks for a structure, so that one structure can have several variations of the same block shape. By default, each structure has one palette.
The problem is that it is not possible to create a structure with multiple palettes in the game and the only way to do this is to edit the structure file manually. It seems like this has always been the case since the introduction of palettes.
But I noticed that the save functionality still exists, but it seems (I'm not sure) to be disabled. In StructureTemplate::fillFromWorld you need to remove 1 line of code: this.palettes.clear(), and then saving the same structure of the same shape but with different blocks will create a new additional palette.
I'm not sure this will work perfectly and I'm not sure if this is how you intended this feature.
I'm not sure if this is a bug. Perhaps you haven't completed this feature, or perhaps it's really a bug, or maybe you don't want this feature/publish this feature for players and data pack creators.
Structure files have palettes. The only structure files that use multiple palettes are shipwrecks. Several palettes allow automatic selection of a set of blocks for a structure, so that one structure can have several variations of the same block shape. By default, each structure has one palette.
The problem is that it is not possible to create a structure with multiple palettes in the game and the only way to do this is to edit the structure file manually. It seems like this has always been the case since the introduction of palettes.
But I noticed that the save functionality still exists, but it seems (I'm not sure) to be disabled. In StructureTemplate::fillFromWorld you need to remove 1 line of code: this.palettes.clear(), and then saving the same structure of the same shape but with different blocks will create a new additional palette.
I'm not sure this will work perfectly and I'm not sure if this is how you intended this feature.
Edit: Yes, it doesn't work perfectly. I changed the shape of the structure and saved it again, but instead of overriding the structure I got a new palette, so I conclude that this is not really a bug.
The bug
The shield does not block attacks when the player faces straight up, even if the enemy is above the player.
How to reproduce
- Ensure you are in Survival or Adventure mode
- Hold a shield:
/item replace entity @s weapon with shield
- Face directly upwards
- Summon an arrow directly above you:
/summon arrow ~ ~20 ~
- Attempt to block the arrow with the shield
→
The shield does not block the arrow
Code analysis and fix
Code analysis by Maity can be found in this comment.
The bug
Ever since the beginning of 1.14 snapshots, mobs wouldn't get knocked back when a player is blocking with a shield.
Here are some screenshots from the current version (1.13.2) and current snapshot (19w14b)
1.13.2:
- Vindicators
- Piglin (New Mob in 1.16.x)
- Zombie Pigman/Zombified Piglin (renamed in 1.16.x)
- Zombie Villager
- Zombie
- Husk
- Drowned
- Wolf
- Wither Skeleton
- Enderman
- Spider & Cave Spider
- Silverfish
- Slime and Magma Cube
These mobs do knockback when you're blocking.
19w14a & b and beyond of 1.14 - 1.16:
The mobs I said above don't do knockback in the current version(s).
However, this doesn't affect to Creeper/TNT explosions, as you still do knockback from it. And arrows from Skeletons/Strays will still bounce of the shield.
Code analysis
Code analysis by Maity & Fuzs can be found in this comment and this comment.
Hi Maity, not quite.
MC-147694 talks about how mobs don't get repelled (aren't pushed back a bit), when their attack is blocked through the player using a shield, whereas this report (MC-248310), talks about how the player who blocks another player's attack using a shield, doesn't receive knockback. See MC-223238, as this may help in understanding this ticket. ![]()





If you add dirt to the tag, then mushrooms will start generating in the world.
It's very easy to fix: just delete this line https://github.com/misode/vanilla-worldgen/blob/28c5c2b0c846cc651874c528bed437de4e83d428/worldgen/biome/frozen_ocean.json#L25
It would be nice to have the sky biome.
This bug was fixed in 1.18. BlockEntity are now removed by iterator.remove()
Duplicate of MC-147694
This bug occurs because LivingEntity::isDamageSourceBlocked uses the entity's viewpoint instead of its direction.
To fix this bug, just replace getViewVector(1) with new Vec3(getDirection().getStepX(), getDirection().getStepY(), getDirection().getStepZ());
What is the problem with adding the cherry grove to multiple tags? Tags have no such limits
Actually, there is another issue: LivingEntity::blockedByShield, which should knockback the attacker (but knockback the defender as Fuzs already reported (but does not knockback because the modified motion packet is not sent)) is being overridden by some mobs without calling the super method. So those mobs will not be knocked back anyway. But this is pretty easy to fix: just move the knockback function that Fuzs suggested to LivingEntity::blockUsingShield
edit: I deleted my previous comment because it was wrong
I'm still not sure as the developers have only recently started documenting some technical changes to the game, so I'd like to keep this issue open until the developers themselves respond
How to reopen?