Increased weapon attack range?

Started by Pootis_Hurm on

Topic category: General discussion

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Increased weapon attack range?

Is it possible to make weapons with increased attack ranges? To make it work like a spear or an halberd.

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think that these values…
Wed, 05/20/2020 - 15:12

I think that these values are hard coded into Minecraft but I’m not sure.

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
it is possible but might be…
Wed, 06/24/2020 - 11:30

it is possible but might be hard to edit. Crispy made once a spear with a far range of attack so maybe he could help you.

Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Crispy made once a spear…
Wed, 06/24/2020 - 11:48

Crispy made once a spear with a far range of attack

???

I don't recall making a spear

I think that these values are hard coded into Minecraft but I’m not sure.

I don't think they are hardcoded or at least forge adds apis to change this since a lot of mods do this.

 

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, and it might be easier…
Wed, 06/24/2020 - 11:58

Oh, and it might be easier to do in the future because of the combat snapshots, they have a new weapon stat called reach.

Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have found a Solution, but…
Tue, 01/05/2021 - 13:46

I have found a Solution, but critical damage and sweeping edge would not work.

I discovered this while working on a decreased attack range for a dagger

First, set attack damage to zero.

You can code a Procedure, where you use 

If [(XposTarget-x)^2 + (YposTarget-y)^2+(ZposTarget-z)^2]^0.5=a {

     Deal [b] damage to [target Entity] type: "GENERIC"

}

This means that if the target is within an "a" block radius around you, you would deal b damage if they have no armor.

Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also, the procedure should…
Tue, 01/05/2021 - 13:52

Also, the procedure should be used for left clicking.

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi, did you succeed in…
Mon, 04/12/2021 - 18:54

Hi,

did you succeed in adding splash damage ? Can you please show me procedure ?

 

Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
could you possibly add a…
Sun, 06/13/2021 - 00:06

could you possibly add a screenchot of this procedure as i am struggling to find the correct blocks

Thanks :)

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here is what I was able to…
Mon, 07/24/2023 - 01:42

Here is what I was able to do using Achillean_Nestoris' code, but when I test it in-game, it doesn't seems to work. I tried setting it as "when entity swings item", but it just has normal reach. Furthermore, there isn't additional condition set has "when left-click" in "when tool in hand tick", so I was wondering if someone had done any progress at all. 

public class TempoProcedure {

    public static void execute(double x, double y, double z, Entity entity) {

        if (entity == null)

            return;

        if (Math.pow(Math.pow(entity.getX() - x, 2) + Math.pow(entity.getY() - y, 2) + Math.pow(entity.getZ() - z, 2), 0.5) == 6) {

            entity.hurt(DamageSource.GENERIC, 5);

        }

    }

}

Looks like that in code or like that in explanded block :