Help! I need the code to shoot fireballs for a mod I am making, I have tried many times, but always ends in an error.
Thanks in advance!
Shooting Minecraft's fireball is as simple as spawning the entity in the world. Do you want to use Minecraft's fireball or create your own? How are you trying to spawn the entity now?
What I was trying to say, is that (I think) fire balls travel in a straight line, so if you fire it straight at something and that something doesn't move, a few seconds later it will get hit by the fireball. Now for instance, if you throw a snow ball at anything far enough away, you will always fall short if you aim at the players look coordinates. You need to aim higher by a certain amount. So was wondering if you know the formula to calculate that. I can probably find it, like you say in the bow or maybe the skeleton classes somewhere.
import net.minecraftforge.common.util.*;public class mcreator_garnetGauntlet{
public mcreator_garnetGauntlet(){}
public static Item block;
public static Object instance;public void load(){
ItemStack stack = new ItemStack(block, 1);}
public void generateNether(World world, Random random, int chunkX, int chunkZ){}
public void generateSurface(World world, Random random, int chunkX, int chunkZ){}
public int addFuel(ItemStack fuel){return 0;}
public void serverLoad(FMLServerStartingEvent event){}
public void preInit(FMLPreInitializationEvent event){}
public void registerRenderers(){}
public boolean onItemUse(ItemStack itemstack, EntityPlayer entity, World world, int i, int j, int k, int l, float a, float b, float c){
super.onItemUse(itemstack, entity, world, i, j, k, l, a, b, c);float var4 = 1.0F;
I am trying to make a map and I am making a creeper boss that has stats so it does not explode. Reason is i want it to shoot fireballs the have no blast radius, (does not destroy blocks) but still does damage.
Thanks in advance!
Shooting Minecraft's fireball is as simple as spawning the entity in the world. Do you want to use Minecraft's fireball or create your own? How are you trying to spawn the entity now?
Just make a new EntityLargeFireball, then set its positions and rotations, then do this to make the fireball go where the entity is looking
ClothingCraft - Highly customizable and realistic clothing! No more silly leather armor!
So what if the projectile has a gravity effect, like an arrow? Then how do you aim it?
[url=2482915-wip-arkcraft-survival-evolved-dinos-taming]
ClothingCraft - Highly customizable and realistic clothing! No more silly leather armor!
[code][CODE][/code]
Vec3 look = player.getLookVec();
EntityMediumMagic magic = new EntityMediumMagic(world, player);
magic.setPosition(player.posX + look.xCoord, player.posY + look.yCoord + 1.5, player.posZ + look.zCoord);
player.inventory.consumeInventoryItem(ModItems.crystalShard);
world.spawnEntityInWorld(magic);
[/CODE]
I'm not sure what you were asking but maybe this will help.
[code] [/code]
[url=2482915-wip-arkcraft-survival-evolved-dinos-taming]
can u help i have an item i want to make it shoot a fireball when u rightclick package mod.mcreator;//based on master condiguration
import cpw.mods.fml.client.*;
import cpw.mods.fml.client.registry.*;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.asm.*;
import cpw.mods.fml.common.asm.transformers.*;
import cpw.mods.fml.common.discovery.*;
import cpw.mods.fml.common.discovery.asm.*;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.functions.*;
import cpw.mods.fml.common.network.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.common.toposort.*;
import cpw.mods.fml.common.versioning.*;
import cpw.mods.fml.relauncher.*;
import cpw.mods.fml.server.*;
import net.minecraft.block.*;
import net.minecraft.block.material.*;
import net.minecraft.client.*;
import net.minecraft.client.audio.*;
import net.minecraft.client.entity.*;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.achievement.*;
import net.minecraft.client.gui.inventory.*;
import net.minecraft.client.model.*;
import net.minecraft.client.multiplayer.*;
import net.minecraft.client.particle.*;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.culling.*;
import net.minecraft.client.renderer.entity.*;
import net.minecraft.client.renderer.tileentity.*;
import net.minecraft.client.settings.*;
import net.minecraft.command.*;
import net.minecraft.crash.*;
import net.minecraft.creativetab.*;
import net.minecraft.dispenser.*;
import net.minecraft.enchantment.*;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.boss.*;
import net.minecraft.entity.effect.*;
import net.minecraft.entity.item.*;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.*;
import net.minecraft.entity.player.*;
import net.minecraft.entity.projectile.*;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.item.crafting.*;
import net.minecraft.nbt.*;
import net.minecraft.network.*;
import net.minecraft.network.rcon.*;
import net.minecraft.pathfinding.*;
import net.minecraft.potion.*;
import net.minecraft.profiler.*;
import net.minecraft.server.*;
import net.minecraft.server.dedicated.*;
import net.minecraft.server.gui.*;
import net.minecraft.server.integrated.*;
import net.minecraft.server.management.*;
import net.minecraft.src.*;
import net.minecraft.stats.*;
import net.minecraft.tileentity.*;
import net.minecraft.util.*;
import net.minecraft.village.*;
import net.minecraft.world.*;
import net.minecraft.world.biome.*;
import net.minecraft.world.chunk.*;
import net.minecraft.world.chunk.storage.*;
import net.minecraft.world.demo.*;
import net.minecraft.world.gen.*;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.layer.*;
import net.minecraft.world.gen.structure.*;
import net.minecraft.world.storage.*;
import net.minecraftforge.classloading.*;
import net.minecraftforge.client.*;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.event.sound.*;
import net.minecraftforge.common.*;
import net.minecraftforge.event.*;
import net.minecraftforge.event.entity.*;
import net.minecraftforge.event.entity.item.*;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.minecart.*;
import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.terraingen.*;
import net.minecraftforge.event.world.*;
import net.minecraftforge.oredict.*;
import net.minecraftforge.transformers.*;
import net.minecraft.init.*;
import java.util.*;
import net.minecraftforge.common.util.*;public class mcreator_garnetGauntlet{
public mcreator_garnetGauntlet(){}
public static Item block;
public static Object instance;public void load(){
ItemStack stack = new ItemStack(block, 1);}
public void generateNether(World world, Random random, int chunkX, int chunkZ){}
public void generateSurface(World world, Random random, int chunkX, int chunkZ){}
public int addFuel(ItemStack fuel){return 0;}
public void serverLoad(FMLServerStartingEvent event){}
public void preInit(FMLPreInitializationEvent event){}
public void registerRenderers(){}
static{
Item.ToolMaterial enumt = EnumHelper.addToolMaterial("GARNETGAUNTLET", 1, 160, 4F, 28, 2);block = (Item)(new ItemSword(enumt){public Set<String> getToolClasses(ItemStack stack){
HashMap<String, Integer> ret = new HashMap<String, Integer>();
ret.put("sword", 1);
return ret.keySet();
}
public boolean onItemUse(ItemStack itemstack, EntityPlayer entity, World world, int i, int j, int k, int l, float a, float b, float c){
super.onItemUse(itemstack, entity, world, i, j, k, l, a, b, c);float var4 = 1.0F;
if(true){
world.getBlock(i, j, k).dropBlockAsItem(world, i, j, k, 1, 1);
world.setBlockToAir(i, j, k);
}
return true;
}
}).setUnlocalizedName("GarnetGauntlet").setTextureName("Garnet's_Gauntlett");
Item.itemRegistry.addObject(475, "GarnetGauntlet", block);
}
}
can u help plz!
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2507269-stevenuniversecraft-mod
You can also look at my thread here. It has what you need here though it doesn't have the "no gravity" effect.
I am trying to make a map and I am making a creeper boss that has stats so it does not explode. Reason is i want it to shoot fireballs the have no blast radius, (does not destroy blocks) but still does damage.
Plz Help!