#plugin dont work

1 messages · Page 1 of 1 (latest)

formal willow
#

Hi ! I tried to make a plugin with spigot 1.16.3 but I don't no why he doesn't work

#

I will send the code

karmic nest
#

ok

formal willow
#
package fr.yuna.europemc;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;



public class Main extends JavaPlugin {
    
    public void OnEnable() {
        
    }
    
    public void OnDisable() {
        
    }
    
    
    public boolean OnCommand(CommandSender sender, Command command, String label, String[] args) {
        
        if(label.equalsIgnoreCase("hello")) {
            if(!(sender instanceof Player)) {
                sender.sendMessage("You need to be a player to run this command!");
                return true;
            }
            
            if(!sender.hasPermission("helloworld.use")) {
                sender.sendMessage(ChatColor.RED + "You do not have permission!");
                return true;
            }
            Player p = (Player) sender;
            p.sendMessage("Hello " + p.getName());
            return true;
        }
        
        return false;
    }
    
}
karmic nest
#

do you get any errors in console?

#

when you load it?

formal willow
#

no

karmic nest
#

do /pl

#

do you see your plugin

formal willow
#

no

karmic nest
#

aha

#

you need to make

#

plugin.yml

#

and if you already did

#

then restart the server

#

after you add a plugin

#

or use sth like /reload or plugman

#

restarting is always safer tho

#

but for your plugin anything should work

formal willow
#

that doesn't do anything

karmic nest
#

?

#

are you running spigot?

#

or bukkit

formal willow
#

oh I've forgot to restart the server

karmic nest
#

or paper

karmic nest
formal willow
#

I don't have my plugin in /pl

karmic nest
#

(0)?

#

hm

formal willow
karmic nest
#

did you make plugin.yml

#

did you copy plugin to the plugins folder?

formal willow
#

where did I put plugin.yml ?

karmic nest
#

somewhere

#

in the project

#

i put it in root

#

but idk

formal willow
#

no, in my plugin folder

karmic nest
#

nonono

#

plugin.yml

#

is something you do on your IDE

formal willow
#

yes i do

karmic nest
#

to then compile your plugin with it

formal willow
#

ow ok

karmic nest
#

EVERY plugin must have plugin.yml to work

formal willow
karmic nest
#

ok

#

but your project files?

#

i have it on src/main/java

#

plugin.yml

formal willow
karmic nest
#

show me plugin.yml

formal willow
#
main: fr.yuna.europemc.Main
name: EuropeMC_1.16.3
version: 1.0
description: EuropeMC
api-version: 1.16.3

commands:
   hello:
      description: HelloWorld!
karmic nest
#

hm

#

try putting the plugin.yml in src

formal willow
#

k

#

doesn't work

karmic nest
#

huhhh

formal willow
karmic nest
#

yes

#

that doesnt matter

formal willow
#

ok

karmic nest
#

can you send me the plugin?

formal willow
#

yes

karmic nest
#

ok

#

set api-version to 1.16

#

recompile

#

and try again

#

@formal willow

formal willow
#

yes

karmic nest
#

sry for taking long i was downloading and decompiling the plugin

karmic nest
#

remove the .3

formal willow
#

yes i did it and my server reboot

karmic nest
#

ok

#

does it work?

formal willow
#

sry for my english level

formal willow
#

doesn't work

karmic nest
#

huh

#

send me the plugin again

formal willow
karmic nest
#

its still

#

1.16.3

#

you need to change it to 1.16

#

or remove api-version all together

formal willow
#

no I change it

#

ok

karmic nest
#

well you didnt export it properly

#

the one you sent still has .3

formal willow
#

ow

#

ok I will change that

karmic nest
#

o wait

#

no

#

now it work

#

s

#

for me

#

the new one you sent me

#

work

formal willow
#

but why it doens't work for me ?

karmic nest
#

well idk

formal willow
#

are you on 1.16.3 ?

karmic nest
#

1.17.1

#

but it is compatible

#

btw do /pl

#

it should appear

#

the plugin itself

#

doesnt work

#

but it should load properly

#

now

formal willow
#

it doesn't work :/

karmic nest
#

but

#

do /pl

formal willow
karmic nest
#

huh

#

is the new one on your plugins folder?

#

you sure

#

?

formal willow
#

yes

karmic nest
#

do /ver

formal willow
karmic nest
#

u running bukkit?

#

try running spigot

#

instead of bukkit

formal willow
karmic nest
#

or paper

formal willow
karmic nest
#

ok

#

can you install plugman?

formal willow
#

what is this ?

karmic nest
#

a plugin to load plugins

formal willow
#

plugmanx ?

karmic nest
#

plugman

#

from devbukkit

#

not spigotmc

formal willow
#

ok it's downloaded

karmic nest
#

put it in

#

restart server etc

#

then do /pl

formal willow
#

already do

karmic nest
#

you should see plugman

formal willow
#

yea

karmic nest
#

ok

#

do /plugman load EuropeMC

#

sorry

#

mistype

formal willow
karmic nest
#

check console

#

for errors

formal willow
karmic nest
#

so thats the problem right there

#

your server

#

the jdk that the server runs on

#

doesnt support the one you used to compile it

#

if im understanding correctly

#

so its not a problem with the plugin itself

#

but what you compile it with and what jdk you run it on

#

im pretty sure that if you just run the server at your local computer

#

it would work

#

maybe im wrong

formal willow
#

I will test to build the plugin with the jdk of the server

karmic nest
#

oke

formal willow
karmic nest
#

jre or jdk

#

maybe its jre

#

but idk much about this

#

but its more of a java as a whole question now

#

and not bukkit

formal willow
karmic nest
#

the jre run by the server is lower than the one you compiled it with

formal willow
#

ok i will fix it

#

do you now what jre it is ?

karmic nest
#

nope

#

you run the server

#

idk

#

if you switch to 1.17

#

paper /spigot whatever

#

it should work

#

since 1.17 requires java 16 to work

#

so the server is forced to update

formal willow
#

so is the jre 16 ?

karmic nest
#

idk

#

but java version will be 16 or higher

#

if u use 1.17

formal willow
#

what is the jre on your server ?

karmic nest
#

idk

#

but i use java 16