Jump to content

Change power of fireball?


Blakexx

Recommended Posts

Ho, so I used to know how to make a fireball and change the power of the fireball and everything, but I forgot how, so I had to look around for ways to do it, so I got this.

 

Remember I already have the item working so it has nothing to do with my item not being implemented properly into the game.

 

@Override

//shoots fireball //

public ItemStack onItemRightClick(ItemStack itemstack, World worldIn, EntityPlayer entityplayer)

{

if (!worldIn.isRemote)

{

Vec3 look = entityplayer.getLookVec();

EntityLargeFireball fireball2 = new EntityLargeFireball(worldIn, entityplayer, 1, 1, 1);

fireball2.setPosition(

entityplayer.posX + look.xCoord * 5,

entityplayer.posY + look.yCoord * 5,

entityplayer.posZ + look.zCoord * 5);

fireball2.accelerationX = look.xCoord * 0.5;

fireball2.accelerationY = look.yCoord * 0.5;

fireball2.accelerationZ = look.zCoord * 0.5;

worldIn.spawnEntityInWorld(fireball2);

}

return itemstack;

}

Link to comment
Share on other sites

EntityLargeFireball fireball2 = new EntityLargeFireball(worldIn, entityplayer, 1, 1, 1);

 

Mmmmm. Magic numbers

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

The direct damage of the Large Fireball is hardcoded at 6.0 in

EntityLargeFireball#onImpact

, but the explosion power is controlled by the public

EntityLargeFireball#explosionPower

field.

 

If you want it to deal a different amount of damage, extend

EntityLargeFireball

and override

onImpact

to do the same thing as

EntityLargeFireball#onImpact

but deal the appropriate amount of damage instead of 6.0.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

I am just trying to change explosion power :P Thanks for the response though.

 

 

EntityLargeFireball fireball2 = new EntityLargeFireball(worldIn, entityplayer, 1, 1, 1);

 

Mmmmm. Magic numbers

 

I changed them all to 100 one at a time and nothing changed.

Link to comment
Share on other sites

That is not the strength.

They are the acceleration variable, and they just get normalized before usage.

So, multiplying some number to them would result in nothing.

 

Seriously, you should try to know what a parameter does before just putting random numbers like 1.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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