lucaargolo / entity-banners

A Minecraft mod strongly inspired by Terraria, which adds entity specific banners that increase damage and defense against the entity for players nearby.
Mozilla Public License 2.0
2 stars 0 forks source link

[1.17] Client Crashes when using REI on Multiplayer Server #2

Closed kalinzange closed 3 years ago

kalinzange commented 3 years ago

Just browsing through REI pages made me crash (Client Only) Not sure if it's related with #1 , if is please close this.

image

latest.log crash-2021-07-19_23.31.21-client.txt

sylv256 commented 3 years ago

this also happens on singleplayer. also, i don't have guardians galore, so i don't think it's related to #1

YuRaNnNzZZ commented 3 years ago

Got the same crash, from scrolling in REI until banners appear.

From OPs crash report:

-- Entity being rendered --
Details:
    Entity Type: lacrimis:ghost (modfest.lacrimis.entity.GhostEntity)
    Entity ID: 275
    Entity Name: Ghost
lucaargolo commented 3 years ago

Sorry for taking too long to answer this, but looks like EntityBanners is incompatible with the GhostEntity from Lacrimis, you can solve that by adding "lacrimis:ghost" to the list of blacklisted entities in the config file.

kwpugh commented 3 years ago

I make a mod which adds a mob that crashes in REI as well. What needs to be done to make a mob compatible with this?

lucaargolo commented 3 years ago

If your mod is not compatible with EntityBanners it probably means you're accessing some things that are not supported in your EntityRenderer. IIRC what was happening with the lacrimis ghost was that the EntityRenderer itself was not registered. You have to run your mod with EntityBanners in the development environment to properly debug it. Also, you don't need REI, you can just scroll in the EntityBanners creative tab.

kwpugh commented 3 years ago

I noticed. The issue only arises if my mob is disabled in the config. If enabled, no crash, but no banner either. What is required for Entity Banners to create a banner automatically?

BTW: looks like the Aether mod crashes with this too, on its Flying Cow.

lucaargolo commented 3 years ago

What's your mod? Maybe it's something I can fix on my end.

kwpugh commented 3 years ago

https://www.curseforge.com/minecraft/mc-mods/gobber-fabric

lucaargolo commented 3 years ago

Ok, so I tried running Gobber with EntityBanners and this is the error I got: crash-2021-08-20_16.18.59-client.txt Apparently, there's something wrong with your attributes implementation? I'm just instantiating a new entity so this really shouldn't cause a crash.

kwpugh commented 3 years ago

Anything wrong with this?

public class NemesisEntity extends HostileEntity { static double health = Gobber2.CONFIG.GENERAL.healthNemesis; static double damage = Gobber2.CONFIG.GENERAL.attackDamageNemesis; static double speed = Gobber2.CONFIG.GENERAL.movementSpeedNemesis; static double knockback = Gobber2.CONFIG.GENERAL.attackKnockbackNemesis; static double resistance = Gobber2.CONFIG.GENERAL.knockbackResistanceNemesis;

public NemesisEntity(EntityType<? extends HostileEntity> entityType, World world)
{
    super(entityType, world);
}

public static DefaultAttributeContainer.Builder createNemesisAttributes()
{
    return NemesisEntity.createMobAttributes()
            .add(EntityAttributes.GENERIC_MAX_HEALTH, health)
            .add(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, resistance)
            .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, speed)
            .add(EntityAttributes.GENERIC_ATTACK_DAMAGE, damage)
            .add(EntityAttributes.GENERIC_ATTACK_KNOCKBACK, knockback);
}

@Override
public void initGoals()
{
    this.goalSelector.add(1, new SwimGoal(this));
    this.goalSelector.add(4, new MeleeAttackGoal(this, 1.0D, false));
    this.targetSelector.add(1, (new RevengeGoal(this, new Class[0])).setGroupRevenge(new Class[0]));
    this.targetSelector.add(2, new FollowTargetGoal(this, PlayerEntity.class, true));
}

}

lucaargolo commented 3 years ago

I investigated a little more and it seems that the issue that caused the previous crash report is related to this https://github.com/kwpugh/gobber_fabric-1.17/blob/927ee64f4de6e785b357acee07110cf4c2502237/src/main/java/com/kwpugh/gobber2/init/EntityInit.java#L32 When you register a HostileEntity but don't register its attributes, it cannot be instantiated, that's why it crashed. After going to your config file and setting "enableAllNemesis" to true, this issue was fixed, but another crash report was generated: crash-2021-08-20_18.08.43-client.txt This looks exactly like the first crash reported in this issue. Turns out you (and probably the lacrimis dev as well) are not properly registering the entity renderer for your entities. In your case, you're only registering the entity renderer for one out of the three nemesis added by your mod https://github.com/kwpugh/gobber_fabric-1.17/blob/927ee64f4de6e785b357acee07110cf4c2502237/src/main/java/com/kwpugh/gobber2/client/EntityRenderRegistry.java#L17 The same crash can be reproduced without EntityBanners by just summoning one of the entities. I'll be closing this issue now since it doesn't have anything to do with my mod.