Posted August 3, 20223 yr I have a mod with an Ice Sword, and I want it to be when you hit something, the surrounding dirt turns to permafrost, a block in Quark. How can I get that mod from the Quark mod? Any help is appreciated. Edited August 3, 20223 yr by TheElementGuy Add version. Please don't put anything from 1.16.5, 1.12.2, 1.14, 1.15, 1.0, or anything not 1.18.x or 1.19.x!
August 3, 20223 yr Should Quark be an optional or required dependency of your mod? Edited August 3, 20223 yr by Luis_ST
August 3, 20223 yr Author Optional because before I want to set the block, I check if quark is loaded. It works without quark. Please don't put anything from 1.16.5, 1.12.2, 1.14, 1.15, 1.0, or anything not 1.18.x or 1.19.x!
August 3, 20223 yr Author Otherwise there is just a mound of powdered snow. Please don't put anything from 1.16.5, 1.12.2, 1.14, 1.15, 1.0, or anything not 1.18.x or 1.19.x!
August 3, 20223 yr With ModList#isLoaded you can check if Quark is load. Then you can use ForgeRegistries.BLOCKS#getValue with the id of the permafrost Block to get the Block. Then you can place the Block in the World (Level). Note IForgeRegistry#getValue can be return null, it should not be null but it's recommended to handle this case (due Quarks Modul system). Edited August 3, 20223 yr by Luis_ST
August 3, 20223 yr Since you have a fallback Block you could also use RegistryObject#orElse, besides you don't need ModList#isLoaded in this case. Edited August 3, 20223 yr by Luis_ST
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.