Copy the class from the snowball and change it to fireball and create your animation
~ ElectricSnap
Ive tried messing around with it..I couldnt get it working..
would you happen to know the exact code on how to do it?
and if you have a yt account, ill like all your vids + sub in return..
yes! thankyou... it worked.. i just had to play around with where it spawned and things like that.. now i know youve helped alot.. but how would i make it work with enderpearls? any ideas?
can you post the file you trying to use to shot the ender pearl ?
in the item you useing to shot the ender pearl change the method to this below then test it ?
remember that for it to teleport you you have to shot EntityEnderPearl not Item.enderPearl ?
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityEnderPearl(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
yeah sure,
package ##.#;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityEgg;
import net.minecraft.entity.projectile.EntityLargeFireball;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.entity.projectile.EntityWitherSkull;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class ############# extends Item
{
public #############(int par1)
{
super(par1);
this.setMaxDamage(100);
maxStackSize = 1;
setCreativeTab(####Mod.####);
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
if (!world.isRemote)
{
Vec3 look = entityplayer.getLookVec();
EntityEnderPearl fireball2 = new EntityEnderPearl(world, 1, 2, 1);
fireball2.setPosition(
entityplayer.posX + look.xCoord * 0,
entityplayer.posY + look.yCoord * 1.5,
entityplayer.posZ + look.zCoord * 0);
fireball2.motionX = look.xCoord * 1.0;
fireball2.motionY = look.yCoord * 1.0;
fireball2.motionZ = look.zCoord * 1.0;
world.spawnEntityInWorld(fireball2);
itemstack.damageItem(1, entityplayer);
}
return itemstack;
}
}
I'm thinking of making a similar item, but that throws a custom projectile, then recharging. I have the recharging part down with my weapon Mjolnir, but cannot seem to make the staff (Gungnir). Check the final season 1 episode of Avengers: Earth's Mightiest Heroes for what I want(it's near the end where Loki controls Gungnir and uses it to knock back the Avengers).
Rollback Post to RevisionRollBack
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
package ##.#;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityEgg;
import net.minecraft.entity.projectile.EntityLargeFireball;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.entity.projectile.EntityWitherSkull;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class NAME extends Item
{
public NAME(int par1)
{
super(par1);
this.setMaxDamage(100);
maxStackSize = 1;
setCreativeTab(CreativeTabs.tabBlock);
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityEnderPearl(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
}
Oh i wanted to make it so when your holding an item.. It will teleport you to where you are looking, i dont mind if it has enderpearls or not, but if you could help with that i would be so grateful.
What folder haves the editable item files? If you tell me. Then I can make a item throw fireballs, snowballs and ender pearls. So can you please tell me where the item files are?
im pretty sure it has "entity throwable' in it..
Ive tried messing around with it..I couldnt get it working..
would you happen to know the exact code on how to do it?
and if you have a yt account, ill like all your vids + sub in return..
yes! thankyou... it worked.. i just had to play around with where it spawned and things like that.. now i know youve helped alot.. but how would i make it work with enderpearls? any ideas?
Snowball2.accelerationX = look.xCoord * 0.1;
Snowball2.accelerationY = look.yCoord * 0.1;
Snowball2.accelerationZ = look.zCoord * 0.1;
i made it so it uses enderpearls.. but the enderpearls just drop 1 block ahead of me.. and they dont tp you.. any ideas?
doesnt even seem to throw the enderpearl..
do you want to discuss this on skype for Instant Messages?
i have skype... but i have it only in my loptop... im am using pc right now
ohh ok.. so do you have any idea on how you could get this to work?
its stumped me...
do you have facebook??
yeah whats yours?
ooh ive made the enderpearl throw.. but.. it doesnt tp you.. now we just have to work on that..
uhm it has this..
but if i import this into my code.. i get a lot of un solvable errors..
yeah sure,
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
-sorash67 || Skorpio
http://www.minecraftforum.net/topic/1839245-1615-forge-sspsmp-skorpios-notonlymoreores-mod-the-crossbow-update/
Oh i wanted to make it so when your holding an item.. It will teleport you to where you are looking, i dont mind if it has enderpearls or not, but if you could help with that i would be so grateful.