So I tried mimicing the beacon code. I know the ticker variable is working but the potion effects are not applying
is there anything wrong with my code?
Forgive me i am new to modding
public PolCanEntity() {
double ranges = 6;
if(ticker >= 23 ) {
int pollutionlevel = 100;
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox((double)xCoord-ranges, (double)yCoord, (double)zCoord, (double)xCoord + ranges, (double)yCoord + ranges, (double)zCoord + ranges);
List list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class,axis);
Iterator ilikepie = list.iterator();
EntityPlayer player;
if(pollutionlevel >=100 && ilikepie.hasNext()) {
player = (EntityPlayer)ilikepie.next();
player.addPotionEffect(new PotionEffect(17,1000,1,true));
ticker = 0;