Jump to content

Can't Figure out how to make a fireball staff shoot fireballs minecraft modding


Recommended Posts

Posted

im trying to make a fireball staff shoot fireballs im not sure exacly how though heres my code please tell me whats wrong the code

package mymod._09_EpicWeapons;

import java.util.Vector;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntityLargeFireball;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;

public class CustomFireStaff extends Item {
    
    public CustomFireStaff() {
        
        this.setCreativeTab(CreativeTabs.COMBAT); 
    } @Override
    public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand handIn) {    
    
        
        
            EntityFireball EntityFireball = new EntityLargeFireball(worldIn, player, 6F, 7F, 9F);
            Vec3d looking = EntityFireball.getLookVec();
            if (looking != null) {
            EntityFireball.motionX = looking.x;
            EntityFireball.motionY = looking.y;
            EntityFireball.motionZ = looking.z;
            EntityFireball.accelerationX = EntityFireball.motionX * 0.1D;
            EntityFireball.accelerationY = EntityFireball.motionY * 0.1D;
            EntityFireball.accelerationZ = EntityFireball.motionZ * 0.1D;
            }
            
    
        
    return new ActionResult<ItemStack>(EnumActionResult.PASS, player.getHeldItem(handIn)); 

    }
    
}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted
1 hour ago, apple54678 said:

im trying to make a fireball staff shoot fireballs im not sure exacly how though heres my code please tell me whats wrong the code

package mymod._09_EpicWeapons;

import java.util.Vector;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntityLargeFireball;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;

public class CustomFireStaff extends Item {
    
    public CustomFireStaff() {
        
        this.setCreativeTab(CreativeTabs.COMBAT); 
    } @Override
    public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand handIn) {    
    
        
        
            EntityFireball EntityFireball = new EntityLargeFireball(worldIn, player, 6F, 7F, 9F);
            Vec3d looking = EntityFireball.getLookVec();
            if (looking != null) {
            EntityFireball.motionX = looking.x;
            EntityFireball.motionY = looking.y;
            EntityFireball.motionZ = looking.z;
            EntityFireball.accelerationX = EntityFireball.motionX * 0.1D;
            EntityFireball.accelerationY = EntityFireball.motionY * 0.1D;
            EntityFireball.accelerationZ = EntityFireball.motionZ * 0.1D;
            }
            
    
        
    return new ActionResult<ItemStack>(EnumActionResult.PASS, player.getHeldItem(handIn)); 

    }
    
}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Show your logs (The error crash file/ .txt)

 

@imacatlolol, how do you know that he was using a outdated Version?

New in Modding? == Still learning!

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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