-
Read items in chest when opened on client side
Thanks for helping me.
-
Read items in chest when opened on client side
How do I check if the chest contents are loaded?
-
Read items in chest when opened on client side
Read the contents of a chest upon opening, and detect its changes. I wanted the packet name to check the source code and see if there is any way I can detect.
-
Read items in chest when opened on client side
Do you know the packet type name? Which event should I handle and access the chest contents inside the event handler?
-
Read items in chest when opened on client side
Firstly, EntityPlayer#openContainer is assigned the container of the opened chest AFTER the initialization (GuiScreen#initGui) of the opened GuiChest (the container is stored in GuiContainer). So, I changed to try to access the chest contents in InitGuiEvent.Post event handler. Secondly, I found that the container stored in GuiContainer is a ContainerChest containing the player inventory AND the chest inventory. Therefore, it is not accurate to access the container and directly get the item stacks via it. Then, I found that ContainerChest#getLowerChestInventory returns the chest inventory (somehow it is called lower inventory). Finally, I checked the runtime type of the inventory returned by ContainerChest#getLowerChestInventory. It turns out to be ContainerLocalMenu. The only place which constructs new ContainerLocalMenus is NetHandlerPlayClient#handleOpenWindow. However, the method accepts a packet that does not store the chest inventory contents. Where did I go wrong? How do I access the chest contents?
-
Read items in chest when opened on client side
It doesn't work. It seems to always access the player inventory.
-
Read items in chest when opened on client side
How do I read the items in an opened chest (chest gui opened), on client side?
-
How to intercept chat message before sent from client to server
How do I intercept chat message before sent from client to server? Is there an event for it?
-
When inventory opened, KeyInputEvent and MouseEvent do not get fired
When inventory opened, KeyInputEvent and MouseEvent do not get fired. How do I detect key inputs and mouse inputs when inventory is opened?
-
EntityJoinWorldEvent fired multiple times
I am working on a client side mod. Sorry I was in a rush and copied from my old java file.
-
EntityJoinWorldEvent fired multiple times
Bump. I have updated to 1.14.4 - 28.1.0. I did some testing and found that: EntityJoinWorldEvent is fired once when joining a server (and a world) from the multiplayer menu EntityJoinWorldEvent is fired multiple times (usually 6 - 10) when switching between worlds on a server or servers on a bungee network The Worlds returned by EntityJoinWorldEvents are not the same instance The EntityJoinWorldEvents are not the same instance (that means I did not register more than once) I have already added the following check into EntityJoinWorldEvent handler mc.thePlayer == event.entity Here is my handler in case: @SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent event) { if (mc.thePlayer == event.entity) { mc.thePlayer.addChatMessage( new ChatComponentText("hello")); } } Does anyone know why this is happening?
-
Run Configurations
When setting up the project, I executed "gradlew genEclipseRuns" and "gradlew eclipse", but there aren't any run configurations (Client / Server).
-
EntityJoinWorldEvent fired multiple times
Updated
-
EntityJoinWorldEvent fired multiple times
package com.example.examplemod; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ServerData; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION) public class ExampleMod { public static final String MODID = "examplemod"; public static final String VERSION = "1.0"; Minecraft mc; @EventHandler public void preInit(FMLPreInitializationEvent event) { mc = Minecraft.getMinecraft(); MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent event) { if (!event.world.isRemote) { mc.thePlayer.sendChatMessage("hello"); } } }
-
EntityJoinWorldEvent fired multiple times
via the player to the server Minecraft mc; @EventHandler public void preInit(FMLPreInitializationEvent event) { mc = Minecraft.getMinecraft(); MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent event) { if (!event.world.isRemote) { mc.thePlayer.sendChatMessage("hello"); } }
IPS spam blocked by CleanTalk.