Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

GlobalEntityTypeAttributes does not exist anymore in 1.17.1 ?


Armanse
 Share

Recommended Posts

Hi i'm trying to make a new entity in my mod however i can't find the class GlobalEntityTypeAttributes in 1.17.1. I think it got renamed but after hours of research i can't find it at all here is what i'm trying to do in my mod main class :

private void setup(final FMLCommonSetupEvent event) {
        DeferredWorkQueue.runLater(() -> {
            GlobalEntityTypeAttributes.put(ModEntityType.ENTITY.get(), Entity.setCustomAttributes().create());
        });
    }

Can someone help me ?

Link to comment
Share on other sites

I did that

@SubscribeEvent
	public static final void entityClientRederer(EntityRenderersEvent.RegisterRenderers event) {
		event.registerEntityRenderer(EntityInit.SLEEPING_PLAYER.get(), SleepingPlayerRenderer::new);
	}

But it says that :

The type SleepingPlayerRenderer does not define SleepingPlayerRenderer(EntityRendererProvider.Context) that is applicable here

can you help me ? Thank you btw diesieben07 

Link to comment
Share on other sites

I know that the problem is here but i don't know what to change ... 

public class SleepingPlayerRenderer extends MobRenderer<SleepingPlayerEntity, SleepingPlayerModel<SleepingPlayerEntity>> {

	
	protected static final ResourceLocation Texture = new ResourceLocation(DreamyMain.MOD_ID, "textures/entity/sleeping_player.png");
	public SleepingPlayerRenderer(Context p_174304_, SleepingPlayerModel<SleepingPlayerEntity> p_174305_) {
		super(p_174304_, p_174305_, 0.7f);
	}
	
	@Override
	public ResourceLocation getTextureLocation(SleepingPlayerEntity p_114482_) {
		// TODO Auto-generated method stub
		return Texture;
	}

}

 

Link to comment
Share on other sites

The second parameter aka the problem is an entityRendererProvider The renderer provider, can be a lambda like MyRenderer::new.

What i sent to him was a lambda. So i really don't know whats the problem.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.