Skip to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

warjort

Members
  • Joined

  • Last visited

Everything posted by warjort

  1. - public static final MenuType<Crate_WhiteOakGUIMenu> WHITE_OAK_CRATE_GUI = registerMenu("white_oak_crate_gui", (id, inv, extraData) -> new Crate_WhiteOakGUIMenu(id, inv, extraData)); + public static final RegistryObject<MenuType<Crate_WhiteOakGUIMenu>> WHITE_OAK_CRATE_GUI = registerMenu("white_oak_crate_gui", (id, inv, extraData) -> new Crate_WhiteOakGUIMenu(id, inv, extraData)); You hold the RegistryObject, then use WHITE_OAK_CRATE_GUI.get() to access it later.
  2. Old enough that the root certificates it comes with have expired. ๐Ÿ™‚
  3. Look at BookViewScreen.loadPages() - see the constructor for BookEditScreen for how it gets the CompoundTag.
  4. Look at how ChestBlock.use() uses getMenuProvider()
  5. subscribe for the RegisterKeyMappingsEvent on the mod event bus
  6. https://johann.loefflmann.net/en/software/jarfix/index.html
  7. NOTE: What is below is not fully tested, I just wrote it and tested it once to see if it works. I've never used GLMs so I had a go at implementing your requirement, this is what I found out (this is using the forge-1.19 mdk's example mod as a base): First I create src/main/resource/data/forge/loot_modifiers/global_loot_modifiers.json to specify the modification files { "replace": false, "entries": [ "examplemod:leaves" ] } The added the mentioned modification in src/main/resources/data/examplemod/loot_modifiers/leaves.json { "conditions": [ { "condition": "examplemod:blocktag", "blocktag": "minecraft:leaves" } ], "type": "examplemod:singleitem", "item": "minecraft:diamond" } Suprisingly, there is no loot condition for block tags so I had to write that public class BlockTagLootItemCondition implements LootItemCondition { final TagKey<Block> blockTag; BlockTagLootItemCondition(TagKey<Block> blockTag) { this.blockTag = blockTag; } public LootItemConditionType getType() { return ExampleMod.BLOCK_TAG_LOOT_ITEM.get(); } public Set<LootContextParam<?>> getReferencedContextParams() { return ImmutableSet.of(LootContextParams.BLOCK_STATE); } public boolean test(LootContext p_81772_) { BlockState blockstate = p_81772_.getParamOrNull(LootContextParams.BLOCK_STATE); return blockstate != null && blockstate.is(this.blockTag); } public static class Serializer implements net.minecraft.world.level.storage.loot.Serializer<BlockTagLootItemCondition> { public void serialize(JsonObject p_81795_, BlockTagLootItemCondition p_81796_, JsonSerializationContext p_81797_) { p_81795_.addProperty("blocktag", p_81796_.blockTag.location().toString()); } public BlockTagLootItemCondition deserialize(JsonObject p_81805_, JsonDeserializationContext p_81806_) { ResourceLocation resourcelocation = new ResourceLocation(GsonHelper.getAsString(p_81805_, "blocktag")); TagKey<Block> blockTag = TagKey.create(Registry.BLOCK_REGISTRY, resourcelocation); return new BlockTagLootItemCondition(blockTag); } } } Then write my actual modifier. This is a simple one that lets you define one item to add to the drops. public class SingleItemLootModifier extends LootModifier { public static final Supplier<Codec<SingleItemLootModifier>> CODEC = Suppliers.memoize(() -> RecordCodecBuilder.create(inst -> codecStart(inst) .and(ForgeRegistries.ITEMS.getCodec().fieldOf("item").forGetter(m -> m.item)) .apply(inst, SingleItemLootModifier::new) )); private final Item item; public SingleItemLootModifier(LootItemCondition[] conditions, Item item) { super(conditions); this.item = item; } @Override public Codec<? extends IGlobalLootModifier> codec() { return CODEC.get(); } @Override protected @NotNull ObjectArrayList<ItemStack> doApply(ObjectArrayList<ItemStack> generatedLoot, LootContext context) { generatedLoot.add(new ItemStack(item, 1)); return generatedLoot; } } Finally I have register the new condition and loot modifier in the main example mod class public static final DeferredRegister<LootItemConditionType> LOOT_ITEM_CONDITIONS = DeferredRegister.create(Registry.LOOT_ITEM_REGISTRY, MODID); public static final RegistryObject<LootItemConditionType> BLOCK_TAG_LOOT_ITEM = LOOT_ITEM_CONDITIONS.register("blocktag", () -> new LootItemConditionType(new BlockTagLootItemCondition.Serializer())); public static final DeferredRegister<Codec<? extends IGlobalLootModifier>> GLM = DeferredRegister.create(ForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, MODID); public static final RegistryObject<Codec<SingleItemLootModifier>> SINGLE_ITEM_LOOT_MODIFIER = GLM.register("singleitem", SingleItemLootModifier.CODEC); public ExampleMod() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); // Register the commonSetup method for modloading modEventBus.addListener(this::commonSetup); // Register the Deferred Register to the mod event bus so blocks get registered BLOCKS.register(modEventBus); // Register the Deferred Register to the mod event bus so items get registered ITEMS.register(modEventBus); // NEW REGISTRIES HERE! LOOT_ITEM_CONDITIONS.register(modEventBus); GLM.register(modEventBus); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); Now when I break anything in the BlockTags.LEAVES tag it drops a diamond.
  8. You are trying to use the clumps mod that has not updated to the recent changes in forge 1.19 Forge 1.19 is still under development (there is no recommended release yet). Mods that are not keeping up with updates won't work. For now, you will need to carefully check your mods have had a recent release before trying to use them.
  9. You are trying to use a mod for minecraft 1.18.2 with 1.19 How you remove mods depends upon your launcher, e.g. with the vanilla minecraft launcher you delete the file from your mods folder, others like curseforge or multimc have a gui. I would suggest you watch a youtube about modding with your launcher to get to know the basics, or look at your launcher's documentation or tutorials if it has any. This forum is to help with problems with forge. Forge is not itself a launcher.
  10. https://github.com/sp614x/optifine/issues/6974
  11. https://forums.minecraftforge.net/topic/113924-better-minecraft-modpack-crashed-after-i-put-other-mods-in-it/#comment-505923
  12. That method used by lost cities wasn't added until forge 40.1.35: https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.1.60/forge-1.18.2-40.1.60-changelog.txt You have 40.1.0, so you can either; * upgrade forge * talk to the lost cities author to find out which version of that mod is compatible with 40.1.0
  13. Your original crash is dated 7/15/22 your second one is 7/14/22? Can I borrow your time travel device. ๐Ÿ™‚
  14. There is a conflict between flickerfix and apoli, contact the mod authors to ask how to resolve it.
  15. Or since this is a modpack, you could also ask the author of the modpack.
  16. This is an issue with the additional additions config file. Contact the mod author to ask how to fix the problem.
  17. Looks like an issue with BetterLoadingScreen, make sure you have the latest version then contact the author. https://github.com/search?q=moveRenderOut&type=code
  18. Run windows powershell as adminstrator, then type the following command netstat -abn a = all b = show the program n = show ports as a number Then locate the entry that is LISTENING on xxx.xxx.xxx.xxx:65535 (in the local address column) Beneath that it will show the service/executable name that is running on that port.
  19. Not really my area of expertise. But usually if you hit the limits of what json models can do then you change your block to a BlockEntity and write your own BlockEntityRenderer to draw what you want. e.g. the vanilla banner could be normal block, but then it wouldn't wave in the wind.
  20. The rubidium mod is trying to use graphics on the server. This is a bug in that mod. But you don't need this mod on the server.
  21. Same error, different file. If it happens again after you fix that file. Look at the error message in the crash report to identify which file is broken.
  22. It cannot open that file because your current user doesn't have the operating system permission. There are similar messages with other files. You need to fix the file permissions in your minecraft folder.
  23. Textures are determined by the block model. Block models are selected in your blockstates.json based on the block's Property(s) in your BlockState. Which BlockState is used is decided by you. e.g. see the how LIT property is used by RedstoneLampBlock
  24. 7.2.9 is world edit for 1.18.1, you have 1.18.2 https://www.curseforge.com/minecraft/mc-mods/worldedit/files
  25. Your config/forge-client.toml is corrupted. Delete it and it will be recreated with default values.

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.