#help-development

1 messages · Page 1785 of 1

paper viper
#

lol

#

like you know your blood is a good buffer

#

for example, when you add hydrogen peroxide to water it gets super basic on the ph scale right

#

but if you add hydrogen peroxide to blood, the effects arent as big

#

its cause your blood stores hydrogen atoms and releases them when necessary to balance ph levels

#

its pretty cool

buoyant viper
#

i guess they meant margin of error and used buffer instead

#

idk

paper viper
#

Yeah

#

bad naming conventions probably

#

XD

#

also anti cheat code is hard to read anyways

#

cause like 99% of the time authors dont give a shit about anyone who looks at the code

proud basin
#

no comments

paper viper
#

but like.. this is just horrible code

#

xD

buoyant viper
#

if funkemunky had anything to do with it, its bound to be a bad project

paper viper
#

I only use comments for stuff that is super hard to understand even if the code is well written. For example, like very mathematical stuff

proud basin
#

"buffer"

#

Apparently he named it that because he was lazy

buoyant viper
#

i also like how most of the reviews on the download pages r from the devs

#

also cant stand CheckA/B/C/D/E/etc

#

like name the class after what it does or merge it with a more generic class

#

also im sorry is it instantiating a new check class object every time it receives a packet

rain cypress
#

Is CraftPlayer cannot be cast to EntityPlayer me being dumb, or is that supposed to work?

IDE isn’t complaining

young knoll
#

CraftPlayer#getHandle

proud basin
quaint mantle
#

how do i get a player from an entity again

young knoll
#

Check and cast

subtle folio
#

