Hey, I'm fairly new to modding, and started at 1.7.10 (yet to move onto later updates). I've made an entity a lot similar to Blaze, however rather than the "fire" aesthetic, I've made the entity more of the opposite to Blaze (ice,water).
Although I have majorly figured the base stuff out including creating my custom fireball entity with slowness and snow placing on blocks. The main issues I'm having are the fireball render still showing the 'fire' animation.
I've tried countless ways to change or even remove the render, however I have not been successful.
I was wondering if this is possible or does the extended fireball entity require the fire?
I hope this makes sense. Code for the custom fireball below. Forge 1.7.10-10.13.4.1448.
package temog.temogaesthetics.entity.projectile;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.init.Blocks;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import temog.temogaesthetics.entity.EntityGlaze;
public class EntityNewSnowball extends EntitySmallFireball{
private static final String __OBFID = "CL_00001721";
public EntityNewSnowball(World p_i1770_1_)
{
super(p_i1770_1_);
this.setSize(0.3125F, 0.3125F);
}
public EntityNewSnowball(World p_i1771_1_, EntityLivingBase p_i1771_2_, double p_i1771_3_, double p_i1771_5_, double p_i1771_7_)
{
super(p_i1771_1_, p_i1771_2_, p_i1771_3_, p_i1771_5_, p_i1771_7_);
this.setSize(0.3125F, 0.3125F);
}
public EntityNewSnowball(World p_i1772_1_, double p_i1772_2_, double p_i1772_4_, double p_i1772_6_, double p_i1772_8_, double p_i1772_10_, double p_i1772_12_)
{
super(p_i1772_1_, p_i1772_2_, p_i1772_4_, p_i1772_6_, p_i1772_8_, p_i1772_10_, p_i1772_12_);
this.setSize(0.3125F, 0.3125F);
}
private static final ResourceLocation mobTextures = new ResourceLocation("TemogAesthetics:textures/entity/projectile/iceball.png");
private static int fire = 0;
protected ResourceLocation getEntityTexture(EntityNewSnowball entity) {
// TODO Auto-generated method stub
return mobTextures;
}
protected ResourceLocation getEntityTexture(Entity entity){
return this.getEntityTexture((EntityNewSnowball)entity);
}
@Override
public boolean isBurning()
{
boolean flag = this.worldObj != null && this.worldObj.isRemote;
return false;
}
/**
* Removes fire from entity.
*
*/
@Override
public void extinguish()
{
this.fire = 0;
}
/**
* Called when this EntityFireball hits a block or entity.
*/
protected void onImpact(MovingObjectPosition p_70227_1_)
{
if (!this.worldObj.isRemote)
{
if (p_70227_1_.entityHit != null)
{
if (!p_70227_1_.entityHit.isImmuneToFire() && p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 4.0F))
{
((EntityLivingBase) p_70227_1_.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 360, 2));
}
}
else
{
int i = p_70227_1_.blockX;
int j = p_70227_1_.blockY;
int k = p_70227_1_.blockZ;
switch (p_70227_1_.sideHit)
{
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
if (this.worldObj.isAirBlock(i, j, k))
{
this.worldObj.setBlock(i, j, k, Blocks.snow_layer, 1, getEntityId());
}
}
this.setDead();
}
}
/**
* Returns true if other Entities should be prevented from moving through this Entity.
*/
public boolean canBeCollidedWith()
{
return Blocks.flowing_water != Blocks.ice;
}
/**
* Called when the entity is attacked.
*/
public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_)
{
return false;
}
}
EntitySmallFireball extends EntityFireball. In EntityFireball's onUpdate() method there is this (Its probably what you're looking for, if so got to get rid of it, try overriding the onUpdate() method with your own.)
Instead of extending EntitySmallFireball, you could copy & paste the code from EntityFireball & EntitySmallFireBall (removing/modify whatever you want) into your EntityNewSnowball's class so you don't have to extend EntitySmallFireball.
Rollback Post to RevisionRollBack
I got a mod...go check it out. Its got guns and hats and other stuff.
Unfortunately tried both of these didn't seem to help, the override onUpdate() didn't seem do anything.
Also tried the none extend, with copies from Fireball and SmallFireball, however it never gets shown in the firing process even with the resource locator command.
The snowball doesn't render? Does it still spawn? By spawn I mean when you throw the snowball it still applies slowdown & snow on the ground (spawns a working but invisible projectile). You might have to create your own renderer for the snowball. Look at RenderSnowball's class and just copy & paste (changing whatever you want) into your own RenderCustomSnowball (whatever you name it). Then do the RenderingRegistry with your new Renderer class.
Rollback Post to RevisionRollBack
I got a mod...go check it out. Its got guns and hats and other stuff.
Hey, I'm fairly new to modding, and started at 1.7.10 (yet to move onto later updates). I've made an entity a lot similar to Blaze, however rather than the "fire" aesthetic, I've made the entity more of the opposite to Blaze (ice,water).
Although I have majorly figured the base stuff out including creating my custom fireball entity with slowness and snow placing on blocks. The main issues I'm having are the fireball render still showing the 'fire' animation.
I've tried countless ways to change or even remove the render, however I have not been successful.
I was wondering if this is possible or does the extended fireball entity require the fire?
I hope this makes sense. Code for the custom fireball below. Forge 1.7.10-10.13.4.1448.
EntitySmallFireball extends EntityFireball. In EntityFireball's onUpdate() method there is this (Its probably what you're looking for, if so got to get rid of it, try overriding the onUpdate() method with your own.)
Instead of extending EntitySmallFireball, you could copy & paste the code from EntityFireball & EntitySmallFireBall (removing/modify whatever you want) into your EntityNewSnowball's class so you don't have to extend EntitySmallFireball.
I got a mod...go check it out. Its got guns and hats and other stuff.
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1291464-1-8-1-7-10-team-fortress-2-mod-v2-0-0-v1-8-6
This is great thanks for the response!
Unfortunately tried both of these didn't seem to help, the override onUpdate() didn't seem do anything.
Also tried the none extend, with copies from Fireball and SmallFireball, however it never gets shown in the firing process even with the resource locator command.
Not sure on what else to do.
The snowball doesn't render? Does it still spawn? By spawn I mean when you throw the snowball it still applies slowdown & snow on the ground (spawns a working but invisible projectile). You might have to create your own renderer for the snowball. Look at RenderSnowball's class and just copy & paste (changing whatever you want) into your own RenderCustomSnowball (whatever you name it). Then do the RenderingRegistry with your new Renderer class.
I got a mod...go check it out. Its got guns and hats and other stuff.
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1291464-1-8-1-7-10-team-fortress-2-mod-v2-0-0-v1-8-6