Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
public boolean attackEntityAsMob(Entity p_70652_1_)
{
if (super.attackEntityAsMob(p_70652_1_))
{
if (p_70652_1_ instanceof EntityLivingBase)
{
byte b0 = 0;
if (this.worldObj.difficultySetting == EnumDifficulty.NORMAL)
{
b0 = 7;
}
else if (this.worldObj.difficultySetting == EnumDifficulty.HARD)
{
b0 = 15;
}
if (b0 > 0)
{
((EntityLivingBase)p_70652_1_).addPotionEffect(new PotionEffect(Potion.poison.id, b0 * 20, 0));
}
}
return true;
}
else
{
return false;
}
}
Вот я по крайней мере могу понять, что такое метод и java в целом знаю хорошо)Dragon2488 написал(а):Хохсерг, тебе самому надо язык учить.
@Override
public boolean attackEntityAsMob(Entity par1Entity)
{
((EntityLivingBase)par1Entity).addPotionEffect(new PotionEffect(20, 15 * 20, 0));
return true;
}
ItemStack is = new ItemStack(Items.golden_sword);this.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword));
ну так то, АТАКА не сработает, если удара не было. Это значит что он не отобразил атаку, но она была.когда я близко к мобу подхожу
this.setCurrentItemOrArmor(0, new ItemStack(Main.euclase_sword));
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
{
this.dropItem(Main.euclase_sword, 1);
}
@Override
public boolean attackEntityAsMob(Entity par1Entity)
{
if (super.attackEntityAsMob(par1Entity))
{
((EntityLivingBase)par1Entity).addPotionEffect(new PotionEffect(20, 15 * 20, 0));
}
return true;
}
@Override
public boolean attackEntityAsMob(Entity par1Entity)
{
((EntityLivingBase)par1Entity).addPotionEffect(new PotionEffect(20, 15 * 20, 0));
return true;
}