
Everything posted by uSkizzik
-
[1.16.4] Custom entity follow player
Vanilla animals already have similar behavior. For example, pigs follow you when you hold a carrot or a carrot on a stick. That's achieved by adding the TemptGoal to the registerGoals method. Here's an example from the vanilla pig class: this.goalSelector.addGoal(4, new TemptGoal(this, 1.2D, Ingredient.of(Items.CARROT_ON_A_STICK), false)); You can also use commas where it says Items.CARROT_ON_A_STICK to add more than one item. P.S.: I'm not sure how you would go about making it follow the player when it's given a specific item, maybe taming?
-
[1.17.1] Help with Dynamic Model Box Positions
So, basically I have this model which I want to change based on my entity's stage. I have my logic in my setupAnim() method and most of it works. My issue is that the following piece of code doesn't change the center head's position but successfully changes the other positions & rotations. if (entity.getStage() == 5) { this.centerHead.setPos(1.0F, -21.0F, 0.0F); this.commandBlock.setPos(0.0F, 0.0F, -10.0F); this.rightRibs.setRotation(0.0F, -0.35F, 0.0F); this.leftRibs.setRotation(0.0F, 0.35F, 0.0F); this.bottomRib.setRotation(0.25F, 0.0F, 0.0F); } else { this.centerHead.setPos(1.0F, -16.0F, 0.0F); this.commandBlock.setPos(0.0F, 0.0F, 0.0F); this.rightRibs.setRotation(0.0F, 0.0F, 0.0F); this.leftRibs.setRotation(0.0F, 0.0F, 0.0F); this.bottomRib.setRotation(0.0F, 0.0F, 0.0F); } What's even more interesting is that I have a very similar piece of code for the 6th stage which works just fine if (entity.getStage() == 6) { this.centerHead.setPos(1.0F, -13.0F, 0.0F); this.commandBlock.visible = false; this.rightRibs.visible = false; this.leftRibs.visible = false; this.bottomRib.visible = false; this.backRibs.visible = false; } else { this.centerHead.setPos(1.0F, -16.0F, 0.0F); this.commandBlock.visible = true; this.rightRibs.visible = true; this.leftRibs.visible = true; this.bottomRib.visible = true; this.backRibs.visible = true; } Here's the full model class if anything else is needed.
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
I actually just made a new method to make the new immutable map with my custom models (via ImmutableMap.builder(), like in vanilla) and it worked.
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
Alright, I finally solved it! Thanks for all the help @diesieben07!
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
Turns out it isn't! Any ideas? EDIT: I solved it by calling the method via the project class. Now I have a new error: https://gist.github.com/uSkizzik/e5079c0a6196a6a213f6255343efa7e8
-
Minecraft Eclipse won't run
You need to use Java 8 for 1.16.5.
-
[1.17.1] Key Binding package net.minecraft.client.settings does not exist import net.minecraft.client.settings.KeyBinding
The new name of that class is KeyMapping. You can use forge bot in the official server to convert old class names to new ones via the command !mcp -c moj <Whatever you want to convert>. That command also works for converting mcp methods to official mojang methods.
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
This is the crash that happens when the game tries to render a zombie with my custom skull on it: Why doesn't it register my custom models? This is the thing I placed before the start of the class: @Mod.EventBusSubscriber(modid = ProjectApple.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) And this is the method I use to register the models: @SubscribeEvent(priority = EventPriority.LOWEST) public void registerSkullPlayerHeadLayers(EntityRenderersEvent.AddLayers event) { Map<EntityType<?>, EntityRenderer<?>> renderers = Minecraft.getInstance().getEntityRenderDispatcher().renderers; for(Map.Entry<EntityType<?>, EntityRenderer<?>> renderer : renderers.entrySet()) { if (renderer.getValue() instanceof LivingEntityRenderer) { List<? extends RenderLayer<?, ?>> layers = ((LivingEntityRenderer<?, ?>) renderer.getValue()).layers; for (RenderLayer<?, ?> layer : layers) { if (layer instanceof CustomHeadLayer) { ((CustomHeadLayer) layer).skullModels.put(PA_TileEntities.CustomSkullTypes.SKIZZIK, new PA_SkullModel(Minecraft.getInstance().getEntityModels().bakeLayer(PA_ModelLayers.SKIZZIK_HEAD_LAYER))); ((CustomHeadLayer) layer).skullModels.put(PA_TileEntities.CustomSkullTypes.SKIZZIK_WITH_GEMS, new PA_SkullModel(Minecraft.getInstance().getEntityModels().bakeLayer(PA_ModelLayers.SKIZZIK_HEAD_WITH_GEMS_LAYER))); } } } } Map<String, EntityRenderer<? extends Player>> skins = Minecraft.getInstance().getEntityRenderDispatcher().getSkinMap(); for(Map.Entry<String, EntityRenderer<? extends Player>> renderer : skins.entrySet()) { if (renderer.getValue() instanceof LivingEntityRenderer) { List<? extends RenderLayer<?, ?>> layers = ((LivingEntityRenderer<?, ?>) renderer.getValue()).layers; for (RenderLayer<?, ?> layer : layers) { if (layer instanceof CustomHeadLayer) { ((CustomHeadLayer) layer).skullModels.put(PA_TileEntities.CustomSkullTypes.SKIZZIK, new PA_SkullModel(Minecraft.getInstance().getEntityModels().bakeLayer(PA_ModelLayers.SKIZZIK_HEAD_LAYER))); ((CustomHeadLayer) layer).skullModels.put(PA_TileEntities.CustomSkullTypes.SKIZZIK_WITH_GEMS, new PA_SkullModel(Minecraft.getInstance().getEntityModels().bakeLayer(PA_ModelLayers.SKIZZIK_HEAD_WITH_GEMS_LAYER))); } } } } } I used ATs instead of reflection which worked for the block renderer.
-
Can anyone help me some of the mods are broken in my mod folder.
1.8 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
1. I forgot to add the bus subscriber (@Mod.EventBusSubscriber(modid = ProjectApple.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)) 2. What am I supposed to do with the skin map exactly?
-
How do I play a custom map that I downloaded off of Planet Minecraft with mods?
There are tutorials online including in the MC wiki on how to setup a vanilla or a forge server.
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
So, I'm still getting the same crash which means that for some reason this thing is still not using my models. Here's my code: @SubscribeEvent(priority = EventPriority.LOWEST) public void registerSkullPlayerHeadLayers(EntityRenderersEvent.AddLayers event) { Map<EntityType<?>, EntityRenderer<?>> renderers = Minecraft.getInstance().getEntityRenderDispatcher().renderers; for(Map.Entry<EntityType<?>, EntityRenderer<?>> renderer : renderers.entrySet()) { if (renderer.getValue() instanceof LivingEntityRenderer) { List<? extends RenderLayer<?, ?>> layers = ((LivingEntityRenderer<?, ?>) renderer.getValue()).layers; for (RenderLayer<?, ?> layer : layers) { if (layer instanceof CustomHeadLayer) { ((CustomHeadLayer) layer).skullModels.put(PA_TileEntities.CustomSkullTypes.SKIZZIK, new PA_SkullModel(Minecraft.getInstance().getEntityModels().bakeLayer(PA_ModelLayers.SKIZZIK_HEAD_LAYER))); ((CustomHeadLayer) layer).skullModels.put(PA_TileEntities.CustomSkullTypes.SKIZZIK_WITH_GEMS, new PA_SkullModel(Minecraft.getInstance().getEntityModels().bakeLayer(PA_ModelLayers.SKIZZIK_HEAD_WITH_GEMS_LAYER))); } } } } }
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
Quick question: How do I get an instance of EntityRenderDispatcher?
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
How do I get all entity renderers though? Also, is FMLClientSetupEvent the correct event or do I need another one?
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
Alright, so the item works now but the equipping feature crashes the game. It seems that when equipping a skull, the game calls "CustomHeadLayer" which calls SkullBlockRenderer (and I need it to call my custom renderer). How do I fix that?
-
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from WildNature mod (wildnature)
1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support. The topic will be closed by a moderator as soon as possible.
-
Can't get ATM6 Server to start.
Downgrade to Java 8 if you want to continue playing on 1.16.5.
-
My game keeps crashing when i try to play with mods
1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support. The topic will be closed by a moderator as soon as possible.
-
How Do I Create An OreGen In 1.17
I haven't dealt with ores yet but I have a suggestion. You can look trough vanilla code and the source code of other mods.
-
HELP the modded minecraft get crashed in freezing data
Can you provide the log?
-
cant run a modded server please help...
1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support. The topic will be closed by a moderator as soon as possible.
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
So can you tell me exactly what I have to do? This is the error I'm getting when opening the creative tab containing the head: It's the same as the one that I got when making the block. What I did there was to change the renderer that I'm using to set the model field to the custom one, so I guess that I have to make a custom renderer for the item too?
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
Alright, the block works perfectly. Now I just need a custom model since the texture height and width of the vanilla one don't do the job for my textures. I'll see about the item in a minute (I still haven't worked on the "fix" for it.)
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
So, this? @SubscribeEvent public static void registerTileEntityRenders(FMLClientSetupEvent event) { BlockEntityRenderers.register(PA_SIGN.get(), SignRenderer::new); BlockEntityRenderers.register(PA_SKULL.get(), SkizzikHeadRenderer::new); }
-
[SOLVED] [1.17.1] Issues with Skull Rendering (again...)
Yup, I knew it was a dumb idea that won't work...
IPS spam blocked by CleanTalk.