Jump to content

ChonkoTheGreat

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by ChonkoTheGreat

  1. Hello,

    when I create a modded block that is harder than wood/doesn't drop when mined with a hand, never drops the block. The strenght of the block also does not seem to work properly, as the block takes very long to break, regardless of what I set the values to be.

    Here's the code of the block:

    unknown.png

    I have already created the block item and the loot table for the block. The issue only occurs when you would need a specific tool for the block to drop. If I were to copy the properties from a dirt block for example, it would drop normally.

  2. Hello,

    I recently tried working on my modpack, but It doesn't seem to want to work when install mods. The log states that there was an error when trying to initialize a CoreMod. Here is the full log.

    [13:38:52] [main/INFO]: ModLauncher running: args [--username, ChonkoTheGreat, --version, forge-40.1.30, --gameDir, C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella, --assetsDir, C:\Users\misch\Twitch\Minecraft\Install\assets, --assetIndex, 1.18, --uuid, a91dbc2239444f97bdf376a213108c8d, --accessToken, ????????, --clientId, M2UzYTkxODEtNmNmOS00MDUxLWEzNmUtMzRiN2Y1ZWFiYmZh, --xuid, 2535470356668691, --userType, msa, --versionType, release, --width, 1366, --height, 768, --launchTarget, forgeclient, --fml.forgeVersion, 40.1.30, --fml.mcVersion, 1.18.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220404.173914]
    [13:38:52] [main/INFO]: ModLauncher 9.1.3+9.1.3+main.9b69c82a starting: java version 17.0.1 by Microsoft
    [13:38:52] [main/INFO]: OptiFineTransformationService.onLoad
    [13:38:52] [main/INFO]: OptiFine ZIP file URL: union:/C:/Users/misch/Twitch/Minecraft/Instances/PizzaCinderella/mods/OptiFine_1.18.2_HD_U_H7.jar%2352!/
    [13:38:52] [main/INFO]: OptiFine ZIP file: C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods\OptiFine_1.18.2_HD_U_H7.jar
    [13:38:52] [main/INFO]: Target.PRE_CLASS is available
    [13:38:53] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/misch/Twitch/Minecraft/Install/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2314!/ Service=ModLauncher Env=CLIENT
    [13:38:53] [main/INFO]: OptiFineTransformationService.initialize
    [13:38:53] [main/INFO]: Found mod file actuallycompatible-0.1.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file alexsdelight-1.18.2-1.2.3.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file alexsmobs-1.18.3.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Aquamirae 3.2.0 (Forge 1.18.2).jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file architectury-4.4.68.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file AutoRegLib-1.7-53.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file balm-3.0.3+0.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Beyond-Earth-1.18.2-6.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file BiomesOPlenty-1.18.2-16.0.0.109-universal.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file blockcarpentry-1.18-0.3.0.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file blueprint-1.18.2-5.3.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Botania-1.18.2-432.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file BuildersDelight-1.18.2-v.0.9.3.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file bygonenether-1.1.2-1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file cfm-7.0.0-pre29-1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file chalk-1.18.2-1.2.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Chimes-1.1.2-1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file chipped-1.18.2-1.2.1-forge.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file ChiselsBits-forge-1.18.2-1.2.90-universal.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file citadel-1.11.3-1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file comforts-forge-1.18.2-5.0.0.4.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Compat-O-Plenty-1.18.2-1.5.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file CosmeticArmorReworked-1.18.2-v2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file CraftTweaker-forge-1.18.2-9.1.148.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file create-mc1.18.2_v0.4.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file createchunkloading-1.1.0-forge.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file culinaryconstruct-forge-1.18.2-4.3.1.0.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file curios-forge-1.18.2-5.0.7.0.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file DramaticDoors-1.18.2-1.6.4.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file duckling-1.0.5-forge.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file DungeonCrawl-1.18.2-2.3.8.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file DustrialDecor-1.3.3-1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file ecologics-FORGE-1.18.2-1.6.8.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file elevatorid-1.18.2-1.8.4.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Enlightened End BB V1.4.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file FarmersDelight-1.18.2-1.1.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file feature_nbt_deadlock_be_gone_forge-2.0.0+1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file flowery-forge-10.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file flowerycore-5.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file flywheel-forge-1.18-0.6.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file geckolib-1.18-forge-3.0.20.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file goblintraders-1.7.2-1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file hedgehog-1.18.2-1.1.0.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file hexerei-0.1.19.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Incendium_v5.0.4.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file jei-1.18.2-9.7.0.195.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file JEITweaker-1.18.2-3.0.0.8.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Kobolds-2.0.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file kotlinforforge-3.3.2-obf.jar of type LANGPROVIDER with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file mannequins-forge-2.1.0+1.18.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Mantle-1.18.2-1.9.20.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file mcw-furniture-3.0.0-mc1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file mcw-roofs-2.1.2-mc1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file mcw-windows-2.0.3-mc1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Mekanism-1.18.2-10.2.2.462.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file MekanismGenerators-1.18.2-10.2.2.462.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file MekanismTools-1.18.2-10.2.2.462.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file moyai-1.18.2-1.1.4.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Mushlings-1.18.2-1.0.0.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file NaturesCompass-1.18.2-1.9.5-forge.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file netherportalfix-forge-1.18-9.0.0.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Obscuria's Essentials 3.2.0 (Forge 1.18.2).jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Obscuria's Tooltips 1.3.0 (1.18.2).jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Oh_The_Biomes_You'll_Go-forge-1.18.2-1.4-RC-24.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Patchouli-1.18.2-69.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file platforms-1.18-1.9.4.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file pollen-forge-1.4.3+1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file Quark-3.2-357.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file QuarkOddities-1.18.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file selene-1.18.2-1.17.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file shetiphiancore-1.18-3.10.9.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file shutupexperimentalsettings-1.0.5.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file simplyhotsprings-1.18.2-0.2.4.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file sit-1.18.2-1.3.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file snuffles-1.0.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file sophisticatedbackpacks-1.18.2-3.17.2.588.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file sophisticatedcore-1.18.2-0.2.6.30.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file supermartijn642corelib-1.0.18-forge-mc1.18.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file supplementaries-1.18.2-1.4.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file TConstruct-1.18.2-3.5.0.17.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file TerraBlender-forge-1.18.2-1.1.0.102.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file the_bumblezone_forge-5.1.2+1.18.2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file The_Undergarden-1.18.2-0.7.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file torohealth-1.18-forge-2.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file trashcans-1.0.15-forge-mc1.18.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file tumbleweed-1.18-0.4.12.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file twilightforest-1.18.2-4.1.1052-universal.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file valhelsia_core-1.18.2-0.3.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file waystones-forge-1.18.2-10.0.0.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file whisperwoods-1.18.2-2.1.0-forge.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file YungsApi-1.18.2-Forge-2.0.8.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file YungsBetterMineshafts-1.18.2-Forge-2.1.3.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:53] [main/INFO]: Found mod file YungsBetterStrongholds-1.18.2-Forge-2.1.1.jar of type MOD with locator {mods folder locator at C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella\mods}
    [13:38:54] [main/INFO]: Found mod file fmlcore-1.18.2-40.1.30.jar of type LIBRARY with locator net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3a7704c
    [13:38:54] [main/INFO]: Found mod file javafmllanguage-1.18.2-40.1.30.jar of type LANGPROVIDER with locator net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3a7704c
    [13:38:54] [main/INFO]: Found mod file mclanguage-1.18.2-40.1.30.jar of type LANGPROVIDER with locator net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3a7704c
    [13:38:54] [main/INFO]: Found mod file client-1.18.2-20220404.173914-srg.jar of type MOD with locator net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3a7704c
    [13:38:54] [main/INFO]: Found mod file forge-1.18.2-40.1.30-universal.jar of type MOD with locator net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3a7704c
    [13:38:55] [main/INFO]: OptiFineTransformationService.transformers
    [13:38:55] [main/INFO]: Targets: 350
    [13:38:56] [main/ERROR]: Error occurred initializing CoreMod
    java.io.FileNotFoundException: null
    	at java.util.Optional.orElseThrow(Optional.java:403) ~[?:?]
    	at cpw.mods.niofs.union.UnionFileSystem.newReadByteChannel(UnionFileSystem.java:220) ~[securejarhandler-1.0.3.jar:?]
    	at cpw.mods.niofs.union.UnionFileSystemProvider.newByteChannel(UnionFileSystemProvider.java:149) ~[securejarhandler-1.0.3.jar:?]
    	at java.nio.file.Files.newByteChannel(Files.java:380) ~[?:?]
    	at java.nio.file.Files.newByteChannel(Files.java:432) ~[?:?]
    	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422) ~[?:?]
    	at java.nio.file.Files.newInputStream(Files.java:160) ~[?:?]
    	at java.nio.file.Files.newBufferedReader(Files.java:2922) ~[?:?]
    	at java.nio.file.Files.newBufferedReader(Files.java:2955) ~[?:?]
    	at net.minecraftforge.fml.loading.moddiscovery.CoreModFile.readCoreMod(CoreModFile.java:28) ~[fmlloader-1.18.2-40.1.30.jar%2316!/:?]
    	at net.minecraftforge.coremod.CoreMod.initialize(CoreMod.java:41) ~[coremods-5.0.1.jar%234!/:5.0.1+15+master.dc5a2922]
    	at net.minecraftforge.coremod.CoreModEngine.initialize(CoreModEngine.java:75) ~[coremods-5.0.1.jar%234!/:5.0.1+15+master.dc5a2922]
    	at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
    	at net.minecraftforge.coremod.CoreModEngine.initializeCoreMods(CoreModEngine.java:69) ~[coremods-5.0.1.jar%234!/:5.0.1+15+master.dc5a2922]
    	at net.minecraftforge.coremod.CoreModProvider.getCoreModTransformers(CoreModProvider.java:17) ~[coremods-5.0.1.jar%234!/:5.0.1+15+master.dc5a2922]
    	at net.minecraftforge.fml.loading.FMLServiceProvider.transformers(FMLServiceProvider.java:133) ~[fmlloader-1.18.2-40.1.30.jar%2316!/:1.0]
    	at cpw.mods.modlauncher.TransformationServiceDecorator.gatherTransformers(TransformationServiceDecorator.java:74) ~[modlauncher-9.1.3.jar%235!/:?]
    	at cpw.mods.modlauncher.TransformationServicesHandler.lambda$initialiseServiceTransformers$6(TransformationServicesHandler.java:86) ~[modlauncher-9.1.3.jar%235!/:?]
    	at java.util.HashMap$Values.forEach(HashMap.java:1065) [?:?]
    	at cpw.mods.modlauncher.TransformationServicesHandler.initialiseServiceTransformers(TransformationServicesHandler.java:86) [modlauncher-9.1.3.jar%235!/:?]
    	at cpw.mods.modlauncher.Launcher.run(Launcher.java:100) [modlauncher-9.1.3.jar%235!/:?]
    	at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.1.3.jar%235!/:?]
    	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.1.3.jar%235!/:?]
    	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.1.3.jar%235!/:?]
    	at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) [bootstraplauncher-1.0.0.jar:?]
    [13:38:56] [main/INFO]: additionalClassesLocator: [optifine., net.optifine.]
    [13:39:01] [main/INFO]: Compatibility level set to JAVA_17
    [13:39:01] [main/INFO]: Successfully loaded Mixin Connector [shetiphian.core.mixins.MixinConnector]
    [13:39:01] [main/INFO]: Launching target 'forgeclient' with arguments [--version, forge-40.1.30, --gameDir, C:\Users\misch\Twitch\Minecraft\Instances\PizzaCinderella, --assetsDir, C:\Users\misch\Twitch\Minecraft\Install\assets, --uuid, a91dbc2239444f97bdf376a213108c8d, --username, ChonkoTheGreat, --assetIndex, 1.18, --accessToken, ????????, --clientId, M2UzYTkxODEtNmNmOS00MDUxLWEzNmUtMzRiN2Y1ZWFiYmZh, --xuid, 2535470356668691, --userType, msa, --versionType, release, --width, 1366, --height, 768]
    [13:39:03] [main/WARN]: Error loading class: net/minecraft/client/renderer/ItemInHandRenderer (java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0)
    [13:39:03] [main/WARN]: @Mixin target net.minecraft.client.renderer.ItemInHandRenderer was not found botania_xplat.mixins.json:client.MixinItemInHandRenderer
    [13:39:04] [main/WARN]: Error loading class: net/minecraft/client/renderer/ItemInHandRenderer (java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0)
    [13:39:04] [main/WARN]: @Mixin target net.minecraft.client.renderer.ItemInHandRenderer was not found selene.mixins.json:FirstPersonRendererMixin
    [13:39:08] [main/WARN]: @Inject(@At("HEAD")) Shift.BY=1 on blueprint.mixins.json:EntityMixin::handler$zbg000$baseTick exceeds the maximum allowed value: 0. Increase the value of maxShiftBy to suppress this warning.

    How exactly do I fix this Issue? Help would be appreciated.

    Thanks in advance.

     

  3. How does one add items to vanilla mob loot tables with global loot modifiers? I already managed to make it work with blocks, but mobs don't seem to work.

    Here's my code:

    LootAdditionModifier:

    public class LootAdditionModifier extends LootModifier {
    	private final Item addition;
    
        protected LootAdditionModifier(ILootCondition[] conditionsIn, Item addition) {
            super(conditionsIn);
            this.addition = addition;
        }
    
        @Nonnull
        @Override
        protected List<ItemStack> doApply(List<ItemStack> generatedLoot, LootContext context) {
            // generatedLoot is the loot that would be dropped, if we wouldn't add or replace
            // anything!
            generatedLoot.add(new ItemStack(addition, 1));
            return generatedLoot;
        }
    
        public static class Serializer extends GlobalLootModifierSerializer<LootAdditionModifier> {
    
            @Override
            public LootAdditionModifier read(ResourceLocation name, JsonObject object, ILootCondition[] conditionsIn) {
                Item addition = ForgeRegistries.ITEMS.getValue(
                        new ResourceLocation(JSONUtils.getString(object, "addition")));
                return new LootAdditionModifier(conditionsIn, addition);
            }
    
            @Override
            public JsonObject write(LootAdditionModifier instance) {
                JsonObject json = makeConditions(instance.conditions);
                json.addProperty("addition", ForgeRegistries.ITEMS.getKey(instance.addition).toString());
                return json;
            }
        }
    }

    LootStructureAdditionModifier:

    public class LootStructureAdditionModifier extends LootModifier{
    	 private final Item addition;
    
    	    protected LootStructureAdditionModifier(ILootCondition[] conditionsIn, Item addition) {
    	        super(conditionsIn);
    	        this.addition = addition;
    	    }
    
    	    @Nonnull
    	    @Override
    	    protected List<ItemStack> doApply(List<ItemStack> generatedLoot, LootContext context) {
    	        // generatedLoot is the loot that would be dropped, if we wouldn't add or replace
    	        // anything!
    	        if(context.getRandom().nextFloat() > 1.0) {
    	            generatedLoot.add(new ItemStack(addition, 1));
    	        }
    	        return generatedLoot;
    	    }
    
    	    public static class Serializer extends GlobalLootModifierSerializer<LootStructureAdditionModifier> {
    
    	        @Override
    	        public LootStructureAdditionModifier read(ResourceLocation name, JsonObject object, ILootCondition[] conditionsIn) {
    	            Item addition = ForgeRegistries.ITEMS.getValue(
    	                    new ResourceLocation(JSONUtils.getString(object, "addition")));
    	            return new LootStructureAdditionModifier(conditionsIn, addition);
    	        }
    
    	        @Override
    	        public JsonObject write(LootStructureAdditionModifier instance) {
    	            JsonObject json = makeConditions(instance.conditions);
    	            json.addProperty("addition", ForgeRegistries.ITEMS.getKey(instance.addition).toString());
    	            return json;
    	        }
    	    }
    	}

    The global_loot_modifiers.json:

    {
      "replace": false,
      "entries": [
        "mikesfancycontent:test"
      ]
    }

    And the test.json:

    {
      "conditions": [
        {
          "condition": "minecraft:entity_properties",
          "entity": "this",
          "predicate": {
            "type": "minecraft:stray"
          }
        }
      ],
      "addition": "mikesfancycontent:frost_berries"
    }

    What do I have to change to make it work for mob drops. Thanks in advance.

  4. Hello
    I have recently made a 2 block tall crop. Problem: The upper block of the block doesn't seem to update with age, always staying at the first stage.                                            Here's the first stage of the plant:

    Screenshot_673.png

    Here is the last stage:

    Screenshot_674.png

    Here is the code I used for the crop:

    public class AncientFruitBlock extends CropsBlock {
           
     
     
        public static final IntegerProperty AGE = BlockStateProperties.AGE_0_5;
        public static final EnumProperty<DoubleBlockHalf> HALF = BlockStateProperties.DOUBLE_BLOCK_HALF;
        private static final VoxelShape[] SHAPE_BY_AGE = new VoxelShape[]{
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 3.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 11.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D)};
                
                
        
        public AncientFruitBlock(Properties builder) {
            super(builder);   
            this.setDefaultState(this.stateContainer.getBaseState().with(HALF, DoubleBlockHalf.LOWER));
        }
        
        public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) {
            DoubleBlockHalf doubleblockhalf = stateIn.get(HALF);
            if (facing.getAxis() != Direction.Axis.Y || doubleblockhalf == DoubleBlockHalf.LOWER != (facing == Direction.UP) || facingState.isIn(this) && facingState.get(HALF) != doubleblockhalf) {
               return doubleblockhalf == DoubleBlockHalf.LOWER && facing == Direction.DOWN && !stateIn.isValidPosition(worldIn, currentPos) ? Blocks.AIR.getDefaultState() : super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
            } else {
               return Blocks.AIR.getDefaultState();
            }
         }
        
        @Nullable
        public BlockState getStateForPlacement(BlockItemUseContext context) {
           BlockPos blockpos = context.getPos();
           return blockpos.getY() < 255 && context.getWorld().getBlockState(blockpos.up()).isReplaceable(context) ? super.getStateForPlacement(context) : null;
        }
        
        public void onBlockPlacedBy(World worldIn, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
            worldIn.setBlockState(pos.up(), this.getDefaultState().with(HALF, DoubleBlockHalf.UPPER), 3);
         }
     
         public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) {
            if (state.get(HALF) != DoubleBlockHalf.UPPER) {
               return super.isValidPosition(state, worldIn, pos);
            } else {
               BlockState blockstate = worldIn.getBlockState(pos.down());
               if (state.getBlock() != this) return super.isValidPosition(state, worldIn, pos); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
               return blockstate.isIn(this) && blockstate.get(HALF) == DoubleBlockHalf.LOWER;
            }
         }
     
         public void placeAt(IWorld worldIn, BlockPos pos, int flags) {
            worldIn.setBlockState(pos, this.getDefaultState().with(HALF, DoubleBlockHalf.LOWER), flags);
            worldIn.setBlockState(pos.up(), this.getDefaultState().with(HALF, DoubleBlockHalf.UPPER), flags);
         }
     
         public void onBlockHarvested(World worldIn, BlockPos pos, BlockState state, PlayerEntity player) {
            if (!worldIn.isRemote) {
               if (player.isCreative()) {
                  removeBottomHalf(worldIn, pos, state, player);
               } else {
                  spawnDrops(state, worldIn, pos, (TileEntity)null, player, player.getHeldItemMainhand());
               }
            }
     
            super.onBlockHarvested(worldIn, pos, state, player);
         }
     
         public void harvestBlock(World worldIn, PlayerEntity player, BlockPos pos, BlockState state, @Nullable TileEntity te, ItemStack stack) {
            super.harvestBlock(worldIn, player, pos, Blocks.AIR.getDefaultState(), te, stack);
         }
     
         protected static void removeBottomHalf(World world, BlockPos pos, BlockState state, PlayerEntity player) {
            DoubleBlockHalf doubleblockhalf = state.get(HALF);
            if (doubleblockhalf == DoubleBlockHalf.UPPER) {
               BlockPos blockpos = pos.down();
               BlockState blockstate = world.getBlockState(blockpos);
               if (blockstate.getBlock() == state.getBlock() && blockstate.get(HALF) == DoubleBlockHalf.LOWER) {
                  world.setBlockState(blockpos, Blocks.AIR.getDefaultState(), 35);
                  world.playEvent(player, 2001, blockpos, Block.getStateId(blockstate));
               }
            }
     
         }
         
         @Override
         protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
            builder.add(HALF);
            builder.add(AGE);
         }
         
         public IntegerProperty getAgeProperty() {
             return AGE;
          }
     
        @Override
        protected IItemProvider getSeedsItem() {
            return ItemInit.ANCIENT_SEED.get();
        }
        
        @Override
        public int getMaxAge() {
            return 5;
         }
     
        @Override
        public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
            return SHAPE_BY_AGE[state.get(this.getAgeProperty())];
        }
     }

    What do I have to do to fix this? Thanks in advance.

  5. The crop is now 2 blocks tall, the only problem is, that the upper block only uses the first model and won't change, no matter the age.

    The code:

    public class AncientFruitBlock extends CropsBlock {
    	   
    
    
    	public static final IntegerProperty AGE = BlockStateProperties.AGE_0_5;
    	public static final EnumProperty<DoubleBlockHalf> HALF = BlockStateProperties.DOUBLE_BLOCK_HALF;
    	private static final VoxelShape[] SHAPE_BY_AGE = new VoxelShape[]{
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 3.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 11.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D)};
    			
    			
        
    	public AncientFruitBlock(Properties builder) {
    		super(builder);   
            this.setDefaultState(this.stateContainer.getBaseState().with(HALF, DoubleBlockHalf.LOWER));
        }
        
        public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) {
            DoubleBlockHalf doubleblockhalf = stateIn.get(HALF);
            if (facing.getAxis() != Direction.Axis.Y || doubleblockhalf == DoubleBlockHalf.LOWER != (facing == Direction.UP) || facingState.isIn(this) && facingState.get(HALF) != doubleblockhalf) {
               return doubleblockhalf == DoubleBlockHalf.LOWER && facing == Direction.DOWN && !stateIn.isValidPosition(worldIn, currentPos) ? Blocks.AIR.getDefaultState() : super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
            } else {
               return Blocks.AIR.getDefaultState();
            }
         }
        
        @Nullable
        public BlockState getStateForPlacement(BlockItemUseContext context) {
           BlockPos blockpos = context.getPos();
           return blockpos.getY() < 255 && context.getWorld().getBlockState(blockpos.up()).isReplaceable(context) ? super.getStateForPlacement(context) : null;
        }
        
        public void onBlockPlacedBy(World worldIn, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
            worldIn.setBlockState(pos.up(), this.getDefaultState().with(HALF, DoubleBlockHalf.UPPER), 3);
         }
    
         public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) {
            if (state.get(HALF) != DoubleBlockHalf.UPPER) {
               return super.isValidPosition(state, worldIn, pos);
            } else {
               BlockState blockstate = worldIn.getBlockState(pos.down());
               if (state.getBlock() != this) return super.isValidPosition(state, worldIn, pos); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
               return blockstate.isIn(this) && blockstate.get(HALF) == DoubleBlockHalf.LOWER;
            }
         }
    
         public void placeAt(IWorld worldIn, BlockPos pos, int flags) {
            worldIn.setBlockState(pos, this.getDefaultState().with(HALF, DoubleBlockHalf.LOWER), flags);
            worldIn.setBlockState(pos.up(), this.getDefaultState().with(HALF, DoubleBlockHalf.UPPER), flags);
         }
    
         public void onBlockHarvested(World worldIn, BlockPos pos, BlockState state, PlayerEntity player) {
            if (!worldIn.isRemote) {
               if (player.isCreative()) {
                  removeBottomHalf(worldIn, pos, state, player);
               } else {
                  spawnDrops(state, worldIn, pos, (TileEntity)null, player, player.getHeldItemMainhand());
               }
            }
    
            super.onBlockHarvested(worldIn, pos, state, player);
         }
    
         public void harvestBlock(World worldIn, PlayerEntity player, BlockPos pos, BlockState state, @Nullable TileEntity te, ItemStack stack) {
            super.harvestBlock(worldIn, player, pos, Blocks.AIR.getDefaultState(), te, stack);
         }
    
         protected static void removeBottomHalf(World world, BlockPos pos, BlockState state, PlayerEntity player) {
            DoubleBlockHalf doubleblockhalf = state.get(HALF);
            if (doubleblockhalf == DoubleBlockHalf.UPPER) {
               BlockPos blockpos = pos.down();
               BlockState blockstate = world.getBlockState(blockpos);
               if (blockstate.getBlock() == state.getBlock() && blockstate.get(HALF) == DoubleBlockHalf.LOWER) {
                  world.setBlockState(blockpos, Blocks.AIR.getDefaultState(), 35);
                  world.playEvent(player, 2001, blockpos, Block.getStateId(blockstate));
               }
            }
    
         }
         
         @Override
         protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
            builder.add(HALF);
            builder.add(AGE);
         }
         
         public IntegerProperty getAgeProperty() {
             return AGE;
          }
    
        @Override
        protected IItemProvider getSeedsItem() {
            return ItemInit.ANCIENT_SEED.get();
        }
        
        @Override
        public int getMaxAge() {
            return 5;
         }
    
        @Override
        public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
            return SHAPE_BY_AGE[state.get(this.getAgeProperty())];
        }
     }

    A picture of the crop at stage 0...
    Screenshot_673.png

    ...and stage 5. What do i have to do to make it change the texture?

    Screenshot_674.png

  6. The code:
     

    public class AncientFruitBlock extends CropsBlock {
    	   
    	public static final IntegerProperty AGE = BlockStateProperties.AGE_0_5;
    	public static final EnumProperty<DoubleBlockHalf> HALF = BlockStateProperties.DOUBLE_BLOCK_HALF;
        private static final VoxelShape[] SHAPE_BY_AGE = new VoxelShape[]{
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 10.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 14.0D, 16.0D),
                Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D)};
    
        public AncientFruitBlock(Properties builder) {
            super(builder);
            this.setDefaultState(this.stateContainer.getBaseState().with(HALF, DoubleBlockHalf.LOWER));
        }
        
        public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) {
            DoubleBlockHalf doubleblockhalf = stateIn.get(HALF);
            if (facing.getAxis() != Direction.Axis.Y || doubleblockhalf == DoubleBlockHalf.LOWER != (facing == Direction.UP) || facingState.isIn(this) && facingState.get(HALF) != doubleblockhalf) {
               return doubleblockhalf == DoubleBlockHalf.LOWER && facing == Direction.DOWN && !stateIn.isValidPosition(worldIn, currentPos) ? Blocks.AIR.getDefaultState() : super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
            } else {
               return Blocks.AIR.getDefaultState();
            }
         }
        
        @Nullable
        public BlockState getStateForPlacement(BlockItemUseContext context) {
           BlockPos blockpos = context.getPos();
           return blockpos.getY() < 255 && context.getWorld().getBlockState(blockpos.up()).isReplaceable(context) ? super.getStateForPlacement(context) : null;
        }
        
        public void onBlockPlacedBy(World worldIn, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
            worldIn.setBlockState(pos.up(), this.getDefaultState().with(HALF, DoubleBlockHalf.UPPER), 3);
         }
    
         public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) {
            if (state.get(HALF) != DoubleBlockHalf.UPPER) {
               return super.isValidPosition(state, worldIn, pos);
            } else {
               BlockState blockstate = worldIn.getBlockState(pos.down());
               if (state.getBlock() != this) return super.isValidPosition(state, worldIn, pos);
               return blockstate.isIn(this) && blockstate.get(HALF) == DoubleBlockHalf.LOWER;
            }
         }
    
         public void placeAt(IWorld worldIn, BlockPos pos, int flags) {
            worldIn.setBlockState(pos, this.getDefaultState().with(HALF, DoubleBlockHalf.LOWER), flags);
            worldIn.setBlockState(pos.up(), this.getDefaultState().with(HALF, DoubleBlockHalf.UPPER), flags);
         }
    
         public void onBlockHarvested(World worldIn, BlockPos pos, BlockState state, PlayerEntity player) {
            if (!worldIn.isRemote) {
               if (player.isCreative()) {
                  removeBottomHalf(worldIn, pos, state, player);
               } else {
                  spawnDrops(state, worldIn, pos, (TileEntity)null, player, player.getHeldItemMainhand());
               }
            }
    
            super.onBlockHarvested(worldIn, pos, state, player);
         }
    
         public void harvestBlock(World worldIn, PlayerEntity player, BlockPos pos, BlockState state, @Nullable TileEntity te, ItemStack stack) {
            super.harvestBlock(worldIn, player, pos, Blocks.AIR.getDefaultState(), te, stack);
         }
    
         protected static void removeBottomHalf(World world, BlockPos pos, BlockState state, PlayerEntity player) {
            DoubleBlockHalf doubleblockhalf = state.get(HALF);
            if (doubleblockhalf == DoubleBlockHalf.UPPER) {
               BlockPos blockpos = pos.down();
               BlockState blockstate = world.getBlockState(blockpos);
               if (blockstate.getBlock() == state.getBlock() && blockstate.get(HALF) == DoubleBlockHalf.LOWER) {
                  world.setBlockState(blockpos, Blocks.AIR.getDefaultState(), 35);
                  world.playEvent(player, 2001, blockpos, Block.getStateId(blockstate));
               }
            }
    
         }
    
         protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
            builder.add(HALF);
         }
    
        @Override
        protected IItemProvider getSeedsItem() {
            return ItemInit.ANCIENT_SEED.get();
        }
        
        @Override
        public int getMaxAge() {
            return 5;
         }
    
        @Override
        public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
            return SHAPE_BY_AGE[state.get(this.getAgeProperty())];
        }
    }

     

  7. In the Main Class i have:

        private void setup(final FMLCommonSetupEvent event) {
    		
    		VillagerUtil.fixPOITypeBlockStates(PointOfInterestTypes.HATMAKER);

    Then I have VillagerUtil:

    public class VillagerUtil
    {
        private static Method blockStatesInjector;
        
        static
        {
            VillagerUtil.blockStatesInjector = ObfuscationReflectionHelper.findMethod(PointOfInterestType.class, "func_221052_a", PointOfInterestType.class);
        }
        
        public static Set<BlockState> getAllStates(Block block)
        {
            return ImmutableSet.copyOf(block.getStateContainer().getValidStates());
        }
        
        public static void fixPOITypeBlockStates(PointOfInterestType poiType)
        {
            try
            {
                VillagerUtil.blockStatesInjector.invoke(null, poiType);
            }
            catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e)
            {
                e.printStackTrace();
            }
        }
        
        public static PointOfInterestType pointOfInterestType(String p1, Set<BlockState> p2, int p3, int p4)
        {
            try
            {
                //          Constructor<PointOfInterestType> c = (Constructor<PointOfInterestType>)PointOfInterestType.class.getDeclaredConstructors()[1];
                Constructor<PointOfInterestType> c = PointOfInterestType.class.getDeclaredConstructor(String.class, Set.class, Integer.TYPE, Integer.TYPE);
                c.setAccessible(true);
                return c.newInstance(p1, p2, p3, p4);
            }
            catch (NoSuchMethodException e)
            {
                e.printStackTrace();
            }
            catch (SecurityException e)
            {
                e.printStackTrace();
            }
            catch (InstantiationException e)
            {
                e.printStackTrace();
            }
            catch (IllegalAccessException e)
            {
                e.printStackTrace();
            }
            catch (IllegalArgumentException e)
            {
                e.printStackTrace();
            }
            catch (InvocationTargetException e)
            {
                e.printStackTrace();
            }
            
            return null;
        }
        
        public static VillagerProfession villagerProfession(String p1, PointOfInterestType p2, ImmutableSet<Item> p3, ImmutableSet<Block> p4, @Nullable SoundEvent p5)
        {
            try
            {
                Constructor<VillagerProfession> c = VillagerProfession.class.getDeclaredConstructor(String.class, PointOfInterestType.class, ImmutableSet.class, ImmutableSet.class, SoundEvent.class);
                c.setAccessible(true);
                return c.newInstance(p1, p2, p3, p4, p5);
            }
            catch (NoSuchMethodException e)
            {
                e.printStackTrace();
            }
            catch (SecurityException e)
            {
                e.printStackTrace();
            }
            catch (InstantiationException e)
            {
                e.printStackTrace();
            }
            catch (IllegalAccessException e)
            {
                e.printStackTrace();
            }
            catch (IllegalArgumentException e)
            {
                e.printStackTrace();
            }
            catch (InvocationTargetException e)
            {
                e.printStackTrace();
            }
            
            return null;
        }
    
    }

    ProfessionInit:

    @EventBusSubscriber(modid = MikesFancyContent.MOD_ID, bus = Bus.MOD)
    @ObjectHolder(MikesFancyContent.MOD_ID)
    public class ProfessionInit {
      
            public static final VillagerProfession HATMAKER = null;
            
            @SubscribeEvent
            public static void registerVillagerProfessions(Register<VillagerProfession> event)
            {
                IForgeRegistry<VillagerProfession> registry = event.getRegistry();
                
                 registry.register(VillagerUtil.villagerProfession("hatmaker", PointOfInterestTypes.HATMAKER, ImmutableSet.of(), ImmutableSet.of(), null).setRegistryName(MikesFancyContent.MOD_ID, "hatmaker"));
    
    
    
       }  
    }

    TradeRegistration:

    @Mod.EventBusSubscriber(modid = MikesFancyContent.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE)
    
    public class TradeRegistration {
    	
    	@SubscribeEvent
        public static void registerTrades(VillagerTradesEvent event){
    
            if (event.getType() == ProfessionInit.HATMAKER)
            {
            	event.getTrades().get(1).add((new TradeBuilder(64, 25, 0.05F).setPrice(Items.EMERALD, 1,1).setForSale(Items.STRING, 5, 1).build()));
            	event.getTrades().get(1).add((new TradeBuilder(64, 25, 0.05F).setPrice(Items.EMERALD, 1,1).setForSale(Items.FEATHER, 5, 1).build()));
            	
            	event.getTrades().get(2).add((new TradeBuilder(64, 25, 0.2F).setPrice(Items.EMERALD, 1,1).setForSale(Items.WHITE_WOOL, 5, 2).build()));
            	event.getTrades().get(2).add((new TradeBuilder(64, 25, 0.2F).setPrice(Items.EMERALD, 1,1).setForSale(Items.BLACK_WOOL, 1, 2).build()));
            	
                //gonna change the rest soon -mike
            	event.getTrades().get(3).add((new TradeBuilder(64, 25, 0.05F).setPrice(Items.EMERALD, 1,1).setForSale(Items.DIRT, 1, 2).build()));
            	event.getTrades().get(3).add((new TradeBuilder(64, 25, 0.05F).setPrice(Items.EMERALD, 1,1).setForSale(Items.DIRT, 1, 2).build()));
            	
            	event.getTrades().get(4).add((new TradeBuilder(64, 25, 0.2F).setPrice(Items.EMERALD, 1,1).setForSale(Items.DIRT, 1, 2).build()));
            	event.getTrades().get(4).add((new TradeBuilder(64, 25, 0.2F).setPrice(Items.EMERALD, 1,1).setForSale(Items.DIRT, 1, 2).build()));
            	
            	event.getTrades().get(5).add((new TradeBuilder(64, 25, 0.2F).setPrice(Items.EMERALD, 1,1).setForSale(Items.DIRT, 1, 2).build()));    
            	event.getTrades().get(5).add((new TradeBuilder(64, 50, 0.05F).setPrice(Items.EMERALD, 3,6).setForSale(Items.DIRT, 1, 1).build()));    
            }

    TradeBuilder:

    public class TradeBuilder {
        private static final ArrayList<ArrayList<TradeBuilder>> TRADES_LIST = new ArrayList<>();
        
        static
        {
            for(int i = 0; i <= 6; ++i)
            {
                TradeBuilder.TRADES_LIST.add(new ArrayList<TradeBuilder>());
            }
        }
        
        private static ArrayList<TradeBuilder> getList(int i)
        {
            return TradeBuilder.TRADES_LIST.get(i);
        }
        
        private static void register(int i, TradeBuilder tradeBuilder)
        {
            TradeBuilder.getList(i).add(tradeBuilder);
        }
        
        public static void forEachLevel(BiConsumer<Integer, TradeBuilder> consumer)
        {
            ArrayList<TradeBuilder> list;
            
            for(int i = 1; i <= 5; ++i)
            {
                list = TradeBuilder.TRADES_LIST.get(i - 1);
                
                for(TradeBuilder tradeBuilder : list)
                {
                    consumer.accept(i, tradeBuilder);
                }
            }
        }
        
        public static void forEachLevel(Consumer<TradeBuilder> consumer)
        {
            TradeBuilder.forEachLevel((level, tradeBuilder) -> consumer.accept(tradeBuilder));
        }
        
        public static void forEachWanderer(Consumer<TradeBuilder> consumer)
        {
            ArrayList<TradeBuilder> list = TradeBuilder.TRADES_LIST.get(5);
            
            for(TradeBuilder tradeBuilder : list)
            {
                consumer.accept(tradeBuilder);
            }
        }
        
        public static void forEachWandererRare(Consumer<TradeBuilder> consumer)
        {
            ArrayList<TradeBuilder> list = TradeBuilder.TRADES_LIST.get(6);
            
            for(TradeBuilder tradeBuilder : list)
            {
                consumer.accept(tradeBuilder);
            }
        }
        
        protected Function<Random, ItemStack> price;
        protected Function<Random, ItemStack> price2;
        protected Function<Random, ItemStack> forSale;
        
        protected final int maxTrades;
        protected final int xp;
        protected final float priceMult;
        
        protected boolean rare;
        
        public TradeBuilder(int maxTrades, int xp, float priceMult)
        {
            this.price = null;
            this.price2 = (random) -> ItemStack.EMPTY;
            this.forSale = null;
            this.maxTrades = maxTrades;
            this.xp = xp;
            this.priceMult = priceMult;
            this.rare = false;
        }
        
        public TradeBuilder setPrice(Function<Random, ItemStack> price)
        {
            this.price = price;
            return this;
        }
        
        public TradeBuilder setPrice(Item item, int min, int max)
        {
            return this.setPrice(TradeBuilder.createFunction(item, min, max));
        }
        
        public TradeBuilder setPrice2(Function<Random, ItemStack> price2)
        {
            this.price2 = price2;
            return this;
        }
        
        public TradeBuilder setPrice2(Item item, int min, int max)
        {
            return this.setPrice2(TradeBuilder.createFunction(item, min, max));
        }
        
        public TradeBuilder setForSale(Function<Random, ItemStack> forSale)
        {
            this.forSale = forSale;
            return this;
        }
        
        public TradeBuilder setForSale(Item item, int min, int max)
        {
            return this.setForSale(TradeBuilder.createFunction(item, min, max));
        }
        
        public TradeBuilder setForSale(MusicDiscItem item, int min, int max)
        {
            return this.setForSale(TradeBuilder.createFunction(item, min, max));
        }
    
        public TradeBuilder setForSale(RegistryObject<MusicDiscItem> item, int min, int max)
        {
            return this.setForSale(TradeBuilder.createFunction(item, min, max));
        }
        
    
    	public TradeBuilder setEmeraldPrice(int emeralds)
        {
            return this.setPrice((random) -> new ItemStack(Items.EMERALD, emeralds));
        }
        
        public TradeBuilder setEmeraldPriceFor(int emeralds, Item item, int amt)
        {
            this.setEmeraldPrice(emeralds);
            return this.setForSale((random) -> new ItemStack(item, amt));
        }
        
        public TradeBuilder setEmeraldPriceFor(int emeralds, Item item)
        {
            return this.setEmeraldPriceFor(emeralds, item, 1);
        }
        
        public TradeBuilder setEmeraldPrice(int min, int max)
        {
            return this.setPrice(Items.EMERALD, min, max);
        }
        
        public TradeBuilder setEmeraldPriceFor(int min, int max, Item item, int amt)
        {
            this.setEmeraldPrice(min, max);
            return this.setForSale((random) -> new ItemStack(item, amt));
        }
        
        public TradeBuilder setEmeraldPriceFor(int min, int max, Item item)
        {
            return this.setEmeraldPriceFor(min, max, item, 1);
        }
        
        public TradeBuilder setRare()
        {
            this.rare = true;
            return this;
        }
        
        public boolean canBuild()
        {
            return this.price != null && this.forSale != null;
        }
        
        public ITrade build()
        {
            return (entity, random) -> !this.canBuild() ? null : new MerchantOffer(this.price.apply(random), this.price2.apply(random), this.forSale.apply(random), this.maxTrades, this.xp, this.priceMult);
        }
        
        public static Function<Random, ItemStack> createFunction(Item item, int min, int max)
        {
            return (random) -> new ItemStack(item, random.nextInt(max) + min);
        }
        
        protected TradeBuilder register(int index)
        {
            TradeBuilder.register(index, this);
            return this;
        }
        
        /**
         * @param level 1-5
         */
        public TradeBuilder registerLevel(int level)
        {
            return this.register(level - 1);
        }
        
        public TradeBuilder registerWanderer(boolean rare)
        {
            return this.register(rare ? 6 : 5);
        }
    }

    and lastly, PointOfInterestTypes:

    @EventBusSubscriber(modid = MikesFancyContent.MOD_ID, bus = Bus.MOD)
    @ObjectHolder(MikesFancyContent.MOD_ID)
    public class PointOfInterestTypes {
    	
    	public static final PointOfInterestType HATMAKER = null;
    	
    	@SubscribeEvent
        public static void registerPointOfInterestTypes(Register<PointOfInterestType> event)
        {	
            IForgeRegistry<PointOfInterestType> registry = event.getRegistry();
    
            registry.register(VillagerUtil.pointOfInterestType("hatmaker", VillagerUtil.getAllStates(BlockInit.HATMAKER_POI.get()), 1, 1).setRegistryName(MikesFancyContent.MOD_ID, "hatmaker"));
    
            
    
       }
    }

     

  8. Sorry if I explain this badly: Basically, I have made a Villager texture and I want to not have the texture for the Villager biome variant appear on them.

    Screenshot_600.png?width=264&height=427

    This is how I want the Villager to look in-game

    Screenshot_602.png?width=334&height=427

    This is how he looks in-game.

    As you can see, the clothes (In this example the regular Plains Villager) still appear. Is there any way to change this?

    Thanks in advance.

     

     

     

×
×
  • Create New...

Important Information

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