How to limit amount of ranged attacks at a time?

Started by shuppyer on

Topic category: Help with modding (Java Edition)

Last seen on 16:55, 1. Jan 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to limit amount of ranged attacks at a time?

The title may be confusing but I'm just having a bit of trouble. I've made two mobs, my own version of the Iceologer and a Ghost. The Iceologer fires snowballs and the ghost fires soul fire. The problem I'm encountering is that they fire indefinitely with no limitations. I'm trying to have them fire in bursts. I want the Ghost's attack to behave like a Blaze, while the Iceologer would preferably fire between 10 to 15 snowballs in one burst. Could anyone explain how to fix this? Thanks!

Last seen on 09:42, 5. Sep 2023
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
1, Unlock the code on the…
Sat, 12/11/2021 - 09:59

1, Unlock the code on the entity.

2, Find this line in this code

this.goalSelector.addGoal(1, new RangedAttackGoal(this, 1.25, 20, 10) {

3, The number 20 is the cooldown on the ranged attack. I find changing it to 90 or 120 is a decent cooldown for mobs. 60 is firing every other second pretty.

Chew

Last seen on 09:42, 5. Sep 2023
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
"pretty much" uggg  
Sat, 12/11/2021 - 10:00

"pretty much" uggg

 

Last seen on 15:24, 24. Apr 2024
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
otherwise use procedure. Don…
Sat, 12/11/2021 - 10:54

otherwise use procedure. Don't use AI ranged items but use normal AI and add procedure if entity burning = shoot ranged