Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ScottNicholson

Members
  • Joined

  • Last visited

Everything posted by ScottNicholson

  1. I wasted so much time on this, I was going crazy, it was all because I misspelt the word "assets" in the file tree, I spelled it assests. Thanks for reading my craziness.
  2. Two things, first I have removed the "assets/" from the front part of the resource location string Second, I realized my assets folder did not have my mod id folder in it, so I added that. But still it comes out with a blank texture
  3. So I am trying to just change the default texture of the slime, I created a custom entity that will do much more later on in the mod, but right now its just a basic slime that I want to change the texture of. I have attached my renderer code below, it is a copy and pasted version of the slimerenderer that vanilla has, except I changed my texture file. For some reason when the slime loads in, it has no texture. The code will work completely fine when I don't change the texture, it will spawn the custom mob as a regular green slime, I don't want to just create a texture pack either. Am I missing something? Thank you for any help you can provide! @OnlyIn(Dist.CLIENT) public class CustomSlimeRenderer extends MobRenderer<Slime, SlimeModel<Slime>> { private static final ResourceLocation SLIME_LOCATION = new ResourceLocation("assests/textures/entities/slime.png"); public CustomSlimeRenderer(EntityRendererProvider.Context p_174391_) { super(p_174391_, new SlimeModel<>(p_174391_.bakeLayer(ModelLayers.SLIME)), 0.25F); this.addLayer(new SlimeOuterLayer<>(this, p_174391_.getModelSet())); } public void render(Slime p_115976_, float p_115977_, float p_115978_, PoseStack p_115979_, MultiBufferSource p_115980_, int p_115981_) { this.shadowRadius = 0.25F * (float)p_115976_.getSize(); super.render(p_115976_, p_115977_, p_115978_, p_115979_, p_115980_, p_115981_); } protected void scale(Slime p_115983_, PoseStack p_115984_, float p_115985_) { float f = 0.999F; p_115984_.scale(0.999F, 0.999F, 0.999F); p_115984_.translate(0.0D, (double)0.001F, 0.0D); float f1 = (float)p_115983_.getSize(); float f2 = Mth.lerp(p_115985_, p_115983_.oSquish, p_115983_.squish) / (f1 * 0.5F + 1.0F); float f3 = 1.0F / (f2 + 1.0F); p_115984_.scale(f3 * f1, 1.0F / f3 * f1, f3 * f1); } public ResourceLocation getTextureLocation(Slime p_115974_) { return SLIME_LOCATION; } } public class EntityRenderer extends CustomSlimeRenderer { public EntityRenderer(EntityRendererProvider.Context p_174391_) { super(p_174391_); } } @Mod.EventBusSubscriber(modid = SlimeMod.MOD_ID, bus= Mod.EventBusSubscriber.Bus.MOD,value = Dist.CLIENT) public final class ModEvents { private ModEvents(){} @SubscribeEvent public static void registerRenderers(EntityRenderersEvent.RegisterRenderers event){ event.registerEntityRenderer(ModeEntityTypes.DUNGEON_SLIME.get(), EntityRenderer::new); } }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.