im trying to saave a hashmap with player inventories to a .properties file in my server. When I try to load the file I get an error with items.putAll(properties); my code: ```java
package net.ntdi.tazpvp.managers;

import net.ntdi.tazpvp.TazPvP;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

import java.io.;
import java.util.
;
import java.util.HashMap;
import java.util.Map;

public class ArmorManager {

static Map<UUID, ItemStack[]> items = new HashMap<UUID, ItemStack[]>();
static Map<UUID, ItemStack[]> armor = new HashMap<UUID, ItemStack[]>();
final static String outputFilePath = TazPvP.getInstance().getDataFolder().getAbsolutePath() + "/inv.properties";
final static String outputFilePath2 = TazPvP.getInstance().getDataFolder().getAbsolutePath() + "/inv.properties";

public static void storeAndClearInventory(Player player){
    UUID uuid = player.getUniqueId();

    ItemStack[] cont = player.getInventory().getContents();
    ItemStack[] armcont = player.getInventory().getArmorContents();

    items.put(uuid, cont);
    armor.put(uuid, armcont);

    player.getInventory().clear();

    remArmor(player);
}

public static void restoreInventory(Player player){
    UUID uuid = player.getUniqueId();

    ItemStack[] contents = items.get(uuid);
    ItemStack[] armorContents = armor.get(uuid);

    if(contents != null){
        player.getInventory().setContents(contents);
    } else {
        //player.getInventory().clear();
    }

    if(armorContents != null){
        player.getInventory().setArmorContents(armorContents);
    } else {
        //remArmor(player);
    }
}

public static void remArmor(Player player){
    player.getInventory().setHelmet(null);
    player.getInventory().setChestplate(null);
    player.getInventory().setLeggings(null);
    player.getInventory().setBoots(null);
}

public static void saveinv() throws IOException {
    File file = new File(outputFilePath);
    Properties properties = new Properties();
    properties.putAll(items);

    properties.store(new FileOutputStream(outputFilePath), null);

}

public static void savearmor() throws IOException {
    File file = new File(outputFilePath2);
    Properties properties = new Properties();
    properties.putAll(armor);

    properties.store(new FileOutputStream(outputFilePath2), null);

}

public static void loadinv() throws IOException {
    Properties properties = new Properties();
    properties.load(new FileInputStream(outputFilePath));
    items.putAll(properties);
}

}

quaint mantle
#

how can i stop formatting in a TextComponent leaking to other components in a BaseComponent[] /// ComponentBuilder()

#

oh hi sorry

long helm
#

when I try to use player.setBedSpawnLocation(x, true) despite me setting override to true it still says "you have no home bed or it was obstructed" and respawns the player at the world spawn

#

how can I fix this

young knoll
#

I mean

#

It has API methods for most things that are in said tags

rain cypress
# young knoll CraftPlayer#getHandle

Using Mojang mapped. If I try the traditional method, I get

Caused by: java.lang.NoSuchMethodError: 'net.minecraft.server.level.EntityPlayer org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer.getHandle()'

#

Must be an issue with my remapping, hmm

stone sinew
rain cypress
gloomy edge
#

Before I let my mind lose with ideas. Is it possible to create custom blocks (without armor stands) with resource packs without replacing existing blocks?

young knoll
#

Technically yes

#

You replace the block states of noteblocks

quaint mantle
#

Those are workarounds but yeah

torn shuttle
#

anyone have any idea of why AbstractArrow#getAttachedBlock() always returns air no matter what?

#

it seems to be getting the block adjacent to the block fired at, not the block it actually landed on

eternal oxide
#

getRelative attached Face

torn shuttle
#

relative to what?

eternal oxide
#

the attached face

torn shuttle
#

but how do I know which face to get?

#

getFacing?

eternal oxide
#

from the ProjectileHitEvent

torn shuttle
#

oh I'm not using that...

#

I was checking the arrow itself

eternal oxide
#

why?

#

ProjectileHitevent will give you the correct block and which face was hit

torn shuttle
#

because 99.99999% of arrow shots are irrelevant to what I want to do this and I'd rather have the overhead of tracking an arrow for 3 seconds once a month than checking every arrow ever shot to see if it's one of mine

#

I'll try getfacing from teh arrow method first

quaint mantle
#

please

quaint mantle
#

Hmm?

#

I think checking every arrow that got shot still better…?

ivory sleet
#

Because comments are redundant if code can explain itself

#

In addition

#

Comments can lie

#

Code never lies, sure it can fool you, but it never lies to you

eternal oxide
#

Clean code and comment everything. Old school.

summer scroll
#

Hey, I'm trying to create a Clan plugin where it has clan point and other data, but what is the best way to make the plugin can sync (clan points, members) across all servers?

ivory sleet
#

Either have a socket server-socket event system across the servers, or something like redis pub/sub, rabbitmq or Kafka to synchronize updates across servers

opal juniper
#

redis FifiHappy

ivory sleet
#

Then have something like a redis cache to cache recently queried objects from your persistent database

#

But I’d avoid using the pub/sub redis mq as its quite vulgar

opal juniper
#

bruh

#

whatever

summer scroll
#

Is it gonna be a spigot or bungee plugin?

ivory sleet
#

That’s not on me

summer scroll
#

What would you do?

opal juniper
#

well

#

redis runs seperately

ivory sleet
summer scroll
#

hmm, okay

ivory sleet
#

You can think of redis as a shared hashmap between servers

summer scroll
#

do i need database server like mysql?

ivory sleet
#

I highly suggest

summer scroll
#

Okay so, for example, I have a Clan object that holds a list of members, and someone joined the clan, how can I sync it?

worn tundra
#

You store the object in a database. I don't suppose you need to sync the object at all times in all servers?

summer scroll
#

I need to sync it for every changes

worn tundra
#

If you update the Clan object on one server, just update it in the database and make your plugin on the other server fetch the latest object from the database

#

You don't need for fetch it immediately, you can do it only when those members for example are requested

summer scroll
#

Oh, so save it on the database and then "ping" the other server that the server need to fetch that recent update?

worn tundra
#

What?

#

You don't have to ping

#

Just get the latest object from database

summer scroll
#

You telling me to just get the value directly from the database?

lean gull
vague oracle
#

Why are you not passing the instance through the constructor

lean gull
#

wdym

vague oracle
#

You are also using 2 objects for the same command

lean gull
#

?

#

i need the plugin object in order to get the gamerules gui object

vague oracle
#

No you don’t get what I’m saying you are creating 2 instances of the same command

lean gull
#

i'm not sure, but i think i need to use the same gamerules gui object so that's why i have a method for it in main

vague oracle
#

You should only make 1

lean gull
#

wdym

#

oh i see

vague oracle
#

I literally just said

lean gull
#

my bad

#

ok now what tho

tardy delta
#

?di

undone axleBOT
lean gull
summer scroll
tardy delta
#

You need a constructor

#

Not a method

lean gull
#

wdym

tardy delta
#

Public Gamerulescommand() {} is a constructor

#

Public void something() {} is a method

worn tundra
tardy delta
#

Note the void

lean gull
#

you mean the class?

#

why are there curly brackets

tardy delta
#

There are in your method goo

#

Too

summer scroll
lean gull
#

??

tardy delta
worn tundra
#

Unless you want the data to be desynchronized?

lean gull
#

you mean like the thing that if it's named after the class then it runs when the glass is referenced?

summer scroll
#

hmm

#

i don't get what you're trying to say sorry

#

can you explain it more?

vague oracle
#

This is why you should learn Java first even just the basics and you would know what is wrong

lean gull
#

can someone help?

vague oracle
#

We did we linked you multiple things that will help you

lean gull
#

could i get an explination on why my code is not working?

quasi flint
#

look at the examples

#

he already statet what you have to do

quaint mantle
summer scroll
ivory sleet
#

Yeah data management is quite difficult

hybrid spoke
summer scroll
eternal oxide
#

Don't forget to give each clan an ID, a UUID to be safe

#

store and read data based upon the ID as players will want to change the clan name

summer scroll
#

noted, thanks

#

i'm guessing if i made this plugin for bungeecord it would be easier? (to sync the clan data)

summer scroll
#

the thing is, clan points is gonna be changed very often and its gonna be hard to sync it

ivory sleet
#

Redis cache and a proper message broker could solve it

quasi flint
#

who needs sync anyways?😂

misty current
#

You can either make it a bungee plugin or have it in each server and use the plugin messaging channel

ivory sleet
#

Plugin message channels are probably not a good option as it uses player connections thus dependent on players being online

misty current
#

Ah yea

#

Well

quasi flint
#

well prob no player online no clan points change

#

i may be wrong tho

ivory sleet
#

The messages you publish in a plugin message channel would be awaiting, and then once a player joined they’d get sent

#

Which can result in a denial of service

summer scroll
harsh gale
#

Hey, does anyone know what the methods are called or if there is a link to the mappings where I can look? This is in the 1.18 and I would like to send that via packets ^^

lavish hemlock
#

what is that fucking font

#

medieval programmer

harsh gale
#

Is that bad? xd

quaint mantle
#

LoL

#

no, not bad, just funny

tardy delta
#

Stone age

#

🪓 ⛏️

crimson terrace
#

well medieval fonts would be fitting for a minecraft plugin, right? Bows, crossbows, sword, plate armor, shields...

tender shard
#

yo everyone I got a weird problem. I wanted to create a plugin that simply bundles the apache commons lang library as it was removed in 1.18. So I just created a new project that simply shades apache commons and relocates it to the old path (org.bukkit.craftbukkit.libs.org.apache.commons.lang3). However, not even this plugin can access classes although Apache Commons is clearly included in the .jar, at the correct path.

package de.jeff_media.compatlib;

import org.apache.commons.lang3.Validate;
import org.bukkit.plugin.java.JavaPlugin;

public class CompatLib extends JavaPlugin {

    @Override
    public void onEnable() {
        Validate.notNull("");
        try {
            Class.forName("org.bukkit.craftbukkit.libs.org.apache.commons.lang3.Validate");
            getLogger().info("Libraries loaded");
        } catch (ClassNotFoundException e) {
            getLogger().severe("Could not load libraries:");
            e.printStackTrace();
        }
    }
}

It anyway results in this:
https://paste.md-5.net/gufoyaruju.cs

Any ideas someone? :/

hybrid spoke
tender shard
#

Obviously Validate is correctly located at the right path in my jar:

paper viper
#

Like they are no longer relocated like such

tender shard
paper viper
#

You have to manually shade it

#

Yeah

#

That’s your best bet

tender shard
#

Didn't you read my text?

paper viper
#

Yeah

tender shard
#

So I just created a new project that simply shades apache commons and relocates it to the old path

paper viper
#

Well the library wasn’t removed

#

It’s relocation just. Changed

tender shard
#

might be but that doesn't help me

#

I manually shaded it to the old path

#

but it's still not found there

paper viper
#

Hmm

tender shard
#

I'm doing this compatlib plugin so I don't have to provide two different versions for 1.17 and 1.18

#

all I want is to provide a plugin that has apache commons included at the old path 😦

quaint mantle
#

guys
how to optimize teleporting like 30 players to a location
player.teleport()

tender shard
quaint mantle
#

so the server wont crash

#

i guess it will crash

tender shard
#

why should it crash?

#

are the chunks loaded where you are teleporting the players to?

quaint mantle
#

cause i remember
there was a minigame plugin that when the game ended and players teleported to spawn, server crashed

#

bedwars1058 was the plugin

tender shard
#

you can use PaperLib to load the chunks before teleporting the players

#

or teleport them async using paperlib

quaint mantle
#

paperapi right ?

tender shard
#

PaperLib

quaint mantle
#

what is that

tender shard
#

google

quaint mantle
tender shard
#

yes

hybrid spoke
tender shard
#

sure

#

one sec

tender shard
#

but as said, the lib is indeed shaded at the correct place, I checked with WinRar and Recaf

#

what I'm trying to achieve is basically a library plugin that simply provides the removed / relocated libraries at their old location so plugins won't break on 1.18

hybrid spoke
#

i am not a maven pro, but what if you force the scope to be compile?

#

and yeah, i know its already in the jar

paper viper
#

and its that mode by default

tender shard
#

and as said, it IS located at the correct location. It seems like the Bukkit classloader is preventing something :/

#

I also opened a forums thread btw, this is really urgent for me 😄

#

anyway I'll try again with compile but I doubt that it changes anything

#

nope, same error 😦

#

btw it does work when I use a package name for relocating that's NOT org.bukkit.craftbukkit...

#

but that doesn't help me because the purpose is to provide it at the old location :/

west oxide
#

hey i have issue

#

so i created new plugin

#

and added a command

#

and everytime i run the command

#

it sends me the usage of it

#

like the one on plugin.yml

hybrid spoke
#

spaces exist

#

use

#

your

#

spacebar

west oxide
#

even if i remove the usage thing

tender shard
#

you are returning "false" instead of "true" @west oxide

eternal oxide
#

does the command work though?

west oxide
#

i tried it on other plugin

#

and made sure everything is same

west oxide
eternal oxide
#

then do as mfnalex said

tender shard
#

the onCommand method returns a boolean. When you are returning false, it shows the usage, when you are returning true, it doesn't

west oxide
# tender shard you are returning "false" instead of "true" <@!798343029697675266>

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class Nick implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (sender instanceof Player) {
          if(args.length == 0) {
             sender.sendMessage("§dPlease provide a username to change nickname to : /nick username");
          }
          else if (args.length==1){
              Player p = (Player) sender;
              p.setDisplayName(args[0]);
          }
          else{
              sender.sendMessage("§cWrong usage , usage: /nick username");
          }
        }
        else{
            sender.sendMessage("§dCommand can only be run by players.");
        }


        return true;
    }
}
eternal oxide
#

returnign false will display the usage, return true to consume the command

west oxide
#

👀

tender shard
west oxide
eternal oxide
#

impossible with that code

tender shard
#

then there's no way that the command actually works. seems like you didn't register the commandexecutor

west oxide
#

import online.shakiz.BwNick.commands.Nick;
import org.bukkit.plugin.java.JavaPlugin;

public class BwNick extends JavaPlugin {
    @Override
    public void onEnable() {

        getCommand("nick").setExecutor(new Nick());

        getServer().getConsoleSender().sendMessage("§dBwNick §fhas been §2enabled.");
    }

    @Override
    public void onDisable() {

        getServer().getConsoleSender().sendMessage("§dBwNick §fhas been §cdisabled.");
    }
}
tender shard
#

show your onEnable and plugin.yml pls

west oxide
#
version: 1.0.0
author: Shakiz
main : online.shakiz.BwNick.BwNick
api-version:  1.8.8
commands:
  nick:
    description: nicks player into new username
    usage: /nick username

#

the command works on my other plugin

#

i just wanted to make it on seperate plugin

#

and literally copied everything and then changed to make it work

tender shard
#

can you upload the whole plugin to github pls? that's probably easier

#

btw api-version 1.8.8 is useless

west oxide
#

||idk how to use github||

tender shard
#

then just zip your project

west oxide
tender shard
#

no

#

it's just useless

west oxide
#

i'll send here

#

i have question how does it know that am trying to change nickname ??

i even tried changing usage on plugin.yml to /nick test and it still sent /nick username

tender shard
#

you said you copy pasted it from your other plugin

#

are you running both at the same time?

west oxide
#

yes but

tender shard
#

well

west oxide
#

i removed the command from the other one

tender shard
#

hm

#

is your plugin even loaded?

west oxide
#

yes

tender shard
#

send your whole latest.log pls

west oxide
#

i tried removing the plugin and then trying again

tender shard
#

?paste

undone axleBOT
west oxide
restive tangle
#

Do you get any errors when the command is run?

west oxide
west oxide
#

i still dont know why tf it shows me "usage /nick nickname" when i changed usage on plugin.yml to "/nick test"

tender shard
#

hm you're not using maven or gradle, I don't have time to test it when I can't simply compile it, sorry

west oxide
#

okay

tender shard
#

better than what? ^^

west oxide
#

than what am using

maiden mountain
tender shard
#

I have no idea what you're using

tender shard
#

it seems like you are not using any dependency / build manager at all

#

so

#

yes, maven/gradle is better than nothing

west oxide
#

ok

tardy delta
#

What's even the purpose of that plugin?

west oxide
#

ty

tender shard
#

changing nicknames

west oxide
#

i'll try to fix and update here

tender shard
#

@west oxide Send me your .jar as DM please

proud basin
tender shard
#

?

brisk estuary
#

you guys are so toxic lol

tender shard
#

yeah this channel is to help people, not to insult them

ivory sleet
tender shard
brisk estuary
#

everytime I see someone asking for help there is a guy criticizing the code

ivory sleet
#

Hmm, yeah, if you’re going to help someone here, you should be purely supportive.

maiden mountain
#

Because those kind of people have nothing better to do

tender shard
maiden mountain
#

I think people forget the fact that everyone was a beginner at some point

tender shard
#

indeed

#

my first plugins were total garbage but I continued and now I got better at doing it lol

maiden mountain
#

Same with me ahaha

#

I remember my first game mod was in javascript

ivory sleet
#

mfnalex

#

are you relocating?

maiden mountain
#

99% copied from existing product and just changing some message and called it my own

ivory sleet
#

It looks like you’re relocating but not shading

maiden mountain
#

Expertise

tender shard
#

there's a screenshot in the forums post showing that it got shaded and relocated correctly

maiden mountain
#

I just figured out i started programming 6 years ago

#

Like wtf, time flies

tender shard
#

my first plugin is 10 years old now lol

maiden mountain
#

Damn, old bloke aint ya?

#

🙃

tender shard
#

26 😄

#

btw we got @west oxide problem fixed

west oxide
tender shard
#

they still had the command declared in their other plugin's plugin.yml

#

so the other plugin simply overrode the command

maiden mountain
#

I'm 20 so go figure when i started programming aha

tender shard
#

my first "coding" was VBScript when I was 6 but that doesn't count 😄

#

then I had a very bad time and decided to learn PHP

#

finally I got to java in school at some point

maiden mountain
#

Finding my passion saved me from Depression

tender shard
#

but that still doesn't help me with this stupid apache commons thing D:

west oxide
maiden mountain
#

Gets stoned to death for saying that

#

But i mainly work with C# and now Java for mc modding

tardy delta
#

my teacher is trying to learn me C#

#

but my knowledge of it is bigger than his 😳 🤞

chrome beacon
#

Same I have Java class in school

tardy delta
#

i had java class in school

#

with blueJ 🥺

chrome beacon
#

Netbeans 🥺

tardy delta
#

mwoaaa

maiden mountain
#

Eclipse 🤢

quaint mantle
#

Ohoh netbeans

tardy delta
#

using vs for c# now

#

i dont like it

quaint mantle
#

i used it in my class years ago

tardy delta
#

intellij is much better compared to it

chrome beacon
#

VS is sloooow :(

hybrid spoke
#

luckily i started with java

tardy delta
#

blueJ compile time half a second 🤓

chrome beacon
maiden mountain
#

I started with C#

#

Been doing it for 6 years now

tardy delta
#

imagine starting with cpp

#

that would be fun i guess

#

just doing the basic stuff

#

and then you see all the possibilties

#

🌝

chrome beacon
#

So does anyone know how I can use Bluetooth to communicate with my program

#

Language doesn't matter

maiden mountain
#

Write your own Kernal driver 😄

hybrid spoke
#

to start with c++ can be pretty aids but also fun. its also good for learning fast and efficient since its very close to the machine, OOP and is fucked up

tardy delta
#

uhu

chrome beacon
tardy delta
#

i dunno

#

BluetoothSocket?

chrome beacon
#

Link?

hybrid spoke
#

there are many possibilities and i just found 3 by googling "java bluetooth connection"

chrome beacon
#

Ah that's BlueCove the dead implementation I was talking about above

tardy delta
#

heh

hybrid spoke
#

even easier if you dont have any language specification

tardy delta
#

arduino 🤓

chrome beacon
#

Yeah I've been looking around a lot

tender shard
#

btw I got an answer on spigotmc forum explaining why relocating the class doesn't work

#

what the

#

this basically breaks my whole idea

#

now I have to shade apache commons into every of my plugins, so they will all be 700kb bigger >.<

#

I just pinged md_5 on spigotmc, I hope I won't get shot lol

maiden mountain
tender shard
#

uuugh my poor neck

tardy delta
#

heh

tender shard
#

I'm not an instanceof Hanging

tardy delta
#

what the heck is my cat doing

tender shard
#

cat things probably 😄

hybrid spoke
tardy delta
tender shard
#

aaaawww

#

what's its name

tardy delta
#

felix

#

😳

tender shard
#

that's the most generic cat name ever lol

maiden mountain
tender shard
#

very cute though

tardy delta
#

oh that looked like your food or something

hybrid spoke
#

oh are we showing our dinner for today?

tardy delta
#

this tho

tender shard
#

Thats my dinner

young knoll
#

Doge

quaint mantle
#

Wait wha

tardy delta
#

doggo

hybrid spoke
#

@tender shard can you send a selfie? because you are my snack

tender shard
#

lmao

tardy delta
#

😳

#

😳

buoyant viper
#

u eatin the gays?

tender shard
#

no my right eye is swollen, no selfies today

buoyant viper
#

kinda fruity

tardy delta
#

soft meat

quaint mantle
#

you can host craftbukkit src?

tender shard
young knoll
#

So that’s how you get your daily dose of vitamin C

tardy delta
tender shard
buoyant viper
#

Vitamin B(ukkit)

tardy delta
#

vitamin A(lerithe)

young knoll
#

Craftbukkit source is fine

tender shard
#

except for the pluginclassloader, that source is cursed

young knoll
#

Since it’s only patches, it doesn’t contain the actual NMS

maiden mountain
quaint mantle
#

LoL

proud basin
#

shemamabo

tardy delta
#

every time i go programming i forgot my ideas

west oxide
#

and then i remember them and realize idk how to lol

tender shard
#

I just ping my todo list people and let them add my ideas to my kanban board lol

tardy delta
#

omg

tardy delta
#

mee6 is my todo list

hybrid spoke
#

and i just add things to my todo and never do them

tardy delta
#

auwch

tender shard
#

that's also a good idea

hybrid spoke
#

later opening the todo while idling in my ide

#

seing the amount of todos

#

closing both

tender shard
#

I know that feel

#

I already get annoyed by just seeing the todo list and that's only one plugin ....

maiden mountain
#

Which app do you use?

tender shard
#

I don't remember

#

let me check

#

wekan

#

installed through snap

#

snap install wekan

#

of course you'll need a reverse proxy if you already got a webserver running

hybrid spoke
#

trello but with a better boards ordering

maiden mountain
#

Trello vs Github projects board

tender shard
#

yeah trello is actually the best

#

but I like to selfhost stuff and wekan comes really close to trello

hybrid spoke
#

is it possible to get your trello-boards like in wekan?

tender shard
#

sure

#

wekan can import from trello

hybrid spoke
#

i mean like that its on the top

mighty pier
#
    @EventHandler
    public void MobSpawn(EntitySpawnEvent e){
        Entity entity = e.getEntity();
        entity.setCustomName("§cMeat");
        if (entity.getType() == EntityType.CREEPER){
            
        }
    }
}```
how do i ignite the creeper?
tender shard
hybrid spoke
tender shard
#

