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.

Aga12s

Members
  • Joined

  • Last visited

  1. Hello, I would like to add a mechanic in my mod where I can render the same entity with different textures based on RNG (Random Number Generation). The concept is similar to Villagers in minecraft and their professions. Here is my code currently (not knowing that the constructor for RenderWanderingPlayer is only called once, not everytime the entity spawned) package xyz.gatya.itmulti.render; import java.util.Random; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.util.ResourceLocation; import xyz.gatya.itmulti.entity.EntityInformation; import xyz.gatya.itmulti.entity.EntityWanderingPlayer; import xyz.gatya.itmulti.util.ModInformation; public class RenderWanderingPlayer extends RenderLiving<EntityWanderingPlayer> { private static final ResourceLocation TEXTURES = new ResourceLocation( ModInformation.MOD_ID + ":textures/entity/" + EntityInformation.WANDERING_NPC_SKINS[(int) (Math.random() * EntityInformation.WANDERING_NPC_SKINS.length + 1)] + ".png" ); public RenderWanderingPlayer(RenderManager rendermanagerIn) { super(rendermanagerIn, new ModelPlayer(0.0F, false), 0.3F); } @Override protected ResourceLocation getEntityTexture(EntityWanderingPlayer entity) { return TEXTURES; } } Code : EntityInformation -> Contains some information of the entity i.e id, available skins for the entity and etc. WANDERING_NPC_SKINS -> Array of strings of possible skins How do I get it to work? The code is just for demonstration
  2. Alright, I will look up the BucketItem class in Eclipse, that is actually a really good reference point. Thank you both for your help
  3. i get the idea, but can you please provide an example for me at least with the hasContainerItem or getContainerItem methods?
  4. Aga12s joined the community
  5. Hello, I am creating a mod that requires this kind of mechanic (see the Linked Example) but I couldn't find any reference to implement this, could someone point me to a code snippet or a short tutorial of how to implement this mechanic? Use Case Example : Shapeless crafting : 1 Knife + 1 Chicken = 9 Chicken Nuggets and the Knife drops the durability Thank you

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.