#why i get this error

1 messages ยท Page 1 of 1 (latest)

rich oxide
lavish torrentBOT
# rich oxide idk how to fix

I uploaded your attachments as gist. That way, they are easier to read for everyone, especially mobile users ๐Ÿ‘

#

<@&987246399047479336> please have a look, thanks.

lavish torrentBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

rich oxide
uncut jay
lavish torrentBOT
# rich oxide

I uploaded your attachments as gist. That way, they are easier to read for everyone, especially mobile users ๐Ÿ‘

rich oxide
#

SORRY

#

I DIDNT MENT TO PING U

#

im realy sorry

#

i didnt press mention ping of

oak stump
gloomy cove
#

EntityRenderers does not seem to have a register method which takes an EntityType and a second argument which I can't deduce the type of

rich oxide
gloomy cove
#

Changed it to what?

#

What is the code now, and what is Killer_QueenRenderer

#

Can you post those files

rich oxide
# gloomy cove What is the code now, and what is Killer_QueenRenderer

RENDER
package net.hrodebert.Manifestation_of_the_souls.entity.client;

import com.mojang.blaze3d.vertex.PoseStack;
import net.hrodebert.Manifestation_of_the_souls.Manifestation_of_the_souls;
import net.hrodebert.Manifestation_of_the_souls.entity.custom.Killer_QueenEntity;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.animatable.GeoEntity;
import software.bernie.geckolib.model.GeoModel;
import software.bernie.geckolib.renderer.GeoEntityRenderer;

public class Killer_QueenRender extends GeoEntityRenderer<Killer_QueenEntity> {
public Killer_QueenRender(EntityRendererProvider.Context renderManager) {
super(renderManager, new Killer_QueenModel());
}

@Override
public ResourceLocation getTextureLocation(Killer_QueenEntity animatable) {
    return new ResourceLocation(Manifestation_of_the_souls.MOD_ID, "textures/entity/Killer_Queen.png");
}

@Override
public void render(Killer_QueenEntity entity, float entityYaw, float partialTick, PoseStack poseStack,
                   MultiBufferSource bufferSource, int packedLight) {


    super.render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
}

}

#

KQMODEL
package net.hrodebert.Manifestation_of_the_souls.entity.client;

import net.hrodebert.Manifestation_of_the_souls.Manifestation_of_the_souls;
import net.hrodebert.Manifestation_of_the_souls.entity.custom.Killer_QueenEntity;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import software.bernie.geckolib.constant.DataTickets;
import software.bernie.geckolib.core.animatable.GeoAnimatable;
import software.bernie.geckolib.core.animatable.model.CoreGeoBone;
import software.bernie.geckolib.core.animation.AnimationState;
import software.bernie.geckolib.model.GeoModel;
import software.bernie.geckolib.model.data.EntityModelData;

public class Killer_QueenModel extends GeoModel<Killer_QueenEntity> {

@Override
public ResourceLocation getModelResource(Killer_QueenEntity animatable) {
    return new ResourceLocation(Manifestation_of_the_souls.MOD_ID, "geo/kq - Converted.geo.json");
}

@Override
public ResourceLocation getTextureResource(Killer_QueenEntity animatable) {
    return new ResourceLocation(Manifestation_of_the_souls.MOD_ID, "textures/entity/Killer_Queen.png");
}

@Override
public ResourceLocation getAnimationResource(Killer_QueenEntity animatable) {
    return new ResourceLocation(Manifestation_of_the_souls.MOD_ID, "geo/kq - Converted.animation.json");

}

@Override
public void setCustomAnimations(Killer_QueenEntity animatable, long instanceId, AnimationState<Killer_QueenEntity> animationState) {
    CoreGeoBone head = getAnimationProcessor().getBone("head");

    if (head != null) {
        EntityModelData entityData = animationState.getData(DataTickets.ENTITY_MODEL_DATA);

        head.setRotX(entityData.headPitch() * Mth.DEG_TO_RAD);
        head.setRotY(entityData.netHeadYaw() * Mth.DEG_TO_RAD);
    }
}

}

#

ENTITY
package net.hrodebert.Manifestation_of_the_souls.entity.custom;

import net.hrodebert.Manifestation_of_the_souls.entity.ModEntities;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.AgeableMob;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.goal.FloatGoal;
import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal;
import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal;
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.IronGolem;
import net.minecraft.world.entity.monster.Creeper;
import net.minecraft.world.entity.npc.AbstractVillager;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.Nullable;
import software.bernie.geckolib.animatable.GeoEntity;
import software.bernie.geckolib.core.animatable.GeoAnimatable;
import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
import software.bernie.geckolib.core.animatable.instance.SingletonAnimatableInstanceCache;

#

import software.bernie.geckolib.core.animation.*;
import software.bernie.geckolib.core.object.PlayState;

public class Killer_QueenEntity extends Animal implements GeoEntity {
private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
public Killer_QueenEntity(EntityType<? extends Animal> entityType, Level level) {
super(entityType, level);
}

public static AttributeSupplier setAttributes() {
    return Animal.createMobAttributes()
            .add(Attributes.MAX_HEALTH, 16D)
            .add(Attributes.ATTACK_DAMAGE, 3.0f)
            .add(Attributes.ATTACK_SPEED, 1.0f)
            .add(Attributes.MOVEMENT_SPEED, 0.4f).build();
}

@Override
#

protected void registerGoals() {
this.goalSelector.addGoal(1, new FloatGoal(this));
this.goalSelector.addGoal(2, new MeleeAttackGoal(this, 1.2D, false));
this.goalSelector.addGoal(4, new WaterAvoidingRandomStrollGoal(this, 1.0D));
this.goalSelector.addGoal(5, new RandomLookAroundGoal(this));

    this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
    this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false));
    this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
    this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, Creeper.class, true));
}
@Nullable
@Override
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob ageableMob) {
    return ModEntities.Killer_queen.get().create(level);
}

@Override
public void registerControllers(AnimatableManager.ControllerRegistrar controllerRegistrar) {
    controllerRegistrar.add(new AnimationController<>(this,"controller", 0,this :: predicate));
}

private <T extends GeoAnimatable> PlayState predicate(AnimationState<T> kqAnimationState) {
    kqAnimationState.getController().setAnimation(RawAnimation.begin().then("idle.model.new", Animation.LoopType.LOOP));
    return PlayState.CONTINUE;
}

@Override
public AnimatableInstanceCache getAnimatableInstanceCache() {
    return cache;
}

}

#

MOD
package net.hrodebert.Manifestation_of_the_souls;

import com.mojang.logging.LogUtils;
import net.hrodebert.Manifestation_of_the_souls.entity.ModEntities;
import net.hrodebert.Manifestation_of_the_souls.entity.client.Killer_QueenRender;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.CreativeModeTabEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.ForgeRegistries;
import org.slf4j.Logger;

import static io.netty.util.internal.ObjectCleaner.register;
import net.minecraft.client.renderer.entity.EntityRenderers;

#

// The value here should match an entry in the META-INF/mods.toml file
@Mod(Manifestation_of_the_souls.MOD_ID)
public class Manifestation_of_the_souls
{
// Define mod id in a common place for everything to reference
public static final String MOD_ID = "mots";
// Directly reference a slf4j logger
private static final Logger LOGGER = LogUtils.getLogger();
public Manifestation_of_the_souls()
{
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();

    // Register the commonSetup method for modloading
    modEventBus.addListener(this::commonSetup);

    ModEntities.register(modEventBus);

    // Register ourselves for server and other game events we are interested in
    MinecraftForge.EVENT_BUS.register(this);

    // Register the item to a creative tab
    modEventBus.addListener(this::addCreative);
}

private void commonSetup(final FMLCommonSetupEvent event)
{
    // Some common setup code
    LOGGER.info("HELLO FROM COMMON SETUP");
    LOGGER.info("DIRT BLOCK >> {}", ForgeRegistries.BLOCKS.getKey(Blocks.DIRT));
}

private void addCreative(CreativeModeTabEvent.BuildContents event)
{

Z
}

// You can use SubscribeEvent and let the Event Bus discover methods to call


// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
@Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public static class ClientModEvents
{
    @SubscribeEvent
    public static void onClientSetup(FMLClientSetupEvent event) {
        Object EntityRenderers = null;
        EntityRenderers.register(ModEntities.Killer_queen.get(), Killer_QueenRender::new);
    }
}

}

gloomy cove
#

Remove the Object EntityRenderers = null;

rich oxide
gloomy cove
#

The entire line

rich oxide
gloomy cove
#

Manifestation_of_the_souls

rich oxide
#

k

gloomy cove
#

The last file you posted

rich oxide
# gloomy cove The last file you posted

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
1 actionable task: 1 executed
D:\Manifestation of the souls\mod\src\main\java\net\hrodebert\Manifestation_of_the_souls\Manifestation_of_the_souls.java:55: error: not a statement
Z
^
D:\Manifestation of the souls\mod\src\main\java\net\hrodebert\Manifestation_of_the_souls\Manifestation_of_the_souls.java:55: error: ';' expected
Z
^
2 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.

Compilation failed; see the compiler error output for details.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 2s

gloomy cove
#

Remove the Z from the addCreative method in the same file

#

You might also consider a basic java course to learn the syntax a bit better ๐Ÿ˜…

rich oxide
#

last error is this

#

Non [a-z0-9/._-] character in path of location: mots:Killer queen

#

how can i fix

#

(i just need to fix this to end the mod then i will lern other things"

gloomy cove
#

Can you post the full error

rich oxide
# gloomy cove Can you post the full error

Caused by: java.lang.NoSuchMethodError: 'net.minecraft.client.Minecraft net.minecraft.client.Minecraft.m_91087_()'
Caused by: java.lang.ExceptionInInitializerError
Caused by: net.minecraft.ResourceLocationException: Non [a-z0-9/._-] character in path of location: mots:Killer queen

gloomy cove
#

It probably doesn't like the space in there

#

I'm assuming Mots is a namespace which it doesn't particularly care about (like minecraft:)

gloomy cove
#

Remove the whitespace in that name

gloomy cove
rich oxide
gloomy cove
#

@static parcel you should probably create your own thread rather than hijacking someone else's ๐Ÿ˜„

#

I mean Discord thread

#

In #1051826284008853505 you can create a new post

keen tartan
#

each problem / person has its own thread normally, it should be on top of the questions section