Jump to content

[half-solved] Very bizarre problem


Recommended Posts

So I made a custom bow with various arrow types. I have two different arrow classes, one for bomb arrows and one for elemental related arrows, both extending the same custom arrow class that extends EntityArrow.


The bomb arrows work perfectly both in survival and creative, but for some unfathomable reason, the elemental arrows work perfectly in creative, but in survival they are all wonky, sometimes just bouncing off of the first air block or at best, the arrow is at a strange angle rather than straight on its trajectory. Yet it works perfectly in creative mode...


This holds true for all 3 elemental arrows, just as all 3 bomb arrow types work exactly the same. Has anyone ever run across something like this before? The arrows are all instantiated and spawned exactly the same way, from the same bow, and registered exactly the same via to the entity tracker.


Thanks in advance for any insights.


EDIT: It's definitely a problem with the client side entity, as the arrow will show up on the ground in the position one would expect based on charge, but the arrow looks as though it bounces off the air until it appears on the ground. All the variables leading up to the spawning of the arrow are the same on both server and client side, though, so it must be something in the entity class itself.


EDIT 2: So I 'fixed' it by adding a datawatcher for the shooting entity's id, as the problem was the arrow would collide with the player without recognizing the player as the shooting entity; I'm still very puzzled as to why one set of arrows worked perfectly and the other didn't, but at least I can see why it wasn't affected in creative mode (player disables damage, so won't collide).


Also, I would have thought that the EntityArrow's shootingEntity field would by synchronized automatically, and it must have been for the bomb arrows as those worked perfectly well... I'd love to know where the difference lay between EntityArrowBomb and EntityArrowElemental that's causing this.


EDIT: removed code. Fixed, but unresolved as to the cause of the discrepancy.


Link to comment
Share on other sites

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.

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.

  • Create New...

Important Information

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