Jump to content

Won't Take Damage java.lang.NoSuchMethodError


Camhain

Recommended Posts

For some reason my Minecraft server is not letting me take any type of damage, and not only that, but I've configured the server to make normally crashing entities to dissapear instead, to try and look at what the error might be. For some reason, Entities will become corrupted when trying to hurt me. Here I give you the crash report:

java.lang.NoSuchMethodError: net.minecraft.entity.player.InventoryPlayer.func_70440_f(I)Lnet/minecraft/item/ItemStack;
    at com.lying.variousoddities.utility.bus.VOBusServer.onPlayerBreakArmorEventPre(VOBusServer.java:878)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_728_VOBusServer_onPlayerBreakArmorEventPre_LivingHurtEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.common.ForgeHooks.onLivingHurt(ForgeHooks.java:604)
    at net.minecraft.entity.player.EntityPlayer.func_70665_d(EntityPlayer.java:1120)
    at net.minecraft.entity.EntityLivingBase.func_70097_a(EntityLivingBase.java:926)
    at net.minecraft.entity.player.EntityPlayer.func_70097_a(EntityPlayer.java:1038)
    at net.minecraft.entity.player.EntityPlayerMP.func_70097_a(EntityPlayerMP.java:645)
    at micdoodle8.mods.galacticraft.core.entities.player.GCEntityPlayerMP.func_70097_a(GCEntityPlayerMP.java:68)
    at drzhark.mocreatures.entity.MoCEntityAnimal.func_70652_k(MoCEntityAnimal.java:1123)
    at drzhark.mocreatures.entity.passive.MoCEntitySnake.func_70652_k(MoCEntitySnake.java:460)
    at net.minecraft.entity.ai.EntityAIAttackMelee.func_190102_a(EntityAIAttackMelee.java:178)
    at net.minecraft.entity.ai.EntityAIAttackMelee.func_75246_d(EntityAIAttackMelee.java:167)
    at net.minecraft.entity.ai.EntityAITasks.func_75774_a(SourceFile:129)
    at net.minecraft.entity.EntityLiving.func_70626_be(EntityLiving.java:763)
    at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:2359)
    at net.minecraft.entity.EntityLiving.func_70636_d(EntityLiving.java:577)
    at net.minecraft.entity.EntityAgeable.func_70636_d(EntityAgeable.java:178)
    at net.minecraft.entity.passive.EntityAnimal.func_70636_d(SourceFile:43)
    at drzhark.mocreatures.entity.MoCEntityAnimal.func_70636_d(MoCEntityAnimal.java:359)
    at drzhark.mocreatures.entity.MoCEntityTameableAnimal.func_70636_d(MoCEntityTameableAnimal.java:435)
    at drzhark.mocreatures.entity.passive.MoCEntitySnake.func_70636_d(MoCEntitySnake.java:415)
    at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2179)
    at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:295)
    at drzhark.mocreatures.entity.passive.MoCEntitySnake.func_70071_h_(MoCEntitySnake.java:265)
    at net.minecraft.world.World.func_72866_a(World.java:1996)
    at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:832)
    at net.minecraft.world.World.func_72870_g(World.java:1958)
    at net.minecraft.world.World.func_72939_s(World.java:1762)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:613)
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:767)
    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
    at java.lang.Thread.run(Unknown Source)

I can also link the whole log if this doesn't help. Thank you.

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

    • Hello, im kind of a newbie on creating mods, and i been trying to make simples mods so far, Right now, i'm creating a mod which detect an specific type of mob and kill it if reach a certain number, by far the mod is detecting the mob and counting them but at the time it reach the limit number, it don't do anything. The Game don't tweak, don't crash, just i't don't run the method i call, which is kill().   public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, InteractionHand pUsedHand) { final var TotalCows = pLevel.getNearbyEntities(Cow.class, TargetingConditions.forNonCombat(), pPlayer, pPlayer.getBoundingBox().inflate(5)); if(pLevel.isClientSide){ if(pPlayer.getItemInHand(InteractionHand.MAIN_HAND).getItem() == this.asItem()){ if(!TotalCows.isEmpty()){ if(TotalCows.get(0).isAlive()){ TotalCows.get(0).kill(); } }else{ pPlayer.sendSystemMessage(Component.literal("No hay vacas")); } } } The sendSystemMessage is get triggered, and when i change the method .kill() by any other like send a message it got called, can i get some tips, and a clue of what i'm missing
    • UPD: I DID IT   @Override public void applyEffectTick(LivingEntity livingEntity, int pAmplifier) { Level level = livingEntity.level(); if (!level.isClientSide()) { Holder<DamageType> entropyHolder = level .registryAccess() .registryOrThrow(Registries.DAMAGE_TYPE) .getHolderOrThrow(GTDamageTypes.ENTROPY_KEY); livingEntity.hurt(new DamageSource(entropyHolder), 1); } super.applyEffectTick(livingEntity, pAmplifier); }  
    • So I came to this public class ModDamageTypes{ public static void bootstrap(BootstapContext<DamageType> context) { context.register(GTDamageTypes.ENTROPY_KEY, new DamageType(GrimTales.MOD_ID + "_entropy", 0.1f)); } } public class GTDamageTypes implements DamageTypes { public static final ResourceKey<DamageType> ENTROPY_KEY = register("entropy"); private static ResourceKey<DamageType> register(String name) { return ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(GrimTales.MOD_ID, name)); } } public class ModWorldGenProvider extends DatapackBuiltinEntriesProvider { public static final RegistrySetBuilder BUILDER = new RegistrySetBuilder() .add(Registries.DAMAGE_TYPE, ModDamageTypes::bootstrap); public ModWorldGenProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> registries) { super(output, registries, BUILDER, Set.of(GrimTales.MOD_ID)); } But! I still have an issue that, I cannot just use Holder.direct, due to it will create error that "Required type:  Holder<DamageType>  Provided : Holder<ResourceKey<DamageType>>" And I still have no clue how to fix it
    • Yea, unless someone else sees this and has a solution in the next 4 or 5 hours, I’m just gonna reinstall the modpack. Thanks for trying to help me out.
    • Sadly, no it didn't work, although the window for minecraft startup stayed longer. do you have anymore recommendations?
  • Topics

×
×
  • Create New...

Important Information

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