Commit f8a4d053 by Jonathan Thomas

Fixed crash when PROTECT behavior targets another player

parent 5405fc31
Pipeline #12717 passed with stages
in 1 minute 51 seconds
......@@ -20,6 +20,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
### Fixed
- Entity persistence is now fixed (after creating a character sheet). No more despawning mobs.
- Fixed crash when PROTECT behavior targets another player
## [1.0.8] - 2024-07-16
......
......@@ -19,7 +19,7 @@ public class ProtectPlayerGoal extends AttackPlayerGoal {
@Override
public boolean canStart() {
MobEntity lastAttackedByEntity = (MobEntity)this.protectedEntity.getLastAttacker();
LivingEntity lastAttackedByEntity = this.protectedEntity.getLastAttacker();
int i = this.protectedEntity.getLastAttackedTime();
if (i != this.lastAttackedTime && lastAttackedByEntity != null && !this.attackerEntity.equals(lastAttackedByEntity)) {
// Set target to attack
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment