Jump to content

[1.15.2] Custom Bat entity won't attack the player unless really close


PenWallet

Recommended Posts

Hi, I'm working on a mod for 1.15.2. I want this custom Bat entity (IridiumBat) to attack the player on sight. Instead, it's only attacking the player if it's really close. It looks as if the bat is actually trying to get closer to me, but it's like fighting its instruction of flying randomly. I've looked around BatEntity looking for a clue as to what's causing it, but I wouldn't really know what to change.

 

I assigned the ZombieAttackModifiedGoal to the IridiumBat, which is just a modified version of ZombieAttackGoal (made it accept IridiumBat in the constructor parameters and deleted the raiseArms parameters). Because ZombieAttackGoal extends from MeleeAttackGoal, which doesn't accept AmbientEntity in its constructor parameters, I needed to make a MeleeAttackModifiedGoal to accept it as well, which is what ZombieAttackModifiedGoal extends now.

 

IridiumBat.java:

public class IridiumBat extends BatEntity {

    @SuppressWarnings("unchecked")
    public IridiumBat(EntityType<? extends BatEntity> type, World worldIn) {
        super((EntityType<? extends BatEntity>) EntitiesList.IRIDIUM_BAT, worldIn);
    }

    @Override
    protected void registerAttributes() {
        super.registerAttributes();
        this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(15.0f);
        this.getAttributes().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE);
        this.getAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(1.0f);
        this.getAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(35.0f);
    }

    @Override
    protected void registerGoals() {
        this.goalSelector.addGoal(8, new LookRandomlyGoal(this));
        this.goalSelector.addGoal(8, new LookAtGoal(this, PlayerEntity.class, 8.0F));
        this.goalSelector.addGoal(0, new ZombieAttackModifiedGoal(this, 1.0D, true));
        this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, false));
    }
}

 

ZombieAttackedModifiedGoal.java:

public class ZombieAttackModifiedGoal extends MeleeAttackModifiedGoal {
    private final IridiumBat bat;

    public ZombieAttackModifiedGoal(IridiumBat bat, double speed, boolean useLongMemory) {
        super(bat, speed, useLongMemory);
        this.bat = bat;
    }

    /**
     * Execute a one shot task or start executing a continuous task
     */
    public void startExecuting() {
        super.startExecuting();
    }

    /**
     * Reset the task's internal state. Called when this task is interrupted by another one
     */
    public void resetTask() {
        super.resetTask();
        this.bat.setAggroed(false);
    }

    /**
     * Keep ticking a continuous task that has already been started
     */
    public void tick() {
        super.tick();
        if (this.attackTick < 10) {
            this.bat.setAggroed(true);
        } else {
            this.bat.setAggroed(false);
        }

    }
}

 

MeleeAttackModifiedGoal.java:

public class MeleeAttackModifiedGoal extends Goal {
    protected final IridiumBat attacker;
    protected int attackTick;
    private final double speedTowardsTarget;
    private final boolean longMemory;
    private Path path;
    private int delayCounter;
    private double targetX;
    private double targetY;
    private double targetZ;
    protected final int attackInterval = 20;
    private long field_220720_k;
    private int failedPathFindingPenalty = 0;
    private boolean canPenalize = false;

    public MeleeAttackModifiedGoal(IridiumBat creature, double speedIn, boolean useLongMemory) {
        this.attacker = creature;
        this.speedTowardsTarget = speedIn;
        this.longMemory = useLongMemory;
        this.setMutexFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK));
    }

    /**
     * Returns whether the EntityAIBase should begin execution.
     */
    public boolean shouldExecute() {
        long i = this.attacker.world.getGameTime();
        if (i - this.field_220720_k < 20L) {
            return false;
        } else {
            this.field_220720_k = i;
            LivingEntity livingentity = this.attacker.getAttackTarget();
            if (livingentity == null) {
                return false;
            } else if (!livingentity.isAlive()) {
                return false;
            } else {
                if (canPenalize) {
                    if (--this.delayCounter <= 0) {
                        this.path = this.attacker.getNavigator().getPathToEntityLiving(livingentity, 0);
                        this.delayCounter = 4 + this.attacker.getRNG().nextInt(7);
                        return this.path != null;
                    } else {
                        return true;
                    }
                }
                this.path = this.attacker.getNavigator().getPathToEntityLiving(livingentity, 0);
                if (this.path != null) {
                    return true;
                } else {
                    return this.getAttackReachSqr(livingentity) >= this.attacker.getDistanceSq(livingentity.func_226277_ct_(), livingentity.func_226278_cu_(), livingentity.func_226281_cx_());
                }
            }
        }
    }

    /**
     * Returns whether an in-progress EntityAIBase should continue executing
     */
    public boolean shouldContinueExecuting() {
        LivingEntity livingentity = this.attacker.getAttackTarget();
        if (livingentity == null) {
            return false;
        } else if (!livingentity.isAlive()) {
            return false;
        } else if (!this.longMemory) {
            return !this.attacker.getNavigator().noPath();
        } else if (!this.attacker.isWithinHomeDistanceFromPosition(new BlockPos(livingentity))) {
            return false;
        } else {
            return !(livingentity instanceof PlayerEntity) || !livingentity.isSpectator() && !((PlayerEntity)livingentity).isCreative();
        }
    }

    /**
     * Execute a one shot task or start executing a continuous task
     */
    public void startExecuting() {
        this.attacker.getNavigator().setPath(this.path, this.speedTowardsTarget);
        this.attacker.setAggroed(true);
        this.delayCounter = 0;
    }

    /**
     * Reset the task's internal state. Called when this task is interrupted by another one
     */
    public void resetTask() {
        LivingEntity livingentity = this.attacker.getAttackTarget();
        if (!EntityPredicates.CAN_AI_TARGET.test(livingentity)) {
            this.attacker.setAttackTarget((LivingEntity)null);
        }

        this.attacker.setAggroed(false);
        this.attacker.getNavigator().clearPath();
    }

    /**
     * Keep ticking a continuous task that has already been started
     */
    public void tick() {
        LivingEntity livingentity = this.attacker.getAttackTarget();
        this.attacker.getLookController().setLookPositionWithEntity(livingentity, 30.0F, 30.0F);
        double d0 = this.attacker.getDistanceSq(livingentity.func_226277_ct_(), livingentity.func_226278_cu_(), livingentity.func_226281_cx_());
        --this.delayCounter;
        if ((this.longMemory || this.attacker.getEntitySenses().canSee(livingentity)) && this.delayCounter <= 0 && (this.targetX == 0.0D && this.targetY == 0.0D && this.targetZ == 0.0D || livingentity.getDistanceSq(this.targetX, this.targetY, this.targetZ) >= 1.0D || this.attacker.getRNG().nextFloat() < 0.05F)) {
            this.targetX = livingentity.func_226277_ct_();
            this.targetY = livingentity.func_226278_cu_();
            this.targetZ = livingentity.func_226281_cx_();
            this.delayCounter = 4 + this.attacker.getRNG().nextInt(7);
            if (this.canPenalize) {
                this.delayCounter += failedPathFindingPenalty;
                if (this.attacker.getNavigator().getPath() != null) {
                    net.minecraft.pathfinding.PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint();
                    if (finalPathPoint != null && livingentity.getDistanceSq(finalPathPoint.x, finalPathPoint.y, finalPathPoint.z) < 1)
                        failedPathFindingPenalty = 0;
                    else
                        failedPathFindingPenalty += 10;
                } else {
                    failedPathFindingPenalty += 10;
                }
            }
            if (d0 > 1024.0D) {
                this.delayCounter += 10;
            } else if (d0 > 256.0D) {
                this.delayCounter += 5;
            }

            if (!this.attacker.getNavigator().tryMoveToEntityLiving(livingentity, this.speedTowardsTarget)) {
                this.delayCounter += 15;
            }
        }

        this.attackTick = Math.max(this.attackTick - 1, 0);
        this.checkAndPerformAttack(livingentity, d0);
    }

    protected void checkAndPerformAttack(LivingEntity enemy, double distToEnemySqr) {
        double d0 = this.getAttackReachSqr(enemy);
        if (distToEnemySqr <= d0 && this.attackTick <= 0) {
            this.attackTick = 20;
            this.attacker.swingArm(Hand.MAIN_HAND);
            this.attacker.attackEntityAsMob(enemy);
        }

    }

    protected double getAttackReachSqr(LivingEntity attackTarget) {
        return (double)(this.attacker.getWidth() * 2.0F * this.attacker.getWidth() * 2.0F + attackTarget.getWidth());
    }
}

 

A small video of the current behavior

 

I'm completely new to modding (just started a few days ago), so any lessons I can learn from this will be most useful, thanks.

Link to comment
Share on other sites

The latter half of updateAITasks in the original BatEntity class might be part of the issue. Try playing around with the code there (such as making it only run when the bat doesn't have an attack target) and seeing if that helps.

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Link to comment
Share on other sites

1 minute ago, imacatlolol said:

The latter half of updateAITasks in the original BatEntity class might be part of the issue. Try playing around with the code there (such as making it only run when the bat doesn't have an attack target) and seeing if that helps.

From what you said I understand I will have to copy the original code from BatEntity and change that condition, but how would I check it doesn't have an attack target? Sorry for being such a noob :(

Link to comment
Share on other sites

8 minutes ago, PenWallet said:

From what you said I understand I will have to copy the original code from BatEntity and change that condition, but how would I check it doesn't have an attack target?

You can call getAttackTarget for that. Make sure to also validate the target using canAttack just to keep things clean.

I'd recommend checking out the updateAITasks in BlazeEntity as a reference. Lots of stuff can be learned just by exploring vanilla classes.

8 minutes ago, PenWallet said:

Sorry for being such a noob :(

Nah don't worry, we all are at the beginning.

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Link to comment
Share on other sites

1 hour ago, imacatlolol said:

You can call getAttackTarget for that. Make sure to also validate the target using canAttack just to keep things clean.

I'd recommend checking out the updateAITasks in BlazeEntity as a reference. Lots of stuff can be learned just by exploring vanilla classes.

Nah don't worry, we all are at the beginning.

Thanks for that, that was definitely a step in the right direction, but now I'm stuck on how to make it move towards the player. I used moveToBlockPosAndAngles() but what it does is teleporting the bat to the player. Any idea on how I would make it move towards me, like a Zombie would (but flying)?

Link to comment
Share on other sites

Well there's a few options, but generally you'd want to use setMotion for this sort of thing. I haven't messed around much with entity motion, but if I had to guess, you would first call getMotion to use as a base, then add the look vector (getLookVec) multiplied by some amount. Not sure if it'll work as expected, but it should give you an idea of where to go from there.

 

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • heres the crash report: ---- Minecraft Crash Report ---- // You should try our sister game, Minceraft! Time: 2023-12-03 05:44:58 Description: Initializing game java.lang.IncompatibleClassChangeError: class net.coderbot.iris.gui.option.ShadowDistanceOption cannot inherit from final class net.minecraft.client.OptionInstance     at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?] {}     at java.lang.ClassLoader.defineClass(ClassLoader.java:1017) ~[?:?] {}     at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:119) ~[securejarhandler-2.1.4.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.4.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.4.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.4.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.4.jar:?] {}     at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] {}     at net.coderbot.iris.config.IrisConfig.save(IrisConfig.java:169) ~[oculus-mc1.19.2-1.6.9.jar%23176!/:?] {re:classloading,re:mixin}     at net.coderbot.iris.config.IrisConfig.initialize(IrisConfig.java:60) ~[oculus-mc1.19.2-1.6.9.jar%23176!/:?] {re:classloading,re:mixin}     at net.coderbot.iris.Iris.onEarlyInitialize(Iris.java:129) ~[oculus-mc1.19.2-1.6.9.jar%23176!/:?] {re:mixin,re:classloading}     at net.minecraft.client.Options.handler$zdb000$iris$beforeLoadOptions(Options.java:1390) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinOptions_Entrypoint,pl:mixin:APP:mixins.oculus.fixes.maxfpscrash.json:MixinMaxFpsCrashFix,pl:mixin:APP:mixins.essential.json:client.options.GameOptionsAccessor,pl:mixin:APP:mixins.essential.json:client.options.MixinGameOptions,pl:mixin:APP:mixins.essential.json:client.settings.Mixin_UnbindConflictingKeybinds,pl:mixin:APP:mixins.essential.json:cosmetics.capes.Mixin_RedirectVanillaCapeSetting,pl:mixin:APP:mixins.oculus.json:sky.MixinOptions_CloudsOverride,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Options.m_92140_(Options.java) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinOptions_Entrypoint,pl:mixin:APP:mixins.oculus.fixes.maxfpscrash.json:MixinMaxFpsCrashFix,pl:mixin:APP:mixins.essential.json:client.options.GameOptionsAccessor,pl:mixin:APP:mixins.essential.json:client.options.MixinGameOptions,pl:mixin:APP:mixins.essential.json:client.settings.Mixin_UnbindConflictingKeybinds,pl:mixin:APP:mixins.essential.json:cosmetics.capes.Mixin_RedirectVanillaCapeSetting,pl:mixin:APP:mixins.oculus.json:sky.MixinOptions_CloudsOverride,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Options.<init>(Options.java:815) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinOptions_Entrypoint,pl:mixin:APP:mixins.oculus.fixes.maxfpscrash.json:MixinMaxFpsCrashFix,pl:mixin:APP:mixins.essential.json:client.options.GameOptionsAccessor,pl:mixin:APP:mixins.essential.json:client.options.MixinGameOptions,pl:mixin:APP:mixins.essential.json:client.settings.Mixin_UnbindConflictingKeybinds,pl:mixin:APP:mixins.essential.json:cosmetics.capes.Mixin_RedirectVanillaCapeSetting,pl:mixin:APP:mixins.oculus.json:sky.MixinOptions_CloudsOverride,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:428) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:memoryleakfix.mixins.json:hugeScreenshotLeak.Minecraft_screenshotMixin,pl:mixin:APP:memoryleakfix.mixins.json:targetEntityLeak.Minecraft_targetClearMixin,pl:mixin:APP:mixins.oculus.json:MixinMinecraft_PipelineManagement,pl:mixin:APP:mixins.essential.json:client.Mixin_RunEssentialTasks,pl:mixin:APP:mixins.essential.json:client.MixinMinecraft,pl:mixin:APP:mixins.essential.json:client.gui.Mixin_FixKeybindUnpressedInEmoteWheel,pl:mixin:APP:mixins.essential.json:client.gui.Mixin_RecalculateMenuScale,pl:mixin:APP:mixins.essential.json:compatibility.vanilla.Mixin_WorkaroundBrokenFramebufferBlitBlending,pl:mixin:APP:mixins.essential.json:events.Mixin_RenderTickEvent,pl:mixin:APP:mixins.essential.json:feature.skin_overwrites.Mixin_InstallTrustingServicesKeyInfo,pl:mixin:APP:securitycraft.mixins.json:camera.MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.m_239872_(Main.java:176) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:51) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:27) ~[fmlloader-1.19.2-43.3.5.jar%23101!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) [bootstraplauncher-1.1.2.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Suspected Mods: NONE Stacktrace:     at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?] {}     at java.lang.ClassLoader.defineClass(ClassLoader.java:1017) ~[?:?] {}     at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:119) ~[securejarhandler-2.1.4.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.4.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.4.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.4.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.4.jar:?] {}     at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] {}     at net.coderbot.iris.config.IrisConfig.save(IrisConfig.java:169) ~[oculus-mc1.19.2-1.6.9.jar%23176!/:?] {re:classloading,re:mixin}     at net.coderbot.iris.config.IrisConfig.initialize(IrisConfig.java:60) ~[oculus-mc1.19.2-1.6.9.jar%23176!/:?] {re:classloading,re:mixin}     at net.coderbot.iris.Iris.onEarlyInitialize(Iris.java:129) ~[oculus-mc1.19.2-1.6.9.jar%23176!/:?] {re:mixin,re:classloading}     at net.minecraft.client.Options.handler$zdb000$iris$beforeLoadOptions(Options.java:1390) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinOptions_Entrypoint,pl:mixin:APP:mixins.oculus.fixes.maxfpscrash.json:MixinMaxFpsCrashFix,pl:mixin:APP:mixins.essential.json:client.options.GameOptionsAccessor,pl:mixin:APP:mixins.essential.json:client.options.MixinGameOptions,pl:mixin:APP:mixins.essential.json:client.settings.Mixin_UnbindConflictingKeybinds,pl:mixin:APP:mixins.essential.json:cosmetics.capes.Mixin_RedirectVanillaCapeSetting,pl:mixin:APP:mixins.oculus.json:sky.MixinOptions_CloudsOverride,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Options.m_92140_(Options.java) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinOptions_Entrypoint,pl:mixin:APP:mixins.oculus.fixes.maxfpscrash.json:MixinMaxFpsCrashFix,pl:mixin:APP:mixins.essential.json:client.options.GameOptionsAccessor,pl:mixin:APP:mixins.essential.json:client.options.MixinGameOptions,pl:mixin:APP:mixins.essential.json:client.settings.Mixin_UnbindConflictingKeybinds,pl:mixin:APP:mixins.essential.json:cosmetics.capes.Mixin_RedirectVanillaCapeSetting,pl:mixin:APP:mixins.oculus.json:sky.MixinOptions_CloudsOverride,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Options.<init>(Options.java:815) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinOptions_Entrypoint,pl:mixin:APP:mixins.oculus.fixes.maxfpscrash.json:MixinMaxFpsCrashFix,pl:mixin:APP:mixins.essential.json:client.options.GameOptionsAccessor,pl:mixin:APP:mixins.essential.json:client.options.MixinGameOptions,pl:mixin:APP:mixins.essential.json:client.settings.Mixin_UnbindConflictingKeybinds,pl:mixin:APP:mixins.essential.json:cosmetics.capes.Mixin_RedirectVanillaCapeSetting,pl:mixin:APP:mixins.oculus.json:sky.MixinOptions_CloudsOverride,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:428) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:memoryleakfix.mixins.json:hugeScreenshotLeak.Minecraft_screenshotMixin,pl:mixin:APP:memoryleakfix.mixins.json:targetEntityLeak.Minecraft_targetClearMixin,pl:mixin:APP:mixins.oculus.json:MixinMinecraft_PipelineManagement,pl:mixin:APP:mixins.essential.json:client.Mixin_RunEssentialTasks,pl:mixin:APP:mixins.essential.json:client.MixinMinecraft,pl:mixin:APP:mixins.essential.json:client.gui.Mixin_FixKeybindUnpressedInEmoteWheel,pl:mixin:APP:mixins.essential.json:client.gui.Mixin_RecalculateMenuScale,pl:mixin:APP:mixins.essential.json:compatibility.vanilla.Mixin_WorkaroundBrokenFramebufferBlitBlending,pl:mixin:APP:mixins.essential.json:events.Mixin_RenderTickEvent,pl:mixin:APP:mixins.essential.json:feature.skin_overwrites.Mixin_InstallTrustingServicesKeyInfo,pl:mixin:APP:securitycraft.mixins.json:camera.MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A} -- Initialization -- Details:     Modules:          ADVAPI32.dll:Advanced Windows 32 Base API:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         COMCTL32.dll:User Experience Controls Library:6.10 (WinBuild.160101.0800):Microsoft Corporation         CRYPT32.dll:Crypto API32:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         CRYPTBASE.dll:Base cryptographic API DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         CRYPTSP.dll:Cryptographic Service Provider API:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         DBGHELP.DLL:Windows Image Helper:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         DNSAPI.dll:DNS Client API DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         GDI32.dll:GDI Client DLL:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         IMM32.DLL:Multi-User Windows IMM32 API Client DLL:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         IPHLPAPI.DLL:IP Helper API:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         KERNEL32.DLL:Windows NT BASE API Client DLL:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         KERNELBASE.dll:Windows NT BASE API Client DLL:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         MpOav.dll:IOfficeAntiVirus Module:4.18.23100.2009 (8fcbd1c22d82af16ba34560e1a70591413e88d17):Microsoft Corporation         NSI.dll:NSI User-mode interface DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         NTASN1.dll:Microsoft ASN.1 API:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         OLEAUT32.dll:OLEAUT32.DLL:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         Ole32.dll:Microsoft OLE for Windows:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         POWRPROF.dll:Power Profile Helper DLL:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         PSAPI.DLL:Process Status Helper:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         Pdh.dll:Windows Performance Data Helper DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         RPCRT4.dll:Remote Procedure Call Runtime:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         SHCORE.dll:SHCORE:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         SHELL32.dll:Windows Shell Common Dll:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         UMPDC.dll:User Mode Power Dependency Coordinator:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         USER32.dll:Multi-User Windows USER API Client DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         USERENV.dll:Userenv:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         VCRUNTIME140.dll:Microsoft® C Runtime Library:14.29.30139.0 built by: vcwrkspc:Microsoft Corporation         VERSION.dll:Version Checking and File Installation Libraries:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         WINHTTP.dll:Windows HTTP Services:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         WINMM.dll:MCI API DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         WS2_32.dll:Windows Socket 2.0 32-Bit DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         WSOCK32.dll:Windows Socket 32-Bit DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         amsi.dll:Anti-Malware Scan Interface:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         bcrypt.dll:Windows Cryptographic Primitives Library:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         bcryptPrimitives.dll:Windows Cryptographic Primitives Library:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         clbcatq.dll:COM+ Configuration Catalog:2001.12.10941.16384 (WinBuild.160101.0800):Microsoft Corporation         combase.dll:Microsoft COM for Windows:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         dbgcore.DLL:Windows Core Debugging Helpers:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         dhcpcsvc.DLL:DHCP Client Service:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         dhcpcsvc6.DLL:DHCPv6 Client:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         fwpuclnt.dll:FWP/IPsec User-Mode API:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         gdi32full.dll:GDI Client DLL:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         glfw.dll:GLFW 3.4.0 DLL:3.4.0:GLFW         java.dll:OpenJDK Platform binary:17.0.8.0:Microsoft         javaw.exe:OpenJDK Platform binary:17.0.8.0:Microsoft         jemalloc.dll         jimage.dll:OpenJDK Platform binary:17.0.8.0:Microsoft         jli.dll:OpenJDK Platform binary:17.0.8.0:Microsoft         jna11175178637920788105.dll:JNA native library:6.1.2:Java(TM) Native Access (JNA)         jsvml.dll:OpenJDK Platform binary:17.0.8.0:Microsoft         jvm.dll:OpenJDK 64-Bit server VM:17.0.8.0:Microsoft         kernel.appcore.dll:AppModel API Host:10.0.22621.2715 (WinBuild.160101.0800):Microsoft Corporation         lwjgl.dll         management.dll:OpenJDK Platform binary:17.0.8.0:Microsoft         management_ext.dll:OpenJDK Platform binary:17.0.8.0:Microsoft         msvcp140.dll:Microsoft® C Runtime Library:14.29.30139.0 built by: vcwrkspc:Microsoft Corporation         msvcp_win.dll:Microsoft® C Runtime Library:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         msvcrt.dll:Windows NT CRT DLL:7.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         mswsock.dll:Microsoft Windows Sockets 2.0 Service Provider:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         napinsp.dll:E-mail Naming Shim Provider:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         ncrypt.dll:Windows NCrypt Router:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         net.dll:OpenJDK Platform binary:17.0.8.0:Microsoft         nio.dll:OpenJDK Platform binary:17.0.8.0:Microsoft         nlansp_c.dll:NLA Namespace Service Provider DLL:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         ntdll.dll:NT Layer DLL:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         perfos.dll:Windows System Performance Objects DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         pfclient.dll:SysMain Client:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         pnrpnsp.dll:PNRP Name Space Provider:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         profapi.dll:User Profile Basic API:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         rasadhlp.dll:Remote Access AutoDial Helper:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         rsaenh.dll:Microsoft Enhanced Cryptographic Provider:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         sechost.dll:Host for SCM/SDDL/LSA Lookup APIs:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         shlwapi.dll:Shell Light-weight Utility Library:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         sunmscapi.dll:OpenJDK Platform binary:17.0.8.0:Microsoft         ucrtbase.dll:Microsoft® C Runtime Library:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         vcruntime140_1.dll:Microsoft® C Runtime Library:14.29.30139.0 built by: vcwrkspc:Microsoft Corporation         verify.dll:OpenJDK Platform binary:17.0.8.0:Microsoft         win32u.dll:Win32u:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         windows.storage.dll:Microsoft WinRT Storage API:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         winrnr.dll:LDAP RnR Provider DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         wintypes.dll:Windows Base Types DLL:10.0.22621.1 (WinBuild.160101.0800):Microsoft Corporation         wshbth.dll:Windows Sockets Helper DLL:10.0.22621.2506 (WinBuild.160101.0800):Microsoft Corporation         zip.dll:OpenJDK Platform binary:17.0.8.0:Microsoft Stacktrace:     at net.minecraft.client.main.Main.m_239872_(Main.java:176) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:51) ~[client-1.19.2-20220805.130853-srg.jar%23179!/:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:27) ~[fmlloader-1.19.2-43.3.5.jar%23101!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-10.0.8.jar%2388!/:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) [bootstraplauncher-1.1.2.jar:?] {} -- 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.8, Microsoft     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft     Memory: 542543992 bytes (517 MiB) / 771751936 bytes (736 MiB) up to 2147483648 bytes (2048 MiB)     CPUs: 12     Processor Vendor: GenuineIntel     Processor Name: 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz     Identifier: Intel64 Family 6 Model 141 Stepping 1     Microarchitecture: unknown     Frequency (GHz): 2.69     Number of physical packages: 1     Number of physical CPUs: 6     Number of logical CPUs: 12     Graphics card #0 name: NVIDIA GeForce GTX 1650 with Max-Q Design     Graphics card #0 vendor: NVIDIA (0x10de)     Graphics card #0 VRAM (MB): 4095.00     Graphics card #0 deviceId: 0x1f9d     Graphics card #0 versionInfo: DriverVersion=31.0.15.3742     Graphics card #1 name: Intel(R) UHD Graphics     Graphics card #1 vendor: Intel Corporation (0x8086)     Graphics card #1 VRAM (MB): 1024.00     Graphics card #1 deviceId: 0x9a68     Graphics card #1 versionInfo: DriverVersion=31.0.101.4575     Memory slot #0 capacity (MB): 8192.00     Memory slot #0 clockSpeed (GHz): 3.20     Memory slot #0 type: DDR4     Memory slot #1 capacity (MB): 8192.00     Memory slot #1 clockSpeed (GHz): 3.20     Memory slot #1 type: DDR4     Virtual memory max (MB): 25259.05     Virtual memory used (MB): 12791.77     Swap memory total (MB): 9173.38     Swap memory used (MB): 124.52     JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     Launched Version: 1.19.2-forge-43.3.5     Backend library: LWJGL version 3.3.1 build 7     Backend API: Unknown     Window size: <not initialized>     GL Caps: Using framebuffer using OpenGL 3.2     GL debug messages: <disabled>     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'forge'     Type: Client (map_client.txt)     CPU: <unknown>
    • This is the mods folder. I tried removing optifine and start but it doesnt work.
    • RECENTLY THIS IS WORLD SPECIFIED TEXTURE PACK
    • I checked my isFood() method: @Override public boolean isFood(@NotNull ItemStack item) { return FOOD_ITEMS.test(item); } the FOOD_ITEMS: protected static final Ingredient FOOD_ITEMS // sorry for protected static lol = Ingredient.of(Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS, Items.TORCHFLOWER_SEEDS, Items.PITCHER_POD); and the Ingredient class, but nothing seems to tell Minecraft that air is a food item.  Tell me if you need full entity code
  • Topics

×
×
  • Create New...

Important Information

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