FireController1847 4 Report post Posted June 5, 2018 (edited) Okay, the dimension change event emits for the nether, in and out. Now, I try the end and.. wait what? It emits when the user enters the end, but does not emit when the user leaves the end via an end gateway. Okay, if this is the case, what's the event I should use for checking when a user leaves the end? Here's my test code right now. @SubscribeEvent @SideOnly(Side.CLIENT) public void onLogin(PlayerLoggedInEvent event) { UltimateDiscordPack.logger.info("Player Logged In"); } @SubscribeEvent @SideOnly(Side.CLIENT) public void onChangeDimension(PlayerChangedDimensionEvent event) { UltimateDiscordPack.logger.info("Player Changed Dimension"); UltimateDiscordPack.logger.info("New Dimension ID: " + event.player.dimension); } @SubscribeEvent @SideOnly(Side.CLIENT) public void onPlayerRespawn(PlayerRespawnEvent event) { UltimateDiscordPack.logger.info("Player Respawned"); } Edited June 6, 2018 by FireController1847 Share this post Link to post Share on other sites
diesieben07 6107 Report post Posted June 5, 2018 Why are you using @SideOnly here? This makes no sense, these events fire on the server. When leaving the end, PlayerRespawnEvent will fire. PlayerRespawnEvent#isEndConquered allows you to check for this case. Share this post Link to post Share on other sites
FireController1847 4 Report post Posted June 6, 2018 I've been using SideOnly because everything else I've tried doesn't give me the desired effect~ I use PlayerLoggedInEvent to detect when the player joins a singleplayer world and NOT a multiplayer world. I use PlayerChangedDimensionEvent to detect when the player changes dimensions... should I be using ServerSide for this? This is a client-only section of the mod, it cannot run on servers. Share this post Link to post Share on other sites
Draco18s 1928 Report post Posted June 6, 2018 1 minute ago, FireController1847 said: I've been using SideOnly because everything else I've tried doesn't give me the desired effect This is not how to use SideOnly Share this post Link to post Share on other sites
FireController1847 4 Report post Posted June 6, 2018 Oh? Have I been doing it wrong this whole time? I have the events only being added via the ClientProxy. Do I just not need SideOnly in that case? And yes, I have read your forge tutorial on sides. Was very confusing to me for some reason, but I understood most of it. Share this post Link to post Share on other sites
Draco18s 1928 Report post Posted June 6, 2018 (edited) 4 minutes ago, FireController1847 said: Oh? Have I been doing it wrong this whole time? http://mcforge.readthedocs.io/en/latest/concepts/sides/ specifically the @SidedProxy section as well as the getSide and SideOnly portion: Quote Annotating a method or field with the @SideOnly annotation indicates to the loader that the respective member should be completely stripped out of the definition not on the specified physical side. Usually, these are only seen when browsing through the decompiled Minecraft code, indicating methods that the Mojang obfuscator stripped out. There is little to no reason for using this annotation directly. Only use it if you are overriding a vanilla method that already has @SideOnly defined. In most other cases where you need to dispatch behavior based on physical sides, use @SidedProxy or a check on getSide() instead. Edited June 6, 2018 by Draco18s Share this post Link to post Share on other sites
FireController1847 4 Report post Posted June 6, 2018 Okay, interesting. That makes sense, compared to last time I read it. I guess the most confusing part to me is, are these events logical-server only, or do they fire for both the logical-server and logical-client? And how are you supposed to know if the events run on the logical-server or the logical-client? And when would be the use cases to run something on either side? Share this post Link to post Share on other sites
diesieben07 6107 Report post Posted June 6, 2018 3 hours ago, FireController1847 said: are these events logical-server only, or do they fire for both the logical-server and logical-client? Server only. 3 hours ago, FireController1847 said: And how are you supposed to know if the events run on the logical-server or the logical-client? The linked documentation explains how to check for logical side. 3 hours ago, FireController1847 said: And when would be the use cases to run something on either side? The idealized version is that the server does all the simulation and gameplay logic, the client only displays and submits user input. In reality that would be a bit too laggy, so the client does a bit more. But ultimately the server has the authority. 1 Share this post Link to post Share on other sites
FireController1847 4 Report post Posted June 6, 2018 Ah, okay. That makes sense, thanks! Share this post Link to post Share on other sites
Draco18s 1928 Report post Posted June 6, 2018 6 hours ago, diesieben07 said: so the client does a bit more For example, the client controls all player motion directly and as far as the server is concerned, the player basically teleports around in small increments. The server can still say "nope, you are not allowed to go there" and the client is forced to listen, but in general, the client is in control. Share this post Link to post Share on other sites