Jump to content

When i hit a mob my game crashes (1.19.2)


st_bl4ck_st

Recommended Posts

I installed about 40 mods (all 1.19.2) and they all work well with each other but as soon as i hit any mob on a singleplayer world my game just crashes. I tried to look and see what was causing the error by myself and i couldn't find a solution to the problem. (Sorry for the grammar!)
 

---- Minecraft Crash Report ----
// There are four lights!

Time: 2022-12-11 23:34:40
Description: Exception in server tick loop

java.lang.NoClassDefFoundError: net/silentchaos512/gear/util/DataResource
    at com.github.dragoni7.core.TraitConst$ModTraits.<clinit>(TraitConst.java:12) ~[SilentCompat-forge-1.19.2-1.0.3.jar%23209!/:1.0.3] {re:classloading}
    at com.github.dragoni7.core.EventHandler.onAttackEntity(EventHandler.java:218) ~[SilentCompat-forge-1.19.2-1.0.3.jar%23209!/:1.0.3] {re:classloading}
    at com.github.dragoni7.core.__EventHandler_onAttackEntity_LivingHurtEvent.invoke(.dynamic) ~[SilentCompat-forge-1.19.2-1.0.3.jar%23209!/:1.0.3] {re:classloading,pl:eventbus:B}
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.3.jar%2379!/:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.3.jar%2379!/:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.3.jar%2379!/:?] {}
    at net.minecraftforge.common.ForgeHooks.onLivingHurt(ForgeHooks.java:343) ~[forge-1.19.2-43.2.0-universal.jar%23226!/:?] {re:classloading}
    at net.minecraft.world.entity.LivingEntity.m_6475_(LivingEntity.java:1578) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,re:computing_frames,re:classloading,pl:mixin:APP:caelus.mixins.json:MixinLivingEntity,pl:mixin:APP:curios.mixins.json:MixinLivingEntity,pl:mixin:APP:supplementaries-common.mixins.json:LivingEntityMixin,pl:mixin:A}
    at net.minecraft.world.entity.LivingEntity.m_6469_(LivingEntity.java:1073) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,re:computing_frames,re:classloading,pl:mixin:APP:caelus.mixins.json:MixinLivingEntity,pl:mixin:APP:curios.mixins.json:MixinLivingEntity,pl:mixin:APP:supplementaries-common.mixins.json:LivingEntityMixin,pl:mixin:A}
    at net.minecraft.world.entity.animal.Animal.m_6469_(Animal.java:75) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:classloading,re:mixin}
    at net.minecraft.world.entity.player.Player.m_5706_(Player.java:1154) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:computing_frames,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_playerentity_iswearing,xf:fml:xaeroworldmap:xaero_wm_playerentity_iswearing,re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_playerentity_iswearing,xf:fml:xaeroworldmap:xaero_wm_playerentity_iswearing,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_playerentity_iswearing,xf:fml:xaeroworldmap:xaero_wm_playerentity_iswearing,pl:mixin:APP:comforts.mixins.json:AccessorPlayer,pl:mixin:APP:supplementaries.mixins.json:PlayerProjectileMixin,pl:mixin:A}
    at net.minecraft.server.level.ServerPlayer.m_5706_(ServerPlayer.java:1368) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}
    at net.minecraft.server.network.ServerGamePacketListenerImpl$1.m_141994_(ServerGamePacketListenerImpl.java:1576) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:classloading}
    at net.minecraft.network.protocol.game.ServerboundInteractPacket$1.m_142457_(ServerboundInteractPacket.java:166) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:classloading}
    at net.minecraft.network.protocol.game.ServerboundInteractPacket.m_179617_(ServerboundInteractPacket.java:66) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:classloading}
    at net.minecraft.server.network.ServerGamePacketListenerImpl.m_6946_(ServerGamePacketListenerImpl.java:1546) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:classloading}
    at net.minecraft.network.protocol.game.ServerboundInteractPacket.m_5797_(ServerboundInteractPacket.java:53) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:classloading}
    at net.minecraft.network.protocol.game.ServerboundInteractPacket.m_5797_(ServerboundInteractPacket.java:13) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:classloading}
    at net.minecraft.network.protocol.PacketUtils.lambda$checkThreadAndEnqueue$0(PacketUtils.java:40) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:classloading,xf:OptiFine:default}
    at net.optifine.util.PacketRunnable.run(PacketRunnable.java:28) ~[OptiFine_1.19.2_HD_U_I1_pre4_MOD.jar%23229!/:?] {re:classloading}
    at net.minecraft.server.TickTask.run(TickTask.java:18) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:classloading,re:mixin}
    at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:198) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,pl:accesstransformer:B,xf:OptiFine:default,re:computing_frames,pl:accesstransformer:B,xf:OptiFine:default,re:classloading,pl:accesstransformer:B,xf:OptiFine:default}
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,re:computing_frames,re:classloading}
    at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:763) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A}
    at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:157) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A}
    at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:163) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,pl:accesstransformer:B,xf:OptiFine:default,re:computing_frames,pl:accesstransformer:B,xf:OptiFine:default,re:classloading,pl:accesstransformer:B,xf:OptiFine:default}
    at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:746) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A}
    at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:740) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A}
    at net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:176) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,pl:accesstransformer:B,xf:OptiFine:default,re:computing_frames,pl:accesstransformer:B,xf:OptiFine:default,re:classloading,pl:accesstransformer:B,xf:OptiFine:default}
    at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:726) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A}
    at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:658) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A}
    at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244) ~[client-1.19.2-20220805.130853-srg.jar%23221!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A}
    at java.lang.Thread.run(Thread.java:833) [?:?] {}