Creeper#ignite

hybrid spoke
#

then cast it to a creeper

mighty pier
#

ok

hybrid spoke
#

and ignite

tender shard
#

yes

#

@hybrid spoke you want to use wekan and trello and have both in sync?

#

if so, no I don't think that's possible^^

hybrid spoke
#

well not its more like a visual setting in trello

#

that you dont have to go to your board dashboard or over a dropdown menu to change the board

hybrid spoke
tender shard
#

ah I understand

buoyant viper
#

wait using snap but on windows?

tender shard
#

actually that's also not all boards, that's just all the boards the user has starred

buoyant viper
#

wait thats the server not the

tender shard
#

it doesn't actually show all boards

buoyant viper
#

im smart

tender shard
buoyant viper
#

snap

tender shard
#

oooh I get it

#

snap is installed on the server, yes 😄

#

debian 11

buoyant viper
#

i was idiot and thought u used it on ur machine

#

and got confused when i saw windows

tender shard
#

no it's public of course 🙂

#

otherwise I couldn't force my people to add things for me there lol

buoyant viper
tender shard
#

I'm only on windows right now to play MSFS and Anno 1800 😄

#

normally I'm on Linux Mint ❤️

buoyant viper
#

hmm

tender shard
#

and debian for all the servers

buoyant viper
#

