Jump to content

Recommended Posts

Posted

I have an event handler that I use to tell whenever an entity gets attacked, and do some other stuff with that.  The problem is, the event is getting called twice per attack, on the client side.

 

I have checks that if the server is dedicated, it will only get called on the server, which works. But when the server is integrated, it only gets called on the client, and is called twice.

 

Here's my code for the attack handler. The LivingDeathEvent works properly, it's only the LivingAttackEvent

 

  Reveal hidden contents

 

 

And where I register the AttackHandler class.

 

  Reveal hidden contents

 

 

And here is the console output:

 

 

  Reveal hidden contents

 

Any help would be much appreciated! Not sure if this is a bug or what.

 

 

 

Posted

I'd suggest using proxies.

 

Only put your client stuff you are interested for that handler on the client side and vice versa for the server.

 

Will make it easier to troubleshoot.  If I had to wager, by the time you do that, I'm betting the issue goes away.

Long time Bukkit & Forge Programmer

Happy to try and help

Posted

I put all my events in a side specific proxy section.  I'm very deliberate in separating the client/server.  It tends to avoid confusion.  I looked briefly through your stuff and there were a few things in there that make me think you could benefit from the same.  However, that is my opinion, not gospel.

Long time Bukkit & Forge Programmer

Happy to try and help

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.