Ranged entities

Started by Orandza on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ranged entities

So I have an immovable entity whose only purpose is to shoot down phantoms. It works fine for the most part but I don't know how to make it target phantoms at a longer distance. I set it to watch closest phantom in radius of 100 blocks and shoot it down but it doesn't work. The range is way smaller than that in-game, probably like 10 blocks or something. Any help would be appreciated.

https://imgur.com/a/KhhrZcN

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can just make it shoot…
Sun, 08/14/2022 - 23:40

You can just make it shoot projectiles thru a procedure. So remove your "attack" ai task but keep the "watch entity" one. Then make a procedure like the one in this image:
https://imgur.com/A2doehT

You can put a "wait _ ticks on server side" procedure block after the "shoot projectile" block if you want a bit of a delay. (Remember 20 ticks is 1 second).

Hope this helps!

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hmm, it doesn't seem to work…
Mon, 08/15/2022 - 12:53

Hmm, it doesn't seem to work. Tried putting this as the procedure for entity update tick, and I also tried using it "on loaded entity update tick" like shown in the image but the entity just doesn't shoot anything. Thing is, I can't find those blocks you used next to the "do" part of the block. Not the shoot from entity block, not the arrow of type block or even the "no entity" block. Searching them up shows no results and I can't find them from any of the menus. All I could do is this, and it doesn't work: https://imgur.com/a/0X2eDXR

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh. That's weird, whenever I…
Mon, 08/15/2022 - 14:43

Oh. That's weird, whenever I checked for updates inside of MCreator, it would just say it's up-to-date. Well thanks, I'll try it out and report the results!

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay, your method works, but…
Mon, 08/15/2022 - 20:26

Okay, your method works, but the entities usually seem to shoot in a totally different direction from where the phantom is. However, it appears that there's a follow range option which wasn't there in the version I had previously and it seems to have solved my problem. The arrows show by the entity are a little inaccurate but it's the best I'll get for now I suppose. Anyways, thanks a bunch.

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Your welcome. And maybe if…
Mon, 08/15/2022 - 21:56

Your welcome. And maybe if you upped the speed on the projectile procedure block, it'll have a better chance of hitting it?

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No, using the procedure…
Tue, 08/16/2022 - 18:04

No, using the procedure doesn't make the entity miss by a little bit, it tends to just rapidly shoot at one spot, often in a completely different direction. The procedure was even set to 0 inaccuracy. I did make a custom projectile with better speed which works okay-ish with the regular attack options for the entity so I'll stick to that for now.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello, I saw that this was…
Thu, 06/01/2023 - 19:17

Hello, I saw that this was already solved but I had a simalar problem. I was making a mod with an sniper entity that was supposed to never miss a target and have very high range. I tried using this but the bullets would fly off in a strange direction. I just wanted to post this to help others who had a problem like mine. I ended up making so the sniper just damaged the entity that it was targeting instead of shooting a projectile. 

https://imgur.com/a/O6mweVk

The NBT tag that I'm using is just for a delay.

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello Ozandza! Could you…
Thu, 06/08/2023 - 04:00

Hello Ozandza! Could you share the mob and its procedure? it just that I was trying to do something very similar to your phantom hunter, a summonable mob that stays in the place and attack players, but can´t come to make it work, not even copying the procedure. Its just a simple mod im doing for a server with friends, so I will apreciate very much if you could help me with that.