Entity that can only look at certain angles (Cannon)

Started by VioletPyre on

Topic category: Help with modding (Java Edition)

Last seen on 01:56, 16. Jan 2024
Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Entity that can only look at certain angles (Cannon)
Sat, 02/18/2023 - 01:32 (edited)

Hi! I have made cannons that Players can use. These ones are perfecly fine, but their "NPC" counterpart are not.

I need these specific cannons to be only able to look , say starting from North and only be able to look slightly to the left and right to shoot an approaching player

without shooting inside the building or explode itself. Right now it looks at far players and tries to shoot them from there, but if i were to hide behind a post it will shoot through it and blow everything up.

 

Else, on moving Ships, they would turn around and shoot the complete wrong side and blow either the ship by shooting on the cabins and other directions that "aren't RP and logical"
This one i hoped it would shoot if a player is in the direction they are facing (ex: this cannon faces East, if a player is in range, try to shoot them , else don't blow yourself up aye?)

By the way, using: MCreator 2023.1 EAP Snapshot on 1.18.2

Anyway, complicated stuff, if someones has help to offer, i'll appreciate it.
In the meantime or if i don't get help, i'll try to fix it with janky stuff x)
Thanks! <3

Edited by VioletPyre on Sat, 02/18/2023 - 01:32