been thinking about fedora recently

tender shard
#

oh and one server is on ubuntu because CheckMK doesn't run on Debian 11 -.-

buoyant viper
#

f

tender shard
#

yeah but it's rolling release, isn't it?

buoyant viper
#

idk

tender shard
#

idk fedora is probably fine but I like to stick to what I already know

#

that's why I keep using Debian, also the major upgrades are always awesome done within 10 minutes without any problems

buoyant viper
#

im just scared debians gonna be hell with proprietary drivers

tender shard
#

well linux mint is based on debian but I never had any driver problems on the desktop

tardy delta
#

manjaro 😳

tender shard
#

even my ASIO soundcard is working fine

buoyant viper
#

cant say im fond of arch

tardy delta
#

raspberry pi smh

buoyant viper
#

mmm raspbian

tardy delta
#

raspbian goes brr so i thought lets choose something else

tender shard
#

raspbian is fine, isn't it?

#

I got it running for 3 years now

tardy delta
#

mwoa

tender shard
#

maybe I should run apt again lmao

tardy delta
#

i have the money to buy a server but uhh yeah

#

i'm stupid

tender shard
#

I recently got my first dedicated server

#

well, renting it

#

the hostname is kidney

#

what hostnames are you people using? I always use parts of the body 😄

buoyant viper
#

