Jump to content

[1.8] Can't get value from entity


DZed

Recommended Posts

So, I'm basically making my own variant of an XP Orb, but no matter what I try, I can't get the value from the Orb, and therefore can't set the proper texture per Orb.

 

Here's the Entity file:

 

 

package com.dialgex.SburbMod.Entities.Boondollars;

import net.minecraft.block.material.Material;

import net.minecraft.entity.Entity;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.util.BlockPos;

import net.minecraft.util.DamageSource;

import net.minecraft.util.MathHelper;

import net.minecraft.world.World;

import net.minecraftforge.fml.relauncher.Side;

import net.minecraftforge.fml.relauncher.SideOnly;

import com.dialgex.SburbMod.Events.PlayerPickupBoondollarEvent;

import com.dialgex.SburbMod.PlayerData.ExtendedPlayer;

public class Boondollar extends Entity

{

/**

* A constantly increasing value that RenderXPOrb uses to control the colour shifting (Green / yellow)

*/

public int xpColor;

/** The age of the XP orb in ticks. */

public int xpOrbAge;

public int field_70532_c;

/** The health of this XP orb. */

private int xpOrbHealth = 5;

/** This is how much XP this orb has. */

int boondollarValue;

/** The closest EntityPlayer to this orb. */

private EntityPlayer closestPlayer;

/** Threshold color for tracking players */

private int xpTargetColor;

public Boondollar(World worldIn, double x, double y, double z, int boonValue)

{

super(worldIn);

this.setSize(0.5F, 0.5F);

this.setPosition(x, y, z);

this.rotationYaw = (float)(Math.random() * 360.0D);

this.motionX = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F);

this.motionY = (double)((float)(Math.random() * 0.2D) * 2.0F);

this.motionZ = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F);

this.boondollarValue = boonValue;

}

/**

* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to

* prevent them from trampling crops

*/

protected boolean canTriggerWalking()

{

return false;

}

public Boondollar(World worldIn)

{

super(worldIn);

this.setSize(0.25F, 0.25F);

}

protected void entityInit() {}

@SideOnly(Side.CLIENT)

public int getBrightnessForRender(float p_70070_1_)

{

float f1 = 0.5F;

if (f1 < 0.0F)

{

f1 = 0.0F;

}

if (f1 > 1.0F)

{

f1 = 1.0F;

}

int i = super.getBrightnessForRender(p_70070_1_);

int j = i & 255;

int k = i >> 16 & 255;

j += (int)(f1 * 15.0F * 16.0F);

if (j > 240)

{

j = 240;

}

return j | k << 16;

}

/**

* Called to update the entity's position/logic.

*/

public void onUpdate()

{

super.onUpdate();

if (this.field_70532_c > 0)

{

--this.field_70532_c;

}

this.prevPosX = this.posX;

this.prevPosY = this.posY;

this.prevPosZ = this.posZ;

this.motionY -= 0.029999999329447746D;

//System.out.println(this.boondollarValue);

if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() == Material.lava)

{

this.motionY = 0.20000000298023224D;

this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);

this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);

this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F);

}

this.pushOutOfBlocks(this.posX, (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D, this.posZ);

double d0 = 8.0D;

 

if (this.xpTargetColor < this.xpColor - 20 + this.getEntityId() % 100)

{

if (this.closestPlayer == null || this.closestPlayer.getDistanceSqToEntity(this) > d0 * d0)

{

this.closestPlayer = this.worldObj.getClosestPlayerToEntity(this, d0);

}

this.xpTargetColor = this.xpColor;

}

 

if (this.closestPlayer != null)

{

double d1 = (this.closestPlayer.posX - this.posX) / d0;

double d2 = (this.closestPlayer.posY + (double)this.closestPlayer.getEyeHeight() - this.posY) / d0;

double d3 = (this.closestPlayer.posZ - this.posZ) / d0;

double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);

double d5 = 1.0D - d4;

if (d5 > 0.0D)

{

d5 *= d5;

this.motionX += d1 / d4 * d5 * 0.1D;

this.motionY += d2 / d4 * d5 * 0.1D;

this.motionZ += d3 / d4 * d5 * 0.1D;

}

}

this.moveEntity(this.motionX, this.motionY, this.motionZ);

