Help with ranged item and mob cooldown

Started by aoooodi2 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with ranged item and mob cooldown

I would like to know how to add a cooldown to a ranged item and how to add a cooldown to a mob,like a skeleton because the mob i made shoots to fast.

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i don't think you can change…
Fri, 10/16/2020 - 01:05

i don't think you can change a custom mob's shooting speed without coding. but if you're up for modifying source code, its a fairly simple thing to change. which minecraft version you modding?

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
edit code of your custom…
Fri, 10/16/2020 - 21:35

edit code of your custom entity element. look for a line that looks like this:

this.goalSelector.addGoal(1, new RangedAttackGoal(this, 1.25D, 20, 10.0F));

in this line of code, 1.25D is the entity's movement speed, 20 is the max attack interval in ticks (so around once per second), 10.0F is the max distance it will shoot. modify the 20 to maybe 40 for 2 second intervals or 60 for 3 second intervals.

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you very much,it…
Sat, 10/17/2020 - 20:28

Thank you very much,it really helped and i learned how to changed entity cooldown and range,but im still strugiln with item cooldown

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
there's a code block to set…
Sun, 10/18/2020 - 17:03

there's a code block to set an item's cooldown:

https://cdn.discordapp.com/attachments/599250311852458006/767432619255660654/unknown.png

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i know but for some reason…
Mon, 10/19/2020 - 18:58

i know but for some reason that didnt work

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
be specific. how does it not…
Mon, 10/19/2020 - 21:24

be specific. how does it not work. how are you doing it?

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
like i put the cooldown…
Tue, 10/20/2020 - 16:07

like i put the cooldown procedure in a when item is used trigger but i can just spam bullets