been looking to change my server host actually, from ovh over to hetzner

tender shard
#

the jumphost is called leg, mailserver is eye, gameserver is kidney, webserver is lung, etc 😄

tardy delta
#

scary

tender shard
buoyant viper
#

yeah hetzner would be around $5 cheaper than my current ovh plan for the same hardware specs

hybrid spoke
#

ew, netcup

buoyant viper
#

so as soon as my commitment runs out

#

im switching

tender shard
#

what's wrong with netcup? 😄

hybrid spoke
#

they want every information about me

#

the servers seem to be good

tender shard
#

they have to know who to sue when you do shit 😄

#

the servers are AWESOME for the price

hybrid spoke
#

yeah but for that they dont need every information

#

i can live with my name, email, phone and adress

tender shard
hybrid spoke
#

but they want way more

tender shard
#

I hope I'm allowed to send the link here

#

it's no ref link or anything

tender shard
#

I'm there since 2018 and I can confirm the servers are indeed awesome

#

I'll try to get the RS 2000 G9 for 11.20€ instead of 16€ on friday

#

but it will probably be sold out within minutes

hybrid spoke
#

i will choose hetzner/OVH anyways over netcup

tender shard
#

yeah hetzner is nice too but you pay like 1.5x as much as netcup

hybrid spoke
#

currently at contabo for discord bot hosting and small mc testserver, but their VPS are shit

tender shard
#

oh contabo is one of the worst hosters I ever had

#

for VPS

maiden mountain
#

i disagree

buoyant viper
tender shard
#

but you get a free firework show

buoyant viper
#

only in france

maiden mountain
#

I use contabo and never have issues

tardy delta
#

looking for self hosting 😳

tender shard
#

also their IO is slow as hell even when you have SSDs

#

but maybe that changed meanwhile

#

my last server there was 1-2 years ago

maiden mountain
#

The changed allot

#

I even had a Rust server on their vps

#

Runs perfect

tender shard
#

let's compare servers with benchmarks 😄

maiden mountain
#

But now, I only use it to test my Minecraft Plugins

#

all i need

tender shard
#

anyone here has any good alternatives to CheckMK?

west oxide
#

hey question

#

so if i have a hashmap

#

and i want to add to it i use .put ?

tender shard
#

yes

west oxide
#