Caused by: java.lang.ClassNotFoundException: net.silentchaos512.gear.util.DataResource
    at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:141) ~[securejarhandler-2.1.4.jar:?] {}
    at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] {}
    ... 33 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
    Minecraft Version: 1.19.2
    Minecraft Version ID: 1.19.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 17.0.3, Microsoft
    Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
    Memory: 1907235968 bytes (1818 MiB) / 5502926848 bytes (5248 MiB) up to 17179869184 bytes (16384 MiB)
    CPUs: 16
    Processor Vendor: GenuineIntel
    Processor Name: Intel(R) Core(TM) i7-10700KF CPU @ 3.80GHz
    Identifier: Intel64 Family 6 Model 165 Stepping 5
    Microarchitecture: unknown
    Frequency (GHz): 3.79
    Number of physical packages: 1
    Number of physical CPUs: 8
    Number of logical CPUs: 16
    Graphics card #0 name: NVIDIA GeForce RTX 2060
    Graphics card #0 vendor: NVIDIA (0x10de)
    Graphics card #0 VRAM (MB): 4095.00
    Graphics card #0 deviceId: 0x1e89
    Graphics card #0 versionInfo: DriverVersion=31.0.15.2737
    Memory slot #0 capacity (MB): 16384.00
    Memory slot #0 clockSpeed (GHz): 2.40
    Memory slot #0 type: DDR4
    Memory slot #1 capacity (MB): 16384.00
    Memory slot #1 clockSpeed (GHz): 2.40
    Memory slot #1 type: DDR4
    Virtual memory max (MB): 37499.70
    Virtual memory used (MB): 21525.24
    Swap memory total (MB): 4864.00
    Swap memory used (MB): 0.00
    JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx16G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
    Server Running: true
    Player Count: 1 / 8; [ServerPlayer['ST_BLACK_ST'/221, l='ServerLevel[1.19.2 Mods]', x=82.66, y=122.00, z=166.34]]
    Data Packs: vanilla, mod:farmersdelight (incompatible), mod:elytraslot, mod:terrablender, mod:moonlight (incompatible), mod:mousetweaks, mod:toolbelt, mod:silentlib (incompatible), mod:biomesoplenty, mod:jade (incompatible), mod:ironfurnaces (incompatible), mod:jei (incompatible), mod:ae2 (incompatible), mod:spectrelib (incompatible), mod:attributefix (incompatible), mod:caelus (incompatible), mod:sophisticatedcore (incompatible), mod:curios, mod:xaerominimap, mod:waystones (incompatible), mod:gravestone (incompatible), mod:clumps (incompatible), mod:xaeroworldmap, mod:comforts, mod:naturescompass (incompatible), mod:configured (incompatible), mod:elevatorid (incompatible), mod:inventoryhud, mod:sophisticatedbackpacks (incompatible), mod:balm (incompatible), mod:forge, mod:silentgear, mod:appleskin, mod:supplementaries (incompatible), mod:ironchest (incompatible), mod:silentcompat, mod:xpbook, mod:betteradvancements (incompatible), Supplementaries Generated Pack, mod:silentgems (incompatible)
    World Generation: Stable
    Type: Integrated Server (map_client.txt)
    Is Modded: Definitely; Client brand changed to 'forge'; Server brand changed to 'forge'
    Launched Version: 1.19.2-forge-43.2.0
    OptiFine Version: OptiFine_1.19.2_HD_U_I1_pre4
    OptiFine Build: 20221114-000910
    Render Distance Chunks: 12
    Mipmaps: 4
    Anisotropic Filtering: 1
    Antialiasing: 0
    Multitexture: false
    Shaders: projectLUMA+-+v1.32.zip
    OpenGlVersion: 3.2.0 NVIDIA 527.37
    OpenGlRenderer: NVIDIA GeForce RTX 2060/PCIe/SSE2
    OpenGlVendor: NVIDIA Corporation
    CpuCount: 16
    ModLauncher: 10.0.8+10.0.8+main.0ef7e830
    ModLauncher launch target: forgeclient
    ModLauncher naming: srg
    ModLauncher services: 
        mixin-0.8.5.jar mixin PLUGINSERVICE 
        eventbus-6.0.3.jar eventbus PLUGINSERVICE 
        fmlloader-1.19.2-43.2.0.jar slf4jfixer PLUGINSERVICE 
        fmlloader-1.19.2-43.2.0.jar object_holder_definalize PLUGINSERVICE 
        fmlloader-1.19.2-43.2.0.jar runtime_enum_extender PLUGINSERVICE 
        fmlloader-1.19.2-43.2.0.jar capability_token_subclass PLUGINSERVICE 
        accesstransformers-8.0.4.jar accesstransformer PLUGINSERVICE 
        fmlloader-1.19.2-43.2.0.jar runtimedistcleaner PLUGINSERVICE 
        modlauncher-10.0.8.jar mixin TRANSFORMATIONSERVICE 
        modlauncher-10.0.8.jar OptiFine TRANSFORMATIONSERVICE 
        modlauncher-10.0.8.jar fml TRANSFORMATIONSERVICE 
    FML Language Providers: 
        minecraft@1.0
        lowcodefml@null
        javafml@null
    Mod List: 
        client-1.19.2-20220805.130853-srg.jar             |Minecraft                     |minecraft                     |1.19.2              |DONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
        FarmersDelight-1.19-1.2.0.jar                     |Farmer's Delight              |farmersdelight                |1.19-1.2.0          |DONE      |Manifest: NOSIGNATURE
        elytraslot-forge-6.0.0+1.19.2.jar                 |Elytra Slot                   |elytraslot                    |6.0.0+1.19.2        |DONE      |Manifest: NOSIGNATURE
        TerraBlender-forge-1.19.2-2.0.1.130.jar           |TerraBlender                  |terrablender                  |2.0.1.130           |DONE      |Manifest: NOSIGNATURE
        moonlight-1.19.2-2.1.16-forge.jar                 |Moonlight Library             |moonlight                     |1.19.2-2.1.16       |DONE      |Manifest: NOSIGNATURE
        MouseTweaks-forge-mc1.19-2.23.jar                 |Mouse Tweaks                  |mousetweaks                   |2.23                |DONE      |Manifest: NOSIGNATURE
        ToolBelt-1.19.2-1.19.7.jar                        |Tool Belt                     |toolbelt                      |1.19.7              |DONE      |Manifest: NOSIGNATURE
        silent-lib-1.19.2-7.0.3.jar                       |Silent Lib                    |silentlib                     |7.0.3               |DONE      |Manifest: NOSIGNATURE
        BiomesOPlenty-1.19.2-17.1.2.492.jar               |Biomes O' Plenty              |biomesoplenty                 |17.1.2.492          |DONE      |Manifest: NOSIGNATURE
        Jade-1.19.1-forge-8.6.3.jar                       |Jade                          |jade                          |8.6.3               |DONE      |Manifest: NOSIGNATURE
        ironfurnaces-1.19.2-3.6.3.jar                     |Iron Furnaces                 |ironfurnaces                  |3.6.3               |DONE      |Manifest: NOSIGNATURE
        jei-1.19.2-forge-11.4.0.288.jar                   |Just Enough Items             |jei                           |11.4.0.288          |DONE      |Manifest: NOSIGNATURE
        appliedenergistics2-forge-12.9.1.jar              |Applied Energistics 2         |ae2                           |12.9.1              |DONE      |Manifest: NOSIGNATURE
        spectrelib-forge-0.10.0+1.19.jar                  |SpectreLib                    |spectrelib                    |0.10.0+1.19         |DONE      |Manifest: NOSIGNATURE
        AttributeFix-Forge-1.19.2-17.1.2.jar              |AttributeFix                  |attributefix                  |17.1.2              |DONE      |Manifest: eb:c4:b1:67:8b:f9:0c:db:dc:4f:01:b1:8e:61:64:39:4c:10:85:0b:a6:c4:c7:48:f0:fa:95:f2:cb:08:3a:e5
        caelus-forge-1.19.2-3.0.0.6.jar                   |Caelus API                    |caelus                        |1.19.2-3.0.0.6      |DONE      |Manifest: NOSIGNATURE
        sophisticatedcore-1.19.2-0.5.32.181.jar           |Sophisticated Core            |sophisticatedcore             |1.19.2-0.5.32.181   |DONE      |Manifest: NOSIGNATURE
        curios-forge-1.19.2-5.1.1.0.jar                   |Curios API                    |curios                        |1.19.2-5.1.1.0      |DONE      |Manifest: NOSIGNATURE
        Xaeros_Minimap_22.16.3_Forge_1.19.1.jar           |Xaero's Minimap               |xaerominimap                  |22.16.3             |DONE      |Manifest: NOSIGNATURE
        waystones-forge-1.19-11.1.0.jar                   |Waystones                     |waystones                     |11.1.0              |DONE      |Manifest: NOSIGNATURE
        gravestone-1.19.2-1.0.1.jar                       |Gravestone Mod                |gravestone                    |1.19.2-1.0.1        |DONE      |Manifest: NOSIGNATURE
        Clumps-forge-1.19.2-9.0.0+14.jar                  |Clumps                        |clumps                        |9.0.0+14            |DONE      |Manifest: NOSIGNATURE
        XaerosWorldMap_1.28.4_Forge_1.19.1.jar            |Xaero's World Map             |xaeroworldmap                 |1.28.4              |DONE      |Manifest: NOSIGNATURE
        comforts-forge-6.0.3+1.19.2.jar                   |Comforts                      |comforts                      |6.0.3+1.19.2        |DONE      |Manifest: NOSIGNATURE
        NaturesCompass-1.19.2-1.10.0-forge.jar            |Nature's Compass              |naturescompass                |1.19.2-1.10.0-forge |DONE      |Manifest: NOSIGNATURE
        configured-2.0.1-1.19.2.jar                       |Configured                    |configured                    |2.0.1               |DONE      |Manifest: NOSIGNATURE
        elevatorid-1.19.2-1.8.9.jar                       |Elevator Mod                  |elevatorid                    |1.19.2-1.8.9        |DONE      |Manifest: NOSIGNATURE
        InventoryHud_[1.19.2].forge-3.4.6.jar             |Inventory HUD+(Forge edition) |inventoryhud                  |3.4.6               |DONE      |Manifest: NOSIGNATURE
        sophisticatedbackpacks-1.19.2-3.18.35.751.jar     |Sophisticated Backpacks       |sophisticatedbackpacks        |1.19.2-3.18.35.751  |DONE      |Manifest: NOSIGNATURE
        balm-4.5.3.jar                                    |Balm                          |balm                          |4.5.3               |DONE      |Manifest: NOSIGNATURE
        forge-1.19.2-43.2.0-universal.jar                 |Forge                         |forge                         |43.2.0              |DONE      |Manifest: 84:ce:76:e8:45:35:e4:0e:63:86:df:47:59:80:0f:67:6c:c1:5f:6e:5f:4d:b3:54:47:1a:9f:7f:ed:5e:f2:90
        silent-gear-1.19.2-3.1.0.jar                      |Silent Gear                   |silentgear                    |3.1.0               |DONE      |Manifest: NOSIGNATURE
        appleskin-forge-mc1.19-2.4.2.jar                  |AppleSkin                     |appleskin                     |2.4.2+mc1.19        |DONE      |Manifest: NOSIGNATURE
        silents-gems-1.19.2-4.4.1.jar                     |Silent's Gems: Base           |silentgems                    |4.4.1               |DONE      |Manifest: NOSIGNATURE
        supplementaries-1.19.2-2.2.26.jar                 |Supplementaries               |supplementaries               |1.19.2-2.2.26       |DONE      |Manifest: NOSIGNATURE
        ironchest-1.19.2-14.2.7.jar                       |Iron Chests                   |ironchest                     |1.19.2-14.2.7       |DONE      |Manifest: NOSIGNATURE
        SilentCompat-forge-1.19.2-1.0.3.jar               |Silent Compat                 |silentcompat                  |1.0.3               |DONE      |Manifest: NOSIGNATURE
        xptome-1.19-2.1.7.jar                             |XP Tome                       |xpbook                        |2.1.7               |DONE      |Manifest: NOSIGNATURE
        BetterAdvancements-1.19.2-0.2.2.142.jar           |Better Advancements           |betteradvancements            |0.2.2.142           |DONE      |Manifest: NOSIGNATURE
    Crash Report UUID: a7f1347c-1eca-4109-a847-1891427a7ee1
    FML: 43.2
    Forge: net.minecraftforge:43.2.0

