Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Leaderboard

Popular Content

Showing content with the highest reputation since 06/12/21 in all areas

  1. The Forge Git repository only contains patches to the decompiled Minecraft source code. In very simplified terms this means "remove this line from this file" or "add this code here". It does not contain the decompiled game source code. When the Forge installer is built, these patch files are converted to binary patches to the compiled code, these binary patch files are then shipped with the installer. As such the installer again does not contain any Minecraft code. When you then run the installer it takes the vanilla Minecraft jar (or downloads it from Mojang's servers if you don't have i
    2 points
  2. Javadocs are built off crowdsourced mappings/docs that change depending on the status of the crowdsourced projects. So, no there is no good javadocs project or website because they always change. You're more then free to build the javadocs yourself for your workspace. And/Or use your IDE's built in javadoc reader. The only/best official docs are https://mcforge.readthedocs.io/en/latest/ created by users in this repo: https://github.com/MinecraftForge/Documentation
    1 point
  3. Some zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.
    1 point
  4. A spawn egg can have its type overwritten by the ItemStack NBT data. Hence getType expects the NBT data being passed in. You can pass null if you just want the egg's default entity type.
    1 point
  5. Currently Java 8-15 are supported. Java 8 is recommended, as that is the version Mojang ships with their launcher.
    1 point
  6. In fact this specifically is the issue. Java 16 is not yet supported.
    1 point
  7. Actually in vanilla the sidebar never disappears in my tests. I have found the bug, just not sure how to fix it yet. Thank you for the report.
    1 point
  8. Note that I am no expert on mappings, and I think generally it is best to use the same mappings as most other people use to make life easier for everybody. However, with that said, this should work: 1. Add this to your build.gradle to create a local maven repo on your computer: repositories { maven { url "file:///${project.projectDir}/mappings" } } 2. Change back the mappings channel (the mappings channel is hardcoded to use 'official', 'snapshot' and 'stable' so you have to use one of those): mappings channel: 'snapshot', version: 'vemerion-mappings' You can
    1 point
  9. 1 point
  10. This. The reason for this is that DeferredRegister relies on static initializers. If you put your RegistryObjects in some random class it is not guaranteed that that class is actually initialized by the time your DeferredRegister is. Hence: Put the DeferredRegister and its entries in the same class. @ObjectHolder is explained here: https://mcforge.readthedocs.io/en/latest/concepts/registries/#using-objectholder
    1 point
  11. First of all the BLOCKS and ITEMS fields (i.e. your DeferredRegister instances) should not be in a separate class. Put them in the same class or you will have issues. No, you cannot, because then you defeat the entire purpose of DeferredRegister. You must create your registry objects (blocks, items, etc.) in the registry event. DeferredRegister manages this for you. If you don't want this, you can also manually subscribe to RegistryEvent and create and register your things there. You can then use @ObjectHolder to obtain the instances for your registry entries. You can also mix and matc
    1 point
  12. There is none that I know of. But I will be working on a patch to Forge to work around this problem.
    1 point
  13. setDefaultState is called in mojang mappings registerDefaultState you can use the bot an the forge discord server https://discord.com/invite/UvedJ9m EDIT: commands: mcpe -> mojang : !moj -c mcp methode/field/(1.17) class mojang -> mcpe : !mcp -c moj methode/field/(1.17) class this create StateDefinition but set not the default values
    1 point
  14. Add protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) { builder.add(LEVEL); } snippet taken from the CauldronBlock with slight edit
    1 point
  15. You lack this method: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/block/ore/HardOreBlock.java#L51-L54 I'm not sure what the Mojang mapping name is for it, but you still lack it.
    1 point
  16. Look the Forge's source code. In BedBlock, minecrafts uses PlayerEntity#displayClientMessage to display sleep result (which can be success or failure, so "You can only sleep at night"). Just give an ITextComponent (StringTextComponent or TranslationTextComponent in most cases) and set the second boolean to true to send an state text instead of sending it to the chat. So: PlayerEntity player = //Get player here player.displayClientMessage(new StringTextComponent(""), true); I havn't check that, but it should be somthing like that
    1 point
  17. To be tinted your model face needs to have a tintindex set (not -1, which is the default and means "do not tint"). block/cube_all has no tintindex set for any of its faces - as such your model does not get tinted.
    1 point
  18. I don't know if it is documented somewhere, no. We could in general do a little better with our documentation on "how to get started if you have never modded before". It's something I have been meaning to tackle but never get around to doing...
    1 point
  19. In general you should use the version that comes with the Minecraft launcher, as that is what Forge will use as the main target. But you are correct, currently 8-15 are supported. With 1.17 this will change to require Java 16 (this is a change from vanilla Minecraft).
    1 point
  20. You cannot reliably do this. What you can do is try to find out by looking through ModList#getModFiles and check where the class came from. But this is unreliable, which is why for example @EventBusSubscriber requires you to specify the ModID.
    1 point
  21. When calling ForgeConfigSpec.Builder#comment you need to pass a valid comment (not null or empty string). If you do not want a comment, do not call this method.
    1 point
  22. It will give you all of them. This is not true. It lets you iterate through all of them. What? Why? That is pretty bad API design. If you really do need a Class instance, make a service interface that provides that Class.
    1 point
  23. you have to overwrite the DimensionType file (minecraft / data / dimension_type / the_nether.json) create a file with the exact name in this directory, take a look at these two links my dimension type for a new dimension and the minecraft wiki for dimensions (look at the vanilla defaults) https://github.com/Luis-st/Forge-1.16.5-Nero/blob/main/src/main/resources/data/nero/dimension_type/deepslate.json https://minecraft.fandom.com/wiki/Custom_dimension
    1 point
  24. If you want to do this for the client, you have to put the "-Xmx 1024M" etc in the JVM arguments setting of the launcher, yes (don't put the -jar in there).
    1 point
  25. Look at PlayerList#load for how to get player data.
    1 point
  26. Java 16 is not yet supported.
    1 point
  27. Howdy You might find this tutorial useful It works in 1.16.3 see example mbe45... https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe45_commands http://greyminecraftcoder.blogspot.com/2020/05/minecraft-by-example.html Cheers Richard
    1 point
  28. IPacket is a vanilla class, do not use it. SimpleChannel no longer requires your packets to implement a certain interface. Instead you need to supply the following things: An encoder (BiConsumer<MSG, PacketBuffer>). This will be called with your packet instance and a PacketBuffer to write the packet data to the byte stream. This used to be toBytes in IMessage. A decoder (Function<PacketBuffer, MSG>). This will be called with the byte stream data and must decode it into an instance of your packet. This used to be done via a reflective constructor call and fromBytes.
    1 point
  29. Well it first of all, you need code that checks all the block positions starting from the player position. However, note that as the distance gets farther the number of blocks required grows very large, so you will have to limit the range for checking to about 10 blocks for performance reasons. For the actually checking, you just loop through all the block locations using "for" loops for each of the x, y, and z dimensions and look for the block. Note though you need to check the distance of each of the target type blocks you find to see if you've actually found the closest.
    1 point
  30. This PR would have allowed you to control the movement speed while the item was in use, but the author hasn't responded for a while. If you were to update it, it may be merged for 1.12.1 and possibly 1.11.2.
    1 point
  31. Thanks for showing me the right direction.
    1 point
  32. To find all of the hostile mobs within 5 blocks, List<Entity> entities = world.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.expand(5.0D, 5.0D, 5.0D)); and then run through those and see which ones are hostile via instanceof. Then, if they are, entity.setDead().
    1 point
  33. Ok, so I have this now. Is there a specific code I need to enter in genericName's place (I chose a temporary name because I didn't know what to use) or can I name it something easier to remember?
    0 points


  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.