why it doesnt work on this case ?

     message.put("test","more test","even more test");```
#

it shows error when i try to write .put

tender shard
#

yes

#

it requires 2 arguments, not three

opal juniper
#

just use

Map<String,String> message = new HashMap<>();
crimson terrace
#

A Hashmap has a key and a value

#

if you want a key to have more values you need to use a set or a list as a value

west oxide
#

nvm that didnt work

tender shard
#

what are you trying to do?

west oxide
crimson terrace
#

what does it say

tender shard
#

a HashMap is like a phone book

#

e.g. Name -> Phone Number

west oxide
tender shard
#

you cannot map three objects together

crimson terrace
#

well its red because you didnt put the () behind it

west oxide
crimson terrace
#

and you need to add the values in the () so that it doesnt show an error anymore

#

message.put("Hello", "test");

tender shard
#
HashMap<String,Integer> ages = new HashMap<>();
ages.put("mfnalex",26);
ages.put("Obama",60);
System.out.println(ages.get("Obama")); // <-- will print "60"
crimson terrace
#

then you can get the result "test" by typing message.get("Hello");

west oxide
tender shard
#

you are probably not inside any code block

cedar dawn
#

@west oxide it needs to be inside a method

hybrid spoke
#

inside a code block*

tender shard
#

btw reading the error messages most of the time tells you what's wrong

tardy delta
#

aarh whats the difference between float and long again?

tender shard
#

you cannot run statements outside of code blocks

tender shard
west oxide
tender shard
#

long are just long integers

tardy delta
hybrid spoke
#

not really

#

a float doesnt need decimals

tender shard
#

3.141592653589793238 is a float. when casting it to a long, you'll end up with 3

tender shard
#

of course you can store 3 as a float but it will end up being stored as 3.0000000000

opal juniper
#

depends where the jvm puts the point, im unaware of how it implements the mantissa / exponent shit

tender shard
#

oh btw speaking about floats

#

there's this awesome video on youtube which explains the quake fast inverse square root thing

opal juniper
#

i have seen it

tender shard
opal juniper
#

yeah

tender shard
#

definitely worth to see for everyone interested

tardy delta
#

saw that on yt

quaint mantle
#

Too hard for my smol humanitarian brain

vernal pier
#

there reason why all the schedular stuff keep askin for my plugin instance

opal juniper
#

cause it wants it

#

idk

#

there is some reason

#

under the hood

#

that it needs it

#

not exactly a deal breaker?

dark wasp
#

Does anybody know if SpigotMC provides a rest API to access the buyers list of one of my own plugins? (pls ping)

austere cove
#

no but u can fetch it anyways thru the html body

ancient plank
#

that's all I know abt the website api

austere cove
#

nah that doesn't have an endpoint for getting the buyer list

ancient plank
#

ye

austere cove
#

You can send a request to

https://www.spigotmc.org/resources/<id>/buyers?page=<page>

(note that the request needs to be authenticated)

and parse memberListItem
but glhf doing that

ember estuary
#

If MapRenderer#render() gets called every tick (atleast thats what someone on spigot.org said), why do maps on the client only update every ~15 ticks?

#

Does the client just refresh the map every 15 ticks, but get packets for the map every tick? or does he only get a packet every 15 ticks?

#

In other words: Can i make a 20 fps map by sending the map packets myself?

lusty cipher
#

anyone know how I can get a ProtectedRegion from a location through the WorldGuard API?

#

ah I think I figured it out. WorldGuard.getInstance().getPlatform().getRegionContainer()

lusty cipher
#

if I softdepend, does that also guarantee my plugin is loaded after the other plugin?

paper viper
#

the plugins are loaded before your plugin yeah

#

but they arent necessary to load your plugin the first place. its like sorta addons and shit

west oxide
#

just crashed server using for loop feeling good 👀

crimson terrace
spare prism
#

is there a way to pass a method into the superclass constructor without using static?

crimson terrace
#

why dont you wanna do it with static?

west oxide
#

all this time to fix it lol

spare prism
dawn phoenix
#

Anyone happen to use pipelines with gitlab?

ember estuary
#

Does the Client only update its surroundings or process packets every tick?
Or can i send a Packet 60 times a second to visually change a block 60 times a second?

crimson terrace
#

A server runs at 20 ticks per second, I think the client updates as often as you have fps

#

the problem would be that the server probably wont send 60 packets a second

ember estuary
#

not even if i use a normal (non-bukkit) scheduler?

#

is the sendPacket NMS limited to 20 tps?

crimson terrace
#

try it 🙂

lavish hemlock
#

you can't fucking stop me

crimson terrace
#

appearently its not possible to do anything more than 20 times per second

ember estuary
#

alright

crimson terrace
#

so i was wrong, even the client works at 20tps

ember estuary
#

alright, thats why i asked

#

thank you

#

sad, but good to know

eternal oxide
#

Pretty sure that thread is wrong.

#

You can send packets faster than 20 per tick and they will be sent

lusty cipher
#

I'm getting a NoClassDefError on com/sk89q/worldguard/protection/flags/Flag. It's expected that the class doesn't exist, but the exception shouldn't happen, I'm not shading nor do I have it installed, testing how the plugin works without it.

Am I not allowed to cast to classes that are not loaded? What gets loaded when the class gets loaded at first? I've specifically not used any class members with types that don't exist in vanilla Java.
https://pastebin.com/FDCYB0fM

crimson terrace
#

but the client wont process them at a faster rate than 20 tps

ember estuary
#

will be sent, yes.
but the client will only process them every tick

eternal oxide
#

You may run into a bandwidth issue, but the client will process packets as fast as it receives them

ember estuary
#

i think thats true, but idk, dont have a client open right now

quaint mantle
#

Hey! Im currently learning to develop spigot plugins. Everything works, i just now want to do a build system. Bascially i tried the maven thing, but it seems dififcult (atleast to me). I wanna setup gradle groovy. https://www.spigotmc.org/wiki/build-you-spigot-plugin-with-gradle-groovy/ will this work on Eclipse IDE?

tardy delta
#

dont

crimson terrace
#

use maven

eternal oxide
#

The client has to process packets faster as you have multiple things happening in a tick. It can;t only do one per tick

latent ocean
#

what is better mcmmo or aureluimskills ?

crimson terrace
eternal oxide
#

different case, thats not packets

quaint mantle
eternal oxide
#

if you use packets to change a block faster it will be displayed on the client

latent ocean
crimson terrace
lusty cipher
ember estuary
#

how do you know, @eternal oxide ?

#

not saying ur wrong, just wondering

eternal oxide
#

ArmorStand animations

quaint mantle
crimson terrace
#

did you make them do the gangnam style Elgar?

#

if not, whats the point

ember estuary
#

can you actually visually tell the difference between 20fps armorstand animation and higher?

#

gotta try that, would definetly proof ur point

#

is there a plugin?

crimson terrace
#

ive gotta look at sending packages too. havent gone too far into that

ember estuary
#

same

#

i wanna do an emulator on a map (which the player holds in his hand). thats why im asking

#

would love if it was 20fps or even more

#

right now it only updates like every 10 ticks or so (on the client side)

quaint mantle
#

Are you trying to find another reason to use packets

ember estuary
#

xD

#

why do you hate packets that much xD

crimson terrace
#

me sending packets

quaint mantle
#

I dont hate packets. I hate when people use them even if there's better and more stable ways. Packets are internals that changes, like every minecraft versio

ember estuary
#

well then whats the better way to get a map to refresh more often than every 10 ticks?

#

dont think there is any

#

cant u use reflections or stuff like that to make nms work across versions?

#

atleast i heard of that, didnt look further into it

ember estuary
quaint mantle
ember estuary
#

I see

crimson terrace
#

can you just set the item in the players hand to an updated map?

#

or am I thinking of something the wrong way

ember estuary
#

maybe, but i think thats gonna play the open-map-animation again

#

i can try

crimson terrace
#

cuz if that works the at least 20 fps on the map could be possible

ember estuary
#

true

spare prism
#

Is there a way to pass a method into the superclass constructor without using static?

final fog
#

Does anyone know a way to use an offline player in a command argument?

tardy delta
#

Wut

#

From name?

final fog
#

Yeah

tardy delta
#

Bukkit.getofflineplayrr

#

Which takes a string

final fog
#

oh wait

#

I could've just done that

#

I was over thinking it

dawn phoenix
#

Anyone have experience with gitlab pipelines? Trying to find an image with java 17 to build a plugin with and it keeps telling me none exist

ember estuary
#

@final fog keep in mind that people can change their name. just saying

final fog
#

I'm storing uuids

#

dont worry

ember estuary
#

alright

ember estuary
#

gotta use packets then

#

but might be limited client side

#

to like 2 fps

#

which i dont hope

full forge
#

playing around with bukkit scheduler, i got an error that said The blank final field plugin may not have been initialized on line 13 when starting my server. doesnt seem right, since when i try to initialise it, it says Cannot instantiate the type JavaPlugin

code:

    
    private final JavaPlugin plugin;
    
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        
        if (sender instanceof Player) {
            Update.p1.add((Player) sender);
            Update.p2.add(Bukkit.getServer().getPlayer(args[0]));
            BukkitTask task = new Update(this.plugin).runTaskTimer(this.plugin, 6000, 6000);
            return true;
        }
        return false;
    }
}
pliant loom
#

can anyone help me with setting an egg's velocity?

#

whenever i spawn it in, it always just dies almost immeidately

#

even when i set the velocity

quaint mantle
#

is there a good guide to setup maven for plugin coding on Eclipse IDE?

quaint mantle
pliant loom
#

im on java 16

tardy delta
#

but if you only have a name you can use it

ember estuary
#

Fishy try passing the instance of your main class (which extends JavaPlugin)

tardy delta
#

it can perform a web lookup tho so you might consider to do it async

ember estuary
#

or just make the main a Singleton, and use MyMain.getInstance() instead of this.plugin

pliant loom
#
Vector vector = p.getLocation().add(0, 0.5, 0).toVector().subtract(bossEntityLocation.toVector());
Egg projectile = (Egg) Bukkit.getWorld(bossEntityLocation.getWorld().getName()).spawn(bossEntityLocation.add(0, 1.5, 0), Egg.class);

getLogger().info(vector.toString());
projectile.setVelocity(vector);

anyone got any clue why this wouldnt work? it works if i apply the velocity to the player

plain river
#

I'm probably being very stupid, but how do i do something like this: /broadcast H E Y and make it send [CONFIGPREFIX] H E Y. I know how to do it a hard way, but not that im willing to do.

The way im thinking of: ChatColor.translateAlternateColorCodes('&', Main.getPlugin().getConfig().getString("prefix") + args[0] + args[1] + args[2] ...
but I have no idea how many args are going to exist

tardy delta
#

stringbuilder?

#

for loop

#

but it starts with args[0] so use String.join(" ", args)

full forge
#

this error message is very useful to me

ember estuary
#

whats it caused by?

#

there has to be more error

full forge
#

running the command :P, its not very specific on what

ember estuary
#

that cant be ur whole log lol

full forge
#

looks like the scheduler

pliant loom
#

send the whole error log

full forge
#

do you want the whole log

#

yeah

ember estuary
#

yea

#

ofc

#

how else am i gonna tell what the error is xD

tardy delta
#

?paste

undone axleBOT
ember estuary
#

error logs are mostly like
at:
at:
at:
...
Caused by: <-- important
at:
...

#

or just ats, then look at the first

ember estuary
pliant loom
#

no cause whenever i apply the velocity to the approaching player, im flung back

#

and it takes a few seconds for me to completely move

ember estuary
#

hmmmm weird

latent ocean
#

um

ember estuary
#

what

latent ocean
#

can anyone tell me which better mcmmo or aleruimskills

mighty sandal
#

Hey does anyone know how to switch the version of a premade server on 1.17 to 1.18 when it comes out. (basically upgrading the server's version) and have the all progress be saved just new items to get will be available along with newly loaded chunks be in chunks in 1.18?

pliant loom
ember estuary
#

xD

#

cant expect me to help if i dont know the error xD

languid sonnet
#

hi whit speak french please for help

ember estuary
#

im german, sorry

languid sonnet
#

😦

#

ok its for to a launcher of so

#

a image of 2game on minecraft

full forge
#

i am now on discord web version

#

i couldnt talk here for some reason

#

anyway heres the log

#

test

#

there we go finally

late sonnet
ember estuary
#

so yeah, getplugin basically. u got any idea @late sonnet ?
My idea was to simple make the main a singleton and use that

#

thats what i am doing all the time, works just fine, idk if its bad practise or if theres a better way tho

crimson terrace
#

wouldnt it be better to just use <MainClass>.getInstance() ?

ember estuary
#

thats what i just said yeah

#

public class MyMain extends JavaPlugin {
private static MyMain instance;

@Override
public void onEnable() {
    instance = this;

   ...
}

public static JavaPlugin getInstance() {
return instance;
}

#

thats my standard main @full forge

crimson terrace
#

then you have a standard static getter for instance

ember estuary
#

and then you can, in your other class, do MyMain.getInstance();

crimson terrace
#

and then you call that anywhere to get your instance

ember estuary
#

yea

#

is my code right now @crimson terrace ?

#

i always make the instance public cuz i prefer MyMain.instance.whatever

#

but bad practise

#

xD

crimson terrace
#

wasnt bad code, sorry if I said something along those lines

ember estuary
#

it was :D

#

if I call it singleton i gotta do it right

#

xD

full forge
#

and then i just say private Main plugin = Main.instance;, correct?

ember estuary
#

you could, yeah

#

or just use "Main.instance" all the time, instead of "this.plugin"

late sonnet
ember estuary
#

should both work

mighty sandal
#

Hey does anyone know how to switch the version of a premade server on 1.17 to 1.18 when it comes out. (basically upgrading the server's version) and have the all progress be saved just new items to get will be available along with newly loaded chunks be in chunks in 1.18?

full forge
#

well either way it worked, ty

ember estuary
ember estuary
fickle helm
#

is there any event fired when a player is using a spyglass? I checked PlayerInteractEvent and nothing was fired

tardy delta
#

why do people put instance = null in their onDisable?

#

for a reload?

#

because the jvm doesnt shutdown?

quaint mantle
dawn phoenix
#

any encounter git issues on gitlab pipelines?

36A problem occurred evaluating project ':Heroes'.
37> Cannot run program "git": error=2, No such file or directory
38* Try:

latent ocean
#

what is better mcmmo or alleruimskills

tardy delta
#

hmm

#

npr

latent ocean
#

?

tardy delta
#

but if the plugin is disabled can another plugin still call methods from it?

#

no classnotfound or something?

tardy delta
latent ocean
#

ye ik

quaint mantle
#

Bukkit.getPlugin will return null for disabled plugin but not getInstance

#

unless you set the instance to null manually

#

(Dependency injection is still better)

tardy delta
#

ah

ember estuary
#

Can i cast a MapCursor (org.bukkit.map) to a MapIcon (net.minecraft.world.level.saveddata.maps) ?

#

doesnt have a handler :(

ivory sleet
#

Probably not

eternal oxide
#
getMapIcon
@Nullable
public MapCursor.Type getMapIcon()
Get the MapCursor.Type that this structure can use on maps. If this is null, this structure will not appear on explorer maps.

Returns:
    the MapCursor.Type or null.

ember estuary
#

that just gives the type :/

#

i dont think thats what i need

eternal oxide
ember estuary
#

my MapCursor doesnt even have that function huh

mighty sandal
#

How long after 1.18 will release will spigot have server version 1.18 ready?

eternal oxide
#

4

round finch
#

Uh?

 public static JavaPlugin getInstance() {
    return instance;
  } 

i used to do

public static MainClass getInstance(){

return instance;
}
ivory sleet
#

?1.18

undone axleBOT
#

There is no ETA. Having an ETA leads to unrealistic deadlines, false hope, and a bad product. It will be ready when it's ready.

mighty sandal
#

Oh

#

Woops

#

Okay

ivory sleet
#

😅

west oxide
#

?paste

undone axleBOT
ivory sleet
west oxide
#

hi conclure

ivory sleet
#

Hola (:

mighty sandal
#

How long did it take for spigot 1.17 to be released?

west oxide
#

and

ivory sleet
mighty sandal
#

Okay

round finch
ivory sleet
#

Because the latter exposes your plugin instance’s full type

west oxide
ivory sleet
#

So with the assumption that you’d have some getters for managers and what not in your main plugin class, then you’d be able to get those through the singleton

#

If you’re now gonna use the singleton

#

shakiz

#

You’re creating a new object of BwCore

#

So in principle

#

You got two or more objects of type BwCore floating around (at least that’s what you’re trying to achieve)

ivory sleet
#

Oh yeah we didn’t cover objects right

west oxide
#

uhh can you show me part of code where that happens ?

ivory sleet
west oxide
#

that's just 1 ?

#

uhh

proud basin
#
private BwCore plugin;
public CreateTag(BwCore plugin) {
this.plugin = plugin;
}```
west oxide
#

