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.

Creepmander

Members
  • Joined

  • Last visited

Everything posted by Creepmander

  1. Hi! Mmm... I write an Entity and it looks like a Mermaid (Im isn't a perfect modeler ). Now i make it to can get air anywhere (It cant drowned => can move in the ground). But it don't wanna go in the water . How i can make it to like to be in water? The MobType class: public abstract class EntityGyogyinMob extends EntityCreature implements IAnimals { public EntityGyogyinMob(World par1World) { super(par1World); } public boolean canBreatheUnderwater() { return true; } /** * Checks if the entity's current position is a valid location to spawn this entity. */ public boolean getCanSpawnHere() { return this.worldObj.checkNoEntityCollision(this.boundingBox); } /** * Get number of ticks, at least during which the living entity will be silent. */ public int getTalkInterval() { return 120; } /** * Determines if an entity can be despawned, used on idle far away entities */ protected boolean canDespawn() { return true; } /** * Get the experience points the entity currently has. */ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { return 1 + this.worldObj.rand.nextInt(5); } public void onEntityUpdate() { int i = this.getAir(); super.onEntityUpdate(); if (this.isEntityAlive() && !this.isInsideOfMaterial(Material.water)) { --i; this.setAir(i); if (this.getAir() == -20) { this.setAir(0); } } else { this.setAir(300); // [] <-- I Think i need to write here. (but i dont know) } } } This is the Entity's class: public class EntitySelloOr1 extends EntityGyogyinMob { private int angerLevel = 0; public EntitySelloOr1(World par1World) { super(par1World); this.moveSpeed = 0.5F; this.texture = "/creepian/textures/SelloOr1.png"; } @Override public int getMaxHealth() { return 30; } public int getAttackStrength(Entity par1Entity) { ItemStack itemstack = this.getHeldItem(); float f = (float)(this.getMaxHealth() - this.getHealth()) / (float)this.getMaxHealth(); int i = 3 + MathHelper.floor_float(f * 4.0F); if (itemstack != null) { i += itemstack.getDamageVsEntity(this); } return i; } protected String getLivingSound() { return null; } protected String getHurtSound() { return null; } protected String getDeathSound() { return null; } protected int getDropItemId() { return 0; } protected boolean isAIEnabled() { return false; } protected void dropFewItems(boolean par1, int par2) { int j = this.rand.nextInt(3 + par2) + 1; for (int k = 0; k < j; ++k) { this.entityDropItem(new ItemStack(creepian.creepian.silverCoin, 1, 0), 0.0F); } } public void onUpdate() { if(this.isInWater() == true) { this.moveSpeed = 0.95F; } super.onUpdate(); } public boolean isInWater() { return this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.6000000238418579D, 0.0D), Material.water, this); } public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setShort("Anger", (short)this.angerLevel); } public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); this.angerLevel = par1NBTTagCompound.getShort("Anger"); } protected Entity findPlayerToAttack() { return this.angerLevel == 0 ? null : super.findPlayerToAttack(); } public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { if (this.isEntityInvulnerable()) { return false; } else { Entity entity = par1DamageSource.getEntity(); if (entity instanceof EntityPlayer) { List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(32.0D, 32.0D, 32.0D)); for (int j = 0; j < list.size(); ++j) { Entity entity1 = (Entity)list.get(j); if (entity1 instanceof EntitySelloOr1) { EntitySelloOr1 entityselloor1 = (EntitySelloOr1)entity1; entityselloor1.becomeAngryAt(entity); } } this.becomeAngryAt(entity); } return super.attackEntityFrom(par1DamageSource, par2); } } /** * Causes this PigZombie to become angry at the supplied Entity (which will be a player). */ private void becomeAngryAt(Entity par1Entity) { this.entityToAttack = par1Entity; this.angerLevel = 400 + this.rand.nextInt(400); } } Yeah!, and i wanna make it can be agressive. (like zombie pig) You can see the code inside but it isn't completed, aaand I don't know what is the missing part. Please help me in it. Sorry for my English.
  2. Yeah, and the last very stupid question, How i can renew this topic? ( I wanna write [sOLVED]
  3. lol, im a low... DONT SAY ANYTHING PLEASE!! (I fix it.) Thanks for the help guys. :3
  4. this is sooooooo long.. Nevermind, if i do that: I have got an error: public class BlockFence2 extends BlockFence { private final String field_94464_a; public BlockFence2(int par1, String par2Str, Material par3Material) { super(par1, par3Material); ////////////////////// Error this.field_94464_a = par2Str; this.setCreativeTab(CreativeTabs.tabDecorations); }
  5. Mmmmm. Sorry, this is the report from Game window. This is the log:
  6. Hi! I have copy the simple wooden fence's file ("BlockFence") and I made a block for it. (And a fence gate but it have no got problems.) It doesn't show any errors, but if i place the block the game is crashed.. Please help me.... The Mod file: package asdf; @Mod(modid = asdf.modid, name = "Asdf", version = "1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class asdf { public static final String modid = "Asdf"; public static final Block Fence1Gate = new BlockFenceGate(502).setHardness(0.5F).setResistance(5.0F).setUnlocalizedName("fence1Gate"); public static final Block Fence1 = (new BlockFence2(501, "wood", Material.wood)).setHardness(0.5F).setResistance(5.0F).setUnlocalizedName("fence1"); @SidedProxy(clientSide="asdf.client.AsdfClientProxy", serverSide="asdf.AsdfCommonProxy") public static AsdfCommonProxy proxy; @Init public void load(FMLInitializationEvent event) { GameRegistry.registerBlock(Fence1, "Fence1"); GameRegistry.registerBlock(Fence1Gate, "Fence1Gate"); LanguageRegistry.addName(Fence1, "Fence1"); LanguageRegistry.addName(Fence1Gate, "Fence1Gate"); proxy.registerRenderers(); } } This is the "BlockFence2" file: package asdf.block; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockFence2 extends Block { private final String field_94464_a; public BlockFence2(int par1, String par2Str, Material par3Material) { super(par1, par3Material); this.field_94464_a = par2Str; this.setCreativeTab(CreativeTabs.tabDecorations); } public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { boolean flag = this.canConnectFenceTo(par1World, par2, par3, par4 - 1); boolean flag1 = this.canConnectFenceTo(par1World, par2, par3, par4 + 1); boolean flag2 = this.canConnectFenceTo(par1World, par2 - 1, par3, par4); boolean flag3 = this.canConnectFenceTo(par1World, par2 + 1, par3, par4); float f = 0.375F; float f1 = 0.625F; float f2 = 0.375F; float f3 = 0.625F; if (flag) { f2 = 0.0F; } if (flag1) { f3 = 1.0F; } if (flag || flag1) { this.setBlockBounds(f, 0.0F, f2, f1, 1.5F, f3); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } f2 = 0.375F; f3 = 0.625F; if (flag2) { f = 0.0F; } if (flag3) { f1 = 1.0F; } if (flag2 || flag3 || !flag && !flag1) { this.setBlockBounds(f, 0.0F, f2, f1, 1.5F, f3); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } if (flag) { f2 = 0.0F; } if (flag1) { f3 = 1.0F; } this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); } public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { boolean flag = this.canConnectFenceTo(par1IBlockAccess, par2, par3, par4 - 1); boolean flag1 = this.canConnectFenceTo(par1IBlockAccess, par2, par3, par4 + 1); boolean flag2 = this.canConnectFenceTo(par1IBlockAccess, par2 - 1, par3, par4); boolean flag3 = this.canConnectFenceTo(par1IBlockAccess, par2 + 1, par3, par4); float f = 0.375F; float f1 = 0.625F; float f2 = 0.375F; float f3 = 0.625F; if (flag) { f2 = 0.0F; } if (flag1) { f3 = 1.0F; } if (flag2) { f = 0.0F; } if (flag3) { f1 = 1.0F; } this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { return false; } public int getRenderType() { return 11; } public boolean canConnectFenceTo(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { int l = par1IBlockAccess.getBlockId(par2, par3, par4); if (l != this.blockID && l != asdf.asdf.Fence1Gate.blockID) { Block block = Block.blocksList[l]; return block != null && block.blockMaterial.isOpaque() && block.renderAsNormalBlock() ? block.blockMaterial != Material.pumpkin : false; } else { return true; } } public static boolean isIdAFence(int par0) { return par0 == asdf.asdf.Fence1.blockID; } @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { return true; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon(this.field_94464_a); } } This is the Crash Report: Please help me, or if have a better way to make a fence please tell it to me. :3
  7. I have got a new idea about it! It will be sooo better! I will made a gui, like It will be GuiInGame, i will made pressable pictures to the right bottom corner. If i press, the Gui is appear. Like World of Warcraft and a binded button to Show/Hide the mouse. I think its a really good idea. ;D
  8. I see. I will try the first way. Thanks for help! I will write when it works, or it isnt.
  9. You think it is possible? How hard do you think?
  10. Can you make me an example? Or link me a tutorial, or any useable things of it?
  11. Hi! I wanna make a Gui next to the inventory, but i cant find the event for it. Do you know what/where is this Event/boolean? (I think this is an event or boolean) I need a line like that: if( -|INVENTORY OPENED|- ); { tam-tararam-ta-tam-ta-tam } ;D Nevermind, please help me if you can!

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.