ultra_reemun Posted April 13, 2020 Share Posted April 13, 2020 Usually to render my thrown items, I use the code: event.getRegistry().register(ENTITY_TYPE.setRegistryName(new ResourceLocation("combat", "entity name"))); I now however am trying to add another trident to the game. This form of rendering does not work in this case, does anybody know how I would go about rendering a new trident? Quote Link to comment Share on other sites More sharing options...
Ugdhar Posted April 13, 2020 Share Posted April 13, 2020 I believe the Trident uses an ItemStackTileEntityRenderer in package net.minecraft.client.renderer.tileentity; Quote Link to comment Share on other sites More sharing options...
Animefan8888 Posted April 13, 2020 Share Posted April 13, 2020 7 minutes ago, ultra_reemun said: event.getRegistry().register(ENTITY_TYPE.setRegistryName(new ResourceLocation("combat", "entity name"))); This has nothing to do with rendering. This is registering your EntityType. 8 minutes ago, ultra_reemun said: This form of rendering does not work in this case, does anybody know how I would go about rendering a new trident? Please define "does not work". Nothing renders? A purple elephant in a minecart renders? Show what you have tried specifically where you register a RenderFactory for your entity. 1 Quote 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. Link to comment Share on other sites More sharing options...
ultra_reemun Posted April 13, 2020 Author Share Posted April 13, 2020 1 minute ago, Animefan8888 said: This has nothing to do with rendering. This is registering your EntityType. Please define "does not work". Nothing renders? A purple elephant in a minecart renders? Show what you have tried specifically where you register a RenderFactory for your entity. Apologies, I pasted the wrong code I'm an idiot... RenderingRegistry.registerEntityRenderingHandler(ENTITY_TYPE, manager -> new SpriteRenderer<>(manager, Minecraft.getInstance().getItemRenderer())); The issue is that when I use this for my trident I get the error: Cannot infer type argument(s) for <T> registerEntityRenderingHandler(EntityType<T>, IRenderFactory<? super T>) Apologies for not being specific enough. Quote Link to comment Share on other sites More sharing options...
ultra_reemun Posted April 13, 2020 Author Share Posted April 13, 2020 9 minutes ago, Ugdhar said: I believe the Trident uses an ItemStackTileEntityRenderer in package net.minecraft.client.renderer.tileentity; Thank you for your reply, I'll try and figure out how it works Quote Link to comment Share on other sites More sharing options...
Animefan8888 Posted April 13, 2020 Share Posted April 13, 2020 2 minutes ago, ultra_reemun said: Thank you for your reply, I'll try and figure out how it works What does ENTITY_TYPE equal? And why doesn't your SpriteRenderer have a generic IE SpriteRenderer<MyTridentEntity> instead of SpriteRenderer<> Quote 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. Link to comment Share on other sites More sharing options...
ultra_reemun Posted April 13, 2020 Author Share Posted April 13, 2020 (edited) 11 minutes ago, Animefan8888 said: What does ENTITY_TYPE equal? And why doesn't your SpriteRenderer have a generic IE SpriteRenderer<MyTridentEntity> instead of SpriteRenderer<> public static final EntityType<SpearIronEntity> ENTITY_TYPE = EntityType.Builder .<SpearIronEntity>create(SpearIronEntity::new, EntityClassification.MISC).size(0.5F, 0.5F) .build("combat:spear_iron_entity"); Apologies again, that's all setup here, which is copy pasted from minecraft's Trident code and then adapted to fit how I've been setting things up with my throwable items. This above code works with my throwable items, based off of code from a snowball, however I don't quite know how the trident fully works yet and therefore don't know what to do about rendering it. Thanks for all your help. Edited April 13, 2020 by ultra_reemun Quote 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.