-4

I just started to learn programming with a book I got recently and it teaches me to write plugins for minecraft with java.The first task is to copie the following code it´s supposed to say Hallo Welt when I enter the minecraft world

import org.bukkit.plugin.java.JavaPlugin;

public class HalloWeltPlugin extends JavaPlugin { 
    public void onEnable() {
        this.getLogger().info("Hallo Welt!");
    }
 
    public void onDisable() {         
    }
}

But when i try to compile the code it shows following error:

HalloWeltPlugin.java:1: error: cannot find symbol
import org.bukkit.plugin.java.JavaPlugin;
                             ^
  symbol:   class JavaPlugin
  location: package org.bukkit.plugin.java
HalloWeltPlugin.java:3: error: cannot find symbol
public class HalloWeltPlugin extends JavaPlugin {
                                     ^
  symbol: class JavaPlugin
HalloWeltPlugin.java:5: error: cannot find symbol
        this.getLogger().info("Hallo Welt!");
            ^
  symbol: method getLogger()
3 errors

As i said i have no idea of programming yet and i would be happy if someone could tell me what the mistake is.

1 Answers1

-1

The Problem seems to be that the Class JavaPlugin can't be resolved hence it is a symbol which can not be found. Did you include the package org.bukkit.plugin.java into your project via maven/gradle or directly?

When you starting out with programming, I'd suggest you to start with the basics instead of jumping right into coding plugins for Minecraft.

A beginners guide to Java like this would suite you better.

Valerij Dobler
  • 1,848
  • 15
  • 25