Shoot arrow power?

8 posts / 0 new
Last post
Offline
Last seen: 1 year 2 months ago
Joined: 06/13/2015 - 20:06
Gems: 0
Shoot arrow power?

Hello!

I'm creating a TF2 mod with MCreator, but my question is:

Can i get a lower shoot arrow power then 1? (the default bow)

Cause i want to make something like a shotgun thing, so a shotgun don't shoot far, so the power needs to be lower.

 

Greetings!

Edited by: AtlantiaKing11NL on 06/13/2015 - 20:12


GH127's picture
Offline
Last seen: 3 months 1 day ago
Joined: 01/16/2015 - 19:00
Gems: -1
umm unfortunely I think you

umm unfortunely I think you will need to use a bit of coding

Offline
Last seen: 1 year 2 months ago
Joined: 06/13/2015 - 20:06
Gems: 0
i'm not so good with coding

i'm not so good with coding in MCreator...

Myabe i can get some help somewhere?

Greetings

MCGamer00000's picture
Offline
Last seen: 1 year 5 months ago
Joined: 06/14/2015 - 07:12
Gems: 0
... Maybe you could use 0.1

... Maybe you could use 0.1 or something in a decimal lower than 1.

Offline
Last seen: 1 year 2 months ago
Joined: 06/13/2015 - 20:06
Gems: 0
arrow power 0.1 errors:

arrow power 0.1 errors:

 

>C:\Pylo\MCreator156\forge\build\sources\java\mod\mcreator\mcreator_scattergun.java:150: error: no suitable constructor found for EntityArrow(World,EntityLivingBase,double)
>EntityArrow entityarrow = new EntityArrow(world, (EntityLivingBase)entity, 0.1 * 2.0F);
>                          ^
>    constructor EntityArrow.EntityArrow(World,EntityLivingBase,float) is not applicable
>      (actual argument double cannot be converted to float by method invocation conversion)
>    constructor EntityArrow.EntityArrow(World,EntityLivingBase,EntityLivingBase,float,float) is not applicable
>      (actual and formal argument lists differ in length)
>    constructor EntityArrow.EntityArrow(World,double,double,double) is not applicable
>      (actual and formal argument lists differ in length)
>    constructor EntityArrow.EntityArrow(World) is not applicable
>      (actual and formal argument lists differ in length)
>C:\Pylo\MCreator156\forge\build\sources\java\mod\mcreator\mcreator_scattergun.java:153: error: method playSoundAtEntity in class World cannot be applied to given types;
>world.playSoundAtEntity(entity, "random.bow", 1.0F, 1.0F / (0.5F * 0.4F + 1.2F) + 0.1 * 0.5F);
>     ^
>  required: Entity,String,float,float
>  found: EntityPlayer,String,float,double
>  reason: actual argument double cannot be converted to float by method invocation conversion
>C:\Pylo\MCreator156\forge\build\sources\java\mod\mcreator\mcreator_scattergun.java:163: error: no suitable constructor found for EntityArrow(World,EntityLivingBase,double)
>EntityArrow entityarrow = new EntityArrow(world, (EntityLivingBase)entity, 0.1 * 2.0F);
>                          ^
>    constructor EntityArrow.EntityArrow(World,EntityLivingBase,float) is not applicable
>      (actual argument double cannot be converted to float by method invocation conversion)
>    constructor EntityArrow.EntityArrow(World,EntityLivingBase,EntityLivingBase,float,float) is not applicable
>      (actual and formal argument lists differ in length)
>    constructor EntityArrow.EntityArrow(World,double,double,double) is not applicable
>      (actual and formal argument lists differ in length)
>    constructor EntityArrow.EntityArrow(World) is not applicable
>      (actual and formal argument lists differ in length)
>C:\Pylo\MCreator156\forge\build\sources\java\mod\mcreator\mcreator_scattergun.java:166: error: method playSoundAtEntity in class World cannot be applied to given types;
>world.playSoundAtEntity(entity, "random.bow", 1.0F, 1.0F / (0.5F * 0.4F + 1.2F) + 0.1 * 0.5F);
>     ^
>  required: Entity,String,float,float
>  found: EntityPlayer,String,float,double
>  reason: actual argument double cannot be converted to float by method invocation conversion
>4 errors
>:compileJava FAILED
>FAILURE: Build failed with an exception.
>* What went wrong:
>Execution failed for task ':compileJava'.
>> Compilation failed; see the compiler error output for details.
>BUILD FAILED
>Total time: 37.76 secs
>* Try:
>Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
>C:\Pylo\MCreator156\forge>
>Task completed with return code 0 in 38432 milliseconds

Offline
Last seen: 5 hours 38 min ago
Joined: 08/27/2013 - 18:03
Gems: 314
in the source of gun is this:

in the source of gun is this:

 if (flag || par3EntityPlayer.inventory.hasItem(Items.redstone))
        {
            float f = 20.0F; (you gave maybe different number)

            EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 2.0F)
            {

 

change float f =  to 0.1;

Offline
Last seen: 1 year 2 months ago
Joined: 06/13/2015 - 20:06
Gems: 0
Thanks! but now the name of

Thanks! but now the name of my gun glitches, it calls: Scattergun but in MC it's item.Scattergun2.name?

How can i fix this?

Offline
Last seen: 5 hours 38 min ago
Joined: 08/27/2013 - 18:03
Gems: 314
this is bug of mcreator

this is bug of mcreator

you have 2 options:

Wait to next update.

Or export the mod to zip, open the zip file and go to Assets/"Your mod name"/lang. open the file in it (en_US.lang). in this file find line with your gun name and open your mod in mcreator and correct the glitched name

 

FOR EXAMPLE:

My gun is named Potato Launcher. In the game is called item.PotatoLauncher.name.

The bug is in the en_US file where is instead of item.PotatoLauncher.name = Potato Launcher

item.potatoLauncher.name = Potato Launcher.

You must correct the first part of the line (item.potatoLauncher.name change to item.PotatoLauncher.name) and it will work on 100%