Posted November 3, 20196 yr Code : Entity Spoiler public class Guy extends TameableEntity { protected Guy(EntityType<? extends TameableEntity> type, World worldIn) { super(type, worldIn); } @Override protected void registerAttributes() { super.registerAttributes(); this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.45D); this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(50); } @Override public AgeableEntity createChild(AgeableEntity ageable) { return null; } } Renderer Spoiler public class Guy_Renderer extends MobRenderer<Guy, PlayerModel<Guy>> { public Guy_Renderer(EntityRendererManager renderManagerIn) { super(renderManagerIn, new PlayerModel<>(3, false), 0.5F); } @Override protected ResourceLocation getEntityTexture(Guy entity) { return new ResourceLocation("minecraft", "player"); } } Factory Spoiler public class Guy_Factory implements IRenderFactory<Guy> { public static final Guy_Factory INSTANCE = new Guy_Factory(); private Guy_Renderer guy_Renderer; @Override public EntityRenderer<? super Guy> createRenderFor(EntityRendererManager manager) { guy_Renderer = new Guy_Renderer(manager); return guy_Renderer; } } Main Spoiler private static EntityType<Guy> guy; private void doClientStuff(final FMLClientSetupEvent event) { // do something that can only be done on the client LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings); RenderingRegistry.registerEntityRenderingHandler(Guy.class, Guy_Factory.INSTANCE); } @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { @SubscribeEvent public static void registerEntities(final RegistryEvent.Register<EntityType<?>> event) { LOGGER.debug("Hello from Register Entities"); event.getRegistry().registerAll( guy = register("guy", EntityType.Builder.<Guy>create(Guy::new, EntityClassification.MISC) .setCustomClientFactory((spawnEntity, world) -> new Guy(guy, world))) ); } @SuppressWarnings("deprecation") private static <T extends Entity> EntityType<T> register(String key, EntityType.Builder<T> builder) { return Registry.register(Registry.ENTITY_TYPE, key, builder.build(key)); } } Results : https://imgur.com/puNc5T7 Edited November 25, 20195 yr by MineModder2000
November 3, 20196 yr 2 hours ago, MineModder2000 said: return new ResourceLocation("minecraft", "player"); I don't think that's a texture in vanilla minecraft. This could either point to assets/minecraft/textures/player.png Or assets/minecraft/textures/entity/player.png Both of which I dont think exist. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 3, 20196 yr Author 11 hours ago, Animefan8888 said: I don't think that's a texture in vanilla minecraft. This could either point to assets/minecraft/textures/player.png Or assets/minecraft/textures/entity/player.png Both of which I dont think exist. How do I make it look like PlayerEntity then? I've tried putting other strings in there too, like "creeper", to no avail.
November 3, 20196 yr 16 minutes ago, MineModder2000 said: I've tried putting other strings in there too, like "creeper", to no avail. Look at the vanilla files. You'll notice that they need more than "minecraft" and "creeper" 21 minutes ago, MineModder2000 said: How do I make it look like PlayerEntity then? Take a look at PlayerRenderer. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 3, 20196 yr Author 1 hour ago, Animefan8888 said: Look at the vanilla files. You'll notice that they need more than "minecraft" and "creeper" Take a look at PlayerRenderer. Oh boy, I am not going to even be able to get all of that to work. I'd rather just extend PlayerRenderer, but then I can't extend TameableEntity in my Entity class without getting type conversion errors in the Factory class.
November 3, 20196 yr 1 minute ago, MineModder2000 said: Oh boy, I am not going to even be able to get all of that to work. Just look at the getEntityTexture method. That will get you the texture. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 3, 20196 yr Author 1 hour ago, Animefan8888 said: Just look at the getEntityTexture method. That will get you the texture. Oh I see, it's "Steve". But this doesn't do, the model is correct but it doesn't render correctly as the Renderer class is extending MobRenderer directly and not PlayerRenderer. I don't see that there is any good way to have the Entity extend TameableEntity, while it renders as a Player or other Entity.
November 4, 20196 yr 7 hours ago, MineModder2000 said: Oh I see, it's "Steve" Well only if the Client has failed to retrieve the texture associated with that account. If you look at the method you'll notice it passes it off to AbstractClientPlayerEntity#getLocationSkin which checks to see if it has the NetworkPlayerInfo and if it does it retrieves the skin from that object. You can replicate this. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 6, 20195 yr Author On 11/3/2019 at 11:28 PM, Animefan8888 said: Well only if the Client has failed to retrieve the texture associated with that account. If you look at the method you'll notice it passes it off to AbstractClientPlayerEntity#getLocationSkin which checks to see if it has the NetworkPlayerInfo and if it does it retrieves the skin from that object. You can replicate this. Right, but it's not enough to have the skin, it doesn't render as it should because I am extending MobRenderer directly without the specifics of PlayerRenderer. But if I extend PlayerRenderer then I can't extend TameableEntity in my Entity class without breaking my Factory class (due to the generic parameters). So I don't think this will be possible. Edited November 6, 20195 yr by MineModder2000
November 6, 20195 yr 7 hours ago, MineModder2000 said: Right, but it's not enough to have the skin, it doesn't render as it should because I am extending MobRenderer directly without the specifics of PlayerRenderer. But if I extend PlayerRenderer then I can't extend TameableEntity in my Entity class without breaking my Factory class (due to the generic parameters). So I don't think this will be possible. Ok? It's called copy and paste or if you dont like that it's called copy what's written. Also all of the rendering is done via a model which you can use any model that extends EntityModel which guess what PlayerModel does extend EntityModel. It's just the layers you have to worry about and the other functions. Also might not want to post the events. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 6, 20195 yr Author 13 hours ago, Animefan8888 said: Ok? It's called copy and paste or if you dont like that it's called copy what's written. Also all of the rendering is done via a model which you can use any model that extends EntityModel which guess what PlayerModel does extend EntityModel. It's just the layers you have to worry about and the other functions. Also might not want to post the events. Oh I've attempted this already, this is not a foreign concept to me. Things got ugly, and I couldn't really copy everything due to class dependencies, inaccessible objects and such. Well of course I already knew about the Model classes, did you not see in my Renderer class I am already using PlayerModel. Using the model alone is not enough, its very blocky and out of proportion, the arms especially. Edited November 6, 20195 yr by MineModder2000
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.