Jump to content

My game crashes and i dont know why. Thanks in advance for any help


Rockwheel01

Recommended Posts

---- Minecraft Crash Report ----
// Uh... Did I do that?

Time: 2/23/21 3:56 PM
Description: There was a severe problem during mod loading that has caused the game to fail

cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodError: appeng.items.materials.MaterialType.getItemInstance()Lnet/minecraft/item/Item;
    at cpw.mods.fml.common.LoadController.transition(LoadController.java:163)
    at cpw.mods.fml.common.Loader.initializeMods(Loader.java:739)
    at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:311)
    at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:552)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Caused by: java.lang.NoSuchMethodError: appeng.items.materials.MaterialType.getItemInstance()Lnet/minecraft/item/Item;
    at AppliedIntegrations.Proxy.CommonProxy.addRecipes(CommonProxy.java:99)
    at AppliedIntegrations.AppliedIntegrations.init(AppliedIntegrations.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
    at cpw.mods.fml.common.Loader.initializeMods(Loader.java:737)
    ... 10 more


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

-- System Details --
Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_51, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 261410728 bytes (249 MB) / 3684696064 bytes (3514 MB) up to 11453595648 bytes (10923 MB)
    JVM Flags: 4 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx12288m -Xms256m -XX:PermSize=256m
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1566 164 mods loaded, 164 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCHI    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
    UCHI    FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1566-1.7.10.jar) 
    UCHI    Forge{10.13.4.1566} [Minecraft Forge] (forge-1.7.10-10.13.4.1566-1.7.10.jar) 
    UCHI    appliedenergistics2-core{rv2-stable-10} [AppliedEnergistics2 Core] (minecraft.jar) 
    UCHI    CodeChickenCore{1.0.7.47} [CodeChicken Core] (minecraft.jar) 
    UCHI    NotEnoughItems{1.0.5.120} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.5.120-universal.jar) 
    UCHI    ThaumicTinkerer-preloader{0.1} [Thaumic Tinkerer Core] (minecraft.jar) 
    UCHI    OpenModsCore{0.10.1} [OpenModsCore] (minecraft.jar) 
    UCHI    <CoFH ASM>{000} [CoFH ASM] (minecraft.jar) 
    UCHI    FastCraft{1.25} [FastCraft] (fastcraft-1.25.jar) 
    UCHI    debug{1.0} [debug] (denseores-1.6.2.jar) 
    UCHI    appliedenergistics2{rv2-stable-10} [Applied Energistics 2] (appliedenergistics2-rv2-stable-10_1.jar) 
    UCHI    bdlib{1.9.4.109} [BD Lib] (bdlib-1.9.4.109-mc1.7.10.jar) 
    UCHI    ae2stuff{0.5.0.56} [AE2 Stuff] (ae2stuff-0.5.0.56-mc1.7.10.jar) 
    UCHI    CoFHCore{1.7.10R3.0.3} [CoFH Core] (CoFHCore-[1.7.10]3.0.3-303.jar) 
    UCHI    ComputerCraft{1.75} [ComputerCraft] (ComputerCraft1.75.jar) 
    UCHI    IC2{2.2.810-experimental} [IndustrialCraft 2] (industrialcraft-2-2.2.810-experimental.jar) 
    UCHI    ForgeMultipart{1.2.0.345} [Forge Multipart] (ForgeMultipart-1.7.10-1.2.0.345-universal.jar) 
    UCHI    Mekanism{9.1.1} [Mekanism] (Mekanism-1.7.10-9.1.1.1031.jar) 
    UCHE    appliedintegrations{3.2} [Applied Integrations] (Applied Integrations-3.2.jar) 
    UCHI    BiblioCraft{1.11.7} [BiblioCraft] (BiblioCraft[v1.11.7][MC1.7.10].jar) 
    UCHI    Mantle{1.7.10-0.3.2.jenkins191} [Mantle] (Mantle-1.7.10-0.3.2b.jar) 
    UCHI    Natura{2.2.0} [Natura] (natura-1.7.10-2.2.0.1.jar) 
    UCHI    BiomesOPlenty{2.1.0} [Biomes O' Plenty] (BiomesOPlenty-1.7.10-2.1.0.2308-universal.jar) 
    UCHI    BiblioWoodsBoP{1.9} [BiblioWoods Biomes O'Plenty Edition] (BiblioWoods[BiomesOPlenty][v1.9].jar) 
    UCHI    Forestry{4.2.16.64} [Forestry for Minecraft] (forestry_1.7.10-4.2.16.64.jar) 
    UCHI    BiblioWoodsForestry{1.7} [BiblioWoods Forestry Edition] (BiblioWoods[Forestry][v1.7].jar) 
    UCHI    BiblioWoodsNatura{1.5} [BiblioWoods Natura Edition] (BiblioWoods[Natura][v1.5].jar) 
    UCHI    Baubles{1.0.1.10} [Baubles] (Baubles-1.7.10-1.0.1.10.jar) 
    UCHI    ThermalFoundation{1.7.10R1.2.0} [Thermal Foundation] (ThermalFoundation-[1.7.10]1.2.0-102.jar) 
    UCHI    ThermalExpansion{1.7.10R4.0.3B1} [Thermal Expansion] (ThermalExpansion-[1.7.10]4.0.3B1-218.jar) 
    UCHI    BigReactors{0.4.3A} [Big Reactors] (BigReactors-0.4.3A.jar) 
    UCHI    BinnieCore{2.0.22.7} [Binnie Core] (binnie-mods-1.7.10-2.0.22.7.jar) 
    UCHI    Botany{2.0.22.7} [Botany] (binnie-mods-1.7.10-2.0.22.7.jar) 
    UCHI    ExtraTrees{2.0.22.7} [Extra Trees] (binnie-mods-1.7.10-2.0.22.7.jar) 
    UCHI    Genetics{2.0.22.7} [Genetics] (binnie-mods-1.7.10-2.0.22.7.jar) 
    UCHI    ExtraBees{2.0.22.7} [Extra Bees] (binnie-mods-1.7.10-2.0.22.7.jar) 
    UCHI    AWWayofTime{v1.3.3} [Blood Magic: Alchemical Wizardry] (BloodMagic-1.7.10-1.3.3-17.jar) 
    UCHI    Thaumcraft{4.2.3.5} [Thaumcraft] (Thaumcraft-1.7.10-4.2.3.5.jar) 
    UCHI    Botania{r1.8-249} [Botania] (Botania r1.8-249.jar) 
    UCHI    BrandonsCore{1.0.0.12} [Brandon's Core] (BrandonsCore-1.0.0.12.jar) 
    UCHI    BuildCraft|Core{7.1.23} [BuildCraft] (buildcraft-7.1.23.jar) 
    UCHI    BuildCraft|Transport{7.1.23} [BC Transport] (buildcraft-7.1.23.jar) 
    UCHI    BuildCraft|Factory{7.1.23} [BC Factory] (buildcraft-7.1.23.jar) 
    UCHI    BuildCraft|Silicon{7.1.23} [BC Silicon] (buildcraft-7.1.23.jar) 
    UCHI    BuildCraft|Robotics{7.1.23} [BC Robotics] (buildcraft-7.1.23.jar) 
    UCHI    BuildCraft|Energy{7.1.23} [BC Energy] (buildcraft-7.1.23.jar) 
    UCHI    BuildCraft|Builders{7.1.23} [BC Builders] (buildcraft-7.1.23.jar) 
    UCHI    BuildCraft|Compat{7.1.7} [BuildCraft Compat] (buildcraft-compat-7.1.7.jar) 
    UCHI    TwilightForest{2.3.8dev} [The Twilight Forest] (twilightforest-1.7.10-2.3.8.jar) 
    UCHI    chisel{2.9.5.11} [Chisel] (Chisel-2.9.5.11.jar) 
    UCHI    CarpentersBlocks{3.3.8.2} [Carpenter's Blocks] (Carpenter's Blocks v3.3.8.2 - MC 1.7.10.jar) 
    UCHI    ChickenChunks{1.3.4.19} [ChickenChunks] (ChickenChunks-1.7.10-1.3.4.19-universal.jar) 
    UCHI    CompactSolars{4.4.39.315} [Compact Solar Arrays] (CompactSolars-1.7.10-4.4.39.315-universal.jar) 
    UCHI    CustomMainMenu{1.9.2} [Custom Main Menu] (CustomMainMenu-MC1.7.10-1.9.2.jar) 
    UCHI    DraconicEvolution{1.0.2h} [Draconic Evolution] (Draconic-Evolution-1.7.10-1.0.2h.jar) 
    UCHI    endercore{1.7.10-0.2.0.39_beta} [EnderCore] (EnderCore-1.7.10-0.2.0.39_beta.jar) 
    UCHI    MineFactoryReloaded{1.7.10R2.8.0RC8} [MineFactory Reloaded] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    Waila{1.5.10} [Waila] (Waila-1.5.10_1.7.10.jar) 
    UCHI    EnderIO{1.7.10-2.3.0.429_beta} [Ender IO] (EnderIO-1.7.10-2.3.0.429_beta.jar) 
    UCHI    EnderStorage{1.4.7.37} [EnderStorage] (EnderStorage-1.7.10-1.4.7.37-universal.jar) 
    UCHI    EnderTech{1.7.10-0.3.2.405} [EnderTech] (EnderTech-1.7.10-0.3.2.405.jar) 
    UCHI    EnderZoo{1.7.10-1.0.15.32} [Ender Zoo] (EnderZoo-1.7.10-1.0.15.32.jar) 
    UCHI    ExtraUtilities{1.2.12} [Extra Utilities] (extrautilities-1.2.12.jar) 
    UCHI    factorization.notify{1.0} [Factorization Notification System] (Factorization-1.7.10-0.8.88.8.8888g.jar) 
    UCHI    factorization.dimensionalSlice{0.8.88.8.8888g} [Factorization Dimensional Slices] (Factorization-1.7.10-0.8.88.8.8888g.jar) 
    UCHI    factorization{0.8.88.8.8888g} [Factorization] (Factorization-1.7.10-0.8.88.8.8888g.jar) 
    UCHI    factorization.misc{0.8.88.8.8888g} [Factorization Miscellaneous Nonsense] (Factorization-1.7.10-0.8.88.8.8888g.jar) 
    UCHI    fastleafdecay{1.4} [Fast Leaf Decay] (FastLeafDecay-1.7.10-1.4.jar) 
    UCHI    FlatSigns{2.1.0.19} [Flat Signs] (FlatSigns-1.7.10-universal-2.1.0.19.jar) 
    UCHI    MineTweaker3{3.0.10} [MineTweaker 3] (MineTweaker3-1.7.10-3.0.10B.jar) 
    UCHI    FTBL{1.0.18.2} [FTBLib] (FTBLib-1.7.10-1.0.18.3.jar) 
    UCHI    FTBU{1.0.18.2} [FTBUtilities] (FTBUtilities-1.7.10-1.0.18.3.jar) 
    UCHI    funkylocomotion{1.0} [Funky Locomotion] (funky-locomotion-1.7.10-beta-7.jar) 
    UCHI    RedstoneArsenal{1.7.10R1.1.1} [Redstone Arsenal] (RedstoneArsenal-[1.7.10]1.1.1-89.jar) 
    UCHI    ImmersiveEngineering{0.7.7} [Immersive Engineering] (ImmersiveEngineering-0.7.7.jar) 
    UCHI    tc{4.4.1_021} [Traincraft] (Traincraft-4.4.1_021.jar) 
    UCHI    TConstruct{1.7.10-1.8.8.build988} [Tinkers' Construct] (TConstruct-1.7.10-1.8.8.jar) 
    UCHI    ThaumicTinkerer{unspecified} [Thaumic Tinkerer] (ThaumicTinkerer-2.5-1.7.10-508.jar) 
    UCHI    MagicBees{2.4.4} [Magic Bees] (magicbees-1.7.10-2.4.4.jar) 
    UCHI    gendustry{1.6.3.132} [GenDustry] (gendustry-1.6.3.132-mc1.7.10.jar) 
    UCHI    guideapi{1.7.10-1.0.1-20} [Guide-API] (Guide-API-1.7.10-1.0.1-20.jar) 
    UCHI    iChunUtil{4.2.3} [iChunUtil] (iChunUtil-4.2.3.jar) 
    UCHI    Hats{4.0.1} [Hats] (Hats-4.0.1.jar) 
    UCHI    HatStand{4.0.0} [HatStand] (HatStand-4.0.0.jar) 
    UCHI    HelpFixer{1.0.7} [HelpFixer] (HelpFixer-1.0.7.jar) 
    UCHI    IC2NuclearControl{2.4.3a} [Nuclear Control 2] (IC2NuclearControl-2.4.3a.jar) 
    UCHI    immersiveintegration{0.6.8} [Immersive Integration] (immersiveintegration-0.6.8.jar) 
    UCHI    inpure|core{1.7.10R1.0.0B9} [INpureCore] (INpureCore-[1.7.10]1.0.0B9-62.jar) 
    UCHI    inventorytweaks{1.59-dev-152-cf6e263} [Inventory Tweaks] (InventoryTweaks-1.59-dev-152.jar) 
    UCHI    ironbackpacks{1.7.10-1.2.20} [Iron Backpacks] (IronBackpacks-1.7.10-1.2.20.jar) 
    UCHI    IronChest{6.0.62.742} [Iron Chest] (ironchest-1.7.10-6.0.62.742-universal.jar) 
    UCHI    JABBA{1.2.2} [JABBA] (Jabba-1.2.2_1.7.10.jar) 
    UCHI    journeymap{5.1.3} [JourneyMap] (journeymap-1.7.10-5.1.3-unlimited.jar) 
    UCHI    MekanismGenerators{9.1.1} [MekanismGenerators] (MekanismGenerators-1.7.10-9.1.1.1031.jar) 
    UCHI    MekanismTools{9.1.1} [MekanismTools] (MekanismTools-1.7.10-9.1.1.1031.jar) 
    UCHI    MineFactoryReloaded|CompatAppliedEnergistics{1.7.10R2.8.0RC8} [MFR Compat: Applied Energistics] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatAtum{1.7.10R2.8.0RC8} [MFR Compat: Atum] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatBackTools{1.7.10R2.8.0RC8} [MFR Compat: BackTools] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatBuildCraft{1.7.10R2.8.0RC8} [MFR Compat: BuildCraft] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatChococraft{1.7.10R2.8.0RC8} [MFR Compat: Chococraft] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatExtraBiomes{1.7.10R2.8.0RC8} [MFR Compat: ExtraBiomes] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatForestry{1.7.10R2.8.0RC8} [MFR Compat: Forestry] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatForgeMicroblock{1.7.10R2.8.0RC8} [MFR Compat: ForgeMicroblock] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatIC2{1.7.10R2.8.0RC8} [MFR Compat: IC2] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    Mystcraft{0.12.3.04} [Mystcraft] (mystcraft-1.7.10-0.12.3.04.jar) 
    UCHI    MineFactoryReloaded|CompatMystcraft{1.7.10R2.8.0RC8} [MFR Compat: Mystcraft] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MrTJPCoreMod{1.1.0.33} [MrTJPCore] (MrTJPCore-1.7.10-1.1.0.33-universal.jar) 
    UCHI    ProjRed|Core{4.7.0pre12.95} [ProjectRed Core] (ProjectRed-1.7.10-4.7.0pre12.95-Base.jar) 
    UCHI    ProjRed|Exploration{4.7.0pre12.95} [ProjectRed Exploration] (ProjectRed-1.7.10-4.7.0pre12.95-World.jar) 
    UCHI    MineFactoryReloaded|CompatProjRed{1.7.10R2.8.0RC8} [MFR Compat ProjectRed] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatRailcraft{1.7.10R2.8.0RC8} [MFR Compat: Railcraft] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatRP2{1.7.10R2.8.0RC8} [MFR Compat: RP2] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatSufficientBiomes{1.7.10R2.8.0RC8} [MFR Compat: Sufficient Biomes] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatThaumcraft{1.7.10R2.8.0RC8} [MFR Compat: Thaumcraft] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatThermalExpansion{1.7.10R2.8.0RC8} [MFR Compat: Thermal Expansion] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatTConstruct{1.7.10R2.8.0RC8} [MFR Compat: Tinkers' Construct] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatTwilightForest{1.7.10R2.8.0RC8} [MFR Compat: TwilightForest] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    MineFactoryReloaded|CompatVanilla{1.7.10R2.8.0RC8} [MFR Compat: Vanilla] (MineFactoryReloaded-1.7.102.8.0RC8-86.jar) 
    UCHI    Morph{0.9.3} [Morph] (Morph-Beta-0.9.3.jar) 
    UCHI    Morpheus{1.7.10-1.6.21} [Morpheus] (Morpheus-1.7.10-1.6.21.jar) 
    UCHI    NEIAddons{1.12.14.40} [NEI Addons] (neiaddons-1.12.14.40-mc1.7.10.jar) 
    UCHI    NEIAddons|Developer{1.12.14.40} [NEI Addons: Developer Tools] (neiaddons-1.12.14.40-mc1.7.10.jar) 
    UCHI    NEIAddons|AppEng{1.12.14.40} [NEI Addons: Applied Energistics 2] (neiaddons-1.12.14.40-mc1.7.10.jar) 
    UCHI    NEIAddons|Botany{1.12.14.40} [NEI Addons: Botany] (neiaddons-1.12.14.40-mc1.7.10.jar) 
    UCHI    NEIAddons|Forestry{1.12.14.40} [NEI Addons: Forestry] (neiaddons-1.12.14.40-mc1.7.10.jar) 
    UCHI    NEIAddons|CraftingTables{1.12.14.40} [NEI Addons: Crafting Tables] (neiaddons-1.12.14.40-mc1.7.10.jar) 
    UCHI    NEIAddons|ExNihilo{1.12.14.40} [NEI Addons: Ex Nihilo] (neiaddons-1.12.14.40-mc1.7.10.jar) 
    UCHI    neiintegration{1.1.2} [NEI Integration] (NEIIntegration-MC1.7.10-1.1.2.jar) 
    UCHI    NotEnoughCodecs{0.3} [NotEnoughCodecs] (NotEnoughCodecs-1.7.10-0.3-snapshot-11.jar) 
    UCHI    notenoughkeys{@MOD_VERSION@} [NotEnoughKeys] (NotEnoughKeys-1.7.10-3.0.0b43-universal.jar) 
    UCHI    numina{0.4.0.119} [Numina] (Numina-0.4.0.119.jar) 
    UCHI    ObsidiPlates{3.0.0.18} [ObsidiPlates] (ObsidiPlates-1.7.10-universal-3.0.0.18.jar) 
    UCHI    OpenMods{0.10.1} [OpenMods] (OpenModsLib-1.7.10-0.10.1.jar) 
    UCHI    OpenBlocks{1.6} [OpenBlocks] (OpenBlocks-1.7.10-1.6.jar) 
    UCHI    OpenPeripheralCore{1.4} [OpenPeripheralCore] (OpenPeripheralCore-1.7.10-1.4.jar) 
    UCHI    OpenPeripheral{0.6} [OpenPeripheralAddons] (OpenPeripheralAddons-1.7.10-0.6.jar) 
    UCHI    OpenPeripheralIntegration{0.6} [OpenPeripheralIntegration] (OpenPeripheralIntegration-1.7.10-0.6.jar) 
    UCHI    PneumaticCraft{1.12.7-152} [PneumaticCraft] (PneumaticCraft-1.7.10-1.12.7-152-universal.jar) 
    UCHI    PortalGun{4.0.0-beta-6} [PortalGun] (PortalGun-4.0.0-beta-6-fix-1.jar) 
    UCHI    ProjRed|Transmission{4.7.0pre12.95} [ProjectRed Transmission] (ProjectRed-1.7.10-4.7.0pre12.95-Integration.jar) 
    UCHI    ProjRed|Compatibility{4.7.0pre12.95} [ProjectRed Compatibility] (ProjectRed-1.7.10-4.7.0pre12.95-Compat.jar) 
    UCHI    ProjRed|Integration{4.7.0pre12.95} [ProjectRed Integration] (ProjectRed-1.7.10-4.7.0pre12.95-Integration.jar) 
    UCHI    ProjRed|Illumination{4.7.0pre12.95} [ProjectRed Illumination] (ProjectRed-1.7.10-4.7.0pre12.95-Lighting.jar) 
    UCHI    ResourceLoader{1.3} [Resource Loader] (ResourceLoader-MC1.7.10-1.3.jar) 
    UCHI    rftools{4.23} [RFTools] (rftools-4.23.jar) 
    UCHI    SolarFlux{1.7.10-0.8b} [Solar Flux] (SolarFlux-1.7.10-0.8b.jar) 
    UCHI    StevesCarts{2.0.0.b18} [Steve's Carts 2] (StevesCarts2.0.0.b18.jar) 
    UCHI    StevesFactoryManager{A93} [Steve's Factory Manager] (StevesFactoryManagerA93.jar) 
    UCHI    ThaumicExploration{0.6.0} [Thaumic Exploration] (ThaumicExploration-1.7.10-1.1-53.jar) 
    UCHI    ThermalDynamics{1.7.10R1.1.0} [Thermal Dynamics] (ThermalDynamics-[1.7.10]1.1.0-161.jar) 
    UCHI    TiCTooltips{1.2.5} [TiC Tooltips] (TiCTooltips-mc1.7.10-1.2.5.jar) 
    UCHI    TMechworks{0.2.15.106} [Tinkers' Mechworks] (TMechworks-1.7.10-0.2.15.106.jar) 
    UCHI    traindieselfix{1.0.0} [Train Diesel Fix] (traindieselfix-1.0.0.jar) 
    UCHI    Translocator{1.1.2.16} [Translocator] (Translocator-1.7.10-1.1.2.16-universal.jar) 
    UCHI    WailaHarvestability{1.1.6} [Waila Harvestability] (WailaHarvestability-mc1.7.10-1.1.6.jar) 
    UCHI    witchery{0.24.1} [Witchery] (witchery-1.7.10-0.24.1.jar) 
    UCHI    WR-CBE|Core{1.4.1.9} [WR-CBE Core] (WR-CBE-1.7.10-1.4.1.9-universal.jar) 
    UCHI    WR-CBE|Addons{1.4.1.9} [WR-CBE Addons] (WR-CBE-1.7.10-1.4.1.9-universal.jar) 
    UCHI    WR-CBE|Logic{1.4.1.9} [WR-CBE Logic] (WR-CBE-1.7.10-1.4.1.9-universal.jar) 
    UCHI    McMultipart{1.2.0.345} [Minecraft Multipart Plugin] (ForgeMultipart-1.7.10-1.2.0.345-universal.jar) 
    UCHI    aobd{2.9.2} [Another One Bites The Dust] (AOBD-2.9.2.jar) 
    UCHI    denseores{1.0} [Dense Ores] (denseores-1.6.2.jar) 
    UCHI    ForgeMicroblock{1.2.0.345} [Forge Microblocks] (ForgeMultipart-1.7.10-1.2.0.345-universal.jar) 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 457.51' Renderer: 'GeForce RTX 3070/PCIe/SSE2'
    OpenModsLib class transformers: [stencil_patches:FINISHED],[movement_callback:FINISHED],[player_damage_hook:FINISHED],[map_gen_fix:FINISHED],[gl_capabilities_hook:FINISHED],[player_render_hook:FINISHED]
    Class transformer null safety: all safe
    AE2 Version: stable rv2-stable-10 for Forge 10.13.2.1291
    CoFHCore: -[1.7.10]3.0.3-303
    Mantle Environment: Environment healthy.
    ThermalFoundation: -[1.7.10]1.2.0-102
    ThermalExpansion: -[1.7.10]4.0.3B1-218
    MineFactoryReloaded: -[1.7.10]2.8.0RC8-86
    RedstoneArsenal: -[1.7.10]1.1.1-89
    TConstruct Environment: Environment healthy.
    ThermalDynamics: -[1.7.10]1.1.0-161
    List of loaded APIs: 
        * API_NEK (1.2.0) from NotEnoughKeys-1.7.10-3.0.0b43-universal.jar
        * appliedenergistics2|API (rv2) from ThaumicTinkerer-2.5-1.7.10-508.jar
        * Baubles|API (1.0.1.10) from ThermalFoundation-[1.7.10]1.2.0-102.jar
        * BiomesOPlentyAPI (1.0.0) from BiomesOPlenty-1.7.10-2.1.0.2308-universal.jar
        * BloodMagicAPI (1.3.3-13) from BloodMagic-1.7.10-1.3.3-17.jar
        * BotaniaAPI (76) from Botania r1.8-249.jar
        * BuildCraftAPI|blocks (1.0) from buildcraft-7.1.23.jar
        * BuildCraftAPI|blueprints (1.5) from buildcraft-7.1.23.jar
        * BuildCraftAPI|boards (2.0) from buildcraft-7.1.23.jar
        * BuildCraftAPI|core (1.0) from extrautilities-1.2.12.jar
        * BuildCraftAPI|crops (1.1) from buildcraft-7.1.23.jar
        * BuildCraftAPI|events (2.0) from buildcraft-7.1.23.jar
        * BuildCraftAPI|facades (1.1) from buildcraft-7.1.23.jar
        * BuildCraftAPI|filler (4.0) from buildcraft-7.1.23.jar
        * BuildCraftAPI|fuels (2.0) from buildcraft-7.1.23.jar
        * BuildCraftAPI|gates (4.1) from buildcraft-7.1.23.jar
        * BuildCraftAPI|items (1.1) from buildcraft-7.1.23.jar
        * BuildCraftAPI|library (2.0) from buildcraft-7.1.23.jar
        * BuildCraftAPI|lists (1.0) from buildcraft-7.1.23.jar
        * BuildCraftAPI|power (1.3) from buildcraft-7.1.23.jar
        * BuildCraftAPI|recipes (3.1) from buildcraft-7.1.23.jar
        * BuildCraftAPI|robotics (3.0) from buildcraft-7.1.23.jar
        * BuildCraftAPI|statements (1.1) from buildcraft-7.1.23.jar
        * BuildCraftAPI|tablet (1.0) from buildcraft-7.1.23.jar
        * BuildCraftAPI|tiles (1.2) from buildcraft-7.1.23.jar
        * BuildCraftAPI|tools (1.0) from extrautilities-1.2.12.jar
        * BuildCraftAPI|transport (4.1) from buildcraft-7.1.23.jar
        * CarpentersBlocks|API (3.3.7) from Carpenter's Blocks v3.3.8.2 - MC 1.7.10.jar
        * ChiselAPI (0.1.1) from Chisel-2.9.5.11.jar
        * ChiselAPI|Carving (0.1.1) from Chisel-2.9.5.11.jar
        * ChiselAPI|Rendering (0.1.1) from Chisel-2.9.5.11.jar
        * CoFHAPI (1.7.10R1.0.2) from IC2NuclearControl-2.4.3a.jar
        * CoFHAPI|block (1.7.10R1.0.13) from EnderIO-1.7.10-2.3.0.429_beta.jar
        * CoFHAPI|core (1.7.10R1.1.0) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHAPI|energy (1.7.10R1.0.2) from buildcraft-7.1.23.jar
        * CoFHAPI|fluid (1.7.10R1.1.0) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHAPI|inventory (1.7.10R1.1.0) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHAPI|item (1.7.10R1.1.0) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHAPI|modhelpers (1.7.10R1.1.0) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHAPI|tileentity (1.7.10R1.0.13) from CoFHCore-[1.7.10]3.0.3-303.jar
        * CoFHAPI|transport (1.7.10R1.1.0) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHAPI|world (1.7.10R1.0.13) from CoFHCore-[1.7.10]3.0.3-303.jar
        * CoFHLib (1.7.10R1.0.4B1) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHLib|audio (1.7.10R1.0.4B1) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHLib|gui (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar
        * CoFHLib|gui|container (1.7.10R1.0.4B1) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHLib|gui|element (1.7.10R1.0.4B1) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHLib|gui|element|listbox (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar
        * CoFHLib|gui|slot (1.7.10R1.0.4B1) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHLib|inventory (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar
        * CoFHLib|render (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar
        * CoFHLib|render|particle (1.7.10R1.0.4B1) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHLib|util (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar
        * CoFHLib|util|helpers (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar
        * CoFHLib|util|position (1.7.10R1.0.4B1) from EnderTech-1.7.10-0.3.2.405.jar
        * CoFHLib|world (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar
        * CoFHLib|world|feature (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar
        * ComputerCraft|API (1.75) from ComputerCraft1.75.jar
        * ComputerCraft|API|FileSystem (1.75) from Traincraft-4.4.1_021.jar
        * ComputerCraft|API|Lua (1.75) from Traincraft-4.4.1_021.jar
        * ComputerCraft|API|Media (1.75) from Traincraft-4.4.1_021.jar
        * ComputerCraft|API|Peripheral (1.75) from ComputerCraft1.75.jar
        * ComputerCraft|API|Permissions (1.75) from ComputerCraft1.75.jar
        * ComputerCraft|API|Redstone (1.75) from ComputerCraft1.75.jar
        * ComputerCraft|API|Turtle (1.75) from ComputerCraft1.75.jar
        * DraconicEvolution|API (1.2) from Draconic-Evolution-1.7.10-1.0.2h.jar
        * EnderIOAPI (0.0.2) from EnderIO-1.7.10-2.3.0.429_beta.jar
        * EnderIOAPI|Redstone (0.0.2) from EnderIO-1.7.10-2.3.0.429_beta.jar
        * EnderIOAPI|Teleport (0.0.2) from EnderIO-1.7.10-2.3.0.429_beta.jar
        * EnderIOAPI|Tools (0.0.2) from EnderIO-1.7.10-2.3.0.429_beta.jar
        * factorization notification system (1.0) from Factorization-1.7.10-0.8.88.8.8888g.jar
        * ForestryAPI|apiculture (4.8.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|arboriculture (4.2.1) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|circuits (3.1.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|core (5.0.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|farming (2.1.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|food (1.1.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|fuels (2.0.1) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|genetics (4.7.1) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|hives (4.1.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|lepidopterology (1.3.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|mail (3.0.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|multiblock (3.0.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|recipes (5.4.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|storage (3.0.0) from forestry_1.7.10-4.2.16.64.jar
        * ForestryAPI|world (2.1.0) from forestry_1.7.10-4.2.16.64.jar
        * gendustryAPI (2.3.0) from gendustry-1.6.3.132-mc1.7.10.jar
        * Guide-API|API (1.7.10-1.0.1-20) from Guide-API-1.7.10-1.0.1-20.jar
        * IC2API (1.0) from Applied Integrations-3.2.jar
        * ImmersiveEngineering|API (1.0) from ImmersiveEngineering-0.7.7.jar
        * inpure|api (1.7) from INpureCore-[1.7.10]1.0.0B9-62.jar
        * McJtyLib (1.8.1) from mcjtylib-1.8.1.jar
        * MekanismAPI|core (9.0.0) from Applied Integrations-3.2.jar
        * MekanismAPI|energy (9.0.0) from Applied Integrations-3.2.jar
        * MekanismAPI|gas (9.0.0) from Mekanism-1.7.10-9.1.1.1031.jar
        * MekanismAPI|infuse (9.0.0) from Applied Integrations-3.2.jar
        * MekanismAPI|laser (9.0.0) from Mekanism-1.7.10-9.1.1.1031.jar
        * MekanismAPI|reactor (9.0.0) from Mekanism-1.7.10-9.1.1.1031.jar
        * MekanismAPI|recipe (9.0.0) from Mekanism-1.7.10-9.1.1.1031.jar
        * MekanismAPI|transmitter (9.0.0) from Applied Integrations-3.2.jar
        * MekanismAPI|util (9.0.0) from Mekanism-1.7.10-9.1.1.1031.jar
        * Mystcraft|API (0.1) from mystcraft-1.7.10-0.12.3.04.jar
        * NuclearControlAPI (v1.0.5) from IC2NuclearControl-2.4.3a.jar
        * OpenBlocks|API (1.1) from OpenBlocks-1.7.10-1.6.jar
        * OpenPeripheralAddonsApi (1.0) from OpenPeripheralAddons-1.7.10-0.6.jar
        * OpenPeripheralApi (3.4.2) from OpenPeripheralCore-1.7.10-1.4.jar
        * PneumaticCraftApi (1.0) from PneumaticCraft-1.7.10-1.12.7-152-universal.jar
        * RailcraftAPI|bore (1.0.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|carts (1.6.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|core (1.5.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|crafting (1.0.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|electricity (2.0.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|events (1.0.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|fuel (1.0.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|helpers (1.1.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|items (1.0.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|locomotive (1.1.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|signals (2.3.0) from Traincraft-4.4.1_021.jar
        * RailcraftAPI|tracks (2.3.0) from Traincraft-4.4.1_021.jar
        * Thaumcraft|API (4.2.2.0) from twilightforest-1.7.10-2.3.8.jar
        * WailaAPI (1.2) from Waila-1.5.10_1.7.10.jar
    Chisel: Errors like "[FML]: Unable to lookup ..." are NOT the cause of this crash. You can safely ignore these errors. And update forge while you're at it.
    EnderIO: No known problems detected.
    Stencil buffer state: Function set: GL30, pool: forge, bits: 8

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • idk how to reply here but no im not coding any mod, all of them are downloaded but its only gfs computer, on mine its ok and i was looking all around the internet and never seen anything similiar atleast  
    • I changed it to public static void but I can't find anyway to get level from the event even if it isn't a listener parameter. @JimiIT92
    • I didn't yet see this happening on 1.20.2 forge, but sadly, I noticed that my mod is incompatible with this version because of this event handler: @SubscribeEvent public static void onPlayerRightClickItem(PlayerInteractEvent.RightClickItem e) { if (e.getItemStack().getItem() instanceof EggItem) { List<ThrownEgg> eggs = e.getLevel().getEntitiesOfClass(ThrownEgg.class, new AABB(e.getEntity().blockPosition().immutable() .below(5) .north(5) .west(5), e.getEntity().blockPosition().immutable() .above(10) .south(5) .east(5))); if (!eggs.isEmpty()) { eggs.forEach(ThrownEgg::discard); if (!e.getEntity().getAbilities().instabuild) e.getItemStack().grow(1); } if (!e.getEntity().level().isClientSide) { ((ServerPlayer) e.getEntity()).connection.send( new ClientboundStopSoundPacket(SoundEvents.EGG_THROW.getLocation(), SoundSource.PLAYERS)); // Minecraft Forge 1.20.2 crashes because of NoSuchMethodError here } e.setCancellationResult(InteractionResult.SUCCESS); e.setCanceled(true); } }  
    • It might just be a misleading log, if you run the command while debugging what's the outcome?  I've tried checking the item inside the RightClickBlock event and it works just fine private static final Ingredient FOOD_ITEMS = Ingredient.of(Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS, Items.TORCHFLOWER_SEEDS, Items.PITCHER_POD); @SubscribeEvent public static void onRightClickBlock(final PlayerInteractEvent.RightClickBlock event) { final ItemStack itemStack = event.getItemStack(); LOGGER.info(FOOD_ITEMS.test(itemStack) + ""); } When I right click a block with an Item it checks if is one of the ingredients of FOOD_ITEMS. Clicking with an empty hand (air) logs false, as expected. Tip: please use the "spoiler" tags for long code snippets and don't merge all your classes into one code snippet EDIT: just noticed you are on 1.20.1. Maybe is just a bug with the Forge version? Try update to the latest Forge 1.20.2 and see if it still occurs
    • I created a temp command with this syntax: /isfood <entity to check> <player to check the item in main hand or off hand> It outputs either string respiration of an ItemStack (<count of items> <item name>) that player holds in his hand if it's a food item for specified entity, or "none" if specified player isn't holding an item which is a food item for the specified entity. Command's code if you didn't understand: event.getDispatcher().register(Commands.literal("isfood").then(Commands.argument("animal", EntityArgument.entity()) .then(Commands.argument("player", EntityArgument.player()).executes(context -> { Entity entity = EntityArgument.getEntity(context, "animal"); Player player = EntityArgument.getPlayer(context, "player"); if (entity instanceof Animal mob) { if (mob.isFood(player.getItemInHand(InteractionHand.MAIN_HAND))) context.getSource().sendSuccess(() -> Component.literal(String.valueOf( player.getItemInHand(InteractionHand.MAIN_HAND))), true); else if (mob.isFood(player.getItemInHand(InteractionHand.OFF_HAND))) context.getSource().sendSuccess(() -> Component.literal(String.valueOf( player.getItemInHand(InteractionHand.OFF_HAND) )), true); else context.getSource().sendSuccess(() -> Component.literal("none"), true); } return 1; })))); So, I tested it on my entity, and command output was: 0 air (also want to say that it happens only if I play Minecraft for a long time) Anyways, the entity code: package mymod.entities.chicken; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.*; import net.minecraft.world.entity.animal.Animal; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.pathfinder.BlockPathTypes; import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import mymod._Entities; public abstract class AbstractChicken extends Animal implements IAbstractChicken { protected static final Ingredient FOOD_ITEMS = Ingredient.of(Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS, Items.TORCHFLOWER_SEEDS, Items.PITCHER_POD); public float flap; public float flapSpeed; public float oFlapSpeed; public float oFlap; public float flapping = 1.0F; protected float nextFlap = 1.0F; protected AbstractChicken(EntityType<? extends AbstractChicken> entityType, Level world) { super(entityType, world); setPathfindingMalus(BlockPathTypes.WATER, 0.0F); } protected SoundEvent getAmbientSound() { return SoundEvents.CHICKEN_AMBIENT; } protected SoundEvent getHurtSound(@NotNull DamageSource damageSource) { return SoundEvents.CHICKEN_HURT; } protected SoundEvent getDeathSound() { return SoundEvents.CHICKEN_DEATH; } @Override protected void playStepSound(@NotNull BlockPos atPos, @NotNull BlockState atState) { playSound(SoundEvents.CHICKEN_STEP, .15f, 1); } @Nullable @Override public AgeableMob getBreedOffspring(@NotNull ServerLevel level, @NotNull AgeableMob mobBredWith) { return null; } @Override protected abstract void registerGoals(); @Override public abstract boolean isBaby(); @Override public abstract boolean canMate(@NotNull Animal other); @Override public final void aiStep() { super.aiStep(); this.oFlap = flap; this.oFlapSpeed = flapSpeed; this.flapSpeed += (this.onGround() ? -1.0F : 4.0F) * 0.3F; this.flapSpeed = Mth.clamp(this.flapSpeed, 0.0F, 1.0F); if (!this.onGround() && this.flapping < 1.0F) { this.flapping = 1.0F; } this.flapping *= 0.9F; Vec3 vec3 = this.getDeltaMovement(); if (!this.onGround() && vec3.y < 0.0D) { this.setDeltaMovement(vec3.multiply(1.0D, 0.6D, 1.0D)); } this.flap += this.flapping * 2.0F; doAIStep(); } protected abstract void doAIStep(); @Override protected float getStandingEyeHeight(@NotNull Pose pose, @NotNull EntityDimensions dimensions) { return this.isBaby() ? dimensions.height * 0.85F : dimensions.height * 0.92F; } @Override public abstract void setBaby(boolean baby); @Override @Nullable public <T extends Mob> T convertTo(@NotNull EntityType<T> toType, boolean copyInventory) { if (isRemoved()) { return null; } else { T t = toType.create(level()); if (t == null) { return null; } else { t.copyPosition(this); t.setNoAi(isNoAi()); if (!(toType == EntityType.CHICKEN || toType == _Entities.ROOSTER.get() || toType == _Entities.CHICK.get())) t.setBaby(isBaby()); if (hasCustomName()) { t.setCustomName(getCustomName()); t.setCustomNameVisible(isCustomNameVisible()); } if (isPersistenceRequired()) { t.setPersistenceRequired(); } t.setInvulnerable(isInvulnerable()); if (copyInventory) { t.setCanPickUpLoot(canPickUpLoot()); for (EquipmentSlot equipmentslot : EquipmentSlot.values()) { ItemStack itemstack = self().getItemBySlot(equipmentslot); if (!itemstack.isEmpty()) { t.setItemSlot(equipmentslot, itemstack.copyAndClear()); t.setDropChance(equipmentslot, getEquipmentDropChance(equipmentslot)); } } } level().addFreshEntity(t); if (isPassenger()) { Entity entity = getVehicle(); stopRiding(); t.startRiding(entity, true); } discard(); return t; } } } public abstract boolean isBoy(); @Override public boolean isFood(@NotNull ItemStack item) { return FOOD_ITEMS.test(item); } @Override protected boolean isFlapping() { return flyDist > nextFlap; } @Override protected void onFlap() { nextFlap = flyDist + flapSpeed / 2f; } public static boolean canSpawn(EntityType<? extends AbstractChicken> entityType, LevelAccessor level, MobSpawnType spawnType, BlockPos pos, RandomSource random) { return entityType != _Entities.CHICK.get() && Animal.checkAnimalSpawnRules(entityType, level, spawnType, pos, random); } } package mymod.entities.chicken; import com.google.common.collect.ImmutableList; import com.google.errorprone.annotations.Immutable; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.stats.Stats; import net.minecraft.util.RandomSource; import net.minecraft.util.TimeUtil; import net.minecraft.util.valueproviders.UniformInt; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.*; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.ai.goal.*; import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal; import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal; import net.minecraft.world.entity.ai.goal.target.ResetUniversalAngerTargetGoal; import net.minecraft.world.entity.animal.*; import net.minecraft.world.entity.monster.Zombie; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.GameRules; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import oshi.util.tuples.Pair; import ru.fokinatorr.chickenmod._Entities; import ru.fokinatorr.chickenmod._EntityDataSerializers; import mymod._Items; import mymod._Sounds; import mymod.ai.ZombieAttackChickenEggGoal; import mymod.entities.BredWithMobStorable; import mymod.util.delayedtask.DelayedTask; import mymod.util.delayedtask.DelayedTasksHolder; import java.util.EnumSet; import java.util.Optional; import java.util.UUID; import java.util.function.Supplier; public class Rooster extends AbstractChicken implements NeutralMob, BredWithMobStorable, DelayedTasksHolder<Rooster> { private static final UniformInt PERSISTENT_ANGER_TIME = TimeUtil.rangeOfSeconds(60, 1800); private int remainingPersistentAngerTime; private UUID persistentAngerTarget; private boolean crowing; private int crowTicks; private int diggingAnimTicks; private int featherDropCoolDown; private static final EntityDataAccessor<FourFeathers> DATA_FEATHERS = SynchedEntityData.defineId(Rooster.class, _EntityDataSerializers.ROOSTER_FEATHERS.get()); private static final EntityDataAccessor<Optional<UUID>> DATA_MOB_BRED_WITH = SynchedEntityData.defineId(Rooster.class, EntityDataSerializers.OPTIONAL_UUID); public Rooster(EntityType<? extends Rooster> entityType, Level world) { super(entityType, world); } @Override public int getRemainingPersistentAngerTime() { return remainingPersistentAngerTime; } @Override public void setRemainingPersistentAngerTime(int remainingPersistentAngerTime) { this.remainingPersistentAngerTime = remainingPersistentAngerTime; } @Nullable @Override public UUID getPersistentAngerTarget() { return persistentAngerTarget; } @Override public void setPersistentAngerTarget(@Nullable UUID persistentAngerTarget) { this.persistentAngerTarget = persistentAngerTarget; } @Override public void startPersistentAngerTimer() { this.remainingPersistentAngerTime = PERSISTENT_ANGER_TIME.sample(random); } @Override protected void defineSynchedData() { super.defineSynchedData(); entityData.define(DATA_FEATHERS, FourFeathers.NONE); entityData.define(DATA_MOB_BRED_WITH, Optional.empty()); } public FourFeathers getFeatherData() { return entityData.get(DATA_FEATHERS); } public void setFeatherData(FourFeathers featherData) { entityData.set(DATA_FEATHERS, featherData); } @Override public void addAdditionalSaveData(@NotNull CompoundTag nbt) { super.addAdditionalSaveData(nbt); addPersistentAngerSaveData(nbt); nbt.put("FeatherData", getFeatherData().writeTag()); nbt.putBoolean("isCrowing", crowing); } @Override public void readAdditionalSaveData(@NotNull CompoundTag nbt) { super.readAdditionalSaveData(nbt); readPersistentAngerSaveData(level(), nbt); if (nbt.contains("FeatherData", Tag.TAG_COMPOUND)) setFeatherData(FourFeathers.readTag(nbt.getCompound("FeatherData"))); else setFeatherData(FourFeathers.NONE); crowing = nbt.contains("isCrowing", Tag.TAG_BYTE) && nbt.getBoolean("isCrowing"); } @Override protected void registerGoals() { goalSelector.addGoal(0, new FloatGoal(this)); goalSelector.addGoal(1, new RoosterMeleeAttackGoal()); goalSelector.addGoal(1, new RoosterRandomTryFindFoodGoal()); goalSelector.addGoal(2, new RoosterBreedGoal()); goalSelector.addGoal(3, new TemptGoal(this, 1, FOOD_ITEMS, false)); goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1)); goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6)); goalSelector.addGoal(7, new RandomLookAroundGoal(this)); targetSelector.addGoal(4, new RoosterRandomAttackNearbyRoosterGoal()); targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, LivingEntity.class, true, entity -> entity instanceof Fox || (entity instanceof Ocelot ocelot && !ocelot.isBaby()) || (entity instanceof Zombie zombie && zombie.goalSelector .getRunningGoals().anyMatch(wrappedGoal -> wrappedGoal.getGoal() instanceof ZombieAttackChickenEggGoal)) || isAngryAt(entity))); targetSelector.addGoal(2, new HurtByTargetGoal(this)); targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, false)); } @Override public void setMobBredWith(@Nullable UUID uuid) { entityData.set(DATA_MOB_BRED_WITH, Optional.ofNullable(uuid)); } @Override @Nullable public UUID getMobBredWith() { return entityData.get(DATA_MOB_BRED_WITH).orElse(null); } // Goals class RoosterMeleeAttackGoal extends MeleeAttackGoal { RoosterMeleeAttackGoal() { super(Rooster.this, 1.4, true); } @Override public void tick() { super.tick(); if (mob.getTarget() != null && mob.distanceToSqr(mob.getTarget()) <= 4) mob.getJumpControl().jump(); } } class RoosterRandomAttackNearbyRoosterGoal extends NearestAttackableTargetGoal<Rooster> { RoosterRandomAttackNearbyRoosterGoal() { super(Rooster.this, Rooster.class, true); } @Override public boolean canUse() { return super.canUse() && random.nextInt(300) == 0; } @Override public boolean canContinueToUse() { return super.canContinueToUse() && mob.getLastHurtMob() != targetMob; } } class RoosterBreedGoal extends BreedGoal { RoosterBreedGoal() { super(Rooster.this, 1, Chicken.class); } @Override protected void breed() { ServerPlayer serverplayer = animal.getLoveCause(); if (serverplayer == null && this.partner.getLoveCause() != null) { serverplayer = this.partner.getLoveCause(); } if (serverplayer != null) { serverplayer.awardStat(Stats.ANIMALS_BRED); CriteriaTriggers.BRED_ANIMALS.trigger(serverplayer, this.animal, this.partner, null); } ((BredWithMobStorable) partner).setMobBredWith(animal.getUUID()); ((BredWithMobStorable) animal).setMobBredWith(partner.getUUID()); animal.setAge(6000); partner.setAge(6000); animal.resetLove(); partner.resetLove(); RandomSource randomsource = animal.getRandom(); if (this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { this.level.addFreshEntity(new ExperienceOrb(this.level, this.animal.getX(), this.animal.getY(), this.animal.getZ(), randomsource.nextInt(7) + 1)); } } } private static final DelayedTask<Rooster> CROW_LATER = new DelayedTask<>(30) { @Override protected void execute() { entity.crow(); } }; private static final DelayedTask<Rooster> ANGRY_CLUCK_LATER = new DelayedTask<>(30) { @Override protected void execute() { entity.playSound(_Sounds.ROOSTER_ANGRY_CLUCK.get()); } }; @Override public ImmutableList<DelayedTask<Rooster>> getTasks() { return ImmutableList.of(CROW_LATER, ANGRY_CLUCK_LATER); } class RoosterRandomTryFindFoodGoal extends Goal { private final Rooster rooster; private int tickCount; private int maxTickCount; private int lastDugTicks; private int roosterLastHurtByMobTimestamp; private double lookAtXOld, lookAtYOld, lookAtZOld; private Vec3 pos; private boolean didEndSuccessfully; private Vec3 lookingAtPos; private static final UniformInt POSSIBLE_MAX_TICK_COUNT = TimeUtil.rangeOfSeconds(4, 10); RoosterRandomTryFindFoodGoal() { super(); this.rooster = Rooster.this; setFlags(EnumSet.of(Flag.LOOK)); } @Override public boolean canUse() { return (isStandingOn(Blocks.GRASS_BLOCK) || isStandingOn(Blocks.DIRT) || isStandingOn(Blocks.PODZOL)) && rooster.random.nextInt(3000) == 20; } @Override public boolean canContinueToUse() { if (rooster.getLastHurtByMobTimestamp() != roosterLastHurtByMobTimestamp) { didEndSuccessfully = false; return false; } else if (tickCount >= maxTickCount) { didEndSuccessfully = true; return false; } return true; } @Override public boolean requiresUpdateEveryTick() { return true; } @Override public void start() { lastDugTicks = 20; roosterLastHurtByMobTimestamp = rooster.getLastHurtByMobTimestamp(); lookAtXOld = rooster.getLookControl().getWantedX(); lookAtYOld = rooster.getLookControl().getWantedY(); lookAtZOld = rooster.getLookControl().getWantedZ(); pos = new Vec3(rooster.position().toVector3f()); lookingAtPos = rooster.position().subtract(0, 1, 0); rooster.getLookControl().setLookAt(lookingAtPos); maxTickCount = POSSIBLE_MAX_TICK_COUNT.sample(rooster.random); } @Override public void stop() { rooster.getLookControl().setLookAt(lookAtXOld, lookAtYOld, lookAtZOld); if (didEndSuccessfully) { int resultItemPercentage = rooster.random.nextInt(100); if (resultItemPercentage <= 1) { rooster.spawnAtLocation(Items.DIAMOND, -1); Rooster.ANGRY_CLUCK_LATER.startExecution(rooster); } else if (resultItemPercentage <= 5) { rooster.spawnAtLocation(Items.GOLD_NUGGET, -1); Rooster.ANGRY_CLUCK_LATER.startExecution(rooster); } else if (resultItemPercentage <= 20) { Rooster.ANGRY_CLUCK_LATER.startExecution(rooster); } else { rooster.spawnAtLocation(FOOD_ITEMS.getItems()[rooster.random.nextInt( FOOD_ITEMS.getItems().length)], -1); Rooster.CROW_LATER.startExecution(rooster); } } } @Override public void tick() { ++tickCount; rooster.getLookControl().setLookAt(lookingAtPos); rooster.getMoveControl().setWantedPosition(pos.x, pos.y, pos.z, rooster.getMoveControl().getSpeedModifier()); if (lastDugTicks <= 0) { lastDugTicks = 20; rooster.diggingAnimTicks = 10; rooster.playSound(rooster.level().getBlockState(rooster.blockPosition().below()) .getSoundType(rooster.level(), rooster.blockPosition().below(), rooster) .getHitSound()); } else lastDugTicks--; } private boolean isStandingOn(Block block) { return rooster.level().getBlockState(rooster.blockPosition().below()).is(block); } } // Feather data storage @Immutable public record FourFeathers(@NotNull FeatherType first, @NotNull FeatherType second, @NotNull FeatherType third, @NotNull FeatherType fourth) { public static final FourFeathers NONE = new FourFeathers(FeatherType.NONE, FeatherType.NONE, FeatherType.NONE, FeatherType.NONE); public FourFeathers(byte first, byte second, byte third, byte forth) { this(FeatherType.fromByte(first), FeatherType.fromByte(second), FeatherType.fromByte(third), FeatherType.fromByte(forth)); } public @NotNull Pair<ItemStack, FourFeathers> removeRandom(RandomSource randomSource) { if (NONE.equals(this)) return new Pair<>(ItemStack.EMPTY, this); int randomNum = randomSource.nextInt(4); while (get(randomNum) == null) randomNum = randomSource.nextInt(4); ItemStack retVal0 = get(randomNum).getDefaultInstance(); FourFeathers retVal1 = switch (randomNum) { case 0 -> new FourFeathers(FeatherType.NONE, second, third, fourth); case 1 -> new FourFeathers(first, FeatherType.NONE, third, fourth); case 2 -> new FourFeathers(first, second, FeatherType.NONE, fourth); case 3 -> new FourFeathers(first, second, third, FeatherType.NONE); default -> null; // unreachable }; return new Pair<>(retVal0, retVal1); } public void dropAll(Rooster asRooster) { asRooster.setFeatherData(FourFeathers.NONE); if (first != FeatherType.NONE) asRooster.spawnAtLocation(first); if (second != FeatherType.NONE) asRooster.spawnAtLocation(second); if (third != FeatherType.NONE) asRooster.spawnAtLocation(third); if (fourth != FeatherType.NONE) asRooster.spawnAtLocation(fourth); } @Nullable public Item get(int i) { return (switch (i) { case 0 -> first; case 1 -> second; case 2 -> third; case 3 -> fourth; default -> throw new IllegalStateException("Unexpected value: " + i); }).asItem(); } // NBT Utils @NotNull public CompoundTag writeTag() { CompoundTag nbt = new CompoundTag(); nbt.putString("first", first.name().toLowerCase()); nbt.putString("second", second.name().toLowerCase()); nbt.putString("third", third.name().toLowerCase()); nbt.putString("fourth", fourth.name().toLowerCase()); return nbt; } @NotNull public static FourFeathers readTag(@NotNull CompoundTag nbt) { return new FourFeathers(tryRead(nbt, "first"), tryRead(nbt, "second"), tryRead(nbt, "third"), tryRead(nbt, "fourth")); } private static FeatherType tryRead(CompoundTag tag, String toRead) { if (tag.contains(toRead, Tag.TAG_STRING)) { try { return FeatherType.valueOf(tag.getString(toRead).toUpperCase()); } catch (IllegalArgumentException e) { return FeatherType.NONE; } } return FeatherType.NONE; } public FourFeathers copy() { return new FourFeathers(first, second, third, fourth); } } public enum FeatherType implements ItemLike { RED(_Items.RED_FEATHER, (byte) 0), YELLOW(_Items.YELLOW_FEATHER, (byte) 1), GREEN(_Items.GREEN_FEATHER, (byte) 2), BLUE(_Items.BLUE_FEATHER, (byte) 3), NONE(() -> null, (byte) -1); private final Supplier<Item> itemSup; private final byte byteVal; FeatherType(Supplier<Item> itemSup, byte byteVal) { this.itemSup = itemSup; this.byteVal = byteVal; } public static FeatherType fromByte(byte item) { return switch (item) { case -1 -> NONE; case 0 -> RED; case 1 -> YELLOW; case 2 -> GREEN; case 3 -> BLUE; default -> throw new IllegalArgumentException("item: " + item); }; } @Override public @Nullable Item asItem() { return itemSup.get(); } public byte asByte() { return byteVal; } } @Override protected void dropCustomDeathLoot(@NotNull DamageSource damageSource, int what, boolean idk) { super.dropCustomDeathLoot(damageSource, what, idk); getFeatherData().dropAll(this); } // Sounds @Override protected SoundEvent getAmbientSound() { return _Sounds.ROOSTER_AMBIENT.get(); } @Override protected SoundEvent getHurtSound(@NotNull DamageSource damageSource) { return _Sounds.ROOSTER_HURT.get(); } @Override protected SoundEvent getDeathSound() { return _Sounds.ROOSTER_DEATH.get(); } public static AttributeSupplier.Builder createAttributes() { return createMobAttributes() .add(Attributes.ATTACK_DAMAGE, 2) .add(Attributes.MAX_HEALTH, 8) .add(Attributes.MOVEMENT_SPEED, .3); } @Override public boolean isBaby() { return false; } @Override public boolean canMate(@NotNull Animal other) { if (this == other) return false; else if (!(other instanceof Chicken)) return false; else return isInLove() && other.isInLove(); } @Override @Nullable public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor worldAccessor, @NotNull DifficultyInstance difficulty, @NotNull MobSpawnType mobSpawnType, @Nullable SpawnGroupData retVal, @Nullable CompoundTag nbt) { if (nbt == null) { setFeatherData(new FourFeathers((byte) random.nextIntBetweenInclusive(-1, 3), (byte) random.nextIntBetweenInclusive(-1, 3), (byte) random.nextIntBetweenInclusive(-1, 3), (byte) random.nextIntBetweenInclusive(-1, 3))); } else { if (nbt.contains("FeatherData", Tag.TAG_COMPOUND)) { setFeatherData(FourFeathers.readTag(nbt.getCompound("FeatherData"))); } } return super.finalizeSpawn(worldAccessor, difficulty, mobSpawnType, retVal, nbt); } @Override protected void doAIStep() { if (crowing && --crowTicks <= 0) { crowing = false; } if (!level().isClientSide) { updatePersistentAnger((ServerLevel) level(), true); if (level().getDayTime() % 24000L == 0L || level().getDayTime() % 24000L == 13000L) crow(); } } @Override public void setBaby(boolean baby) { if (baby) { Chick me = convertTo(_Entities.CHICK.get(), false); if (me != null) { me.setBoy(true); } } } @Override public @NotNull InteractionResult mobInteract(@NotNull Player player, @NotNull InteractionHand hand) { if (isFood(player.getItemInHand(hand))) { return super.mobInteract(player, hand); } else if (player.getItemInHand(hand) == ItemStack.EMPTY) { dropFeather(player); return InteractionResult.CONSUME; } return InteractionResult.PASS; } private void dropFeather(@Nullable LivingEntity target) { Pair<ItemStack, FourFeathers> resFeathers = getFeatherData().removeRandom(random); setFeatherData(resFeathers.getB()); if (resFeathers.getA() != null && featherDropCoolDown == 0 && target != null) { spawnAtLocation(resFeathers.getA()); playSound(SoundEvents.ITEM_PICKUP); setTarget(target); featherDropCoolDown = random.nextIntBetweenInclusive(20, 30); } } @Override public void setTarget(@Nullable LivingEntity target) { super.setTarget(target); if (target != null) { setPersistentAngerTarget(target.getUUID()); startPersistentAngerTimer(); } } public void crow() { if (!crowing) { crowing = true; crowTicks = 70; var lookControl = getLookControl(); lookControl.setLookAt(lookControl.getWantedX(), position().y + .2, lookControl.getWantedZ()); playSound(_Sounds.ROOSTER_CROW.get()); level().getEntitiesOfClass(Chicken.class, getBoundingBox().inflate(20)) .forEach(chicken -> chicken.setTarget(this)); } } public boolean isCrowing() { return crowing; } @Override public void tick() { super.tick(); if (diggingAnimTicks > 0) --diggingAnimTicks; if (featherDropCoolDown > 0) --featherDropCoolDown; tickTasks(); } public int getDiggingAnimTicks() { return diggingAnimTicks; } @Override public boolean isBoy() { return true; } } package mymod.entities.chicken; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.sounds.SoundEvent; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.*; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.ai.goal.*; import net.minecraft.world.entity.animal.Animal; import net.minecraft.world.entity.animal.Chicken; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.phys.AABB; import org.jetbrains.annotations.NotNull; import mymod._Entities; import mymod._Sounds; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; public class Chick extends AbstractChicken { private static final EntityDataAccessor<Boolean> DATA_IS_BOY = SynchedEntityData.defineId(Chick.class, EntityDataSerializers.BOOLEAN); private final boolean initializedIsBoy; public Chick(EntityType<? extends Chick> entityType, Level world) { super(entityType, world); setAge(-24000); initializedIsBoy = false; } public Chick(EntityType<? extends Chick> entityType, Level world, boolean isBoy) { super(entityType, world); setAge(-24000); setBoy(isBoy); initializedIsBoy = true; } @Override protected SoundEvent getAmbientSound() { return _Sounds.CHICK_AMBIENT.get(); } @Override protected SoundEvent getHurtSound(@NotNull DamageSource damageSource) { return _Sounds.CHICK_HURT.get(); } @Override protected SoundEvent getDeathSound() { return _Sounds.CHICK_DEATH.get(); } @Override public float getVoicePitch() { return (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } @Override protected void defineSynchedData() { super.defineSynchedData(); entityData.define(DATA_IS_BOY, false); } @Override public void addAdditionalSaveData(@NotNull CompoundTag nbt) { super.addAdditionalSaveData(nbt); nbt.putBoolean("IsBoy", isBoy()); } @Override public void readAdditionalSaveData(@NotNull CompoundTag nbt) { super.readAdditionalSaveData(nbt); if (nbt.contains("IsBoy", Tag.TAG_BYTE)) setBoy(nbt.getBoolean("IsBoy")); } @Override protected void registerGoals() { goalSelector.addGoal(0, new FloatGoal(this)); goalSelector.addGoal(1, new PanicGoal(this, 1.4)); goalSelector.addGoal(2, new TemptGoal(this, 1, FOOD_ITEMS, false)); goalSelector.addGoal(3, new ChickFollowParentGoal()); goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1)); goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6)); goalSelector.addGoal(7, new RandomLookAroundGoal(this)); } @Override public void setLastHurtByMob(LivingEntity hurtByMob) { super.setLastHurtByMob(hurtByMob); if (getType() == _Entities.CHICK.get() && hurtByMob != null) { level().getEntitiesOfClass(Rooster.class, new AABB(blockPosition().below(20).north(20).west(20), blockPosition().above(20).south(20).east(20))) .stream() .filter(r -> r.getPersistentAngerTarget() == null && r.getTarget() == null) .forEach(r -> r.setTarget(hurtByMob)); } } @Override public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor worldAccessor, @NotNull DifficultyInstance difficulty, @NotNull MobSpawnType mobSpawnType, @Nullable SpawnGroupData retVal, @Nullable CompoundTag nbt) { if (!initializedIsBoy) { if (nbt != null && nbt.contains("IsBoy", Tag.TAG_BYTE)) setBoy(nbt.getBoolean("IsBoy")); else setBoy(random.nextBoolean()); } return super.finalizeSpawn(worldAccessor, difficulty, mobSpawnType, retVal, nbt); } class ChickFollowParentGoal extends Goal { private Animal parent; private int timeToRecalculatePath; @Override public boolean canUse() { List<Animal> list = new ArrayList<>(); list.addAll(level().getEntitiesOfClass(Chicken.class, getBoundingBox().inflate(8, 4, 8))); list.addAll(level().getEntitiesOfClass(Rooster.class, getBoundingBox().inflate(8, 4, 8))); Animal animal = null; double d0 = Double.MAX_VALUE; for (Animal animal1 : list) { if (animal1.getAge() >= 0) { double d1 = distanceToSqr(animal1); if (!(d1 > d0)) { d0 = d1; animal = animal1; } } } if (animal == null) { return false; } else if (d0 < 9.0D) { return false; } else { parent = animal; return true; } } @Override public boolean canContinueToUse() { if (!parent.isAlive()) return false; double d = distanceToSqr(parent); return !(d < 9) && !(d > 256); } @Override public void start() { timeToRecalculatePath = 0; } @Override public void stop() { parent = null; } @Override public void tick() { if (--timeToRecalculatePath <= 0) { timeToRecalculatePath = adjustedTickDelay(10); getNavigation().moveTo(parent, 1.1); } } } public static AttributeSupplier.Builder createAttributes() { return createMobAttributes() .add(Attributes.MAX_HEALTH, 4) .add(Attributes.MOVEMENT_SPEED, .25); } @Override public void ageBoundaryReached() { super.ageBoundaryReached(); if (getAge() >= 0) { if (isBoy()) convertTo(_Entities.ROOSTER.get(), false); else convertTo(EntityType.CHICKEN, false); } } @Override public boolean isBaby() { return true; } @Override public boolean canMate(@NotNull Animal other) { return false; } @Override public void setBoy(boolean newBoolean) { entityData.set(DATA_IS_BOY, newBoolean); } @Override protected void doAIStep() { } @Override public void setBaby(boolean baby) { if (!baby) { if (isBoy()) { convertTo(_Entities.ROOSTER.get(), false); } else { convertTo(EntityType.CHICKEN, false); } } } @Override public boolean isBoy() { return entityData.get(DATA_IS_BOY); } } sorry for too long post lol
  • Topics

×
×
  • Create New...

Important Information

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