Jump to content

ChaKha

Members
  • Posts

    23
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed

ChaKha's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm trying to update some code I wrote for a 1.8 mod to 1.9, but I ran into a snag. My class implemented IExtendedEntityProperties back in 1.8, but that doesn't seem to exist in 1.9. What do I need to edit or take a look at so that my save/loadNBTData methods work properly?
  2. Thanks! I spawned it on the client and it worked. I modified the code from Jabelar's particle tutorial for anyone who wants to know.
  3. Alright, so I've run into a problem while trying to spawn particles. I believe I'm using the spawnParticle method correctly, as it's mostly copy/pasted from the enderpearl source code, yet I don't see any particles when I run the code (yes, my video settings are set to 'All' for particles). This is being called in an onEntityItemUpdate(...) method in a custom item class I wrote (the item has its own custom entityItem). Any help solving this conundrum would be appreciated. onEntityItemUpdate method: P.S I've tried the onEntityItemUpdate code both in that method and in the EntityItem's onUpdate method.
  4. Alright, so Jabelar and jeffryfisher were correct, I had overlooked the parameters (the lists in specific). All I needed to do was to correct them as jeffryfisher had done above. Thanks all of you!
  5. I definitely included more than just the method stubs, sorry if it wasn't clear that I was omitting the rest of the code!
  6. Hello, So I've been trying to get this ItemBlock going, but I've run into a snag. These two methods: @SideOnly(Side.CLIENT) @Override public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) @SideOnly(Side.CLIENT) @Override public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) I'm trying to override these methods from the original ItemBlock/Item classes, but I keep recieving the message (from eclipse) that I can't override them and that it's causing a name clash. Any solutions or work-arounds would be greatly appreciated. Edit: Using forge version 1.8-11.14.4.1577.
  7. Alright, so I changed the code to: double prevHeight = posY; for (int i = 0; i < partArray.length; i++) { partArray[i].setPosition(posX, ((30 - (2 * i)) / 16) + prevHeight, posZ); prevHeight = ((30 - (2 * i)) / 16) + prevHeight; } However, nothing appears to have changed. Did I do it wrong?
  8. Except that I can't see them... Edit: Here's what I do see though, just the one big box that I had already set in the constructor:
  9. Correct. Do you mean something like this: public void onLivingUpdate() { int prevHeight = 0; for (int i = 0; i < partArray.length; i++) { partArray[i].setPosition(0, ((30 - (2 * i)) / 16) + prevHeight, 0); prevHeight = ((30 - (2 * i)) / 16) + prevHeight; } } I ran the game with that bit of code in, but I still can't hit it correctly. Is there a way I could see the hitboxes so I can position them better, or is that not the issue?
  10. Alright. So, all I have really tried so far is copy/editing code from the enderdragon and some other mods that included complex hitbox entities. If you want to see exactly what I've done, then here's the very incomplete entity class: public class EntityNWPlantBossTendril extends EntityLiving implements IEntityMultiPart { public double targetX; public double targetY; public double targetZ; private static int MAX_HEALTH = 50; private static float ARMOR_MULTIPLIER = 2F; public Entity[] partArray; public EntityDragonPart tendrilBase; public EntityDragonPart tendrilPart1; public EntityDragonPart tendrilPart2; public EntityDragonPart tendrilPart3; public EntityDragonPart tendrilPart4; public EntityDragonPart tendrilPart5; public EntityDragonPart tendrilPart6; public EntityDragonPart tendrilPart7; public EntityDragonPart tendrilPart8; public EntityDragonPart tendrilPart9; public EntityDragonPart tendrilPart10; public EntityDragonPart tendrilPart11; public EntityDragonPart tendrilPart12; public EntityDragonPart tendrilPart13; public EntityDragonPart tendrilPart14; public EntityNWPlantBoss master; public EntityNWPlantBossTendril(World world) { super(world); partArray = (new Entity[] { tendrilBase = new EntityDragonPart(this, "base", 4F, 4F), tendrilPart1 = new EntityDragonPart(this, "tendrilPart1", 10.0F, 10.0F), tendrilPart2 = new EntityDragonPart(this, "tendrilPart2", 10.0F, 10.0F), tendrilPart3 = new EntityDragonPart(this, "tendrilPart3", 10.0F, 10.0F), tendrilPart4 = new EntityDragonPart(this, "tendrilPart4", 10.0F, 10.0F), tendrilPart5 = new EntityDragonPart(this, "tendrilPart5", 10.0F, 10.0F), tendrilPart6 = new EntityDragonPart(this, "tendrilPart6", 10.0F, 10.0F), tendrilPart7 = new EntityDragonPart(this, "tendrilPart7", 10.0F, 10.0F), tendrilPart8 = new EntityDragonPart(this, "tendrilPart8", 10.0F, 10.0F), tendrilPart9 = new EntityDragonPart(this, "tendrilPart9", 10.0F, 10.0F), tendrilPart10 = new EntityDragonPart(this, "tendrilPart10", 10.0F, 10.0F), tendrilPart11 = new EntityDragonPart(this, "tendrilPart11", 10.0F, 10.0F), tendrilPart12 = new EntityDragonPart(this, "tendrilPart12", 10.0F, 10.0F), tendrilPart13 = new EntityDragonPart(this, "tendrilPart13", 10.0F, 10.0F), tendrilPart14 = new EntityDragonPart(this, "tendrilPart14", 10.0F, 10.0F) }); setSize(2.125F, 15.0F); ignoreFrustumCheck = true; experienceValue = 20;//WIP } public EntityNWPlantBossTendril(World world, double x, double y, double z) { this(world); setPosition(x, y, z); } protected void applyEntityAttributes() { super.applyEntityAttributes(); getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D); getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(MAX_HEALTH); getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.0D); } public void onLivingUpdate() { //WIP } public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEFINED; } protected void entityInit() { super.entityInit(); } public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); } public void readFromNBT(NBTTagCompound nbttagcompound) { super.readFromNBT(nbttagcompound); } public boolean attackEntityFromPart(EntityDragonPart dragonPart, DamageSource dmgSrc, float f0) { int armoredDamage = Math.round(f0 / ARMOR_MULTIPLIER); double range = calculateRange(dmgSrc); if (range > 14D) return false; else return superAttackFrom(dmgSrc, armoredDamage); } protected boolean superAttackFrom(DamageSource dmgSrc, float f0) { return super.attackEntityFrom(dmgSrc, f0); } protected double calculateRange(DamageSource dmgSrc) { double range = -1D; if (dmgSrc.getEntity() != null) { range = getDistanceSqToEntity(dmgSrc.getEntity()); } if (dmgSrc.getSourceOfDamage() != null) { range = getDistanceSqToEntity(dmgSrc.getSourceOfDamage()); } return range; } public boolean attackEntityFrom(DamageSource dmgSrc, float f0) { return false; } public Entity[] getParts() { return partArray; } public boolean isEntityInvulnerable() { return false; } public boolean canDespawn() { return false; } public void knockBack(Entity entity1, float f, double d2, double d3) {} protected String getLivingSound() { return "mob.enderdragon.growl";//Test sounds } protected String getHurtSound() { return "mob.enderdragon.hit"; } protected String getDeathSound() { return "mob.enderdragon.death"; } protected float getSoundVolume() { return 2.0F; } public void onDeath(DamageSource dmgSrc) { super.onDeath(dmgSrc); } protected void dropFewItems(boolean par1, int par2) { //WIP } protected boolean isAIEnabled() { return false; } public boolean canBeCollidedWith() { return true; } protected void onDeathUpdate() { //Death anim stuff here } public World func_82194_d() { return worldObj; } } My first issue that I've come across is that whenever I attempt to attack my entity, it doesn't take damage. I realize I set the attackEntityFrom to return false, but I want to be able to tell which hitbox of the entity was hit (I assumed attackEntityFromPart would do the trick). How can I fix this? I also have a question: does each sub-entity of the mob have to be my own custom part entity, or can they just be dragonParts? Should I be using onUpdate() or onLivingUpdate()? Finally, here is a picture of the mob (WIP). Each box is intended to have its own hitbox, including the parent entity on the bottom.
  11. Hello, I've been making a few posts recently on the forums about small, random problems that have to do with a multipart mob I'm attempting to create. However, I've run into so many issues making it that I think my problem is that I don't fully understand how to make a multipart entity. I'm already fully aware of how to completely make a single entity (thanks to some Jabelar tutorials ). So, here's what I'm hoping someone can provide: Is there any sort of tutorial or guidance on making a multipart entity besides studying the enderdragon code (as I've already done that)? I apologize if I'm simply missing some obvious facts, but I need help. Thanks for reading at least!
  12. Hello, I've been trying to make an entity made of multiple parts, therefore it can have multiple hitboxes. However, the problem is that I can't see the hitboxes by pressing f3 + B. I saw a post (http://www.minecraftforge.net/forum/index.php/topic,6258.0.html) with code making them visible, but I can't place it anywhere in my mod properly. So, where do I need to put this code, or is there an easier way now?
  13. Hello, I've been making my own custom mob for a while now, and I've come across this issue. My mob is pretty tall (about 15 blocks tall if you want numbers), so whenever I look up at it and don't look at its base (on the ground), it disappears. Whenever I look back down at its base, it pops back up. How can I fix it to be rendered persistently or something like that? Thanks for reading!
  14. Hello, I've been dealing with a bit of a problem for quite a while now with my modded server. My server goes down to restart on a regular basis, but every now and then it won't start back up. This will continue for a few hours even if I try manually starting the server. There is no log, and no crash report. The console just freezes. It usually stops after it's loaded the default config, but it will also stop after a few launch wrappers run. It's also a bit annoying to find my server randomly able to start up perfectly fine a few hours afterwards. Why is this happening, and why is it so inconsistent?
  15. Thanks! setUnlocalizedName was unavailable (which was what I was trying to do), but setBlockName did the trick!
×
×
  • Create New...

Important Information

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