float f = 0.98F;

if (this.onGround)

{

f = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.98F;

}

this.motionX *= (double)f;

this.motionY *= 0.9800000190734863D;

this.motionZ *= (double)f;

if (this.onGround)

{

this.motionY *= -0.8999999761581421D;

}

//++this.xpColor;

++this.xpOrbAge;

if (this.xpOrbAge >= 6000)

{

this.setDead();

}

}

/**

* Returns if this entity is in water and will end up adding the waters velocity to the entity

*/

public boolean handleWaterMovement()

{

return this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox(), Material.water, this);

}

/**

* Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args:

* amountDamage

*/

protected void dealFireDamage(int p_70081_1_)

{

this.attackEntityFrom(DamageSource.inFire, (float)p_70081_1_);

}

/**

* Called when the entity is attacked.

*/

public boolean attackEntityFrom(DamageSource source, float amount)

{

if (this.isEntityInvulnerable(source))

{

return false;

}

else

{

this.setBeenAttacked();

this.xpOrbHealth = (int)((float)this.xpOrbHealth - amount);

if (this.xpOrbHealth <= 0)

{

this.setDead();

}

return false;

}

}

/**

* (abstract) Protected helper method to write subclass entity data to NBT.

*/

public void writeEntityToNBT(NBTTagCompound p_70014_1_)

{

p_70014_1_.setShort("Health", (short)((byte)this.xpOrbHealth));

p_70014_1_.setShort("Age", (short)this.xpOrbAge);

p_70014_1_.setShort("Value", (short)this.boondollarValue);

}

/**

* (abstract) Protected helper method to read subclass entity data from NBT.

*/

public void readEntityFromNBT(NBTTagCompound p_70037_1_)

{

this.xpOrbHealth = p_70037_1_.getShort("Health") & 255;

this.xpOrbAge = p_70037_1_.getShort("Age");

this.boondollarValue = p_70037_1_.getShort("Value");

}

/**

* Called by a player entity when they collide with an entity

*/

public void onCollideWithPlayer(EntityPlayer entityIn)

{

if (!this.worldObj.isRemote)

{

ExtendedPlayer props = ExtendedPlayer.get(entityIn);

if (this.field_70532_c == 0 && entityIn.xpCooldown == 0)

{

if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new com.dialgex.SburbMod.Events.PlayerPickupBoondollarEvent(entityIn, this))) return;

entityIn.xpCooldown = 2;

this.worldObj.playSoundAtEntity(entityIn, "random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F));

entityIn.onItemPickup(this, 1);

props.addBoondollars(this.boondollarValue);

//System.out.println(this.getBoondollarValue());

this.setDead();

}

}

}

/**

* Returns the XP value of this XP orb.

*/

public int getBoondollarValue(){

System.out.println(this.boondollarValue); // THIS F***ER GETS THE RIGHT VALUE

return this.boondollarValue;

}

 

@SideOnly(Side.CLIENT)

public int getTextureByValue(){

System.out.println(this.getBoondollarValue()); // THIS F***ER WON'T GET THE RIGHT VALUE

return this.boondollarValue >= 50 ? 3 : (this.boondollarValue >= 25 ? 2 : (this.boondollarValue >= 10 ? 1 : (this.boondollarValue >= 5 ? 0 : -1)));

}

/**

int returnxp = -1;

if(this.boondollarValue == 50){

returnxp = 3;

}else if(this.boondollarValue == 25){

returnxp = 2;

}else if(this.boondollarValue == 10){

returnxp = 1;

}else if(this.boondollarValue == 5){

returnxp = 0;

}else if(this.boondollarValue == 0){

returnxp = 1;

//System.out.println("Still Zero, but if/then works");

}

return returnxp;

}

/**

* If returns false, the item will not inflict any damage against entities.

*/

public boolean canAttackWithItem()

{

return false;

}

}

 

 

I'm at such a loss of what to do.

I've added System.outs over various places, and the only place that zero's out the value completely is the "getTextureByValue" part

 

If needed, here's the render file:

 

 

package com.dialgex.SburbMod.Client.Renderer;

import com.dialgex.SburbMod.Entities.Boondollars.Boondollar;

import net.minecraft.client.Minecraft;

import net.minecraft.client.renderer.GlStateManager;

