版本信息
你使用的IDE:
你使用的IDE版本:<2019.3.2.0>
Forge版本: <forge-1.15.2-31.1.0>
Minecraft版本: <1.15.2>
错误情况简述
我按照mcjty的教程添加了一个实体,并且代码没有错误,可以正常进入游戏,但是在游戏里面召唤一个自己添加的实体时,游戏直接崩溃了。
报错日志
<这个是加载游戏界面过程中的错误代码>
java.lang.IllegalStateException: No renderer registered for specialitem:suicide_bomber
at net.minecraft.client.renderer.entity.EntityRendererManager.validateRendererExistence(EntityRendererManager.java:192) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraftforge.fml.client.registry.RenderingRegistry.loadEntityRenderers(RenderingRegistry.java:50) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
at net.minecraftforge.fml.client.ClientModLoader.postSidedRunnable(ClientModLoader.java:127) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraftforge.fml.ModLoader.lambda$loadMods$14(ModLoader.java:158) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
at net.minecraft.resources.AsyncReloader.lambda$null$3(AsyncReloader.java:66) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:140) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:110) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(ThreadTaskExecutor.java:97) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:930) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.run(Minecraft.java:554) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.main.Main.main(Main.java:177) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162] {}
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162] {}
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162] {}
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162] {}
at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.0.0-milestone.4.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.0.0-milestone.4.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.0.0-milestone.4.jar:?] {}
at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.0.0-milestone.4.jar:?] {}
at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.0.0-milestone.4.jar:?] {}
at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {}
[18:39:22] [Forge Version Check/WARN] [ne.mi.fm.VersionChecker/]: Failed to process update information
java.io.IOException: Server returned HTTP response code: 400 for URL: http://myurl.me/
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_162] {}
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_162] {}
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_162] {}
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_162] {}
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1944) ~[?:1.8.0_162] {}
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1939) ~[?:1.8.0_162] {}
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_162] {}
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1938) ~[?:1.8.0_162] {}
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1508) ~[?:1.8.0_162] {}
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) ~[?:1.8.0_162] {}
at net.minecraftforge.fml.VersionChecker$1.openUrlStream(VersionChecker.java:189) ~[?:?] {re:classloading}
at net.minecraftforge.fml.VersionChecker$1.process(VersionChecker.java:206) ~[?:?] {re:classloading}
at java.lang.Iterable.forEach(Iterable.java:75) [?:1.8.0_162] {}
at net.minecraftforge.fml.VersionChecker$1.run(VersionChecker.java:157) [?:?] {re:classloading}
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: http://myurl.me/
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) ~[?:1.8.0_162] {}
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) ~[?:1.8.0_162] {}
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) ~[?:1.8.0_162] {}
at net.minecraftforge.fml.VersionChecker$1.openUrlStream(VersionChecker.java:173) ~[?:?] {re:classloading}
... 3 more
<这个是用“/summon”指令召唤实体后的错误代码>
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[authlib-1.5.25.jar:?] {}
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) ~[authlib-1.5.25.jar:?] {}
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) ~[authlib-1.5.25.jar:?] {}
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) ~[authlib-1.5.25.jar:?] {}
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716) ~[guava-21.0.jar:?] {}
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) ~[guava-21.0.jar:?] {}
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) ~[guava-21.0.jar:?] {}
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) ~[guava-21.0.jar:?] {}
at com.google.common.cache.LocalCache.get(LocalCache.java:4154) ~[guava-21.0.jar:?] {}
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158) ~[guava-21.0.jar:?] {}
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147) ~[guava-21.0.jar:?] {}
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153) ~[guava-21.0.jar:?] {}
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) ~[authlib-1.5.25.jar:?] {}
at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:1990) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.resources.SkinManager.lambda$loadProfileTextures$4(SkinManager.java:96) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402) [?:1.8.0_162] {}
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_162] {}
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_162] {}
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_162] {}
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_162] {}
[18:20:22] [Server thread/INFO] [minecraft/MinecraftServer]: [Dev: 召唤了新的自爆者]
[18:20:22] [Render thread/INFO] [minecraft/NewChatGui]: [CHAT] 召唤了新的自爆者
[18:20:22] [Render thread/FATAL] [minecraft/Minecraft]: Unreported exception thrown!
java.lang.NullPointerException: null
at net.minecraft.client.renderer.entity.EntityRendererManager.func_229086_a_(EntityRendererManager.java:232) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.renderer.WorldRenderer.func_228426_a_(WorldRenderer.java:944) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.renderer.GameRenderer.func_228378_a_(GameRenderer.java:612) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:434) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:957) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.run(Minecraft.java:554) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.main.Main.main(Main.java:177) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162] {}
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162] {}
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162] {}
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162] {}
at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.0.0-milestone.4.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.0.0-milestone.4.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.0.0-milestone.4.jar:?] {}
at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.0.0-milestone.4.jar:?] {}
at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.0.0-milestone.4.jar:?] {}
at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {}
[18:43:12] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 2615ms or 52 ticks behind
相关代码
<实体文件:SuicideBomber.java>
package com.specialitem.specialitem.entity;
import net.minecraft.entity.AgeableEntity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.world.World;
import javax.annotation.Nullable;
public class SuicideBomber extends MonsterEntity {
public SuicideBomber(EntityType<? extends MonsterEntity> type, World p_i48553_2_) {
super(type, p_i48553_2_);
}
@Nullable
public AgeableEntity createChild(AgeableEntity ageable){
return null;
}
}
<模型文件:EntityModel.java>
package com.specialitem.specialitem.entity;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.renderer.model.ModelRenderer;
public class EntityModel extends net.minecraft.client.renderer.entity.model.EntityModel<SuicideBomber> {
public ModelRenderer body;
public EntityModel(){
body = new ModelRenderer(this, 0, 0);
body.func_228300_a_(-3, -3, -3, 6, 6, 6);
}
@Override
public void func_225597_a_(SuicideBomber p_225597_1_, float p_225597_2_, float p_225597_3_, float p_225597_4_, float p_225597_5_, float p_225597_6_) {
}
@Override
public void func_225598_a_(MatrixStack p_225598_1_, IVertexBuilder p_225598_2_, int p_225598_3_, int p_225598_4_, float p_225598_5_, float p_225598_6_, float p_225598_7_, float p_225598_8_) {
body.func_228309_a_(p_225598_1_,p_225598_2_,p_225598_3_,p_225598_4_,p_225598_5_,p_225598_6_,p_225598_7_,p_225598_8_);
}
}
<渲染文件:EntityRenderer.java>
package com.specialitem.specialitem.entity;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.util.ResourceLocation;
import javax.annotation.Nullable;
public class EntityRenderer extends MobRenderer<SuicideBomber, EntityModel> {
private static final ResourceLocation TEXTURE = new ResourceLocation("textures/entity/bomber.png");
public EntityRenderer(EntityRendererManager manager) {
super(manager, new EntityModel(), 0.5f);
}
@Nullable
@Override
public ResourceLocation getEntityTexture(SuicideBomber entity) {
return TEXTURE;
}
}
<注册文件:RegisterHandler.java 的部分代码>
@SubscribeEvent
public static void onEntityRegistry(final RegistryEvent.Register<EntityType<?>> Event){
Event.getRegistry().register(EntityType.Builder.create(SuicideBomber::new, EntityClassification.CREATURE)
.size(1,1)
.setShouldReceiveVelocityUpdates(false)
.build("suicide_bomber")
.setRegistryName("suicide_bomber"));
}
<实体注册文件:EntityHelper.java>
package com.specialitem.specialitem.entity;
import net.minecraft.entity.EntityType;
import net.minecraftforge.registries.ObjectHolder;
public class EntityHelper {
@ObjectHolder("specialitem:suicide_bomber")
public static EntityType<SuicideBomber> SUICIDE_BOMBER;
}