Link to comment
Share on other sites

Issue with the silentcompat mod, check you have the latest version then contact the mod author.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Minecraft 1.20.1 Forge 47.2.0 log and crash report: https://pastebin.com/P7tQymQS ; (crash report) I launch the game and i got this error: Someone could help me please?  
    • EDIT: NVM, the enchantment ID was wrong and that was causing the issue. Not sure why it doesn't let me delete this post Hi, I'm trying to make a "smelting" enchantment Global Loot Modifier, but for some reason the game could not decode its related JSON file, altough is applying the Loot Modifier to every single loot When I join a world I get this error in the console   [01:08:01] [Render thread/WARN] [ne.mi.co.lo.LootModifierManager/]: Could not decode GlobalLootModifier with json id mineworld:enchantments/fiery_touch - error: Not a json array: {"condition":"minecraft:match_tool","predicate":{"enchantments":[{"enchantment":"mineworld:smelting","levels":{"min":1}}]}} The GLM Json file is the following { "type": "mineworld:fiery_touch", "conditions": [ { "condition": "minecraft:match_tool", "predicate": { "enchantments": [ { "enchantment": "mineworld:smelting", "levels": { "min": 1 } } ] } } ] } And this is the LootModifier class   package org.mineworld.loot; import com.google.common.base.Suppliers; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.core.RegistryAccess; import net.minecraft.world.Container; import net.minecraft.world.SimpleContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeManager; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; import net.minecraftforge.common.loot.IGlobalLootModifier; import net.minecraftforge.common.loot.LootModifier; import net.minecraftforge.items.ItemHandlerHelper; import org.jetbrains.annotations.NotNull; import org.mineworld.MineWorld; import java.util.List; import java.util.Optional; import java.util.function.Supplier; import java.util.stream.IntStream; /** * {@link MineWorld MineWorld} loot modifier for smelting a drop from a block */ public final class FieryTouchModifier extends LootModifier { /** * {@link Supplier<Codec> The loot codec supplier} */ public static final Supplier<Codec<FieryTouchModifier>> CODEC = Suppliers.memoize(() -> RecordCodecBuilder.create(inst -> codecStart(inst).apply(inst, FieryTouchModifier::new))); /** * Constructor. Set the {@link LootItemCondition loot id conditions} * * @param lootConditions {@index ILootCondition The conditions that need to be matched before the loot is modified} */ public FieryTouchModifier(final LootItemCondition[] lootConditions) { super(lootConditions); } /** * Add the {@link MWLootItem items} to the loot * * @param loot {@link ObjectArrayList<ItemStack> The current loot} * @param context {@link LootContext The loot context} * @return {@link ObjectArrayList<ItemStack> The modified loot} */ @Override protected @NotNull ObjectArrayList<ItemStack> doApply(final ObjectArrayList<ItemStack> loot, final LootContext context) { if(context.hasParam(LootContextParams.BLOCK_STATE)) { final Level level = context.getLevel(); final RecipeManager recipeManager = level.getRecipeManager(); final RegistryAccess registryAccess = level.registryAccess(); IntStream.range(0, loot.size()).forEach(index -> { final ItemStack drop = loot.get(index); final ItemStack smeltedDrop = tryGetSmeltedDrop(recipeManager, RecipeType.SMELTING, level, registryAccess, drop) .orElse(tryGetSmeltedDrop(recipeManager, RecipeType.SMITHING, level, registryAccess, drop) .orElse(tryGetSmeltedDrop(recipeManager, RecipeType.BLASTING, level, registryAccess, drop) .orElse(tryGetSmeltedDrop(recipeManager, RecipeType.SMOKING, level, registryAccess, drop) .orElse(tryGetSmeltedDrop(recipeManager, RecipeType.CAMPFIRE_COOKING, level, registryAccess, drop) .orElse(ItemStack.EMPTY))))); if(!smeltedDrop.isEmpty()) { loot.set(index, smeltedDrop); } }); } return loot; } /** * Get the {@link Codec loot modifier codec} * * @return {@link #CODEC The loot modifier codec} */ @Override public Codec<? extends IGlobalLootModifier> codec() { return CODEC.get(); } /** * Try to set the smelted drop to the {@link List<ItemStack> block drop list} * * @param recipeManager {@link RecipeManager The recipe manager} * @param recipeType {@link RecipeType The recipe type} * @param level {@link Level The level reference} * @param registryAccess {@link RegistryAccess The registry access} * @param drop {@link ItemStack The dropped item} * @return {@link ItemStack The smelted ItemStack} */ private static <C extends Container, T extends Recipe<C>> Optional<ItemStack> tryGetSmeltedDrop(final RecipeManager recipeManager, final RecipeType<T> recipeType, final Level level, final RegistryAccess registryAccess, final ItemStack drop) { return recipeManager.getRecipeFor(recipeType, (C) new SimpleContainer(drop), level) .map(recipe -> recipe.value().getResultItem(registryAccess)) .filter(itemStack -> !itemStack.isEmpty()) .map(itemStack -> ItemHandlerHelper.copyStackWithSize(itemStack, drop.getCount() * itemStack.getCount())); } } I have another GLM that has some entries as well and doesn't have any issues
    • Why are you doing this instead of just playing the sound using the level or the player method? 
    • You can use  event.getEntity().level()  
  • Topics

×
×
  • Create New...

Important Information

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