ayyy

#

fixed

#

thanks everyone

thorn beacon
#

Good afternoon all, what do I need to do in order to have ${project.version} replaced?

ivory sleet
#

Gradle or maven?

thorn beacon
#

Oh yes, maven

ivory sleet
#

Ah @eternal oxide might be able to assist then (I use gradle)

thorn beacon
#

mkay, thanks anyway for passing it on :)

livid tundra
#

how do I use a persistantdatatype?

quaint mantle
livid tundra
#

entity

quaint mantle
#

anyways

#

?pdc

tardy delta
#

when is the clearactions called?

quaint mantle
ember estuary
#

How can i stop the player from looking around (clientside)?

#

besides making him spectate an entity

quaint mantle
tardy delta
#

oke

livid tundra
#

how can I give a player an item instantly?

quaint mantle
livid tundra
#

thanks!

quaint mantle
#
Map<Integer, ItemStack> leftovers = player.getInventory().addItem(item);

if (!leftovers.isEmpty()) {
    int amount = 0;

    for (ItemStack item : leftovers.values()) {
        amount += item.getAmount();
    }    

    player.sendMessage(amount + " items could not be added because your inventory is full.");
}

if u wanna add an inventory full check

#

just thought id send this

ember estuary
#

Controllable cursor! :D
Now i just gotta find out how to get rid of the stuttering. any ideas?

