Jump to content

pizzapim

Members
  • Posts

    8
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    Holland
  • Personal Text
    I'm trying to mod Minecraft!

pizzapim's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thanks for the suggestion of not using the languageRegistry. I changed it and it's still working. Was a bit frustrated because apparently the first line in the lang file isn't being read. Also the name is still appearing above the entity's head.
  2. I just used the /summon jolo:Monster command to spawn it, the entity doesn't spawn naturally right now. Also I don't think I'm setting a custom name, but when I spawn the entity in it always has "entity.jolo.Monster.name" as his custom name. Anyways, this is my entity class, EntityMonster.class: public class EntityMonster extends EntityMob{ public EntityMonster (World worldIn) { super(worldIn); this.setSize(0.9F, 1.3F); ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIPanic(this, 2.0D)); this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); //this.setAlwaysRenderNameTag(false); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); } protected String getLivingSound() { return "mob.zombie.say"; } protected String getHurtSound() { return "mob.zombie.hurt"; } protected void playStepSound(BlockPos pos, Block blockIn) { this.playSound("mob.blaze.hit", 0.15F, 1.0F); }; protected float getSoundVolume () { return 0.4F; } protected Item getDropItem () { return Items.cooked_beef; } protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { int i = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_); for (int j = 0; j < i; ++j) { this.dropItem(Items.bone, 1); } i = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + p_70628_2_); for (int k = 0; k < i; ++k) { if (this.isBurning()) { this.dropItem(Items.coal, 1); } else { this.dropItem(Items.cooked_beef, 1); } } } public boolean interact(EntityPlayer player) { ItemStack itemstack = player.inventory.getCurrentItem(); if (itemstack != null && itemstack.getItem() == Items.bucket && !player.capabilities.isCreativeMode && !this.isChild()) { if (itemstack.stackSize-- == 1) { player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(Items.milk_bucket)); } else if (!player.inventory.addItemStackToInventory(new ItemStack(Items.lava_bucket))) { player.dropPlayerItemWithRandomChoice(new ItemStack(Items.lava_bucket, 1, 0), false); } return true; } else { return super.interact(player); } } public EntityMonster createChild(EntityAgeable ageable) { return new EntityMonster(this.worldObj); } public float getEyeHeight() { return this.height; } }
  3. Anyone got any idea? Should I override canRenderName from RendererLivingEntity.class?
  4. Yeah, I know I should be doing it, just didn't know about @Reference.
  5. Thank you, I got the registerModEntity working now! It didn't fix the initial problem though.
  6. Rendermonster: [spoiler] public class RenderMonster extends RendererLivingEntity { public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.MOD_ID + ":textures/entity/monster.png"); public RenderMonster() { super(Minecraft.getMinecraft().getRenderManager(), new ModelMonster() { @Override public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) { super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale); } }, 1F); } @Override protected void preRenderCallback(EntityLivingBase entity, float f) { if(entity instanceof EntityMonster) { EntityMonster monster = (EntityMonster) entity; GL11.glScalef(1F, 1F, 1F); } } @Override protected ResourceLocation getEntityTexture(Entity entity) { return TEXTURE; } } [/spoiler] Also I tried using EntityRegistry.registerModEntity instead of EntityRegistry.registerGlobalEntityID, like this: EntityRegistry.registerModEntity(entity, name, Reference.MOD_ID, this, 8, 3, false); That didn't work because I 'can't use this in a static context'. I then tried to put this in my main mod's class, called Jolo.class: public static Object instance = new Jolo(); And then do this in the register class: EntityRegistry.registerModEntity(entity, name, Reference.MOD_ID, Jolo.instance, 8, 3, false); But that doesn't work... Also sorry if I'm making stupid mistakes.
  7. Also I tried putting this in my code: this.setAlwaysRenderNameTag(false); But this didn't do it.
  8. Hi, My entity always shows its nametag, eventhough I didn't set it. Here's a picture of it: Here's my class for registering entities (this is where I think the problem is and can be fixed): public class JoloEntities { public static void init() { registerEntity(EntityMonster.class, Reference.MOD_ID + ":Monster"); LanguageRegistry.instance().addStringLocalization("entity.jolo:Monster.name", "en_US", "Monster"); } @SideOnly(Side.CLIENT) public static void initRenders() { RenderingRegistry.registerEntityRenderingHandler(EntityMonster.class, new RenderMonster()); } private static void registerEntity(Class<? extends EntityLiving> entity, String name) { EntityRegistry.registerGlobalEntityID(entity, name, EntityRegistry.findGlobalUniqueEntityId()); } } Any help is appreciated! -pizzapim
×
×
  • Create New...

Important Information

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