import net.minecraft.client.renderer.OpenGlHelper;

import net.minecraft.client.renderer.Tessellator;

import net.minecraft.client.renderer.WorldRenderer;

import net.minecraft.client.renderer.entity.Render;

import net.minecraft.client.renderer.entity.RenderManager;

import net.minecraft.entity.Entity;

import net.minecraft.util.MathHelper;

import net.minecraft.util.ResourceLocation;

import net.minecraftforge.fml.relauncher.Side;

import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)

public class RenderBoondollar extends Render

{

private static final ResourceLocation BoondollarTextures = new ResourceLocation("sburbmod", "textures/entities/BoondollarTex.png");

public RenderBoondollar(RenderManager p_i46178_1_)

{

super(p_i46178_1_);

this.shadowSize = 0.15F;

this.shadowOpaque = 0.75F;

}

public void doRender(Boondollar entity, double x, double y, double z, float p_76986_8_, float partialTicks)

{

GlStateManager.pushMatrix();

GlStateManager.translate((float)x, (float)y, (float)z);

this.bindEntityTexture(entity);

int i = entity.getTextureByValue();

float f2 = (float)(i * 64 + 0) / 256.0F;

float f3 = (float)(i * 64 + 64) / 256.0F;

float f4 = (float)(i * 256 + 0) / 256.0F;

float f5 = (float)(i * 256 + 256) / 256.0F;

float f6 = 1.0F;

float f7 = 0.5F;

float f8 = 0.25F;

int j = entity.getBrightnessForRender(partialTicks);

int k = j % 65536;

int l = j / 65536;

OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)k / 1.0F, (float)l / 1.0F);

GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

float f10 = 255.0F;

float f11 = ((float)entity.xpColor + partialTicks) / 2.0F;

l = (int)((MathHelper.sin(f11 + 0.0F) + 1.0F) * 0.5F * f10);

int i1 = (int)f10;

int j1 = (int)((MathHelper.sin(f11 + 4.1887903F) + 1.0F) * 0.1F * f10);

int k1 = l << 16 | i1 << 8 | j1;

GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);

GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);

float f9 = 0.3F;

GlStateManager.scale(f9, f9, f9);

Tessellator tessellator = Tessellator.getInstance();

WorldRenderer worldrenderer = tessellator.getWorldRenderer();

worldrenderer.startDrawingQuads();

worldrenderer.setColorRGBA_I(k1, 128);

worldrenderer.setNormal(0.0F, 1.0F, 0.0F);

worldrenderer.addVertexWithUV((double)(0.0F - f7), (double)(0.0F - f8), 0.0D, (double)f2, (double)f5);

worldrenderer.addVertexWithUV((double)(f6 - f7), (double)(0.0F - f8), 0.0D, (double)f3, (double)f5);

worldrenderer.addVertexWithUV((double)(f6 - f7), (double)(1.0F - f8), 0.0D, (double)f3, (double)f4);

worldrenderer.addVertexWithUV((double)(0.0F - f7), (double)(1.0F - f8), 0.0D, (double)f2, (double)f4);

tessellator.draw();

GlStateManager.disableBlend();

GlStateManager.disableRescaleNormal();

GlStateManager.popMatrix();

super.doRender(entity, x, y, z, p_76986_8_, partialTicks);

//System.out.println(i);

}

protected ResourceLocation getTexture(Boondollar p_180555_1_)

{

return BoondollarTextures;

}

protected ResourceLocation getEntityTexture(Entity entity)

{

return this.getTexture((Boondollar)entity);

}

public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float partialTicks)

{

this.doRender((Boondollar)entity, x, y, z, p_76986_8_, partialTicks);

}

}

