• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Handle is called when the client has received the packet, so there should be where you sync the data (what you've done in the previous post is correct), which you should get the client player and its capability to sync in here. Also:  You can get the context from the supplier (given in the second parameter of handle(...), then call Context#setPacketHandled)
    • public class PlayerMentalCapabilityMessage { ClientPlayerEntity player = Minecraft.getInstance().player; LazyOptional<PlayerMentalInterface> playermentalinterface = player.getCapability(PlayerMentalCapabilityRegistry.PLAYER_MENTAL_CAPABILITY); int currentMental = ((PlayerMentalInterface) playermentalinterface).getMental(); public PlayerMentalCapabilityMessage(int currentMental) { this.currentMental = currentMental; } public static void encode(PlayerMentalCapabilityMessage message, PacketBuffer buf) { buf.writeInt(message.currentMental); } public static PlayerMentalCapabilityMessage decode(PacketBuffer buf) { int currentMental = buf.readInt(); return new PlayerMentalCapabilityMessage(currentMental); } public static void handle(PlayerMentalCapabilityMessage msg, Supplier<NetworkEvent.Context> ctx) { ctx.get().enqueueWork(() -> { }); } } Is it like this? I'm still not sure about Context.setPacketHandled () so please tell me more.
    • Hello, I prepared a mod package for myself from twitch, when entering the game, it gives the following error: logs / fml-client-latest.log 1.7.10  details:http://www.mediafire.com/file/flpav855frvj2a1/latest.log/file
    • I cannot seem to download the forge launcher because the universal link says I have no application to launch it in. Is there a windows installer of the newer versions?
    • It seems like you are syncing an int to the client? You can use dist executor to make sure you are on the right side and get the capability from the client player (using Minecraft.getInstance().player), then you can set the value got from the packet (msg.currentMental). Also make sure you have packet set handled Context.setPacketHandled()
  • Topics

  • Who's Online (See full list)