I need the entity that exits the healing spell i'm making die when it hits a player and heal them, but just die if they hits anything else. I don't do that much work with entities of this sort, so my code may have a lot of easy workarounds I don't know about. I haven't added any system yet to heal the player, but I'm working on it.
package WowArmory.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public abstract class EntityHeal extends Entity implements IProjectile{
public EntityHeal(World p_i1582_1_) {
super(p_i1582_1_);
this.setSize(0.5F, 0.5F);
this.yOffset = 0.0F;
}
// TODO Auto-generated constructor stub
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit instanceof EntityPlayer)
{
//Heal player then die.
}
else
{
//Errors with this line VVV
this.setDead;
}
}
}
I need the entity that exits the healing spell i'm making die when it hits a player and heal them, but just die if they hits anything else. I don't do that much work with entities of this sort, so my code may have a lot of easy workarounds I don't know about. I haven't added any system yet to heal the player, but I'm working on it.
package WowArmory.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public abstract class EntityHeal extends Entity implements IProjectile{
public EntityHeal(World p_i1582_1_) {
super(p_i1582_1_);
this.setSize(0.5F, 0.5F);
this.yOffset = 0.0F;
}
// TODO Auto-generated constructor stub
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit instanceof EntityPlayer)
{
//Heal player then die.
}
else
{
//Errors with this line VVV
this.setDead;
}
}
}
What are the errors though?! Telling us that a particular line errors is useless unless we know what the error is.
Rollback Post to RevisionRollBack
Please don't PM me asking for help, I will just redirect you to the appropriate forum, where there are others who are far more skilled than me.
On this.setDead; it says that it cannot be resolved or is not a field, and then when I hit the top quick fix (create field 'setDead' inside EntityHeal)it then says Syntax error, insert "AssignmentOperator Expression" to complete Expression, with no further fixes. Sorry for not including this :P. (New code:)
package WowArmory.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public abstract class EntityHeal extends Entity implements IProjectile{
//The is what's new
private Object setDead;
//This is what's new
public EntityHeal(World p_i1582_1_) {
super(p_i1582_1_);
this.setSize(0.5F, 0.5F);
this.yOffset = 0.0F;
}
// TODO Auto-generated constructor stub
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit instanceof EntityPlayer)
{
//Heal player then die.
}
else
{
//Errors with this line VVV
this.setDead;
}
}
}
On this.setDead; it says that it cannot be resolved or is not a field, and then when I hit the top quick fix (create field 'setDead' inside EntityHeal)it then says Syntax error, insert "AssignmentOperator Expression" to complete Expression, with no further fixes. Sorry for not including this :P. (New code:)
package WowArmory.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public abstract class EntityHeal extends Entity implements IProjectile{
//The is what's new
private Object setDead;
//This is what's new
public EntityHeal(World p_i1582_1_) {
super(p_i1582_1_);
this.setSize(0.5F, 0.5F);
this.yOffset = 0.0F;
}
// TODO Auto-generated constructor stub
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit instanceof EntityPlayer)
{
//Heal player then die.
}
else
{
//Errors with this line VVV
this.setDead;
}
}
}
Why is that class abstract?
Rollback Post to RevisionRollBack
Please don't PM me asking for help, I will just redirect you to the appropriate forum, where there are others who are far more skilled than me.
Undo all the quick fixes(The options Eclipse gives you to fix the errors), then go learn Java. The quick fixes are no substitute for a good knowledge of Java.
Rollback Post to RevisionRollBack
Please don't PM me asking for help, I will just redirect you to the appropriate forum, where there are others who are far more skilled than me.
I need the entity that exits the healing spell i'm making die when it hits a player and heal them, but just die if they hits anything else. I don't do that much work with entities of this sort, so my code may have a lot of easy workarounds I don't know about. I haven't added any system yet to heal the player, but I'm working on it.
What are the errors though?! Telling us that a particular line errors is useless unless we know what the error is.
Please don't PM me asking for help, I will just redirect you to the appropriate forum, where there are others who are far more skilled than me.
This is not the signature you are looking for.
Banners and such things
Oh yeah, that's important.
On this.setDead; it says that it cannot be resolved or is not a field, and then when I hit the top quick fix (create field 'setDead' inside EntityHeal)it then says Syntax error, insert "AssignmentOperator Expression" to complete Expression, with no further fixes. Sorry for not including this :P. (New code:)
Why is that class abstract?
Please don't PM me asking for help, I will just redirect you to the appropriate forum, where there are others who are far more skilled than me.
This is not the signature you are looking for.
Banners and such things
Ummmm...
I have no idea. I don't remember doing anything that even changed that
This is what I have now.
Now with the error of Syntax error, insert "AssignmentOperator Expression" to complete Expression, and I don't know where to insert it.
Undo all the quick fixes(The options Eclipse gives you to fix the errors), then go learn Java. The quick fixes are no substitute for a good knowledge of Java.
Please don't PM me asking for help, I will just redirect you to the appropriate forum, where there are others who are far more skilled than me.
This is not the signature you are looking for.
Banners and such things