Everything posted by Peerius
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
And now?
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
Okay, this is the first time for me using github, so hopefully everything works fine. I testet it locally and it worked.. https://github.com/Peerius1701/Peerius.git
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
No, I'm not learning modding with java, but I'm learning it in my studies, but I don't have that much experience yet and I also noticed that modding is quite different to other programming projects. Okay, thank you It also works.. but the particles still not spawn yet and my entity is still invisible.
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
You are right, thank you. I removed this section. Also removed.. found this somewhere in vanilla code.. I guess it was LlamaSpitEntity. *Sigh* I think I have big comprehension problems concerning this topic. I have changed it to the following: public final EntityType<HeartEntity> HEART = RegistryHandler.HEART_ENTITY.get(); But then I had the error "Cannot refer to an instance field HeartEntity.HEART while explicitly invoking a constructor" in the constructors and that's why I changed them to: public HeartEntity(double x, double y, double z, World worldIn) { super(RegistryHandler.HEART_ENTITY.get(), x, y, z, worldIn); } and I think that's wrong as well, but I had no better solution.. Since you said, HarryTalks has no idea what he's talking about - Can you recommend tutorials? I don't want to annoy anyone in this forum with my java problems, because I'm currently learning it.
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
This could be possible as my entity is invisible ? Here is my entity class: @ObjectHolder(DeepAffection.modid) public class HeartEntity extends ProjectileItemEntity { @ObjectHolder("heart_entity") public static final EntityType<HeartEntity> HEART = RegistryHandler.HEART_ENTITY.get(); @OnlyIn(Dist.CLIENT) public HeartEntity(double x, double y, double z, World worldIn) { super(HeartEntity.HEART, x, y, z, worldIn); } protected HeartEntity(LivingEntity livingEntityIn, World worldIn) { super(HeartEntity.HEART, livingEntityIn, worldIn); } public HeartEntity(FMLPlayMessages.SpawnEntity packet, World world) { super(HeartEntity.HEART, world); } @Override public IPacket<?> createSpawnPacket() { return NetworkHooks.getEntitySpawningPacket(this); } @Override protected void onImpact(RayTraceResult result) { if (result instanceof EntityRayTraceResult) { EntityRayTraceResult entityRayTraceResult = (EntityRayTraceResult) result; if(entityRayTraceResult.getEntity() instanceof AnimalEntity) { MobEntity entity = (MobEntity) entityRayTraceResult.getEntity(); entity.addPotionEffect(new EffectInstance(Effects.REGENERATION,100,2)); this.remove(); } else if(entityRayTraceResult.getEntity() instanceof PlayerEntity) { PlayerEntity entity = (PlayerEntity) entityRayTraceResult.getEntity(); entity.addPotionEffect(new EffectInstance(Effects.REGENERATION,100,2)); this.remove(); }else if(entityRayTraceResult.getEntity() instanceof MonsterEntity) { MobEntity entity = (MobEntity) entityRayTraceResult.getEntity(); entity.addPotionEffect(new EffectInstance(Effects.SLOWNESS,100,10)); this.remove(); } } else if (result instanceof BlockRayTraceResult) { BlockRayTraceResult blockRayTraceResult = (BlockRayTraceResult) result; World world = this.world; Block block = world.getBlockState(blockRayTraceResult.getPos()).getBlock(); if(block == Blocks.GRASS_BLOCK) { world.setBlockState(blockRayTraceResult.getPos(), BlockList.pink_grass_block.getDefaultState()); Vec3d vec = blockRayTraceResult.getHitVec(); double x = vec.getX(); double y = vec.getY(); double z = vec.getZ(); this.setMotion(x,y,z); this.remove(); } Vec3d vec = blockRayTraceResult.getHitVec(); double x = vec.getX(); double y = vec.getY(); double z = vec.getZ(); this.setMotion(x,y,z); this.remove(); } } public void tick() { super.tick(); if(!this.world.isRemote) { Vec3d vec3d = this.getMotion(); double d0 = this.getPosX() + vec3d.x; double d1 = this.getPosY() + vec3d.y; double d2 = this.getPosZ() + vec3d.z; this.world.addParticle(ParticleTypes.HEART, d0 - vec3d.x * 0.25D, d1 - vec3d.y * 0.25D, d2 - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z); } } @Override protected Item getDefaultItem() { return ItemList.heart; } } And my registration code: public class RegistryHandler { public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = new DeferredRegister<>(ForgeRegistries.ENTITIES, DeepAffection.modid); public static void init(){ ENTITY_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus()); } public static final RegistryObject<EntityType<HeartEntity>> HEART_ENTITY = ENTITY_TYPES.register("heart_entity", () -> EntityType.Builder.<HeartEntity>create(EntityClassification.MISC).size(0.5F, 0.5F).build("heart_entity")); } And this could also be relevant: @Mod("deepaffection") public class DeepAffection { public static DeepAffection instance; public static final String modid = "deepaffection"; private static final Logger Logger = LogManager.getLogger(modid); public static final ItemGroup group = new DeepAffectionItemGroup(); public DeepAffection() { instance = this; FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientRegistries); RegistryHandler.init(); MinecraftForge.EVENT_BUS.register(this); } private void clientRegistries(final FMLClientSetupEvent event) { DeepAffectionRenderRegistry.registryEntityRenders(); DeepAffectionItemRender.render(); Logger.info("clientRegistries method registred."); } ... @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents{ ... @SubscribeEvent public void registerEntities(final RegistryEvent.Register<EntityType<?>> event) { event.getRegistry().registerAll ( HeartEntity.HEART ); Logger.info("Entities registred."); } } And for completeness my renderer for the entity: @OnlyIn(Dist.CLIENT) public class DeepAffectionRenderRegistry { public static void registryEntityRenders() { final Logger logger = LogManager.getLogger(DeepAffection.modid); RenderingRegistry.registerEntityRenderingHandler(RegistryHandler.HEART_ENTITY.get(), renderManager -> new SpriteRenderer<HeartEntity>(renderManager, Minecraft.getInstance().getItemRenderer())); logger.info("Entity render registerd."); } }
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
I now testet it with the debugger and came to a strange result... The tick() method get's called, the variables are calculated correctly, the only thing missing is the particles. Edit: But I had to change the this.world.isRemote() to !this.world.isRemote() I think this.world somehow is in the wrong world.
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
I basically followed this tutorial on youtube, because I'm very new to modding and didn't know where to start: (Yes, I know the title says 1.14) Edit: Just tried it with the runClient.launch files etc, now it's working
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
Clicked on the arrow besides the bug symbol and clicked main.
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
I wanted, but then this happened: Exception in thread "main" joptsimple.MissingRequiredOptionsException: Missing required option(s) [accessToken, version] at joptsimple.OptionParser.ensureRequiredOptions(OptionParser.java:426) at joptsimple.OptionParser.parse(OptionParser.java:400) at net.minecraft.client.main.Main.main(SourceFile:75) Picked up _JAVA_OPTIONS: -Xmx6144m
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
Okay, but then my tick() method doesn't seem to get called repeatedly. But since my entity is flying normally, it seems like the "normal" tick() method get's called.. Do you have any idea how I can change that?
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
I'm actually calling it in the item class right here after the worldIn.playSound(): @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) { ItemStack stack = playerIn.getHeldItem(handIn); Vec3d look = playerIn.getLookVec(); HeartEntity heart = new HeartEntity(1.0D,1.0D,1.0D,worldIn); heart.setPosition(playerIn.lastTickPosX + look.x , playerIn.lastTickPosY + look.y + 1, playerIn.lastTickPosZ + look.z); Vec3d vec3d = heart.getMotion(); double d0 = heart.getPosX() + vec3d.x; double d1 = heart.getPosY() + vec3d.y; double d2 = heart.getPosZ() + vec3d.z; worldIn.addParticle(ParticleTypes.HEART, d0 - vec3d.x * 0.25D, d1 - vec3d.y * 0.25D, d2 - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z); heart.shoot(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F,1.5F,0.0F); if (!worldIn.isRemote) { worldIn.addEntity(heart); if(!playerIn.isCreative()) { stack.shrink(1); } } worldIn.playSound(null,playerIn.getPosition(), SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.PLAYERS,1.0f,1.0f); heart.tick(); return new ActionResult<ItemStack>(ActionResultType.SUCCESS, stack); } I just don't know how to repeatedly call it the right way. I thought of a while(heart.isAlive()) because my entity get's removed when colliding with something, but then tick() get's called so fast that the entity instantly reaches it's destination. I also tried TimeUnit.MILLISECONDS.wait() with a try/catch but that caused my game to crash...
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
Bump
-
[1.15.2] Adding a particle track to my ProjectileItemEntity
Hello, I just wanted my entity to have a track consisting of particles and I guess I have to do something with the tick() method of my entity. But for now the particles just spawn once when the entity is spawned. Here is my code for the tick method: public void tick() { super.tick(); if(this.world.isRemote) { Vec3d vec3d = this.getMotion(); double d0 = this.getPosX() + vec3d.x; double d1 = this.getPosY() + vec3d.y; double d2 = this.getPosZ() + vec3d.z; this.world.addParticle(ParticleTypes.HEART, d0 - vec3d.x * 0.25D, d1 - vec3d.y * 0.25D, d2 - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z); } } Thanks in advance
-
[1.15.2] Throwable Entity Rendering Problems [SOLVED]
Nevermind, it works now after orientating on this: .Thank you for your help.
-
[1.15.2] Throwable Entity Rendering Problems [SOLVED]
All right. Sorry, I thought the rest wouldn't be relevant. Here is a full error log: [04Apr2020 20:18:18.179] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevclient, --fml.mcpVersion, 20200307.202953, --fml.mcVersion, 1.15.2, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 31.1.27, --version, MOD_DEV, --assetIndex, 1.15, --assetsDir, C:\Users\peers\.gradle\caches\forge_gradle\assets, --username, Dev, --accessToken, ????????, --userProperties, {}] [04Apr2020 20:18:18.187] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 5.0.0-milestone.4+67+b1a340b starting: java version 1.8.0_231 by Oracle Corporation [04Apr2020 20:18:19.971] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust [04Apr2020 20:18:21.724] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevclient' with arguments [--version, MOD_DEV, --gameDir, ., --assetsDir, C:\Users\peers\.gradle\caches\forge_gradle\assets, --assetIndex, 1.15, --username, Dev, --accessToken, ????????, --userProperties, {}] [04Apr2020 20:18:26.040] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Setting user: Dev [04Apr2020 20:18:42.331] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Backend library: LWJGL version 3.2.2 build 10 [04Apr2020 20:18:44.556] [modloading-worker-2/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 31.1.27, for MC 1.15.2 with MCP 20200307.202953 [04Apr2020 20:18:44.556] [modloading-worker-2/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v31.1.27 Initialized [04Apr2020 20:18:45.306] [Render thread/INFO] [censoredmodid/]: Blocks registred. [04Apr2020 20:18:45.353] [Render thread/INFO] [censoredmodid/]: Items registred. [04Apr2020 20:18:49.565] [Render thread/INFO] [com.mojang.text2speech.NarratorWindows/]: Narrator library for x64 successfully loaded [04Apr2020 20:18:49.732] [Render thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: Default, Mod Resources [04Apr2020 20:18:49.793] [modloading-worker-2/INFO] [censoredmodid/]: Setup method registred. [04Apr2020 20:18:51.855] [modloading-worker-3/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity censoredmodid:censored_entity [04Apr2020 20:18:51.864] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Starting version check at https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json [04Apr2020 20:18:51.869] [modloading-worker-3/INFO] [deepaffection/]: Entity render registerd. [04Apr2020 20:18:51.898] [modloading-worker-3/INFO] [deepaffection/]: clientRegistries method registred. [04Apr2020 20:18:52.620] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Found status: OUTDATED Current: 31.1.27 Target: 31.1.35 [04Apr2020 20:19:05.737] [Render thread/INFO] [net.minecraft.client.audio.SoundSystem/]: OpenAL initialized. [04Apr2020 20:19:05.738] [Render thread/INFO] [net.minecraft.client.audio.SoundEngine/SOUNDS]: Sound engine started [04Apr2020 20:19:06.074] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 1024x512x4 minecraft:textures/atlas/blocks.png-atlas [04Apr2020 20:19:06.272] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 128x128x4 minecraft:textures/atlas/signs.png-atlas [04Apr2020 20:19:06.274] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x512x4 minecraft:textures/atlas/banner_patterns.png-atlas [04Apr2020 20:19:06.280] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x512x4 minecraft:textures/atlas/shield_patterns.png-atlas [04Apr2020 20:19:06.287] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas [04Apr2020 20:19:06.290] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas [04Apr2020 20:19:06.293] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas [04Apr2020 20:19:06.976] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256x0 minecraft:textures/atlas/particles.png-atlas [04Apr2020 20:19:06.982] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas [04Apr2020 20:19:06.984] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 128x128x0 minecraft:textures/atlas/mob_effects.png-atlas [04Apr2020 20:19:07.733] [Realms Notification Availability checker #1/INFO] [com.mojang.realmsclient.client.RealmsClient/]: Could not authorize you against Realms server: Invalid session id [04Apr2020 20:19:12.032] [Render thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498] [04Apr2020 20:19:12.033] [Render thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0] [04Apr2020 20:19:12.034] [Render thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0] [04Apr2020 20:19:12.035] [Render thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498] [04Apr2020 20:19:12.037] [Render thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0] [04Apr2020 20:19:12.288] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Starting integrated minecraft server version 1.15.2 [04Apr2020 20:19:12.288] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Generating keypair [04Apr2020 20:19:12.513] [Server thread/INFO] [net.minecraftforge.registries.GameData/REGISTRIES]: Injecting existing registry data into this SERVER instance [04Apr2020 20:19:12.871] [Server thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: Default, main, forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar [04Apr2020 20:19:15.895] [Server thread/INFO] [net.minecraft.item.crafting.RecipeManager/]: Loaded 6 recipes [04Apr2020 20:19:19.675] [Server thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 825 advancements [04Apr2020 20:19:20.481] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing start region for dimension minecraft:overworld [04Apr2020 20:19:21.623] [Render thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Einstiegsbereich wird vorbereitet: 0% [04Apr2020 20:19:21.623] [Render thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Einstiegsbereich wird vorbereitet: 0% [04Apr2020 20:19:21.623] [Render thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Einstiegsbereich wird vorbereitet: 0% [04Apr2020 20:19:22.039] [Render thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Einstiegsbereich wird vorbereitet: 83% [04Apr2020 20:19:22.572] [Render thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Time elapsed: 2084 ms [04Apr2020 20:19:23.023] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved [04Apr2020 20:19:23.026] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved [04Apr2020 20:19:23.030] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Changing view distance to 11, from 10 [04Apr2020 20:19:29.348] [Netty Local Client IO #0/INFO] [net.minecraftforge.fml.network.NetworkHooks/]: Connected to a modded server. [04Apr2020 20:19:29.474] [Server thread/INFO] [net.minecraft.server.management.PlayerList/]: Dev[local:E:fb3edaec] logged in with entity id 233 at (69.19712512044106, 81.678043496736, 60.595977333329) [04Apr2020 20:19:29.520] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Dev hat das Spiel betreten [04Apr2020 20:19:30.274] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Saving and pausing game... [04Apr2020 20:19:30.292] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test'/minecraft:overworld [04Apr2020 20:19:30.441] [Render thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 0 advancements [04Apr2020 20:19:30.871] [Server-Worker-9/WARN] [com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService/]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@2cf5d6a6[id=380df991-f603-344c-a090-369bad2a924a,name=Dev,properties={},legacy=false] 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:1995) ~[?:?] at net.minecraft.client.resources.SkinManager.lambda$loadProfileTextures$4(SkinManager.java:96) ~[?:?] at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402) [?:1.8.0_231] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_231] at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_231] at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_231] at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_231] [04Apr2020 20:19:35.072] [Render thread/FATAL] [net.minecraft.util.concurrent.ThreadTaskExecutor/]: Error executing task on Client java.lang.IllegalStateException: Invalid entity data item type for field 7 on entity PigEntity['Schwein'/443, l='MpServer', x=68.59, y=82.26, z=59.92]: old=0(class java.lang.Byte), new=1 air(class net.minecraft.item.ItemStack) at net.minecraft.network.datasync.EntityDataManager.setEntryValue(EntityDataManager.java:246) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.network.datasync.EntityDataManager.setEntryValues(EntityDataManager.java:234) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.client.network.play.ClientPlayNetHandler.handleEntityMetadata(ClientPlayNetHandler.java:587) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.network.play.server.SEntityMetadataPacket.processPacket(SEntityMetadataPacket.java:50) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.network.play.server.SEntityMetadataPacket.processPacket(SEntityMetadataPacket.java:12) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:140) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:110) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(ThreadTaskExecutor.java:97) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:935) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.client.Minecraft.run(Minecraft.java:559) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at net.minecraft.client.main.Main.main(Main.java:177) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231] at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.2-31.1.27_mapped_snapshot_20200225-1.15.1-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.27_mapped_snapshot_20200225-1.15.1-recomp.jar:?] [04Apr2020 20:19:37.456] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Saving and pausing game... [04Apr2020 20:19:37.462] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test'/minecraft:overworld [04Apr2020 20:19:42.058] [Server thread/INFO] [net.minecraft.network.play.ServerPlayNetHandler/]: Dev lost connection: Verbindung getrennt [04Apr2020 20:19:42.059] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Dev hat das Spiel verlassen [04Apr2020 20:19:42.066] [Server thread/INFO] [net.minecraft.network.play.ServerPlayNetHandler/]: Stopping singleplayer server as player logged out [04Apr2020 20:19:42.130] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping server [04Apr2020 20:19:42.130] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving players [04Apr2020 20:19:42.130] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving worlds [04Apr2020 20:19:42.130] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test'/minecraft:overworld [04Apr2020 20:19:42.462] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (Test): All chunks are saved [04Apr2020 20:19:42.474] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (Test): All chunks are saved [04Apr2020 20:19:44.116] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Stopping! I guess it could also be relevant that there is no data fixer registered for my entity. I think I'm not using the @ObjectHolder the right way.. where is my mistake? Here is my entity class: @ObjectHolder(CensoredMod.modid) public class CensoredEntity extends ProjectileItemEntity { @ObjectHolder("censored_entity") public static final EntityType<CensoredEntity> CENSORED = register(); ... public static EntityType<CensoredEntity> register() { return EntityType.Builder.<CensoredEntity>create(EntityClassification.MISC).setCustomClientFactory(CensoredEntity::new).size(0.8f, 0.8f).build(CensoredMod.modid + ":censored_entity"); } } And where I register the entity: @SubscribeEvent public void registerEntities(final RegistryEvent.Register<EntityType<?>> event) { event.getRegistry().registerAll ( CensoredEntity.CENSORED ); } And here is my render registry: @OnlyIn(Dist.CLIENT) public class CensoredModRenderRegistry { public static void registryEntityRenders() { RenderingRegistry.registerEntityRenderingHandler(CensoredEntity.CENSORED, renderManager -> new SpriteRenderer<CensoredEntity>(renderManager, Minecraft.getInstance().getItemRenderer())); } } where the method is getting called during the FMLClientSetupEvent.
-
[1.15.2] Throwable Entity Rendering Problems [SOLVED]
I am currently thinking of two options for rendering my entity. The one is with the SpriteRenderer, which is used by vanilla to render items like snowballs. When I use this one, the game spawns a PigEntity when right clicking with my custom item and the error message as shown here: The other option I thought of was to extend SpriteRenderer to override the getEntityTexture method with a ResourceLocation to my texture for the ProjectileItemEntity. But then the error as shown here appears: Where only the first error is relevant. So overall my problem is that I don't know how to make the entity have the texture of my custom item.
-
[1.15.2] Throwable Entity Rendering Problems [SOLVED]
Bump... still needing help with this
-
[1.15.2] Throwable Entity Rendering Problems [SOLVED]
Update: Found out that in vanilla items like ender pearls are rendered with the SpriteRenderer so now my renderer looks like this: @OnlyIn(Dist.CLIENT) public class CustomEntityRender extends SpriteRenderer<CustomEntity> { protected CustomEntityRender(EntityRendererManager renderManager, ItemRenderer itemRenderer) { super(renderManager, itemRenderer); } @Override public ResourceLocation getEntityTexture(CustomEntity entity) { return Modid.RegistryEvents.location("textures/entity/texture.png"); } } I changed my RenderRegistry to: RenderingRegistry.registerEntityRenderingHandler(CustomEntity.CUSTOM, renderManager -> new CustomEntityRender(renderManager, Minecraft.getInstance().getItemRenderer())); While SpriteRenderer extends EntityRenderer, but I don't have access to the SpriteRenderer class. Inside of the EntityRenderer, the method looks like this: public abstract ResourceLocation getEntityTexture(T entity); My problem is the error shown in the attached screenshot. So it seems like I'm only overriding the getEntityTexture() method from EntityRenderer and not from SpriteRenderer. Edit: I removed the super.getEntityTexture(entity) error - this was just an act of desperation and I know it's very wrong Can someone please help me fixing this problem? Thanks in advance.
-
[1.15.2] Throwable Entity Rendering Problems [SOLVED]
When running the game and throwing my mod item, there's the following error in the log: [25Mär2020 08:17:58.031] [Render thread/FATAL] [net.minecraft.util.concurrent.ThreadTaskExecutor/]: Error executing task on Client java.lang.IllegalStateException: Invalid entity data item type for field 7 on entity PigEntity['Schwein'/411, l='MpServer', x=-262.54, y=81.56, z=417.63]: old=0(class java.lang.Byte), new=1 air(class net.minecraft.item.ItemStack) at net.minecraft.network.datasync.EntityDataManager.setEntryValue(EntityDataManager.java:246) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.network.datasync.EntityDataManager.setEntryValues(EntityDataManager.java:234) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.client.network.play.ClientPlayNetHandler.handleEntityMetadata(ClientPlayNetHandler.java:568) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.network.play.server.SEntityMetadataPacket.processPacket(SEntityMetadataPacket.java:47) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.network.play.server.SEntityMetadataPacket.processPacket(SEntityMetadataPacket.java:12) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:140) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:110) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(ThreadTaskExecutor.java:97) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:887) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.client.Minecraft.run(Minecraft.java:520) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at net.minecraft.client.main.Main.main(Main.java:176) ~[forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231] at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.1-30.0.51_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:101) [forge-1.15.1-30.0.51_mapped_snapshot_20190719-1.14.3-recomp.jar:?] Edit: It also seems like my custom entity doesn't even get registred. So here is where I register my entity: @SubscribeEvent public void registerEntities(final RegistryEvent.Register<EntityType<?>> event) { event.getRegistry().registerAll ( EntityType.Builder.<CensoredEntity>create(EntityClassification.MISC).setCustomClientFactory(CensoredEntity::new).size(0.8f, 0.8f).build(modid + ":censored_entity") ); }
-
[1.15.2] Throwable Entity Rendering Problems [SOLVED]
But then I also need my render class to extend something else than EntityRenderer because it doesn't depend on a model, am I right? What renderer shall I use? I also looked at comporable Vanilla items like snowballs, eggs and ender pearls, but I didn't find any renderer to those. I saw that in the past the rendering could be made with RenderSnowball but this class doesn't exist anymore.
-
[1.15.2] Throwable Entity Rendering Problems [SOLVED]
Hello I have this little issue that I wanted to create a new item which can be thrown but I have problems with rendering the created entity. It works like it should except that it has the texture of a pig instead of my entity. Could someone please help me? Entity Class: public class CensoredEntity extends ThrowableEntity { public static final EntityType<CensoredEntity> CENSORED = register(); public CensoredEntity(double x, double y, double z, World worldIn) { super(CensoredEntity.CENSORED, x, y, z, worldIn); } protected CensoredEntity( LivingEntity livingEntityIn, World worldIn) { super(CensoredEntity.CENSORED, livingEntityIn, worldIn); } protected CensoredEntity(EntityType<CensoredEntity> entityCensoredEntityType, World world) { super(CensoredEntity.CENSORED, world); } @Override public IPacket<?> createSpawnPacket() { return NetworkHooks.getEntitySpawningPacket(this); } @Override protected void onImpact(RayTraceResult result) { if (result instanceof EntityRayTraceResult) { EntityRayTraceResult entityRayTraceResult = (EntityRayTraceResult) result; if(entityRayTraceResult.getEntity() instanceof MobEntity) { MobEntity entity = (MobEntity) entityRayTraceResult.getEntity(); double d0 = (double)entity.lastTickPosX ; double d1 = (double)entity.lastTickPosY + 1D; double d2 = (double)entity.lastTickPosZ; entity.addPotionEffect(new EffectInstance(Effects.REGENERATION,100,2)); this.world.playSound(d0, d1, d2, SoundEvents.BLOCK_ANVIL_HIT, SoundCategory.AMBIENT,1,1,true); this.remove(); } else if(entityRayTraceResult.getEntity() instanceof PlayerEntity) { PlayerEntity entity = (PlayerEntity) entityRayTraceResult.getEntity(); entity.addPotionEffect(new EffectInstance(Effects.REGENERATION,100,2)); this.remove(); } } else if (result instanceof BlockRayTraceResult) { BlockRayTraceResult blockRayTraceResult = (BlockRayTraceResult) result; World world = this.world; Block block = world.getBlockState(blockRayTraceResult.getPos()).getBlock(); if(block == Blocks.GRASS_BLOCK) { world.setBlockState(blockRayTraceResult.getPos(), BlockList.pink_grass_block.getDefaultState()); Vec3d vec = blockRayTraceResult.getHitVec(); double x = vec.getX(); double y = vec.getY(); double z = vec.getZ(); this.setMotion(x,y,z); this.remove(); } Vec3d vec = blockRayTraceResult.getHitVec(); double x = vec.getX(); double y = vec.getY(); double z = vec.getZ(); this.setMotion(x,y,z); this.remove(); } } public static EntityType<CensoredEntity> register() { return EntityType.Builder.<CensoredEntity>create(CensoredEntity::new, EntityClassification.MISC).size(0.8f, 0.8f).build(Censored.modid + ":censored_entity"); } public void tick() { Vec3d vec3d = this.getMotion(); double d0 = this.func_226277_ct_() + vec3d.x; double d1 = this.func_226278_cu_() + vec3d.y; double d2 = this.func_226281_cx_() + vec3d.z; this.world.addParticle(ParticleTypes.HEART, d0 - vec3d.x * 0.25D, d1 - vec3d.y * 0.25D, d2 - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z); LivingEntity livingentity = this.getThrower(); if (livingentity != null && livingentity instanceof PlayerEntity && !livingentity.isAlive()) { this.remove(); } else { super.tick(); } } protected Item func_213885_i() { return ItemList.censored; } @Override protected void registerData() { } } Entity Render Class: @OnlyIn(Dist.CLIENT) public class CensoredEntityRender extends EntityRenderer<CensoredEntity> { protected CensoredEntityRender(EntityRendererManager renderManager) { super(renderManager); } @Override public ResourceLocation getEntityTexture(CensoredEntity entity) { return Censoredmodid.RegistryEvents.location("textures/entity/censored"); } public static class RenderFactory implements IRenderFactory<CensoredEntity> { @Override public EntityRenderer<? super CensoredEntity> createRenderFor(EntityRendererManager manager) { return new CensoredEntityRender(manager); } } } Render Registry: @OnlyIn(Dist.CLIENT) public class CensoredIdRenderRegistry { public static void registryEntityRenders() { RenderingRegistry.registerEntityRenderingHandler(CensoredEntity.CENSORED, new CensoredEntityRender.RenderFactory()); } } I also have a model class for my entity but it's empty because I don't know if this is needed for an item entity. Thank you in advance ?
-
[1.15.2]Throwable entity renderer renders.... a pig?
I have the same problem - Have you found a solution yet?
-
[1.15.1] Putting modded flowers in a modded flower pot
Yes.. Sorry for wasting your time, I forgot the "modid:" in the blockstates file.
-
[1.15.1] Putting modded flowers in a modded flower pot
Okay thank you, that worked. Now I have a new problem... I obviously don't exactly know how to add a flower pot containing my flower. When the flower pot gets replaced there appears the "texture not available" texture. Here is the models json I used: { "parent": "block/flower_pot_cross", "textures": { "plant": "censored_id:block/censored_flower" } } Thanks in advance again
-
[1.15.1] Putting modded flowers in a modded flower pot
Hello, I wanted to be able to put a flower created by me in a flower pot. After realising I have to add a new flower pot with my modded flower and change the onItemUse method I got some issues. Here is my code of the new onItemUse method: public ActionResultType onItemUse(ItemUseContext context) { ItemStack stack = context.getItem(); World world = context.getWorld(); if(stack.getItem()==ItemList.censored_flower) { BlockState state = world.getBlockState(context.getPos()); if(state.getProperties().equals(Blocks.FLOWER_POT.getDefaultState().getProperties())) { world.setBlockState(context.getPos(), BlockList.censored_flower_pot.getDefaultState()); stack.setCount(stack.getCount()-1); return ActionResultType.SUCCESS; } if(state.getBlock()==Blocks.GRASS_BLOCK||state.getBlock()==Blocks.DIRT) { BlockPos pos = new BlockPos(context.getHitVec()); if(world.getBlockState(pos).getBlock()==Blocks.AIR) { world.setBlockState(pos, BlockList.censored_flower.getDefaultState()); stack.setCount(stack.getCount()-1); return ActionResultType.SUCCESS; } } } logger.info("Fail."); return ActionResultType.FAIL; } So my problem is that the method doesn't seem to register when I rightclick on an empty flower pot while holding my flower. I also tried it with state.getBlock()==Blocks.FLOWER_POT but that didn't work either. The placement on grass and dirt blocks works perfectly. I believe the solution will be easy but I can't find it. Thank you very much in advance.
IPS spam blocked by CleanTalk.