OrcaWorld Posted September 9, 2020 Share Posted September 9, 2020 Hey, guys I fixed My first Entity lags and bugs and I created a new Entity. But game crashes again. But I don't know why. Here's crash reports. From CMOD: [19:53:20] [Render thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Client java.lang.IllegalStateException: No renderer registered for kikoriki:chicko at net.minecraft.client.renderer.entity.EntityRendererManager.validateRendererExistence(EntityRendererManager.java:198) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.registry.RenderingRegistry.loadEntityRenderers(RenderingRegistry.java:50) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.client.ClientModLoader.postSidedRunnable(ClientModLoader.java:121) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.ModLoader.lambda$loadMods$14(ModLoader.java:160) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.resources.AsyncReloader.lambda$null$3(AsyncReloader.java:66) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(ThreadTaskExecutor.java:97) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:962) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:590) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_241] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_241] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_241] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-6.1.1.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {} From Crash reports: ---- Minecraft Crash Report ---- // Uh... Did I do that? Time: 09.09.20 19:54 Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:239) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:999) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:619) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:437) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:991) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:590) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_241] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_241] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_241] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-6.1.1.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace: at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:239) at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:999) at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:619) -- Affected level -- Details: All players: 1 total; [ClientPlayerEntity['Dev'/298, l='ClientLevel', x=-15.05, y=71.00, z=-57.02]] Chunk stats: Client Chunk Cache: 841, 537 Level dimension: minecraft:overworld Level spawn location: World: (-16,69,-48), Chunk: (at 0,4,0 in -1,-3; contains blocks -16,0,-48 to -1,255,-33), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Level time: 337 game time, 337 day time Server brand: forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.world.ClientWorld.fillCrashReport(ClientWorld.java:465) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2048) at net.minecraft.client.Minecraft.run(Minecraft.java:611) at net.minecraft.client.main.Main.main(Main.java:184) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) -- System Details -- Details: Minecraft Version: 1.16.2 Minecraft Version ID: 1.16.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_241, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 385074808 bytes (367 MB) / 933232640 bytes (890 MB) up to 1776812032 bytes (1694 MB) CPUs: 8 JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ModLauncher: 6.1.1+74+master.966c698 ModLauncher launch target: fmluserdevclient ModLauncher naming: mcp ModLauncher services: /mixin-0.8.jar mixin PLUGINSERVICE /eventbus-3.0.3-service.jar eventbus PLUGINSERVICE /forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-launcher.jar object_holder_definalize PLUGINSERVICE /forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-launcher.jar runtime_enum_extender PLUGINSERVICE /accesstransformers-2.2.0-shadowed.jar accesstransformer PLUGINSERVICE /forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-launcher.jar capability_inject_definalize PLUGINSERVICE /forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-launcher.jar runtimedistcleaner PLUGINSERVICE /mixin-0.8.jar mixin TRANSFORMATIONSERVICE /forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-launcher.jar fml TRANSFORMATIONSERVICE FML: 33.0 Forge: net.minecraftforge:33.0.21 FML Language Providers: javafml@33.0 minecraft@1 Mod List: client-extra.jar Minecraft {minecraft@1.16.2 DONE} main Kikoriki Mod {kikoriki@1.16.2-1.0.0 DONE} forge-1.16.2-33.0.21_mapped_snapshot_20200514-1.16-recomp.jar Forge {forge@33.0.21 DONE} Launched Version: MOD_DEV Backend library: LWJGL version 3.2.2 build 10 Backend API: AMD Radeon(TM) Vega 8 Graphics GL version 4.6.13560 Compatibility Profile Context 26.20.11030.4004, ATI Technologies Inc. GL Caps: Using framebuffer using OpenGL 3.0 Using VBOs: Yes Is Modded: Definitely; Client brand changed to 'forge' Type: Client (map_client.txt) Graphics mode: fancy Resource Packs: Current Language: Русский (Россия) CPU: 8x AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx And here ModEntityTypes class maybe here I have error: package com.kikoriki.orca.init; import com.kikoriki.orca.KikorikiCore; import com.kikoriki.orca.entity.ChickoEntity; import com.kikoriki.orca.entity.KrashEntity; import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class ModEntityTypes { public static DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITIES, KikorikiCore.MOD_ID); public static final RegistryObject<EntityType<KrashEntity>> KRASH = ENTITY_TYPES.register("krash", () -> EntityType.Builder.create(KrashEntity::new, EntityClassification.CREATURE) .size(1.0f, 0.6f) .build(new ResourceLocation(KikorikiCore.MOD_ID, "krash").toString())); public static final RegistryObject<EntityType<ChickoEntity>> CHICKO = ENTITY_TYPES.register("chicko", () -> EntityType.Builder.create(ChickoEntity::new, EntityClassification.CREATURE) .size(1.0f, 0.6f) .build(new ResourceLocation(KikorikiCore.MOD_ID, "chicko").toString())); } And here's New Entity's Render , maybe it have problems: package com.kikoriki.orca.client.render; import com.kikoriki.orca.KikorikiCore; import com.kikoriki.orca.client.model.ChickoModel; import com.kikoriki.orca.entity.ChickoEntity; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.util.ResourceLocation; public class ChickoRenderer extends MobRenderer<ChickoEntity, ChickoModel<ChickoEntity>> { protected static final ResourceLocation TEXTURE = new ResourceLocation(KikorikiCore.MOD_ID, "textures/chicko.png"); public ChickoRenderer(EntityRendererManager renderManagerIn) { super(renderManagerIn, new ChickoModel<ChickoEntity>(), 0.8F); } @Override public ResourceLocation getEntityTexture(ChickoEntity entity) { return TEXTURE; } } Interesting fact: My first Entity , have the same render, but game don't crash(yeah, I just copied it's render). Here's entity code, maybe here some problems: package com.kikoriki.orca.entity; import java.util.UUID; import java.util.function.Predicate; import javax.annotation.Nullable; import com.kikoriki.orca.init.ModEntityTypes; import net.minecraft.block.BlockState; import net.minecraft.entity.AgeableEntity; import net.minecraft.entity.Entity; import net.minecraft.entity.EntitySize; import net.minecraft.entity.EntityType; import net.minecraft.entity.IAngerable; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.MobEntity; import net.minecraft.entity.Pose; import net.minecraft.entity.ai.attributes.AttributeModifierMap; import net.minecraft.entity.ai.attributes.Attributes; import net.minecraft.entity.ai.goal.*; import net.minecraft.entity.monster.AbstractSkeletonEntity; import net.minecraft.entity.monster.CreeperEntity; import net.minecraft.entity.monster.GhastEntity; import net.minecraft.entity.passive.AnimalEntity; import net.minecraft.entity.passive.TameableEntity; import net.minecraft.entity.passive.TurtleEntity; import net.minecraft.entity.passive.horse.AbstractHorseEntity; import net.minecraft.entity.passive.horse.LlamaEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.AbstractArrowEntity; import net.minecraft.item.DyeColor; import net.minecraft.item.DyeItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.item.crafting.Ingredient; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.datasync.DataParameter; import net.minecraft.network.datasync.DataSerializers; import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.particles.ParticleTypes; import net.minecraft.util.ActionResultType; import net.minecraft.util.DamageSource; import net.minecraft.util.Hand; import net.minecraft.util.RangedInteger; import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvents; import net.minecraft.util.TickRangeConverter; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; public class ChickoEntity extends TameableEntity implements IAngerable { private static final DataParameter<Boolean> BEGGING = EntityDataManager.createKey(net.minecraft.entity.passive.WolfEntity.class, DataSerializers.BOOLEAN); private static final DataParameter<Integer> COLLAR_COLOR = EntityDataManager.createKey(net.minecraft.entity.passive.WolfEntity.class, DataSerializers.VARINT); private static final Ingredient TEMPTATION_ITEMS = Ingredient.fromItems(Items.BROWN_MUSHROOM); private static final DataParameter<Integer> field_234232_bz_ = EntityDataManager.createKey(net.minecraft.entity.passive.WolfEntity.class, DataSerializers.VARINT); public static final Predicate<LivingEntity> TARGET_ENTITIES = (p_213440_0_) -> { EntityType<?> entitytype = p_213440_0_.getType(); return entitytype == EntityType.SHEEP || entitytype == EntityType.RABBIT || entitytype == EntityType.FOX; }; private float headRotationCourse; private float headRotationCourseOld; private boolean isWet; private boolean isShaking; private float timeWolfIsShaking; private float prevTimeWolfIsShaking; private static final RangedInteger field_234230_bG_ = TickRangeConverter.func_233037_a_(20, 39); private UUID field_234231_bH_; public ChickoEntity(EntityType<? extends com.kikoriki.orca.entity.ChickoEntity> type, World worldIn) { super(type, worldIn); this.setTamed(false); } protected void registerGoals() { this.goalSelector.addGoal(1, new SwimGoal(this)); this.goalSelector.addGoal(2, new SitGoal(this)); this.goalSelector.addGoal(3, new com.kikoriki.orca.entity.ChickoEntity.AvoidEntityGoal(this, LlamaEntity.class, 24.0F, 1.5D, 1.5D)); this.goalSelector.addGoal(4, new LeapAtTargetGoal(this, 0.4F)); this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0D, true)); this.goalSelector.addGoal(6, new FollowOwnerGoal(this, 1.0D, 10.0F, 2.0F, false)); this.goalSelector.addGoal(7, new BreedGoal(this, 1.0D)); this.goalSelector.addGoal(8, new WaterAvoidingRandomWalkingGoal(this, 1.0D)); this.goalSelector.addGoal(9, new TemptGoal(this, 1.2D, false, TEMPTATION_ITEMS)); this.goalSelector.addGoal(10, new LookAtGoal(this, PlayerEntity.class, 8.0F)); this.goalSelector.addGoal(10, new LookRandomlyGoal(this)); this.targetSelector.addGoal(1, new OwnerHurtByTargetGoal(this)); this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this)); this.targetSelector.addGoal(3, (new HurtByTargetGoal(this)).setCallsForHelp()); this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, 10, true, false, this::func_233680_b_)); this.targetSelector.addGoal(5, new NonTamedTargetGoal<>(this, AnimalEntity.class, false, TARGET_ENTITIES)); this.targetSelector.addGoal(6, new NonTamedTargetGoal<>(this, TurtleEntity.class, false, TurtleEntity.TARGET_DRY_BABY)); this.targetSelector.addGoal(7, new NearestAttackableTargetGoal<>(this, AbstractSkeletonEntity.class, false)); this.targetSelector.addGoal(8, new ResetAngerGoal<>(this, true)); } public static AttributeModifierMap.MutableAttribute func_234233_eS_() { return MobEntity.func_233666_p_().func_233815_a_(Attributes.field_233821_d_, (double) 0.3F).func_233815_a_(Attributes.field_233818_a_, 8.0D).func_233815_a_(Attributes.field_233823_f_, 2.0D); } protected void registerData() { super.registerData(); this.dataManager.register(BEGGING, false); this.dataManager.register(COLLAR_COLOR, DyeColor.RED.getId()); this.dataManager.register(field_234232_bz_, 0); } protected void playStepSound(BlockPos pos, BlockState blockIn) { this.playSound(SoundEvents.ENTITY_RABBIT_JUMP, 0.15F, 1.0F); } public void writeAdditional(CompoundNBT compound) { super.writeAdditional(compound); compound.putByte("CollarColor", (byte) this.getCollarColor().getId()); this.func_233682_c_(compound); } /** * (abstract) Protected helper method to read subclass entity data from NBT. */ public void readAdditional(CompoundNBT compound) { super.readAdditional(compound); if (compound.contains("CollarColor", 99)) { this.setCollarColor(DyeColor.byId(compound.getInt("CollarColor"))); } this.func_241358_a_((ServerWorld) this.world, compound); } protected SoundEvent getAmbientSound() { if (this.func_233678_J__()) { return SoundEvents.ENTITY_RABBIT_ATTACK; } else if (this.rand.nextInt(3) == 0) { return this.isTamed() && this.getHealth() < 10.0F ? SoundEvents.ENTITY_RABBIT_AMBIENT : SoundEvents.ENTITY_RABBIT_AMBIENT; } else { return SoundEvents.ENTITY_RABBIT_AMBIENT; } } protected SoundEvent getHurtSound(DamageSource damageSourceIn) { return SoundEvents.ENTITY_RABBIT_HURT; } protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_RABBIT_DEATH; } /** * Returns the volume for the sounds this mob makes. */ protected float getSoundVolume() { return 0.4F; } /** * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons * use this to react to sunlight and start to burn. */ public void livingTick() { super.livingTick(); if (!this.world.isRemote && this.isWet && !this.isShaking && !this.hasPath() && this.onGround) { this.isShaking = true; this.timeWolfIsShaking = 0.0F; this.prevTimeWolfIsShaking = 0.0F; this.world.setEntityState(this, (byte) 8); } if (!this.world.isRemote) { this.func_241359_a_((ServerWorld) this.world, true); } } /** * Called to update the entity's position/logic. */ public void tick() { super.tick(); if (this.isAlive()) { this.headRotationCourseOld = this.headRotationCourse; if (this.isBegging()) { this.headRotationCourse += (1.0F - this.headRotationCourse) * 0.4F; } else { this.headRotationCourse += (0.0F - this.headRotationCourse) * 0.4F; } if (this.isInWaterRainOrBubbleColumn()) { this.isWet = true; if (this.isShaking && !this.world.isRemote) { this.world.setEntityState(this, (byte) 56); this.func_242326_eZ(); } } else if ((this.isWet || this.isShaking) && this.isShaking) { if (this.timeWolfIsShaking == 0.0F) { this.playSound(SoundEvents.ENTITY_WOLF_SHAKE, this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); } this.prevTimeWolfIsShaking = this.timeWolfIsShaking; this.timeWolfIsShaking += 0.05F; if (this.prevTimeWolfIsShaking >= 2.0F) { this.isWet = false; this.isShaking = false; this.prevTimeWolfIsShaking = 0.0F; this.timeWolfIsShaking = 0.0F; } if (this.timeWolfIsShaking > 0.4F) { float f = (float) this.getPosY(); int i = (int) (MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float) Math.PI) * 7.0F); Vector3d vector3d = this.getMotion(); for (int j = 0; j < i; ++j) { float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.getWidth() * 0.5F; float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.getWidth() * 0.5F; this.world.addParticle(ParticleTypes.SPLASH, this.getPosX() + (double) f1, (double) (f + 0.8F), this.getPosZ() + (double) f2, vector3d.x, vector3d.y, vector3d.z); } } } } } private void func_242326_eZ() { this.isShaking = false; this.timeWolfIsShaking = 0.0F; this.prevTimeWolfIsShaking = 0.0F; } /** * Called when the mob's health reaches 0. */ public void onDeath(DamageSource cause) { this.isWet = false; this.isShaking = false; this.prevTimeWolfIsShaking = 0.0F; this.timeWolfIsShaking = 0.0F; super.onDeath(cause); } /** * True if the wolf is wet */ @OnlyIn(Dist.CLIENT) public boolean isWolfWet() { return this.isWet; } /** * Used when calculating the amount of shading to apply while the wolf is wet. */ @OnlyIn(Dist.CLIENT) public float getShadingWhileWet(float p_70915_1_) { return Math.min(0.0F + MathHelper.lerp(p_70915_1_, this.prevTimeWolfIsShaking, this.timeWolfIsShaking) / 0.0F * 0.0F, 0.0F); } @OnlyIn(Dist.CLIENT) public float getShakeAngle(float p_70923_1_, float p_70923_2_) { float f = (MathHelper.lerp(p_70923_1_, this.prevTimeWolfIsShaking, this.timeWolfIsShaking) + p_70923_2_) / 0.0F; if (f < 0.0F) { f = 0.0F; } else if (f > 0.0F) { f = 0.0F; } return MathHelper.sin(f * (float) Math.PI) * MathHelper.sin(f * (float) Math.PI * 0.0F) * 0.0F * (float) Math.PI; } @OnlyIn(Dist.CLIENT) public float getInterestedAngle(float p_70917_1_) { return MathHelper.lerp(p_70917_1_, this.headRotationCourseOld, this.headRotationCourse) * 0.0F * (float) Math.PI; } protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn) { return sizeIn.height * 0.8F; } /** * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently * use in wolves. */ public int getVerticalFaceSpeed() { return this.func_233684_eK_() ? 20 : super.getVerticalFaceSpeed(); } /** * Called when the entity is attacked. */ public boolean attackEntityFrom(DamageSource source, float amount) { if (this.isInvulnerableTo(source)) { return false; } else { Entity entity = source.getTrueSource(); this.func_233687_w_(false); if (entity != null && !(entity instanceof PlayerEntity) && !(entity instanceof AbstractArrowEntity)) { amount = (amount + 1.0F) / 2.0F; } return super.attackEntityFrom(source, amount); } } public boolean attackEntityAsMob(Entity entityIn) { boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float) ((int) this.func_233637_b_(Attributes.field_233823_f_))); if (flag) { this.applyEnchantments(this, entityIn); } return flag; } public void setTamed(boolean tamed) { super.setTamed(tamed); if (tamed) { this.getAttribute(Attributes.field_233818_a_).setBaseValue(200.0D); this.setHealth(200.0F); } else { this.getAttribute(Attributes.field_233818_a_).setBaseValue(8.0D); } this.getAttribute(Attributes.field_233823_f_).setBaseValue(4.0D); } public ActionResultType func_230254_b_(PlayerEntity p_230254_1_, Hand p_230254_2_) { ItemStack itemstack = p_230254_1_.getHeldItem(p_230254_2_); Item item = itemstack.getItem(); if (this.world.isRemote) { boolean flag = this.isOwner(p_230254_1_) || this.isTamed() || item == Items.BROWN_MUSHROOM && !this.isTamed() && !this.func_233678_J__(); return flag ? ActionResultType.CONSUME : ActionResultType.PASS; } else { if (this.isTamed()) { if (this.isBreedingItem(itemstack) && this.getHealth() < this.getMaxHealth()) { if (!p_230254_1_.abilities.isCreativeMode) { itemstack.shrink(1); } this.heal((float) item.getFood().getHealing()); return ActionResultType.SUCCESS; } if (!(item instanceof DyeItem)) { ActionResultType actionresulttype = super.func_230254_b_(p_230254_1_, p_230254_2_); if ((!actionresulttype.isSuccessOrConsume() || this.isChild()) && this.isOwner(p_230254_1_)) { this.func_233687_w_(!this.func_233685_eM_()); this.isJumping = false; this.navigator.clearPath(); this.setAttackTarget((LivingEntity) null); return ActionResultType.SUCCESS; } return actionresulttype; } DyeColor dyecolor = ((DyeItem) item).getDyeColor(); if (dyecolor != this.getCollarColor()) { this.setCollarColor(dyecolor); if (!p_230254_1_.abilities.isCreativeMode) { itemstack.shrink(1); } return ActionResultType.SUCCESS; } } else if (item == Items.BROWN_MUSHROOM && !this.func_233678_J__()) { if (!p_230254_1_.abilities.isCreativeMode) { itemstack.shrink(1); } if (this.rand.nextInt(3) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, p_230254_1_)) { this.setTamedBy(p_230254_1_); this.navigator.clearPath(); this.setAttackTarget((LivingEntity) null); this.func_233687_w_(true); this.world.setEntityState(this, (byte) 7); } else { this.world.setEntityState(this, (byte) 6); } return ActionResultType.SUCCESS; } return super.func_230254_b_(p_230254_1_, p_230254_2_); } } /** * Handler for {@link World#setEntityState} */ @OnlyIn(Dist.CLIENT) public void handleStatusUpdate(byte id) { if (id == 8) { this.isShaking = true; this.timeWolfIsShaking = 0.0F; this.prevTimeWolfIsShaking = 0.0F; } else if (id == 56) { this.func_242326_eZ(); } else { super.handleStatusUpdate(id); } } @OnlyIn(Dist.CLIENT) public float getTailRotation() { if (this.func_233678_J__()) { return 1.5393804F; } else { return this.isTamed() ? (0.0F - (this.getMaxHealth() - this.getHealth()) * 0.0F) * (float) Math.PI : ((float) Math.PI / 0F); } } /** * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on * the animal type) */ public boolean isBreedingItem(ItemStack stack) { Item item = stack.getItem(); return item.isFood() && item.getFood().isMeat(); } /** * Will return how many at most can spawn in a chunk at once. */ public int getMaxSpawnedInChunk() { return 8; } public int func_230256_F__() { return this.dataManager.get(field_234232_bz_); } public void func_230260_a__(int p_230260_1_) { this.dataManager.set(field_234232_bz_, p_230260_1_); } public void func_230258_H__() { this.func_230260_a__(field_234230_bG_.func_233018_a_(this.rand)); } @Nullable public UUID func_230257_G__() { return this.field_234231_bH_; } public void func_230259_a_(@Nullable UUID p_230259_1_) { this.field_234231_bH_ = p_230259_1_; } public DyeColor getCollarColor() { return DyeColor.byId(this.dataManager.get(COLLAR_COLOR)); } public void setCollarColor(DyeColor collarcolor) { this.dataManager.set(COLLAR_COLOR, collarcolor.getId()); } public com.kikoriki.orca.entity.ChickoEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_) { com.kikoriki.orca.entity.ChickoEntity chickoentity = ModEntityTypes.CHICKO.get().create(p_241840_1_); UUID uuid = this.getOwnerId(); if (uuid != null) { chickoentity.setOwnerId(uuid); chickoentity.setTamed(true); } return chickoentity; } public void setBegging(boolean beg) { this.dataManager.set(BEGGING, beg); } /** * Returns true if the mob is currently able to mate with the specified mob. */ public boolean canMateWith(AnimalEntity otherAnimal) { if (otherAnimal == this) { return false; } else if (!this.isTamed()) { return false; } else if (!(otherAnimal instanceof com.kikoriki.orca.entity.ChickoEntity)) { return false; } else { com.kikoriki.orca.entity.ChickoEntity chickoentity = (com.kikoriki.orca.entity.ChickoEntity) otherAnimal; if (!chickoentity.isTamed()) { return false; } else if (chickoentity.func_233684_eK_()) { return false; } else { return this.isInLove() && chickoentity.isInLove(); } } } public boolean isBegging() { return this.dataManager.get(BEGGING); } public boolean shouldAttackEntity(LivingEntity target, LivingEntity owner) { if (!(target instanceof CreeperEntity) && !(target instanceof GhastEntity)) { if (target instanceof net.minecraft.entity.passive.WolfEntity) { com.kikoriki.orca.entity.ChickoEntity chickoentity = (com.kikoriki.orca.entity.ChickoEntity) target; return !chickoentity.isTamed() || chickoentity.getOwner() != owner; } else if (target instanceof PlayerEntity && owner instanceof PlayerEntity && !((PlayerEntity) owner).canAttackPlayer((PlayerEntity) target)) { return false; } else if (target instanceof AbstractHorseEntity && ((AbstractHorseEntity) target).isTame()) { return false; } else { return !(target instanceof TameableEntity) || !((TameableEntity) target).isTamed(); } } else { return false; } } public boolean canBeLeashedTo(PlayerEntity player) { return !this.func_233678_J__() && super.canBeLeashedTo(player); } @OnlyIn(Dist.CLIENT) public Vector3d func_241205_ce_() { return new Vector3d(0.0D, (double) (0.6F * this.getEyeHeight()), (double) (this.getWidth() * 0.4F)); } class AvoidEntityGoal<T extends LivingEntity> extends net.minecraft.entity.ai.goal.AvoidEntityGoal<T> { private final com.kikoriki.orca.entity.ChickoEntity chicko; public AvoidEntityGoal(com.kikoriki.orca.entity.ChickoEntity chickoIn, Class<T> entityClassToAvoidIn, float avoidDistanceIn, double farSpeedIn, double nearSpeedIn) { super(chickoIn, entityClassToAvoidIn, avoidDistanceIn, farSpeedIn, nearSpeedIn); this.chicko = chickoIn; } /** * Returns whether execution should begin. You can also read and cache any state necessary for execution in this * method as well. */ public boolean shouldExecute() { if (super.shouldExecute() && this.avoidTarget instanceof LlamaEntity) { return !this.chicko.isTamed() && this.avoidLlama((LlamaEntity) this.avoidTarget); } else { return false; } } private boolean avoidLlama(LlamaEntity llamaIn) { return llamaIn.getStrength() >= com.kikoriki.orca.entity.ChickoEntity.this.rand.nextInt(5); } /** * Execute a one shot task or start executing a continuous task */ public void startExecuting() { com.kikoriki.orca.entity.ChickoEntity.this.setAttackTarget((LivingEntity) null); super.startExecuting(); } /** * Keep ticking a continuous task that has already been started */ public void tick() { com.kikoriki.orca.entity.ChickoEntity.this.setAttackTarget((LivingEntity) null); super.tick(); } } } And final, Mod Core, maybe here problems: package com.kikoriki.orca; import com.kikoriki.orca.entity.ChickoEntity; import com.kikoriki.orca.entity.KrashEntity; import com.kikoriki.orca.init.ModEntityTypes; import com.kikoriki.orca.init.ModItems; import net.minecraft.block.Blocks; import net.minecraft.entity.ai.attributes.GlobalEntityTypeAttributes; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.DeferredWorkQueue; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @Mod("kikoriki") public class KikorikiCore { private static final Logger LOGGER = LogManager.getLogger(); public static final String MOD_ID = "kikoriki"; public KikorikiCore() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); ModItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); ModEntityTypes.ENTITY_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus()); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { DeferredWorkQueue.runLater(() -> { GlobalEntityTypeAttributes.put(ModEntityTypes.KRASH.get(), KrashEntity.func_234233_eS_().func_233813_a_()); GlobalEntityTypeAttributes.put(ModEntityTypes.CHICKO.get(), ChickoEntity.func_234233_eS_().func_233813_a_()); }); } private void doClientStuff(final FMLClientSetupEvent event) { } public static final ItemGroup TAB = new ItemGroup("kikoriki") { @Override public ItemStack createIcon() { return new ItemStack(Blocks.OXEYE_DAISY); } }; } Well, answer me if you know why game crashed. Quote Link to comment Share on other sites More sharing options...
Beethoven92 Posted September 9, 2020 Share Posted September 9, 2020 Quote java.lang.IllegalStateException: No renderer registered for kikoriki:chicko You forgot to register your entity renderer Quote Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port Link to comment Share on other sites More sharing options...
OrcaWorld Posted September 9, 2020 Author Share Posted September 9, 2020 Umm... I can look to stupid in your eyes Beethoven92, but that means? Because my first entity succefully got his renderer, can you tell how to do it? Quote Link to comment Share on other sites More sharing options...
Beethoven92 Posted September 9, 2020 Share Posted September 9, 2020 Well, you have to bind an entity to its renderer. You have to do this in your client setup event with RenderingRegistry#registerEntityRenderingHandler Quote Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port Link to comment Share on other sites More sharing options...
OrcaWorld Posted September 9, 2020 Author Share Posted September 9, 2020 A! Yes I forget about this! Oh, I was so fool. Thank you! Quote Link to comment Share on other sites More sharing options...
Beethoven92 Posted September 9, 2020 Share Posted September 9, 2020 (edited) You're welcome...Does it work correctly now? Edited September 9, 2020 by Beethoven92 1 Quote Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port Link to comment Share on other sites More sharing options...
OrcaWorld Posted September 9, 2020 Author Share Posted September 9, 2020 Yes! Quote Link to comment Share on other sites More sharing options...
Draco18s Posted September 9, 2020 Share Posted September 9, 2020 TLDR: Learn to read your damn crash logs. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
Recommended Posts
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.