Woodwalkers

Woodwalkers

506k Downloads

ignoreShapedPlayers crashes game. Field field_6660 not found in entity.

Marttico opened this issue ยท 1 comments

commented

Mod loader

Forge

Minecraft version

1.21.4

Woodwalkers version

6.2

CraftedCore version

5.7

Modloader version

Fabric 0.16.10

The latest.log file

Here's the log

Issue description

I'm currently trying to create a mod that turns me into a bat whenever I start flying. I've noticed that, with the mob morphing enabled, after some time, the game crashed with the following error:
Caused by: java.lang.NoSuchFieldError: Class net.minecraft.entity.ai.goal.ActiveTargetGoal does not have member field 'net.minecraft.entity.mob.MobEntity field_6660'

It seems the error is happening within the ignoreShapedPlayers function of the woodwalkers mod.

To make sure I'm not interfacing with the mod in the wrong way I've read through the docs. Here I tried to see how I could best interface with the walkers mod to turn the player into a bat. From what I can see, this is the only piece of code that's necessary to do this:

PlayerShape.updateShapes(player, shape); // updates the current shape to the specified shape or resets it if shape is null

I have implemented this into my code in the following way:

Entity created;
NbtCompound nbt = new NbtCompound();
nbt.putBoolean("isSpecial", true);
nbt.putString("id", EntityType.getId(EntityType.BAT).toString());
created = EntityType.loadEntityWithPassengers(nbt, player.getServerWorld(), SpawnReason.LOAD, (entity) -> entity);
PlayerShape.updateShapes(player,  (LivingEntity) created);

I'm curious whether I may be incorrectly interfacing with the mod, or whether there's something wrong with the mod, making Minecraft crash.

Steps to reproduce

  1. Start game
  2. Create world
  3. Wander around a bit in bat form (using my mod)
  4. Crash

Other

I'm new to Minecraft modding, so there's a fair chance I'm doing something wrong. However, on the crash logs it does show that it's specifically crashing in the woodwalkers mod part (I think). If there's anything else I can provide, please do tell!

commented

This error only occurs when running the game via Gradle. I'm not sure what causes the error, but it is most likely a mapping issue in Loom. You should be able to start the game and test it by assembling the mod and installing it in a normal Minecraft instance.

I don't think it is possible to fix this issue within the mod without modifying loom or parchment itself.

EDIT: When you need to run it via gradle, make sure to create a world where no mobs spawn.