Jump to content

Novârch

Members
  • Posts

    422
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Novârch

  1. I have no idea why it's better, but I've seen people recommend it a lot on these forums, maybe someone else could clarify why.
  2. That's fine, all I would change is use ClientTickEvent instead of InputEvent.
  3. https://plugins.jetbrains.com/plugin/8327-minecraft-development One of the 20+ options that apear when you right click a field/method/etc. is "Get SRG name". Edit: I should also note that IntelliJ will most likely recommend you the plugin if you use Forge (yay data collection), DO NOT INSTALL IT DIRECTLY FROM INTELLIJ, you will get a super outdated version, report some stupid issues on their GitHub, get told to update and regret your decisions, install it from the link.
  4. To add on to this, if you're using IntelliJ there is a Minecraft development plugin that gives you the option to get the SRG name of something on right click.
  5. Maybe you could use ProjectileHelper#rayTraceEntities, otherwise, most of the logic for Minecraft#objectMouseOver is in Minecraft#getMouseOver.
  6. 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  7. It doesn't exist anymore, you have to make the methods manually, it looks a bit like this: public class MyMessage { int value; public MyMessage(int value) { this.value = value; } public static void encode(MyMessage msg, PacketBuffer buffer) { buffer.writeInt(msg.value); } public static MyMessage decode(PacketBuffer buffer) { return new MyMessage(buffer.readInt()); //Remember to read in the same oreder you wrote! } public static void handle(MyMessage msg, Supplier<NetworkEvent.Context> ctx) { if (ctx.get().getDirection() == NetworkDirection.PLAY_TO_SERVER) { //Checks if the packet's direction is to the server ctx.get().enqueueWork(() -> { //Your code goes here }); } ctx.get().setPacketHandled(true); } } I'm 99% sure that's correct, kinda freestyled it though. To send it use SimpleChannel#sendToServer, don't forget to register it with SimpleChannel#registerMessage, and don't worry if you don't understand it right away, it took me a while to fully understand packets in 1.15.
  8. You're correct on that one, forgot to mention that. The custom Teleporter class has to override placeEntity and return repositionEntity.apply(false) to prevent spawning a Nether portal.
  9. 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  10. 1.8 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  11. That is not a modding problem, it's a basic Java problem, please learn basic Java before modding. If you do know basic Java and are just a bit confused, look through DeferredRegister, everything you need is there.
  12. Use DeferredRegister#create, the constructor is deprecated with a comment next to it saying what to use instead, doesn't get much more obvious than that.
  13. I'm not saying it's impossible to make a mod while learning Java, I just think it's much easier to mod after you've polished your Java fundementals. For instance, if you already knew Java, you would have never posted this. You would have looked at SlimeBlock and seen what makes it bouncy, and copied it, or instantiated your block as a SlimeBlock, etc. You'll have a much better time modding if you learn Java first.
  14. ...How is that relevant to what I said...? As I said take a look at the TYPE HIERARCHY of ITextComponent to understand the sendMessage method. Edit: Just looked at the first post, you literally just have to rearange the words in TextComponentString.
  15. Please take a look at the type hierarchy of ITextComponent, every IDE has it. As for the method being empty, I'm pretty sure you're looking at the method in Entity instead of PlayerEntity.
  16. Learn basic Java, then come back. Don't learn Java as you mod, even if you succeed in what you're doing that way (you probably won't) if you plan to work on the mod a more than a week you're most likely going to rewrite the entire mod after seeing your older code. As diesieben stated take a look at SlimeBlock, everything you need is there.
  17. Extend Event, then call MinecraftForge#EVENT_BUS#register to register it, remember you have to fire your event manually using MinecraftForge#EVENT_BUS#post.
  18. The best we have currently are the docs, although they're a bit outdated.
  19. Return a use of repositionEntity.apply with false as the parameter, in placeEntity, like this:
  20. He's obviously not, Block.Properties is not in 1.12.
  21. Have you ever run 1.15.2 from the normal launcher?
  22. Upload your entire mod, preferably as a git repository.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.