quaint mantle
#

you cant

ember estuary
#

:/

quaint mantle
#

i mean maybe you could control it with vectors and stuff

#

to try and make it more smoothe

ember estuary
#

probably gonna allow the player to turn and then tp him back if he reaches pitch 90 or 45. would be smoother i guess

#

thats my only idea

#

any better idea? xD

#

right now i tp him back everytime he looks around even a little bit

#

tp him back = reset where hes looking

#

the problem is if he looks all the way down (pitch 90), he cant look any further down

#

therefor not being able to move the cursor down further

livid tundra
#

how do I make a custom command?(is there a tutorial?)

west oxide
#

hey i have a question ...

    test: test
    test2:Testt

for example this is config file and i want to get all the elements in "Tags"
so like test and test2 in this case

west oxide
#

1 sec

ember estuary
west oxide
livid tundra
#

thanks!

west oxide
#

because i want to make them in gui

red sedge
#

yh

ember estuary
#

no problem ^^

west oxide
red sedge
#

look into docs about it k?

west oxide
# livid tundra thanks!

https://www.youtube.com/watch?v=r4W4drYdb4Q

i am currently following this series if you want (am learning too)

Howdy all and welcome to my all-new series for Plugin Development! New videos every Monday. Join my discord for help and more :)

Download Eclipse: https://www.eclipse.org/downloads/packages/release/2019-03/r/eclipse-ide-java-developers

Download Java Jre: https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

Down...

▶ Play video
red sedge
#

config.getConfigurationSection(key)

#

smth like this

west oxide
#

ok

#

i'll look in docs

west oxide
tardy delta
#

i dont understand why it would make sense if you instantiate a command class with the constructor that you have to give a plugin instance which the command class uses to call super(plugin) with
if every command does that with the same instance, whats the point? it never gets modified again?

eternal night
#

register your command in the plugin.yml

#

triple check the spelling

tardy delta
#
class Base {
  private Plugin plugin;
  public Base(Plugin plugin) {
    this.plugin = plugin;
}
}

class Derived extends Base {
  public Derived(Plugin plugin) {
  super(plugin);
}
}```
whats the point of doing this every time with a command class so the plugin is always replaced with the same?
#

new Derived(this)

coral helm
#

FileConfiguration Set

livid tundra
#

how do I get a Player from a username

eternal night
#

probably type that question into google

livid tundra
#

but should I use getplayer, getplayerexact, or matchplayer?

waxen plinth
#

getPlayer

#

getPlayerExact if you have the exact name

livid tundra
#

what does it mean by exact name?

tardy delta
#

exact name

livid tundra
#

what's the difference between a normal name and an exact name?

tardy delta
#

getPlayer("fourteen") can return fourteenbrush is fourteenbrush is online

#

getPlayerExact("fourteen") would return null

livid tundra
#

oh

#

how do I get the plugin in a command class?

proud basin
#

Anyone know how I can fix this? ```
'java' is not recognized as an internal or external command,
operable program or batch file.

#

It's defined in system variables

glossy venture
#

you have to restart cmd

#

or terminal

proud basin
#

I have

#

anyways I fixed that part but it won't let me change back from 16 to 1. 8

spare kestrel
#

Hello everyone i hope your all doing good, i have a little question : how can i change the color of the player name above the player head ?

jade grove
#

i know this isnt a spigotmc related question but here goes:

im trying replace two strings ("%online%" and "%player_name%") however it doesnt return with the value i want to replace it with, it just returns %online% for example

code:

    @Override
    public List<String> getLines(Player player) {
        return plugin.getConfig().getStringList("scoreboard.lines"
                .replace("%online%", Bukkit.getServer().getOnlinePlayers().toString())
                .replace("%player_name%", player.getName()));
    }```
#

im using missionaryboard as a scoreboard library

livid tundra
#

what value does online and/or player_name store? if it's a string, try directly putting the variable instead of surrounding it with "%

jade grove
west oxide
jade grove
#

the % represents a placeholder in the configuration file

jade grove
livid tundra
#

are you sure it didn't replace it? maybe the method returns the value before replacing?

livid tundra
#

how are you checking if it's replaced

jade grove
#

im quite literally using the java.lang replace method

tardy delta
#

^^

eternal night
#

that also won't work

#

I mean

#

ah xD

tardy delta
#

Bukkit.getServer().getOnlinePlayers().toString()); goes brr

#

idk if that returns a list or a set