Jump to content

The code does not work on servers, any ideas?

Alanor Miga

Recommended Posts

So this is a code for a "burst-type" gun, what it does is that it stops the onKeyPressed (holding) after a couple of ticks, effectively making a burst-like click.


I was told that the error is that the server does not what player to reference so it just dies and crashes the server



Link to comment
Share on other sites

2 hours ago, Luis_ST said:

you need to add the Dist to the EventBusSubscriber via the 'value' and set it to Dist.CLIENT

Ayye! Works almost like a charm! It does not crash, however, none of the postShoot/preShoot events trigger, these are in charge of making the shooting sound and spending ammo upon shooting.

Log be here:


Back to the drawing board it goes!

Link to comment
Share on other sites

40 minutes ago, Alanor Miga said:

do not post code for other here, you can permalink them on github, for example:

these Events are server and client side or server side only (im not 100% sure),
but this means you can't put them into a Client side EventHandler class, move them to a new/other EventHandler

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...

Important Information

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