Jump to content

Arrow Tick detection | Minecraft Forge 1.19.4  

  1. 1. I want to detect an arrow every tick. Is there any event that can help me achieve this? I have tried using the LivingGetProjectileEvent, but it only updates a few times and then stops, even if the arrow is still in the air. Additionally, this event only provides information about the player who shot the arrow.

    • There is a Event
      0
    • There is no event
      0


Recommended Posts

Posted

I want to detect an arrow every tick. Is there any event that can help me achieve this?

I have tried using the LivingGetProjectileEvent, but it only updates a few times and then stops, even if the arrow is still in the air. Additionally, this event only provides information about the player who shot the arrow.

Posted

all entities tick all the time, including projectile entities.

respond to entity tick event, check the side (client), check total world ticks (you don't want particles 20x per second so you'll ask if total time modulo 20 is 7 or something like that), check that the entity is your projectile, check that it isn't dead/removed, check that it is moving (entities remember previous position).
then pop a particle.

Posted
6 hours ago, Stynxyxy said:

How do I get the arrow entity then?

event.getEntity().             tick event (every instance of it) exists so that you can do things when the entity (your projectile) gets one tick older.

just subscribe to the tick event (LivingUpdateEvent).
use the logger (or just system.out.printLine) and print out important things in event object.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.