/**

@SideOnly(Side.CLIENT)

public class RenderBoondollar extends Render

{

private static final ResourceLocation BoondollarTextures = new ResourceLocation("sburbmod", "textures/entities/BoondollarTex.png");

public RenderBoondollar()

{

super(Minecraft.getMinecraft().getRenderManager());

this.shadowSize = 0.15F;

this.shadowOpaque = 0.75F;

}

/**

* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then

* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic

* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,

* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.

*

public void doRender(Boondollar entity, double x, double y, double z, float p_76986_8_, float partialTicks)

{

GlStateManager.pushMatrix();

GlStateManager.translate((float)x, (float)y, (float)z);

this.bindEntityTexture(entity);

int i = entity.getTextureByXP();

float f2 = (float)(i * 64 + 0) / 256.0F;

float f3 = (float)(i * 64 + 64) / 256.0F;

float f4 = (float)(i * 256 + 0) / 256.0F;

float f5 = (float)(i * 256 + 256) / 256.0F;

float f6 = 1.0F;

float f7 = 0.5F;

float f8 = 0.25F;

int j = entity.getBrightnessForRender(partialTicks);

int k = j % 65536;

int l = j / 65536;

OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)k / 1.0F, (float)l / 1.0F);

GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

float f10 = 255.0F;

float f11 = ((float)entity.xpColor + partialTicks) / 2.0F;

l = (int)((MathHelper.sin(f11 + 0.0F) + 1.0F) * 0.5F * f10);

int i1 = (int)f10;

int j1 = (int)((MathHelper.sin(f11 + 4.1887903F) + 1.0F) * 0.1F * f10);

int k1 = l << 16 | i1 << 8 | j1;

GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);

GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);

float f9 = 0.3F;

GlStateManager.scale(f9, f9, f9);

Tessellator tessellator = Tessellator.getInstance();

WorldRenderer worldrenderer = tessellator.getWorldRenderer();

worldrenderer.startDrawingQuads();

worldrenderer.setColorRGBA_I(k1, 128);

worldrenderer.setNormal(0.0F, 1.0F, 0.0F);

worldrenderer.addVertexWithUV((double)(0.0F - f7), (double)(0.0F - f8), 0.0D, (double)f2, (double)f5);

worldrenderer.addVertexWithUV((double)(f6 - f7), (double)(0.0F - f8), 0.0D, (double)f3, (double)f5);

worldrenderer.addVertexWithUV((double)(f6 - f7), (double)(1.0F - f8), 0.0D, (double)f3, (double)f4);

worldrenderer.addVertexWithUV((double)(0.0F - f7), (double)(1.0F - f8), 0.0D, (double)f2, (double)f4);

tessellator.draw();

GlStateManager.disableBlend();

GlStateManager.disableRescaleNormal();

GlStateManager.popMatrix();

super.doRender(entity, x, y, z, p_76986_8_, partialTicks);

}

/**

* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.

*

protected ResourceLocation getEntityTexture(Boondollar p_110775_1_)

{

return BoondollarTextures;

}

/**

* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.

*

protected ResourceLocation getEntityTexture(Entity p_110775_1_)

{

return this.getEntityTexture((Boondollar)p_110775_1_);

}

/**

* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then

* handing it off to a worker function which does the actual work. In all probability, the class Render is generic

* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,

* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.

*

public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)

{

this.doRender((Boondollar)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);

}

}

*/

 

 

 

And the dropEvent File (a mess):

 

 

package com.dialgex.SburbMod.Events;

import java.util.Random;

import com.sun.org.apache.bcel.internal.generic.INSTANCEOF;

import net.minecraftforge.fml.common.FMLLog;

import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

import net.minecraft.entity.EntityLiving;

import net.minecraft.entity.IEntityLivingData;

import net.minecraft.entity.passive.*;

import net.minecraft.entity.monster.*;

import net.minecraft.entity.boss.*;

import net.minecraft.server.MinecraftServer;

import net.minecraft.util.MathHelper;

import net.minecraft.world.World;

import net.minecraftforge.event.entity.living.LivingDropsEvent;

import com.dialgex.SburbMod.Client.Renderer.RenderBoondollar;

import com.dialgex.SburbMod.Entities.Boondollars.Boondollar;

