'What happened to net.minecraft.class_746?
I am working on a fabric mod with java that requires commands such as ".command" and to do so requires my program accesses sent messages. After looking at some code by other people that have done what I am trying to do, I notice that they all use net.minecraft.class_746 as a mixin. I have been trying to as well on Minecraft 1.18.1 but after going through the net.minecraft directory, I found that there is only class_6567 and class_6148 as well as many other packages. I have been digging through the other files but I have not found anything to achieve what I want. I am not able to find anything to access all sent messages. Any help would be appreciated. Thanks!
Solution 1:[1]
After about an hour of digging, I found the ClientPlayerEntity class. It seems to work just like class_746 and I was able to get my desired result. If anyone needs it, here is a basic portion of code:
@Mixin( ClientPlayerEntity.class )
public class ChatMixin {
@Inject(method={"sendChatMessage"}, at={@At("HEAD")}, cancellable=true)
public void sendChatMessage(final String message, final CallbackInfo ci) {
if(message.equalsIgnoreCase(".command")) {
ci.cancel();
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | joshdimatteo |
