- 48
- 1
Есть entity:
Но есть вопрос как загрузит для нево текстурку.
Java:
package com.feldsher_.gopnimod.entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityCanned extends EntityThrowable{
public EntityCanned(World worldIn)
{
super(worldIn);
}
public EntityCanned(World worldIn, EntityLivingBase p_i1774_2_)
{
super(worldIn, p_i1774_2_);
}
public EntityCanned(World worldIn, double x, double y, double z)
{
super(worldIn, x, y, z);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
if (p_70184_1_.entityHit instanceof EntityLivingBase)
{
((EntityLivingBase)p_70184_1_.entityHit).addPotionEffect(new PotionEffect(Potion.invisibility.id, 100, 0));
}
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 4.0F);
}
for (int i = 0; i < 8; ++i)
{
this.worldObj.spawnParticle(EnumParticleTypes.BARRIER, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
}
if (!this.worldObj.isRemote)
{
this.setDead();
}
}
}