public class BoondollarDropEvent{

 

private static int rNum(int min, int max) {

Random r = new Random();

int randomNum = r.nextInt((max - min) + 1) + min;

return randomNum;

}

 

public static double rand;

@SubscribeEvent

public void onEntityDrop(LivingDropsEvent event){

World world = event.entity.worldObj;

 

if (event.source.getDamageType().equals("player")){

double tx = event.entityLiving.posX;

double ty = event.entityLiving.posY;

double tz = event.entityLiving.posZ;

rand = Math.random();

 

int cent3 = 0;

int cent2 = 0;

int cent1 = 0;

int cent0 = 0;

int val50 = 50;

int val25 = 25;

int val10 = 10;

int val5 = 5;

/**

* Overworld Passives

*/

if (event.entityLiving instanceof EntityPig||

event.entityLiving instanceof EntityCow||

event.entityLiving instanceof EntitySheep||

event.entityLiving instanceof EntityOcelot||

event.entityLiving instanceof EntitySquid||

event.entityLiving instanceof EntityChicken||

event.entityLiving instanceof EntityHorse||

event.entityLiving instanceof EntityBat||

event.entityLiving instanceof EntityMooshroom){

int min3=1;

int min2=2;

int min1=5;

int min0=10;

for(int i=1; i<(min3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(min2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(min1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(min0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.83d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.66d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.50d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.33d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.16d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

}

}

}

}

}

}

/**

* Overworld Hostiles

*/

if (event.entityLiving instanceof EntityGolem||

event.entityLiving instanceof EntitySpider||

event.entityLiving instanceof EntityCaveSpider||

event.entityLiving instanceof EntityZombie||

(event.entityLiving instanceof EntitySkeleton && ((EntitySkeleton) event.entityLiving).getSkeletonType()!=1)||

event.entityLiving instanceof EntitySilverfish||

(event.entityLiving instanceof EntitySlime && ((EntitySlime) event.entityLiving).getSlimeSize()==1)||

event.entityLiving instanceof EntityWitch||

event.entityLiving instanceof EntityIronGolem||

event.entityLiving instanceof EntityCreeper||

event.entityLiving instanceof EntityBat){

int min3=1;

int min2=3;

int min1=7;

int min0=15;

for(int i=1; i<(min3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(min2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(min1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(min0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

System.out.println(val5);

}

if(rand < 0.83d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.66d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.50d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.33d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.16d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

}

}

}

}

}

}

 

/**

* Villagers

*/

if (event.entityLiving instanceof EntityVillager){

int min3=2;

int min2=4;

int min1=11;

int min0=22;

for(int i=1; i<(min3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(min2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(min1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(min0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.83d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.66d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.50d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.33d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.16d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

}

}

}

}

}

}

/**

* Nether Mobs

*/

if (event.entityLiving instanceof EntityMagmaCube||

(event.entityLiving instanceof EntitySkeleton && ((EntitySkeleton) event.entityLiving).getSkeletonType()==1)||

event.entityLiving instanceof EntityBlaze||

event.entityLiving instanceof EntityPigZombie){

int min3=2;

int min2=5;

int min1=12;

int min0=25;

for(int i=1; i<(min3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(min2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(min1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(min0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.83d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.66d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.50d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.33d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.16d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

}

}

}

}

}

}

/**

* Endermen

*/

if (event.entityLiving instanceof EntityEnderman){

int min3=3;

int min2=7;

int min1=17;

int min0=35;

for(int i=1; i<(min3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(min2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(min1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(min0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.83d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.66d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.50d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.33d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.16d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

}

}

}

}

}

}

/**

* Ghast

*/

if (event.entityLiving instanceof EntityGhast){

int min3=4;

int min2=9;

int min1=22;

int min0=45;

for(int i=1; i<(min3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(min2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(min1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(min0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.83d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.66d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.50d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.33d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.16d){

for(int i=1; i==cent3;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i==cent2;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i==cent1;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i==cent0;i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

}

}

}

}

}

}

/**

* Wither

*/

if (event.entityLiving instanceof EntityWither){

int min3=20;

int min2=40;

int min1=100;

int min0=200;

int f3=4;

int f2=8;

int f1=20;

int f0=40;

for(int i=1; i<(min3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(min2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(min1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(min0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.83d){

for(int i=1; i<(f3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(f2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(f1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(f0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.66d){

for(int i=1; i<(f3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(f2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(f1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(f0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.50d){

for(int i=1; i<(f3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(f2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(f1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(f0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.33d){

for(int i=1; i<(f3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(f2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(f1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(f0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.16d){

for(int i=1; i<(f3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(f2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(f1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(f0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

}

}

}

}

}

}

/**

* End Dragon

*/

if (event.entityLiving instanceof EntityDragon){

int min3=25;

int min2=50;

int min1=125;

int min0=250;

int f3=5;

int f2=10;

int f1=25;

int f0=50;

for(int i=1; i<(min3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(min2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(min1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(min0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.83d){

for(int i=1; i<(f3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(f2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(f1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(f0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.66d){

for(int i=1; i<(f3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(f2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(f1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(f0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.50d){

for(int i=1; i<(f3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(f2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(f1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(f0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.33d){

for(int i=1; i<(f3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(f2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(f1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(f0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

if(rand < 0.16d){

for(int i=1; i<(f3+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val50));

}

for(int i=1; i<(f2+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val25));

}

for(int i=1; i<(f1+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val10));

}

for(int i=1; i<(f0+1);i++){

world.spawnEntityInWorld(new Boondollar(world, tx, ty, tz, val5));

}

}

}

}

}

}

}

 

 

///////////////////////////////////////////

}

}

}

 

 

Please help me, I'm almost ripping my hair out

Link to comment
Share on other sites

http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/2137055-1-7-2-customizing-packet-handling-with

OR simple/short:

http://www.minecraftforge.net/forum/index.php/topic,20135.0.html

 

IMPORTANT

In 1.8 there are 4 threads (not 2 like in pre-1.8).

Server, Client and two netty (for server and client).

Because of that you might have problems if e.g server constructs entity and will send packet to client, but client won't be able to apply changes on entity because it hasn't constructed it yet. To avoid that create new Runnable and throw it into mc main thread:

Minecraft.getMinecraft().addScheduledTask(Runnable);

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Really sorry for any frustration I may have caused.

I remember having this issue when writing for 1.7, but I lost that code and just remembered I found the solution on an old thread I made on Minecraftforum.net

http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2187766-solved-custom-xp-currency?comment=43

 

Thanks again for the help

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • For the moment it seems fixed. I deleted the JEI Config file, the Journeymap Server Config file, and disabled both the mods (even while disabled, it would still crash until those config files were gone). They're useful mods and I'd hate to not use it, would just deleting and redownloading the mods work?
    • For hours I have been trying to just instal Mr. Crayfish's Refurbished Furniture Mod, but each step to fix the error codes, the more problems arise. The farthest I got through the steps was getting to the Forge Installer, but once I had selected the file, an error saying "The directory is missing a launcher profile. Please run the minecraft launcher first". At this point I don;'t know what more I can do. Please help.
    • I create my mod pack,yesterday my mod pack is fine but i add one mod and error. I'm delete this mmod but minecraft is still stop on CONFIG_LOAD then I tried to delete config and restart it but again. If you can pleace help me. https://imgur.com/ngZBzuv
    • game crashes before even opening (log:https://mclo.gs/M8xvX7c)
    • I have created a custom entity that extends "TamableAnimal", but I am wanting to have it spawn in the ocean. I have it spawning right now, but it spawns way too frequently even with weight set to 1. I am guessing it is because it is rolling in the spawn pool of land animals since TameableAnimal extends Animal and is different than WaterAnimal, and since no land animals spawn in the ocean it just fills every inch up with my custom entity. I have followed basic tutorials for spawning entities with Forge, but I feel like I am missing something about how to change what spawn pool this custom entity ends up in. Is it possible to change that or do I need to refactor it to be based off of WaterAnimal to get those spawn? My biome modifier JSON file: { "type": "forge:add_spawns", "biomes": "#minecraft:is_ocean", "spawners": { "type": "darwinsmysticalmounts:water_animal", "weight": 20, "minCount": 1, "maxCount": 1 } } My client event: event.register(ModEntityTypes.WATER_ANIMAL.get(), SpawnPlacements.Type.NO_RESTRICTIONS, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, WaterWyvernEntity::checkCustomWaterAnimalSpawnRules, SpawnPlacementRegisterEvent.Operation.REPLACE); And the actual custom spawn rule that makes it spawn in the water: public static boolean checkCustomWaterAnimalSpawnRules(EntityType<WaterAnimalEntity> pAnimal, LevelAccessor pLevel, MobSpawnType pSpawnType, BlockPos pPos, RandomSource pRandom) { return pPos.getY() > pLevel.getSeaLevel() - 16 && pLevel.getFluidState(pPos.below()).is(FluidTags.WATER); }  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.