How to make a entity do BOTH ranged and melee attacks?

Started by AceEntertainment on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 years ago
Joined Jul 2022
Points:
342

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
How to make a entity do BOTH ranged and melee attacks?

I am making a boss mob for my mod and I am planning to make it so it can shoot projectiles when the player is far enough (like the wither) and attack normally when its close enough (melee, like a zombie)

I am new to coding so I would prefer if this was done with procedure blocks instead. However, any help provided I will graciously accept :)

Active 2 years ago
Joined Jul 2022
Points:
330

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
I'm not experenced when…
Sun, 07/31/2022 - 04:41

I'm not experenced when procedures but I do know a few coding, however this I am not fimilair with yet.

Active 2 years ago
Joined Jul 2022
Points:
330

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
for instance, I only know a…
Sun, 07/31/2022 - 04:44

for instance, I only know a few things like how to get mobs to be able to shoot tridents, pick up loot, have an inventory, crossbows, bows, act like vanilla entities, and more. So, if you r interested in these things than I can help you.

Active 2 years ago
Joined Jul 2022
Points:
330

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
sorry for all the grammar…
Sun, 07/31/2022 - 04:45

sorry for all the grammar. making a mod rn

Active 2 years ago
Joined May 2022
Points:
589

User statistics:

  • Modifications: 2
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 382
You can give him attack…
Sun, 07/31/2022 - 04:52

You can give him attack damage from the properties section and give him projectiles in the ranged attack in the ai/goals section.

If you remove attack damage then it wont do melee and removing ranged attacks well removes ranged attacks.

It doesn't use procedures. Trust me I made a boss using this as well it yeets cobblestone and can also slam you.

Active 2 years ago
Joined Jul 2022
Points:
330

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
that sounds interesting, for…
Sun, 07/31/2022 - 04:55

that sounds interesting, for the crossbows and bows thingy, I was referring to like a pillager, you know how they load crossbows, yeah I know how to do that. And for the "pick up loot" that ones pretty easy.

Active 2 years ago
Joined May 2022
Points:
589

User statistics:

  • Modifications: 2
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 382
excuse me mister TOPR you've…
Sun, 07/31/2022 - 04:55

excuse me mister TOPR you've been here for 14 minutes so it's not expected you'll know much either so you don't need to mention that and above that he hasn't asked you specifically so he doesn't need your clarification cause he doesn't need that

Active 2 years ago
Joined May 2022
Points:
589

User statistics:

  • Modifications: 2
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 382
also don't think i'm yelling…
Sun, 07/31/2022 - 04:56

also don't think i'm yelling cause thats how the username is spelt

Active 2 years ago
Joined Jul 2022
Points:
330

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
Bruh, I've been "coding" for…
Sun, 07/31/2022 - 05:01

Bruh, I've been "coding" for a decent 1 year now. Even though You didn't say "how to make mobs be able to shoot crossbows and bows" I decided that it'd be good to mention that anyways. I'm just telling you what I know.

Active 2 years ago
Joined Jul 2022
Points:
330

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
and also what made me join…
Sun, 07/31/2022 - 05:02

and also what made me join this site was this comment.

Active 2 years ago
Joined Jul 2022
Points:
330

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
Yeah, I know I need some…
Sun, 07/31/2022 - 05:08

Yeah, I know I need some sleep I got backwards.

Active 2 years ago
Joined Jul 2022
Points:
330

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
now that I reread this…
Sun, 07/31/2022 - 16:17

now that I reread this comment, I don't think this is possible with custom coding. Like if you want a mob to have a ranged weapon in it's mainhand and be able to use that ranged weapon then that will require some coding, and if you want him to do melee attacks when he has a sword or any item like that in his mainhand, then that'll not require any coding. Only the ranged attack part.

Active 5 months ago
Joined Mar 2020
Points:
635

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 19
you could probably detect…
Tue, 09/12/2023 - 21:20

you could probably detect when the player is far away using the "is entity in cube of size" block but im not sure how the arrow would work using procedures, because it would have to aim towards the player. if you're making a boss, then maybe shooting 4 arrows in different directions may be good.