Jump to content

Recommended Posts

Posted

Hi Guys

Im pretty new to Minecraft Modding.

I got myself a preset from a youtube and i want to try adding a "Evolved Zombie". I added Classes for the Entity (Renderer, Model & entity itself).

I added all the Assets, and added a Spawn Egg Item. So far so good.

As i tried spawning the mob by Console or Spawn egg, nothing happens. I only get a large Exception on the console.

I tried reading through the log, but i have no idea what the problem is. I mean i know its a null pointer exception, but i dont know where soething is null.

 

Please send help.

Log is attached

 

Please also if you can speak german, answer me in german, because i can speak better them.

 

latest.log

Posted
public class ModEntityType {

    public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITIES, Tutorial.MOD_ID);

    // Entity Types
    public static final RegistryObject<EntityType<HogEntity>> HOG = ENTITY_TYPES.register("hog",
            () -> EntityType.Builder.create(HogEntity::new, EntityClassification.CREATURE)
                    .size(1.0f, 1.0f) // Hitbox Size
                    .build(new ResourceLocation(Tutorial.MOD_ID, "hog").toString()));

    public static final RegistryObject<EntityType<EvolvedZombieEntity>> EVOLVED_ZOMBIE = ENTITY_TYPES.register("evolved_zombie",
            () -> EntityType.Builder.<EvolvedZombieEntity>create(EvolvedZombieEntity::new, EntityClassification.MONSTER)
                    .size(1.0f, 1.0f)
                    .build(new ResourceLocation(Tutorial.MOD_ID, "evolved_zombie").toString()));


}
public class EvolvedZombieModel<T extends EvolvedZombieEntity> extends ZombieModel<T> {

    public EvolvedZombieModel(float modelSize, boolean p_i1168_2_) {
        super(modelSize, p_i1168_2_);
    }

    protected EvolvedZombieModel(float p_i48914_1_, float p_i48914_2_, int p_i48914_3_, int p_i48914_4_) {
        super(p_i48914_1_, p_i48914_2_, p_i48914_3_, p_i48914_4_);
    }

    public boolean isAggressive(T entityIn) {
        return entityIn.isAggressive();
    }
}
public class EvolvedZombieRenderer extends ZombieRenderer {

    public EvolvedZombieRenderer(EntityRendererManager renderManagerIn) {
        super(renderManagerIn);
    }
}
public class EvolvedZombieEntity extends ZombieEntity {


    public EvolvedZombieEntity(EntityType<? extends ZombieEntity> type, World worldIn) {
        super(type, worldIn);
        Tutorial.LOGGER.log(Level.INFO,toString() + " <-- THIS IS MY INFO");
    }

    public EvolvedZombieEntity(World worldIn) {
        super(worldIn);
    }

    public static AttributeModifierMap.MutableAttribute setCustomAttributes() {
        return MobEntity.func_233666_p_()
                .createMutableAttribute(Attributes.MAX_HEALTH, 10.0D)
                .createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.25D);
    }

    @Override
    public String toString() {
        return "EvolvedZombieEntity{" +
                "livingSoundTime=" + livingSoundTime +
                ",\n experienceValue=" + experienceValue +
                ",\n lookController=" + lookController +
                ",\n moveController=" + moveController +
                ",\n jumpController=" + jumpController +
                ",\n navigator=" + navigator +
                ",\n goalSelector=" + goalSelector +
                ",\n targetSelector=" + targetSelector +
                ",\n inventoryHandsDropChances=" + Arrays.toString(inventoryHandsDropChances) +
                ",\n inventoryArmorDropChances=" + Arrays.toString(inventoryArmorDropChances) +
                ",\n isSwingInProgress=" + isSwingInProgress +
                ",\n swingingHand=" + swingingHand +
                ",\n swingProgressInt=" + swingProgressInt +
                ",\n arrowHitTimer=" + arrowHitTimer +
                ",\n beeStingRemovalCooldown=" + beeStingRemovalCooldown +
                ",\n hurtTime=" + hurtTime +
                ",\n maxHurtTime=" + maxHurtTime +
                ",\n attackedAtYaw=" + attackedAtYaw +
                ",\n deathTime=" + deathTime +
                ",\n prevSwingProgress=" + prevSwingProgress +
                ",\n swingProgress=" + swingProgress +
                ",\n ticksSinceLastSwing=" + ticksSinceLastSwing +
                ",\n prevLimbSwingAmount=" + prevLimbSwingAmount +
                ",\n limbSwingAmount=" + limbSwingAmount +
                ",\n limbSwing=" + limbSwing +
                ",\n maxHurtResistantTime=" + maxHurtResistantTime +
                ",\n randomUnused2=" + randomUnused2 +
                ",\n randomUnused1=" + randomUnused1 +
                ",\n renderYawOffset=" + renderYawOffset +
                ",\n prevRenderYawOffset=" + prevRenderYawOffset +
                ",\n rotationYawHead=" + rotationYawHead +
                ",\n prevRotationYawHead=" + prevRotationYawHead +
                ",\n jumpMovementFactor=" + jumpMovementFactor +
                ",\n attackingPlayer=" + attackingPlayer +
                ",\n recentlyHit=" + recentlyHit +
                ",\n dead=" + dead +
                ",\n idleTime=" + idleTime +
                ",\n prevOnGroundSpeedFactor=" + prevOnGroundSpeedFactor +
                ",\n onGroundSpeedFactor=" + onGroundSpeedFactor +
                ",\n movedDistance=" + movedDistance +
                ",\n prevMovedDistance=" + prevMovedDistance +
                ",\n unused180=" + unused180 +
                ",\n scoreValue=" + scoreValue +
                ",\n lastDamage=" + lastDamage +
                ",\n isJumping=" + isJumping +
                ",\n moveStrafing=" + moveStrafing +
                ",\n moveVertical=" + moveVertical +
                ",\n moveForward=" + moveForward +
                ",\n newPosRotationIncrements=" + newPosRotationIncrements +
                ",\n interpTargetX=" + interpTargetX +
                ",\n interpTargetY=" + interpTargetY +
                ",\n interpTargetZ=" + interpTargetZ +
                ",\n interpTargetYaw=" + interpTargetYaw +
                ",\n interpTargetPitch=" + interpTargetPitch +
                ",\n interpTargetHeadYaw=" + interpTargetHeadYaw +
                ",\n interpTicksHead=" + interpTicksHead +
                ",\n activeItemStack=" + activeItemStack +
                ",\n activeItemStackUseCount=" + activeItemStackUseCount +
                ",\n ticksElytraFlying=" + ticksElytraFlying +
                ",\n spinAttackDuration=" + spinAttackDuration +
                ",\n brain=" + brain +
                ",\n preventEntitySpawning=" + preventEntitySpawning +
                ",\n rideCooldown=" + rideCooldown +
                ",\n forceSpawn=" + forceSpawn +
                ",\n world=" + world +
                ",\n prevPosX=" + prevPosX +
                ",\n prevPosY=" + prevPosY +
                ",\n prevPosZ=" + prevPosZ +
                ",\n rotationYaw=" + rotationYaw +
                ",\n rotationPitch=" + rotationPitch +
                ",\n prevRotationYaw=" + prevRotationYaw +
                ",\n prevRotationPitch=" + prevRotationPitch +
                ",\n onGround=" + onGround +
                ",\n collidedHorizontally=" + collidedHorizontally +
                ",\n collidedVertically=" + collidedVertically +
                ",\n velocityChanged=" + velocityChanged +
                ",\n motionMultiplier=" + motionMultiplier +
                ",\n removed=" + removed +
                ",\n prevDistanceWalkedModified=" + prevDistanceWalkedModified +
                ",\n distanceWalkedModified=" + distanceWalkedModified +
                ",\n distanceWalkedOnStepModified=" + distanceWalkedOnStepModified +
                ",\n fallDistance=" + fallDistance +
                ",\n lastTickPosX=" + lastTickPosX +
                ",\n lastTickPosY=" + lastTickPosY +
                ",\n lastTickPosZ=" + lastTickPosZ +
                ",\n stepHeight=" + stepHeight +
                ",\n noClip=" + noClip +
                ",\n entityCollisionReduction=" + entityCollisionReduction +
                ",\n rand=" + rand +
                ",\n ticksExisted=" + ticksExisted +
                ",\n inWater=" + inWater +
                ",\n eyesFluidLevel=" + eyesFluidLevel +
                ",\n eyesInWater=" + eyesInWater +
                ",\n field_241335_O_=" + field_241335_O_ +
                ",\n inLava=" + inLava +
                ",\n hurtResistantTime=" + hurtResistantTime +
                ",\n firstUpdate=" + firstUpdate +
                ",\n dataManager=" + dataManager +
                ",\n addedToChunk=" + addedToChunk +
                ",\n chunkCoordX=" + chunkCoordX +
                ",\n chunkCoordY=" + chunkCoordY +
                ",\n chunkCoordZ=" + chunkCoordZ +
                ",\n serverPosX=" + serverPosX +
                ",\n serverPosY=" + serverPosY +
                ",\n serverPosZ=" + serverPosZ +
                ",\n ignoreFrustumCheck=" + ignoreFrustumCheck +
                ",\n isAirBorne=" + isAirBorne +
                ",\n timeUntilPortal=" + timeUntilPortal +
                ",\n inPortal=" + inPortal +
                ",\n portalCounter=" + portalCounter +
                ",\n lastPortalPos=" + lastPortalPos +
                ",\n lastPortalVec=" + lastPortalVec +
                ",\n teleportDirection=" + teleportDirection +
                ",\n entityUniqueID=" + entityUniqueID +
                ",\n cachedUniqueIdString='" + cachedUniqueIdString + '\'' +
                ",\n glowing=" + glowing +
                '}';
    }
}

 

Posted

So i updated all to version 1.16.5.

I also added 

@Override
    public IPacket<?> createSpawnPacket() {
        return NetworkHooks.getEntitySpawningPacket(this);
    }

in EvolvedZombieEntity.java.

but it is still not working....

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.