Zacomat Posted October 18, 2020 Posted October 18, 2020 I'm trying the RightClickBlock event. In the mod class i have a method for handling the event: this is the class declaration: @Mod(ExampleMod.MODID) @Mod.EventBusSubscriber public class ExampleMod { ... and this is my static method in ExampleMod class: @SubscribeEvent public static void onBlockRichtClick(RightClickBlock e) { LOGGER.info("HELLO FROM onBlockRichtClick " + e + " phase=" + e.getPhase() + " isRemote=" + e.getPlayer().world.isRemote); if (e.getPlayer().world.isRemote) { LOGGER.info("onBlockRichtClick world.isRemote=true bookshelves.silkRequired=" + BookshelfConfig.silkRequiredValue.get().toString()); LOGGER.info("onBlockRichtClick world.isRemote=true bookshelves.items=" + BookshelfConfig.itemsValue.get().toString()); LOGGER.info("onBlockRichtClick world.isRemote=true bookshelves.books=" + BookshelfConfig.booksValue.get().toString()); LOGGER.info("onBlockRichtClick world.isRemote=true bookshelves.silkRequired=" + BookshelfConfig.silkRequired); LOGGER.info("onBlockRichtClick world.isRemote=true bookshelves.items=" + BookshelfConfig.items); LOGGER.info("onBlockRichtClick world.isRemote=true bookshelves.books=" + BookshelfConfig.books); } else { LOGGER.info("onBlockRichtClick world.isRemote=false bookshelves.silkRequired=" + BookshelfConfig.silkRequiredValue.get().toString()); LOGGER.info("onBlockRichtClick world.isRemote=false bookshelves.items=" + BookshelfConfig.itemsValue.get().toString()); LOGGER.info("onBlockRichtClick world.isRemote=false bookshelves.books=" + BookshelfConfig.booksValue.get().toString()); LOGGER.info("onBlockRichtClick world.isRemote=false bookshelves.silkRequired=" + BookshelfConfig.silkRequired); LOGGER.info("onBlockRichtClick world.isRemote=false bookshelves.items=" + BookshelfConfig.items); LOGGER.info("onBlockRichtClick world.isRemote=false bookshelves.books=" + BookshelfConfig.books); } } but this is the logger output: [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: HELLO FROM onBlockRichtClick net.minecraftforge.event.entity.player.PlayerInteractEvent$RightClickBlock@5b160208 phase=NORMAL isRemote=true [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.silkRequired=true [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.items=[minecraft:painting, minecraft:paper, minecraft:filled_map, minecraft:item_frame, minecraft:map] [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.books=[minecraft:book, minecraft:writable_book, minecraft:written_book, minecraft:enchanted_book] [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.silkRequired=true [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.items=[item_frame, paper, filled_map, painting, map] [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.books=[written_book, writable_book, book, enchanted_book] [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: HELLO FROM onBlockRichtClick net.minecraftforge.event.entity.player.PlayerInteractEvent$RightClickBlock@36ec4071 phase=NORMAL isRemote=true [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.silkRequired=true [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.items=[minecraft:painting, minecraft:paper, minecraft:filled_map, minecraft:item_frame, minecraft:map] [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.books=[minecraft:book, minecraft:writable_book, minecraft:written_book, minecraft:enchanted_book] [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.silkRequired=true [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.items=[item_frame, paper, filled_map, painting, map] [08:20:29] [Render thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=true bookshelves.books=[written_book, writable_book, book, enchanted_book] [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: HELLO FROM onBlockRichtClick net.minecraftforge.event.entity.player.PlayerInteractEvent$RightClickBlock@78512fcc phase=NORMAL isRemote=false [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.silkRequired=true [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.items=[minecraft:painting, minecraft:paper, minecraft:filled_map, minecraft:item_frame, minecraft:map] [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.books=[minecraft:book, minecraft:writable_book, minecraft:written_book, minecraft:enchanted_book] [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.silkRequired=true [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.items=[item_frame, paper, filled_map, painting, map] [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.books=[written_book, writable_book, book, enchanted_book] [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: HELLO FROM onBlockRichtClick net.minecraftforge.event.entity.player.PlayerInteractEvent$RightClickBlock@5b675fb6 phase=NORMAL isRemote=false [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.silkRequired=true [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.items=[minecraft:painting, minecraft:paper, minecraft:filled_map, minecraft:item_frame, minecraft:map] [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.books=[minecraft:book, minecraft:writable_book, minecraft:written_book, minecraft:enchanted_book] [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.silkRequired=true [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.items=[item_frame, paper, filled_map, painting, map] [08:20:29] [Server thread/INFO] [co.ex.ex.ExampleMod/]: onBlockRichtClick world.isRemote=false bookshelves.books=[written_book, writable_book, book, enchanted_book] Why there are 4 different instance of the event? Quote
poopoodice Posted October 18, 2020 Posted October 18, 2020 https://mcforge.readthedocs.io/en/latest/concepts/sides/ The event is triggered on different sides, therefore it prints 4 times. Quote
Draco18s Posted October 18, 2020 Posted October 18, 2020 Specifically once on each side for each hand. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Recommended Posts
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.