Everything posted by Asweez
-
Creating a bot
Why do you need this done so bad? And no we won't help because that is hacking
-
Creating a bot
That is kind of hacking
-
Blender to Minecraft
Well to put it into minecraft you're going to need to export your model into a Java file
-
Creating a bot
And if it is an entity you'll definitely need to start programming custom AIs for your entity to run on. Like Ernio said look into the sheep class to see how they locate and change grass.
-
Making an entity translucent and invincible
Ok I figured out the invincible part. I just set the isEntityInvulnerable to true and then they can't be hit
-
Making an entity translucent and invincible
Ok how do I enable / modify alpha in GL?
-
Making an entity translucent and invincible
What's an alpha layer and how do I add it? And by invincible I mean that you can't hit it.
-
Making an entity translucent and invincible
Pretty much what the title says. How would I do so?
-
Making an entity as a light source
It works thanks everyone
-
Making an entity as a light source
Ok cool ill try that
-
Making an entity as a light source
Ok I found a bug. When I apply it to the player, when the player jumps/sprint jumps, it will leave a trail of lighted blocks behind the player. Any way to fix this?
-
[1.8] MinecraftByExample sample code project
I have a lot of expertise with items and nbt stuff. I have some with entities and GUIs and almost nothing with blocks. If you ever need anything with those areas mentioned then I will try to help.
-
Making an entity as a light source
Lol Ya thx it works now
-
Making an entity as a light source
Ahhh yea I was wondering why it was 16 but I figured it probably has to be above 15 or something. Will try it out on see how it goes
-
Making an entity as a light source
Still not working, even though I made a living entity to test it: package com.apmods.magicraft.entity; import net.minecraft.entity.EntityLiving; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; public class EntityLivingTest extends EntityLiving{ public EntityLivingTest(World p_i1594_1_) { super(p_i1594_1_); // TODO Auto-generated constructor stub } public void onLivingUpdate() { super.onLivingUpdate(); addLight(); } private void addLight() { this.worldObj.setLightValue(EnumSkyBlock.Block, (int) this.posX, (int) this.posY, (int) this.posZ, 16); this.worldObj.markBlockRangeForRenderUpdate((int) this.posX, (int) this.posY, (int) this.posX, 12, 12, 12); this.worldObj.markBlockForUpdate((int) this.posX, (int) this.posY, (int) this.posZ); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX, (int) this.posY + 1, (int) this.posZ); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX, (int) this.posY - 1, (int) this.posZ); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX + 1, (int) this.posY, (int) this.posZ); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX - 1, (int) this.posY, (int) this.posZ); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX, (int) this.posY, (int) this.posZ + 1); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX, (int) this.posY, (int) this.posZ - 1); } }
-
Making an entity as a light source
package com.apmods.magicraft.entity; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IProjectile; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; import com.apmods.magicraft.main.SpellLib; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class EntitySpell extends EntityThrowable implements IProjectile{ private int arrowShake; private Entity shootingEntity; public EntitySpell(World par1World) { super(par1World); this.setThrowableHeading(motionX, motionY, motionZ, 4.5f, 1F); } public EntitySpell(World par1World, EntityLivingBase player, int spell) { super(par1World, player); this.setSpell(spell); float speed = 4.5f; if(spell == 7){ speed = 0; } this.shootingEntity = player; this.setThrowableHeading(motionX, motionY, motionZ, speed, 1F); } public EntitySpell(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5) { super(par1World); this.renderDistanceWeight = 10.0D; this.shootingEntity = par2EntityLivingBase; this.posY = par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D; double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX; double d1 = par3EntityLivingBase.boundingBox.minY + (double)(par3EntityLivingBase.height / 3.0F) - this.posY; double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ; double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2); if (d3 >= 1.0E-7D) { float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI)); double d4 = d0 / d3; double d5 = d2 / d3; this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3); this.yOffset = 0.0F; float f4 = (float)d3 * 0.2F; this.setThrowableHeading(d0, d1 + (double)f4, d2, par4, par5); } } @Override protected void entityInit() { //Spell this.dataWatcher.addObject(20, Integer.valueOf(1)); } @Override public void readEntityFromNBT(NBTTagCompound nbt) { super.readEntityFromNBT(nbt); this.setSpell(nbt.getInteger("spell")); } @Override public void writeEntityToNBT(NBTTagCompound nbt) { super.writeEntityToNBT(nbt); nbt.setFloat("spell", this.getSpell()); } @Override protected void onImpact(MovingObjectPosition mop) { Block block = this.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ); if(mop.entityHit != null && mop.entityHit instanceof EntityLivingBase){ EntityLivingBase entity = (EntityLivingBase) mop.entityHit; float f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); int damage = 0; double knockback = 0; if(this.getSpell() == SpellLib.STUPEFY){ entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 20, 0)); damage = 6; knockback = 0.3; } else if(this.getSpell() == SpellLib.AVADA_KEDAVRA){ damage = 100; knockback = 0.2; } else if(this.getSpell() == SpellLib.EXPELLIARMUS){ damage = 1; knockback = 0.2; if(entity instanceof EntityPlayer){ EntityPlayer player = (EntityPlayer) entity; ItemStack item = player.getCurrentEquippedItem(); if(item != null){ player.setCurrentItemOrArmor(0, null); this.dropItem(item.getItem(), item.stackSize); } // this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, player.posX + rand.nextInt(), player.posY + 2, player.posZ + rand.nextInt(), item.copy())); } else{ if(entity.getEquipmentInSlot(0) != null){ ItemStack item = entity.getEquipmentInSlot(0); if(item != null){ entity.setCurrentItemOrArmor(0, null); this.dropItem(item.getItem(), item.stackSize); } } } } else if(this.getSpell() == SpellLib.EXPULSO){ this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3.0f, true); } else if(this.getSpell() == SpellLib.CONFRINGO){ this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 3.0f, true, true); } else if(this.getSpell() == SpellLib.INCENDIO){ entity.setFire(5); } else if(this.getSpell() == SpellLib.AGUAMENTI){ entity.extinguish(); } else if(this.getSpell() == SpellLib.ALARTE_ASCENDARE){ entity.addVelocity(0, 2.5, 0); } entity.attackEntityFrom(DamageSource.magic, 1.0f * damage); entity.addVelocity(this.motionX * knockback * 0.6000000238418579D / (double)f4, knockback, this.motionZ * knockback * 0.6000000238418579D / (double)f4); } else if( block != Blocks.air){ if(this.getSpell() == SpellLib.DURO){ this.worldObj.setBlock(mop.blockX, mop.blockY, mop.blockZ, Blocks.stone); } else if(this.getSpell() == SpellLib.EXPULSO){ this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3.0f, true); } else if(this.getSpell() == SpellLib.CONFRINGO){ this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 3.0f, true, true); } else if(this.getSpell() == SpellLib.INCENDIO){ if(mop.sideHit == 1){ this.worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ, Blocks.fire); Random rand = new Random(); if(rand.nextInt(3) == 0){ if(this.worldObj.getBlock((int)this.posX + 1, (int)this.posY, (int)this.posZ) == Blocks.air){ this.worldObj.setBlock((int)this.posX + 1, (int)this.posY, (int)this.posZ, Blocks.fire); } } if(rand.nextInt(3) == 0){ if(this.worldObj.getBlock((int)this.posX - 1, (int)this.posY, (int)this.posZ) == Blocks.air){ this.worldObj.setBlock((int)this.posX - 1, (int)this.posY, (int)this.posZ, Blocks.fire); } } if(rand.nextInt(3) == 0){ if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ - 1) == Blocks.air){ this.worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ - 1, Blocks.fire); } } if(rand.nextInt(3) == 0){ if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ + 1) == Blocks.air){ this.worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ + 1, Blocks.fire); } } if(rand.nextInt(3) == 0){ if(this.worldObj.getBlock((int)this.posX + 1, (int)this.posY, (int)this.posZ + 1) == Blocks.air){ this.worldObj.setBlock((int)this.posX + 1, (int)this.posY, (int)this.posZ + 1, Blocks.fire); } } if(rand.nextInt(3) == 0){ if(this.worldObj.getBlock((int)this.posX + 1, (int)this.posY, (int)this.posZ - 1) == Blocks.air){ this.worldObj.setBlock((int)this.posX + 1, (int)this.posY, (int)this.posZ - 1, Blocks.fire); } } if(rand.nextInt(3) == 0){ if(this.worldObj.getBlock((int)this.posX - 1, (int)this.posY, (int)this.posZ + 1) == Blocks.air){ this.worldObj.setBlock((int)this.posX - 1, (int)this.posY, (int)this.posZ + 1, Blocks.fire); } } if(rand.nextInt(3) == 0){ if(this.worldObj.getBlock((int)this.posX - 1, (int)this.posY, (int)this.posZ - 1) == Blocks.air){ this.worldObj.setBlock((int)this.posX - 1, (int)this.posY, (int)this.posZ - 1, Blocks.fire); } } } } else if(this.getSpell() == SpellLib.AGUAMENTI){ // if(mop.sideHit == 1){ // this.worldObj.setBlock((int)this.posX, (int)this.posY + 1, (int)this.posZ, Blocks.flowing_water); // } // else if(mop.sideHit == 0){ // this.worldObj.setBlock((int)this.posX, (int)this.posY - 1, (int)this.posZ, Blocks.flowing_water); // } // else if(mop.sideHit == 2){ // this.worldObj.setBlock((int)this.posX + 1, (int)this.posY, (int)this.posZ, Blocks.flowing_water); // } // else if(mop.sideHit == 4){ // this.worldObj.setBlock((int)this.posX - 1, (int)this.posY, (int)this.posZ, Blocks.flowing_water); // } // else if(mop.sideHit == 3){ // this.worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ + 1, Blocks.flowing_water); // } // else if(mop.sideHit == 5){ // this.worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ - 1, Blocks.flowing_water); // } this.worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ, Blocks.flowing_water); } else{ this.setDead(); } } this.setDead(); } @Override public float getGravityVelocity(){ return 0; } @SideOnly(Side.CLIENT) public int getBrightnessForRender(float par1) { return 15728880; } /** * Gets how bright this entity is. */ public float getBrightness(float par1) { return 1.0F; } public void onUpdate(){ super.onUpdate(); // if(this.getSpell() == SpellLib.LUMOS){ // this.addLight(); // if (this.isDead) { // this.worldObj.updateLightByType(EnumSkyBlock.Block, // (int) this.posX, (int) this.posY, (int) this.posZ); // } // } Random rand = new Random(); if(rand.nextInt(2) == 1){ this.worldObj.spawnParticle("enchantmenttable", this.posX + rand.nextFloat()- 0.6f, this.posY , this.posZ + rand.nextFloat() - 0.6f, rand.nextFloat() - 0.5f, 0, rand.nextFloat() - 0.5f); } else{ this.worldObj.spawnParticle("enchantmenttable", this.posX - rand.nextFloat(), this.posY, this.posZ - rand.nextFloat(), rand.nextFloat() - 0.5f, 0, rand.nextFloat() - 0.5f); } } public void onEntityUpdate(){ super.onEntityUpdate(); if(this.getSpell() == SpellLib.LUMOS){ this.addLight(); } } public int getSpell(){ return this.dataWatcher.getWatchableObjectInt(20); } private void setSpell(int f){ this.dataWatcher.updateObject(20, Integer.valueOf(f)); } private void addLight() { System.out.println("light"); this.worldObj.setLightValue(EnumSkyBlock.Block, (int) this.posX, (int) this.posY, (int) this.posZ, 16); this.worldObj.markBlockRangeForRenderUpdate((int) this.posX, (int) this.posY, (int) this.posX, 12, 12, 12); this.worldObj.markBlockForUpdate((int) this.posX, (int) this.posY, (int) this.posZ); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX, (int) this.posY + 1, (int) this.posZ); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX, (int) this.posY - 1, (int) this.posZ); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX + 1, (int) this.posY, (int) this.posZ); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX - 1, (int) this.posY, (int) this.posZ); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX, (int) this.posY, (int) this.posZ + 1); this.worldObj.updateLightByType(EnumSkyBlock.Block, (int) this.posX, (int) this.posY, (int) this.posZ - 1); } public void setShootingEntity(EntityLivingBase entity){ this.shootingEntity = entity; } }
-
Making an entity as a light source
Ok I tried that the addLight method IS being called, but its not lighting anything up. It is 2 blocks above the ground btw.
-
Making an entity as a light source
No I'm using that tick handler just to see it work. Right now I haven't done anything with my entity
-
Making an entity as a light source
Yes I said everything is working.
-
Making an entity as a light source
Ok so I set up an addLight() thing for a player tick event, and everything is working but the addLight isn't doing anything. Here is my code: @SubscribeEvent public void onTick(TickEvent.PlayerTickEvent evt){ this.addLight(evt.player.worldObj, evt.player); } private void addLight(World world, EntityPlayer player) { world.setLightValue(EnumSkyBlock.Block, (int) player.posX, (int) player.posY, (int) player.posZ, 16); world.markBlockRangeForRenderUpdate((int) player.posX, (int) player.posY, (int) player.posX, 12, 12, 12); world.markBlockForUpdate((int) player.posX, (int) player.posY, (int) player.posZ); world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY + 1, (int) player.posZ); world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY - 1, (int) player.posZ); world.updateLightByType(EnumSkyBlock.Block, (int) player.posX + 1, (int) player.posY, (int) player.posZ); world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 1, (int) player.posY, (int) player.posZ); world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY, (int) player.posZ + 1); world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY, (int) player.posZ - 1); }
-
Making an entity as a light source
So I tryed using that on my projectile, which just stays in place atm. I have the add light method in the onUpdate method and it doesn't light anything up. Is there anything I should change?
-
Making an entity as a light source
Wow thanks
-
Making an entity as a light source
Thanks! This is along the lines of what I had, I just couldn't quite get there. Could you explain what the update light by type does?
-
Making an entity as a light source
1.7.10 It is a throwable entity but any code would help
-
[1.7.10] Packet Won't Send To Server
First, packets don't have anything to do with proxies-- use packets to send a message from the client(user) to the server(what actually handles minecraft). Stop whining about how no one tells you anything and just tells you what you're doing wrong. If they tell you something, TRY to learn it, stop giving up. In your case, make a packet handler and send a packet saying, "hey, user wants to make an explosion" from the gui to minecraft so minecraft makes an explosion.
IPS spam blocked by CleanTalk.