Tetra

Tetra

12M Downloads

[Bug] Expecting Forge:Reach_distance to be available for all entities

maxanier opened this issue ยท 1 comments

commented

Observed behaviour

When entity that does not have the forge:reach_distance attribute (all non Player entities in vanilla) attacks with an ItemModularHandheld item the game crashes.

ItemModularHandheld#sweepAttack accepts any LivingEntity as attacker and always tries to retrieve the reach distance from it:

double reach = attacker.getAttributeValue(ForgeMod.REACH_DISTANCE.get());

I have not reproduced this myself, but got a bug report for my mod Vampirism.
TeamLapen/Vampirism#982

Expected behaviour

Check if the attacker has the reach attribute. Otherwise use a default value.

But maybe I am missing something here, and Vampirism is at fault.

Steps to reproduce

  1. Give a Vampire minion (or probably any LivingEntity without the reach attribute)
  2. Let the minion attack?

Crashlog

https://github.com/TeamLapen/Vampirism/files/7197929/debug.log

Tetra version

3.14.0

mGui version

3.2.0

Forge version

1.16.5-36.2.4

Other mods

Vampirism 1.16.5-1.8.1

commented

The bug report was from me, and yes its JustAnGhost or "Just A Ghost, Don't Mind Us" I haven't really tried to replicate it, but I probably could if I use the same world