Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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)); 

    }
    
}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.