Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicMobs MythicMobs
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 144
    • Issues 144
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicMobsMythicMobs
  • Issues
  • #806

Closed
Open
Created May 25, 2022 by Marvin Klar@MarvinKlar

Pigs despawn on attack - Can't find attribute minecraft:generic.attack_damage

Summary

I configured the following pig to attack players using MythincMobs 5.0.4.

Wildschwein:
  Type: PIG
  Display: '&8Wildschwein'
  Health: 25
  Damage: 8
  AIGoalSelectors:
  - 0 clear
  - 1 meleeattack
  - 2 randomstroll
  AITargetSelectors:
  - 0 clear
  - 1 players
  Options:
    Angry: true
    PreventOtherDrops: true
    PreventItemPickup: true
    PreventRenaming: true
    Interactable: false
    KnockbackResistance: 0.5

When the pig is about to attack a player, the pig despawns and the following error occours in the console log:

[11:47:09] [Server thread/ERROR]: Entity threw exception at world:508.8488889113545,52.0,-2767.1202016608704
java.lang.IllegalArgumentException: Can't find attribute minecraft:generic.attack_damage
	at net.minecraft.world.entity.ai.attributes.AttributeSupplier.getAttributeInstance(AttributeSupplier.java:22) ~[?:?]
	at net.minecraft.world.entity.ai.attributes.AttributeSupplier.getValue(AttributeSupplier.java:28) ~[?:?]
	at net.minecraft.world.entity.ai.attributes.AttributeMap.getValue(AttributeMap.java:65) ~[?:?]
	at net.minecraft.world.entity.LivingEntity.getAttributeValue(LivingEntity.java:2410) ~[?:?]
	at net.minecraft.world.entity.Mob.doHurtTarget(Mob.java:1533) ~[?:?]
	at net.minecraft.world.entity.ai.goal.MeleeAttackGoal.checkAndPerformAttack(MeleeAttackGoal.java:142) ~[?:?]
	at net.minecraft.world.entity.ai.goal.MeleeAttackGoal.tick(MeleeAttackGoal.java:134) ~[?:?]
...

Am I missing something or is this a bug? I already tried to add the option AttackSpeed, but this doesn't fix the issue.

Steps to reproduce

Create a config file for the given mob, spawn it and let it attack a player.

Current behavior

The pig despawns.

Intended correct behavior

The pig should not despawn and deal damage to the player.

Debug log snippet

https://pastebin.com/y24E623s

Proposed fixes

I googled a bit and found out that the attibute attack_damage of entities is not writeable by default, but this can be changed (and I think this is already done). But maybe the error occours because the pig is an passive mob which maybe doesn't have the attack_damage attribute by default?

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking