Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class net.minestom.server.entity.Player$Hand not found. #133

Open
athinaslime opened this issue Jan 9, 2025 · 4 comments
Open

Class net.minestom.server.entity.Player$Hand not found. #133

athinaslime opened this issue Jan 9, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@athinaslime
Copy link

athinaslime commented Jan 9, 2025

Here is my code

 public static void main(String[] args) {
        MinecraftServer minecraftServer = MinecraftServer.init();

        InstanceManager instanceManager = MinecraftServer.getInstanceManager();
        InstanceContainer instanceContainer = instanceManager.createInstanceContainer();

        instanceContainer.setGenerator(unit -> unit.modifier().fillHeight(0, 3, Block.GRASS_BLOCK));

        GlobalEventHandler globalEventHandler = MinecraftServer.getGlobalEventHandler();
        globalEventHandler.addListener(AsyncPlayerConfigurationEvent.class, event -> {
            Player player = event.getPlayer();

            event.setSpawningInstance(instanceContainer);
            player.setRespawnPoint(new Pos(0, 4, 0));
        });

        var lamp = MinestomLamp.builder()
                .build();
        lamp.register(new TestMenuCommand());

        Platform<Instance, Player, ItemStack, Object> platform = MinestomPlatform
                .minestomNpcPlatformBuilder()
                .extension(TestServer.class)
                .actionController(builder -> {
                    builder.flag(NpcActionController.SPAWN_DISTANCE, 10);
                    builder.flag(NpcActionController.IMITATE_DISTANCE, 5);
                    builder.flag(NpcActionController.AUTO_SYNC_POSITION_ON_SPAWN, true);
                })
                .build();
        
        platform.newNpcBuilder()
                .position(MinestomUtil.positionFromMinestom(new Pos(5, 3, 0), instanceContainer))
                .flag(Npc.LOOK_AT_PLAYER, true)
                .flag(Npc.HIT_WHEN_PLAYER_HITS, true)
                .flag(Npc.SNEAK_WHEN_PLAYER_SNEAKS, true)
                .build();

        minecraftServer.start("0.0.0.0", 25565);
    }

I get this error everytime i launch the server.
Caused by: java.lang.ClassNotFoundException: net.minestom.server.entity.Player$Hand

Minestom and npc-lib is shaded in my project.

Here is my build.gradle.kts

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
    id("java")
    id("maven-publish")
    id("com.gradleup.shadow") version "9.0.0-beta4"
}

group = "tragedy"
version = "0.0.1"

repositories {
    mavenCentral()
}

dependencies {
    implementation("net.minestom:minestom-snapshots:1d0f512256")

    implementation("io.github.revxrsal:lamp.common:4.0.0-rc.2")
    implementation("io.github.revxrsal:lamp.minestom:4.0.0-rc.2")

    implementation("io.github.juliarn:npc-lib-minestom:3.0.0-beta10")

    implementation("dev.hollowcube:polar:1.12.1")
}

tasks.withType<ShadowJar> {
    archiveClassifier.set("")
    archiveFileName.set("${project.name}-$version.jar")
}

tasks.withType<JavaCompile> {
    options.compilerArgs.add("-parameters")
}
@derklaro
Copy link
Collaborator

derklaro commented Jan 9, 2025

Might be that they moved some classes again... Will check later

@derklaro derklaro added the bug Something isn't working label Jan 9, 2025
@athinaslime
Copy link
Author

Might be that they moved some classes again... Will check later

Checked on the latest commit, it's in that package so i have no clue what could be causing this.

@athinaslime
Copy link
Author

I just checked, release 3.0.0 beta 10 (the latest release on maven central) doesn't have the updated class, should fix with a new release to update the Minestom version.

@derklaro
Copy link
Collaborator

👍 I will try to publish a new release in the next few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants