#help-archived

1 messages · Page 213 of 1

lone fog
#

You would want to read it into a variable, remove the item, and then set it again

dusky sigil
#

ill try

blazing burrow
#

@subtle bison thanks changing the api version makes it work

subtle bison
#

glad i could help

blazing burrow
#

yeah

#

so what doesthe api version do?

dusky sigil
#

didnt work

lone fog
#

Tells spigot what version your plugin is meant for

subtle bison
#

it basically gets which minecraft version of blocks, items etc is gonna be used

lone fog
#

In this case it tells spigot to use the new Materials rather than the legacy ones

blazing burrow
#

ahh i see

dusky sigil
#

@blazing burrow it tells spigot what minecraft version youre using. If youre using blocks from 1.13 than spigot wont know what they are unless you specify your version

subtle bison
#

yeah

river cradle
#
public NPC(Location location, String name, String skinURL) {
    this.location = location;
    this.name = name;
    
    final MinecraftServer server = ((CraftServer)Bukkit.getServer()).getServer();
    final WorldServer world = ((CraftWorld)Bukkit.getWorld(location.getWorld().getName())).getHandle();
    final GameProfile gameProfile = new GameProfile(UUID.randomUUID(), name);
    
    final String[] skin = getSkin(skinURL);
    System.out.println("VALUE:");
    System.out.println(skin[0]);
    System.out.println("SIGNATURE:");
    System.out.println(skin[1]);
    
    gameProfile.getProperties().put("textures", new Property("textures", skin[0], skin[1]));
    
    entityPlayer = new EntityPlayer(server, world, gameProfile, new PlayerInteractManager(world));
    entityPlayer.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    
    addNPCPacket();
}

Assuming that my value and signature are correct, what is my error? (The NPC's appear as Steves/Alexes). Or are my value and signature wrong?

subtle bison
#

legacy one are below 1.12

#

ones

blazing burrow
#

okay

#

so which one does it do by default?

lone fog
#

Legacy I gusss

subtle bison
#

you need to specify api version if you wanna use legacy

lone fog
#

1.12 and below don’t have an api-version

subtle bison
#

wait

#

wth im lost

blazing burrow
#

ohhhh

#

bruh xd

subtle bison
#

yeah he is right

blazing burrow
#

okay thanks

dusky sigil
#

anyone has any idea about my problem?

subtle bison
#

@blazing burrow if you are working with items and its not working i recommend adding api version

blazing burrow
#

mhm i see

subtle bison
#

also it will tell you that you need to specify api-version in your console

#

so checking console is just a good way

blazing burrow
#

ohh makes sense

#

i mean

#

my console so much spam xd

lone fog
#

You should set it to match the version you are developing for

subtle bison
#

LMAO

blazing burrow
#

okay so its better to do api 1.16 since im doing 1.16

lone fog
#

Yes

subtle bison
#

also api versions are always only first releases of the mc version

#

like 1.13, 1.14, 1.15, 1.16

#

never 1.16.1

#

atleast i dont think

blazing burrow
#

oh okay thanks

subtle bison
#

@dusky sigil try to ask some better coders than me here bcs im not really experienced with configs

#

new to bukkit too

dusky sigil
#

spigot*

#

ok, thanks for being honest about it though

silver pewter
#

Why is so hard to get a premium plugin verified lol

inland oxide
#

the more you want something, the greater the resistance

subtle bison
#

woah

#

that actually sounds like my fricking life xddd

inland oxide
#

yeh, as soon as you don't care, it falls into order in the universe

silver pewter
#

I want to provide a great plugin with full support and updates every week for a fee of $10.50

inland oxide
#

oh dear.

balmy sentinel
#

If it's a common plugin or a plugin that already exists they won't accept it.

inland oxide
#

another capitalist

#

need to realize that money flows to you when you aren't trying so hard

silver pewter
#

It's a plugin that exists but with a lot more features

inland oxide
#

the more you try to chase it, the harder it is

#

better to invest your energy in good karma

silver pewter
#

I ain't trying to chase the money

inland oxide
#

oh, so it's the pride?

silver pewter
#

Yeah and to support people

inland oxide
#

well, then open source

lone fog
#

More features does not always mean good

balmy sentinel
#

what even is the plugin

inland oxide
#

better be good

balmy sentinel
#

if it's a plugin not worth being premium, they will also not accept it.

#

For example, if anyone could code it.

inland oxide
#

especially if its a fork of someone elses plugin

#

well, anyone can code a plugin

river cradle
#

Hi there, if I try to change the skin of an NPC to a certain value and signature and

gameProfile.getProperties().put("textures", new Property("textures", value, signature));

doesn't work, does that mean my value and signature are wrong?

sturdy oar
#

It took 16 days for me to get resources approved

#

Just wait

inland oxide
#

I think mine was in a weekend.

#

but they know me

#

then they convinced me to give it away for free

#

well, that's the story i'm stickin with

sturdy oar
#

I just have 1 premium. I don't think I'll do any more premium resources, I expected more downloads tbh

inland oxide
#

yeh, asking minecrafters for money, its like blood from a turnip

balmy sentinel
#

I mean I get some premium resources, but some of them should definitely not be premium. If you want money go to a server a code for them or look at people hiring devs on the forums.

silver pewter
#

I'm making this ```
A Plugin with 2 systems
System 1:
Guild
Rewards
Bank
Unlockables
Levels
XP
Privacy
Player Limit
Fully Configurable
System 2:
Party
Mini-Challanges
Player Limit
Levels
Unlockables
Rewards
Points

they can disable party or guilds or have them both on```

sturdy oar
#

I just use Parties

inland oxide
#

yawn.

frigid ember
#

hey kludge 😊

inland oxide
#

sup

frigid ember
#

great job on your auctionhouse plugin!

inland oxide
#

oh noes, they are chasing me

frigid ember
#

😏

inland oxide
#

must find a rock to hide under

sturdy oar
#

I think I don't get downloads because I don't like making GUIs

frigid ember
#

yes GUIs very important

sturdy oar
#

I know but commands are more reliable

#

And have less load

frigid ember
#

yo do y'all use the spigot api for public use, but the paper one for private use?

dusky sigil
#

you guys should learn to type cuz guis are a PAIN

sturdy oar
#

yo do y'all use the spigot api for public use, but the paper one for private use?
@frigid ember I always use spigot

#

Paper API doesn't offer many things tbh

frigid ember
#

oh shoot, are we not allowed to talk about paper here

#

i mean ehh, it has a couple useful methods

inland oxide
#

correct, the first part

sturdy oar
#

I always end up using NMS so I don't really need extra methods

dusky sigil
#

you - you monster use NMS normally?

#

you like pain or somethin?

inland oxide
#

yes

#

pain is writing new code for a 5 year old.

dusky sigil
#

...okay

#

i guess?

sturdy oar
#

Bro if 5yo pays me I can code whatever they needs

inland oxide
#

5 year old as in 1.8.8

dusky sigil
#

ppl really like 1.18.8

sturdy oar
#

I do as well

#

😳 🤪

inland oxide
#

oh, 1.18.8, a premonition of sorts...

sturdy oar
#

Although I prefer to use 1.12.2 when possible

inland oxide
#

oof, thought i was on the general channel...

sturdy oar
#

Help is general when no one needs help

inland oxide
#

ok, in all seriousness, either someone ask for help or go to the general channel

#

actually, some of us don't have to ask

dusky sigil
#

you can scroll up to my question

#

i have this config: ```yml
factions: ''
players:

  • dfac08af-af88-42ff-8509-8f441bca858b
    factionnames:
  • test
    faction:
    test:
    leader: dfac08af-af88-42ff-8509-8f441bca858b
    Members: 1
    MemberNames:
    • dfac08af-af88-42ff-8509-8f441bca858b
and im doing this:```
cfgtotal.set("faction." + factionname, null);

i looked it up and it SHOULD delete all of the test: making the config look like this:```yml
factions: ''
players:

  • dfac08af-af88-42ff-8509-8f441bca858b
    factionnames:
  • test
    faction:

and it doesnt work!
factionname should be correct..
inland oxide
#

i need a keyboard macro to type something then backspace over and over

balmy sentinel
#

are you saving it correctly after editing the file?

dusky sigil
#

yes

#

you mean cfgtotal.save?

#

yeah

balmy sentinel
#

what is cfgtotal?

#

also databases are better for saving data then yml

dusky sigil
#

cfgtotal is a config file that - get this, EXISTS

#

also

#

SQL is pain i cant get it

#

its NOT

#

an arraylist

#

i even tried deleting it that way

frigid ember
#
    private void saveData() {
        for (Map.Entry<UUID, List<Data>> map : dataMap.entrySet()) {
            getConfig().set("deathlocation." + map.getKey(), map.getValue());
        }
        saveConfig();
    }```
Would this be a good option to save my hashmap since it exists of uuid, data
#

and data has 3 values

balmy sentinel
#

SQL is easy to learn and it's free so I really don't get what you mean by that. Meh, I never save anything in a yml file anymore besides NPC locations.

#

why are you trying to save a hashmap?

frigid ember
#

yes

balmy sentinel
#

@dusky sigil give me a sec looking on the forums for a solution, I don't really use yml files.

inland oxide
#

would need to see your config code

frigid ember
#

whys that

#

xd

#

it should automatically generate the deathlocation.?

inland oxide
#

cfgtotal is FileConfiguration?

dusky sigil
#

yeah

frigid ember
#

ohh to someone else

inland oxide
#

if you get the ConfigurationSection for faction then try to set "test" to null what happens?

frigid ember
#

why are you trying to save a hashmap?
@balmy sentinel save&load onrestart

#

otherwise the data will be lost?

balmy sentinel
dusky sigil
#

saw that

balmy sentinel
#

rippp

dusky sigil
#

lol

#

im doing the exact same thing

balmy sentinel
#

If you want to save the data why are you storing it in a hashmap in the first place? If you really want to persist over restart use a yml file or a database @frigid ember

frigid ember
#

yes

#

.yml file

#

thats what I said didnt I?

#

but is this way of saving that value a good option?

balmy sentinel
#

yes, but my point is if you're trying to save it why are you putting it into a hasmap in the first place just put it in a yml file as soon as you get the info

frigid ember
#

would I then be able to access the info and delete it at certain moments?

inland oxide
#
  ConfigurationSection cs = cfgtotal.getConfigurationSection("faction");
  if (cs.contains(factionname) cs.set(factionname, null);
}```
#

set might not like the path

dusky sigil
#

hmmm

#

ill try that thanks

balmy sentinel
#

Whenever you get the data you need/want to save, save it. When you need to access that data, check if it exists in the yml file. If it exists, great, access it. If it doesn't exists do whatever you want.

frigid ember
#

but a .yml file on updates after reload/restart

inland oxide
#

don't forget to plugin.saveConfig() afterwards.

frigid ember
#

doesnt it?

dusky sigil
#
                  ConfigurationSection cs = cfgtotal.getConfigurationSection("faction");
                  if (cs.contains(factionname)) {
                      cs.set(factionname, null);
                }
            }```
frigid ember
#

nvm I can keep saveConfig();

dusky sigil
#

so like this?

frigid ember
#

but I always did it this way :p

inland oxide
#

I don't use a path for the set in ConfigurationSection methods

dusky sigil
#

still didnt work

#

no errors, too

frigid ember
#

Frogsoup

balmy sentinel
#

yes?

frigid ember
#

to get the data again and put it in the hashmap again?

#
    private void loadData() {
        if (getConfig().getConfigurationSection("deathlocation") != null) {
            for (String times : getConfig().getConfigurationSection("deathlocation").getKeys(true)) {
                
            }
        }
    }```
#

?

#

and than put the info in

#

at the

dusky sigil
frigid ember
balmy sentinel
#

I'm not really the person you should be asking about yml files. I prefer, and always use, databases as I find them far more efficient and useful for storing persistent data (especially if you want to store a lot of information).

dusky sigil
#

that means..

#

oh no..

#

SQL...

balmy sentinel
#

@dusky sigil to answer you question in SQL all you would've had to do is DELETE FROM table WHERE field="factionName";

dusky sigil
#

welp

#

time to learn SQL

#

pain

balmy sentinel
#

it's way easier than dealing with yml files imo. I would only use yml files for storing a small amount of data like the location of NPCs, maybe spawnpoints, etc.

dusky sigil
#

found a 4 hours 20 mins (nice) vid on youtube. time to start the grind.

balmy sentinel
#

worth it imo. I had a whole semesters worth of SQL and I loved it.

dusky sigil
#

dunno if you can "love" code

#

you can be... neutral about it, i guess

sinful spire
#

_ _

subtle bison
#

is there a way to check if a player presses jump button?

#

or if they press it while in air?

balmy sentinel
#

Listen for PlayerMoveEvent and check if the Y increases

subtle bison
#

yeah but while they are already in air and moving?

balmy sentinel
frigid ember
#

yo how would I go around displaying the plugins list alphabetically?

sturdy oar
#

Newer versions do that I think

#

Are you using an old version?

#

🦧

frigid ember
#

😓

#

I'm using 1.12.2

subtle bison
#

on my 1.16 server they arent listed alphabetically

wintry flare
trim vapor
#

can someone help

#

with an exploit fix

#

?

wintry flare
#

Depends

balmy sentinel
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

golden geyser
#

So, I'm working on a project that in addition to using Spigot Plugins for commands, uses Scoreboards to save data.
The thing is, I need help checking if a Player has a certain scoreboard tag, as well as adding or removing it.
These are my current lines of code that try to do this, but don't work:

// Add a tag to a player
player.getScoreboard().getEntries().add("BuildMode");

// Remove a tag from a player
player.getScoreboard().getEntries().remove("BuildMode");

// Check if the player has a tag
if (player.getScoreboard().getEntries().contains("BuildMode")) { 

}```
quick arch
#

Why not just use Persistent Data Containers

golden geyser
#

I ended up deciding to add plugin functionality AFTER building save data on a scoreboard.

#

And this is a private plugin, by the way.

quick arch
#

o

unkempt ridge
#

I'm working on a project where I have to send a message in a 2-3 different classes. Would it be smart to create one class and have public static voids that send a player the message? i.e. player.sendMessage(Messages.promoted);

quick arch
#

btw, it's Player#getScoreboardTags

golden geyser
#

Thank you!

quick arch
#

👍

frigid ember
#

@fleet crane is your name based off the md5 checksum command for linux?

golden perch
#

hello i need help in DeluxeHub (:

subtle bison
#

could anyone give me any advice on how to add something to a hashmap when a command is ran and then in an EventHandler check if that thing is in the hashmap and if yes do something and if no nothing will happen, by running the same command again it will remove the thing from the hashmap

#

its essentially a toggle command for eventhandler

#

i cant seem to get it working

vernal spruce
#

You store it in main or a managrr then grab a instance of it

subtle bison
#

my code:

#

inside the class:
HashMap<String, Boolean> isBabyOn;
String babyToggle = "toggle";

when the command is ran:
isBabyOn.put(babyToggle, false); <--- i get an error here

inside the eventhandler:
if (isBabyOn.get(babyToggle) == Boolean.TRUE)

golden perch
#

can i get some help

#

i swear its simple

#

in DeluxeHub

sturdy oar
#

Why Boolean.TRUE lmao

golden perch
#

@sturdy oar

#

can you help me pls

sturdy oar
#

No

golden perch
#

):

sturdy oar
#

Go to deluxeHub discord

subtle bison
#

yeah i realised the Boolean.TRUE wasnt the problem

#

so how to fix that tho

#

any hint

pastel nacelle
#

no need to replace it with true

subtle bison
#

Baby.onCommand(Baby.java:60) ~[?:?]

isBabyOn.put(babyToggle, false);

pastel nacelle
#

just remove it completely

tiny pebble
#

Alright so I've used the InventoryClickEvent with the getMatrix method to simulate a crafting recipe. It has to be simulated as the output it different each time. So, I've used CraftingInventory#setResult to set the result. Everything works, although when it sets the result the result doesn't actually show, but I can click it and it will be there in my cursor as if it were there the entire time. How do I make it show in the result slot? CraftingInventory#setItem(0, ItemStack) didn't work.

pastel nacelle
#

if you have a map of booleans, unless you need a tri-state

#

use a set instead

#

set contains key = true, set doesn't contain key = false

#

diddling with a map just risks nulls

subtle bison
#

on it

quick arch
#

The hashmap should be UUID and boolean

pastel nacelle
#

should be a uuid set

subtle bison
#

whats the haste url

pastel nacelle
#

unless it needs to be a tristate

subtle bison
#

wait how to do the code style on discord?

pastel nacelle
#

what

#

wtf

plush nexus
#

how can i use a loot table to generate an item?

pastel nacelle
#

do you need the boolean to be able to be null or not?

#

or do you only need true and false?

#

whoever is diddling with the map that has booleans in it

subtle bison
#

im trying to send it

#

it doesnt fcking work

pastel nacelle
#

a simple question

subtle bison
#

?haste

pastel nacelle
#

do you need it to be null or not

tiny pebble
#

?paste

worldly heathBOT
subtle bison
pastel nacelle
#

@subtle bison

subtle bison
#

i only need true or false

pastel nacelle
#

ok

#

use a set

#

not a map

#

using a map here is dumb

subtle bison
#

will a set work

pastel nacelle
#

yes. that's why i'm telling you to use a set

#

a set is effectively a boolean map, but can't hold nulls

subtle bison
#

oh yeah thats sounds smart

#

but i need to initialise that too right

#

okay

#

but i dont get where

#

because if i do it in the onCommand its gonna be the same everytime

solemn grove
#

players flying around with elytra breaks the server performance (down to 3 tps)
any workaround for this other than banning elytra?

subtle bison
#

in the constructor of the class?

humble spoke
#

how can i set an item's name and not have it be in italic?

subtle bison
#

@proud furnace kinda works but it always thinks that isBabyOn = false since i initialised it that way in my constructor

frigid ember
#

yo why isnt this working

#
        String servertotal = PlaceholderAPI.setPlaceholders(p, "%server_max_players%");
subtle bison
lusty gyro
#

Does anyone know of a plugin that allows you to give temporary ranks (or permissions), and also execute commands when the rank starts or expires?

bold anchor
#

That has temporary ranks sure, no clue about the other thing

warm crane
#

Luck perms Does the Temp Ranks / perms

lusty gyro
#

It would be faster than making it myself, lol

#

hmm

warm crane
#

Not sure about

execute commands when the rank starts or expires

subtle bison
lusty gyro
#

yeah

subtle bison
#

no errors

#

Syntax error, insert "VariableDeclarators" to complete LocalVariableDeclaration

#

yeah i am getting the messages

#

i want there to be a toggle arg

#

of course

#

no but the thing is that if i dont check if the boolean is true or no it works fine without toggling

#

so i dont think thats the problem

#

i have tried it yet, working on it

#

and no im getting a different message every time

#

it swaps between on and off

#

yeah but the listener doesnt know that the boolean was changed i dont think

#

um

#

work perfectly now

#

u were right

#

tysm ily

soft fable
#

Hello. Can anyone help me with this? Its a problem when I am stopping the server while I am in a staff mode. https://sourceb.in/1cdd2a2937 The problem is that its clearing my normal inventory

subtle bison
#

shouldve listened to you

lusty gyro
#
        if(ModModeManager.getInstance().isInModMode(p)){
            p.getInventory().clear();
            p.performCommand("mod");
        }```
#

It says that it clears your inventory

#

If that's the problem, then remove that line

soft fable
#

It clears my mod inventory

#

I can try

lusty gyro
#

What do you mean mod inventory?

soft fable
#

It have sepperate inventorys

#

thats my /mod command

#

it sepperates my inventory so I got one normal inventory and a mod inventory

lusty gyro
#

All that line is doing is clearing everything you have in your current inventory, to Spigot you only have one, and that would be whatever you see when you press the button to open it

#

So if you can set your inventory back to the normal inventory, then clear it

#

That would work

#

As far as I know

soft fable
#

it didn't work when i deleted the /clear now it made the mod inventory to the normal inventory

tiny pebble
#

Does PotionEffectType#getId still work even if it's deprecated?

soft fable
#

so it just replaced everything

tiny pebble
#

i just got no idea what magic value means lmfao

balmy sentinel
#

@soft fable what are you trying to accomplish?

soft fable
#

The problem is that its clearing my normal inventory

lusty gyro
#

The problem is that its clearing my normal inventory
It clears my mod inventory

#

so which one

soft fable
#

?

#

It clears my normal

lusty gyro
#

You said both

#

So what are you using to make multiple inventories?

soft fable
#

oh

balmy sentinel
#

That’s supposed to happen when you execute “player.getInventory().clear;” It clears everything in the players inventory?

lusty gyro
#

ItzVipe says there are multiple inventories, one for normal, and one for mod

soft fable
#

I am using an method to save inventory and load inventory

lusty gyro
#

So all you would need to do is clear the correct one

#

So which one do you want to clear?

frigid ember
#

Does anyone have experience installing mysql on linux?

#

I am getting dependencies not found errors

soft fable
#

I want to clear my mod and I after want to keep my normal

#

it doesn't that

lusty gyro
#

To clear your mod inventory, just load in your mod inventory, then call player.getInventory().clear;

soft fable
#

k

lusty gyro
#

All spigot knows is that your inventory is what you see in your hotbar, and what you see when you open your inventory, it doesn't care about what you did to load or save

#

So to clear your mod inventory, make sure it is loaded, then set it to nothing, and save it

#

(And if you were previously in your normal inventory, then of course go back to normal inventory)

#

Anyway, I'll be afk for a while

frigid ember
#

yo how do you make this command work through console?

public class ListCommand implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        OfflinePlayer p = (Player) sender;
        String serveronline = PlaceholderAPI.setPlaceholders(p, "%server_online%");
        String servertotal = PlaceholderAPI.setPlaceholders(p, "%server_max_players%");
        sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&eThere are currently &8(&6" + serveronline + "&8/&6" + servertotal + "&8)" + " &eplayers online on &6&lTheCrib&e."));
        return false;
    }
}
balmy sentinel
#

You’re casting the sender to a player that’s why it isn’t working. You should also do a check before casting to a player by checking if(sender instanceof Player).

frigid ember
#

But how would I make it work through console?

patent monolith
#

AH wait i deleted that

rare prairie
#

But how would I make it work through console?
You can't, you can only display in console random players, like you iterating over players or gets a random player from collection

lone fog
#

Why do you need placeholders for that

#

Isn't there a bukkit.getMaxPlayers() and also bukkit.getOnlinePlayers().size()

frigid ember
#

just wanted to use placeholders 🤷‍♂️

rare prairie
#

makes no sense in console

patent monolith
#

Okay... here is the log again:

[08/01/2020 10:43:02 pm] [Server thread/INFO]: Perzan left the game[08/02/2020 03:52:08 am] [Server thread/INFO]: com.mojang.authlib.GameProfile@29c5ca6b[id=<null>,name=Skeppy,properties={},legacy=false] (/x.x.x.x:xxxxx) lost connection: Disconnected

Again, I am NOT Skeppy

#

I have no idea why his name appeared there

balmy sentinel
#

I’m not sure about Bukkit.getMaxPlayers(); but there is Bukkit.getOnlinePlayers().size();

patent monolith
#

Usually, "name" will say the username...

rare prairie
#

Probably because that player GameProfile is been modified/removed by something plugin, or you're running online/offline server and he/she connected via purchased/cracked client.

frigid ember
#

how do i remove a perms is it sumtin like -essentials.break idk

mellow bobcat
#

@frigid ember what permission plug-in are you using?

rare prairie
#

Bukkit.getPluginManager().removePermission

frigid ember
#

luckperms

#

i think

mellow bobcat
#

do /lp group <groupname> permission set essentials.break false

rare prairie
#

unset

mellow bobcat
#

or that

frigid ember
#

ok

timber thorn
#

Is there a way to track the worlds on a given spigot server or the whole bungee network?

undone narwhal
#

What do you mean ?

timber thorn
#

As in: when a world gets added to the network, some event triggers, and when it gets deleted it triggers again?

tiny pebble
#

Is there a way to have it hide the little "C418 - Cat" description sorta thing? Using custom item and don't want that to be tehre

balmy sentinel
#

@tiny pebble take a look at ItemFlags

timber thorn
#

What do you mean ?
@undone narwhal So basically I want to keep track of world-specific data for every world on the server. When the world gets deleted though, I'd like it to delete all the entries of data in the database that tracks it. When a new world gets created, it creates an entry in the database (that isn't so much the issue since I can just create the entry when I enter the first piece of data for that world...)

#

I know I can look up all the worlds on a server when it boots up and loads my plugin, that's not an issue.

#

What I don't know is if a world can get deleted while the server is running

#

and what to do with worlds that are on a different server in the bungee network.

#

Is there a way to have my plugin communicate with my plugin that's running on another server in the same bungee network?

#

Am I being stupid here?

dusky sigil
#

I was recommended popSQL (not free anymore ): ) to use mySQL. does anyone have a free alternative?

frigid ember
#

So how would I go around making the plugin list alphabetical?

subtle bison
#

Plugin[] plugins = this.getServer().getPluginManager().getPlugins();
for (Plugin p : plugins) {
player.sendMessage(p.getName())
}

#

now you just gotta make it alphabetical

quick arch
#

🤔

#

that'll send it in one line each

dusky sigil
#

I'd suggest putting all of the plugin names into a arrayList and sorting.

quick arch
#

and then join em' with commas

subtle bison
#

Plugin[] plugins = this.getServer().getPluginManager().getPlugins();
for (Plugin p : plugins) {
player.sendMessage(p.getName())
}

and use something like

Collections.sort(plugins, String.CASE_INSENSITIVE_ORDER);
to sort them i guess

dusky sigil
#

Uhh...

#

i dont think plugins is an arraylist

subtle bison
#

its probably not but thats easy to create an arraylist and add them to it

#

by using the for loop

dusky sigil
#

hold on

quick arch
#

yeah it's not an array list

dusky sigil
#

yeah

#

its easy to do tbh

quick arch
#

Just wait for Choco's PR 👀

#

It sends in json messages that shows description, version, etc. on hover

subtle bison
#

@frigid ember this is how you get the plugins into an ArrayList

ArrayList<String> pluginList = new ArrayList<String>( );
Plugin[] plugins = player.getServer().getPluginManager().getPlugins();
for (Plugin plugin : plugins) {
pluginList.add(plugin.getName());
}
Collections.sort(pluginList, String.CASE_INSENSITIVE_ORDER);

frigid ember
#

hmm

quick arch
#

Coloring them shouldn't make any difference during the sorting right 🤔

frigid ember
#

KingAlter I have that already

quick arch
#

o

frigid ember
#

json messages

#

but I'm doing something a bit different

subtle bison
#

@frigid ember this is how you get the plugins into an ArrayList

ArrayList<String> pluginList = new ArrayList<String>( );
Plugin[] plugins = player.getServer().getPluginManager().getPlugins();
for (Plugin plugin : plugins) {
pluginList.add(plugin.getName());
}
Collections.sort(pluginList, String.CASE_INSENSITIVE_ORDER);
@subtle bison sorry for the formatting btw

frigid ember
#

hmm let me see something hold on

tiny pebble
#

@balmy sentinel I did but I'm not sure which it would be? Out of the six itemflags there are there isn't one that seems to disable a name unless it's considered an attribute. I'll try the attribute one though 😛

balmy sentinel
#

@tiny pebble turn them all off ;3

tiny pebble
#

lmfao that's always a solution

balmy sentinel
#

it’s weird like if you want to hide the lore on the Banner Patterns (1.16 item) you need to turn of the potion effect item flag to hide it.

#

it’s weird and personally when I’m creating GUIs I don’t want anything showing anyways so I turn them all off

tiny pebble
#

that's kinda whack

#

i want some things showing just not what the original item is since its a custom item

bold anchor
#

Arrays.asList(plugins)

tiny pebble
#

like i have custom lore i wanna keep but i dont want people to know its secretly a CD 😮

balmy sentinel
#

Turning off the ItemFlags won’t remove a lore you set

tiny pebble
#

ah sweet

#

how can i get the slot number of a specific item in an inventory?

#

basically the opposite of Inventory#getItem

balmy sentinel
#

If you listen on InventoryClickEvent there is event.getSlot()

tiny pebble
#

ah im listening on CraftItemEvent

#

making it so when item A with item B, item A leaves another item behind, like crafting with a bucket

#

bucket of milk or something

balmy sentinel
#

no idea I’ve never messed with that event before. Your best bet is reading the docs or try the forums.

tiny pebble
#

yeah i'll probably have to make my own method of some sort

subtle bison
#

@frigid ember still need it?

frigid ember
#

hmm?

subtle bison
#

ArrayList<String> pluginList = new ArrayList<String>( );
Plugin[] plugins = player.getServer().getPluginManager().getPlugins();
for (Plugin plugin : plugins) {
pluginList.add(plugin.getName());
}
Collections.sort(pluginList, String.CASE_INSENSITIVE_ORDER);
for (String pluginName : pluginList){
player.sendMessage(ChatColor.BLUE + pluginName);
}

frigid ember
#

wait can I dm you some code?

subtle bison
#

sure

#

ArrayList<String> pluginList = new ArrayList<String>( );
Plugin[] plugins = player.getServer().getPluginManager().getPlugins();
for (Plugin plugin : plugins) {
pluginList.add(plugin.getName());
}
Collections.sort(pluginList, String.CASE_INSENSITIVE_ORDER);
for (String pluginName : pluginList){
player.sendMessage(ChatColor.BLUE + pluginName);
}
@subtle bison btw anyone knows how to make it so that for each it will add the pluginName to 1 string?

balmy sentinel
#

Use StringBuilder

jagged torrent
#

just use a StringJoiner

tiny dagger
#

^

#

stringjoiner is so good

subtle bison
#

yeah i found that but i dont get how to format it

#

put it into the for loop?

tiny dagger
#

watch an example

subtle bison
#

yup

jagged torrent
#
Player player = ...;
Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins();
Arrays.stream(plugins).map(Plugin::getName).sort(String.CASE_INSENSITIVE_ORDER).forEach(plugin -> player.sendMessage(ChatColor.BLUE + plugin));

Don't you just want something like this tho

tiny dagger
#

so much lambda 👀

quick arch
#

stream 👀

jagged torrent
#

lambda life

subtle bison
#

haha lol

jagged torrent
#

or just collect them all in a StringJoiner

#

1 line ez

sturdy oar
#

In C lambda is to access fields of unions and structures

#

It confuses me so much

tiny dagger
#

i actually wanna understand them ^

sturdy oar
#

I recommend SoloLearn

tiny dagger
#

i saw them on a glance tho never looked into

#

feels bad how java knowledge doesn't always transfer

sturdy oar
#

In my case

#

C knowledge transfers to Java

subtle bison
#

@jagged torrent well it gives the same output

jagged torrent
#

I know xd

subtle bison
#

but i wanna put it into 1 string

tiny dagger
#

to some degreee viper

jagged torrent
#

you can do that too

subtle bison
#

not really sure how to format the StringJoiner tho

#

or use

jagged torrent
#

how do you want to join them?

tiny dagger
#

i have an example somewhere

sturdy oar
#

@tiny dagger come into general if you want to do C discussion

tiny dagger
#

ye

tiny pebble
#

Is there a way to like... send an event? I have a simulated recipe and since it's simulated it doesn't really count as a recipe, therefore it doesn't send CraftItemEvent. How can I make it do that O.o

jagged torrent
#

PluginManager#callEvent(Event)

tiny pebble
#

Thank you!

subtle bison
#

anyone anything on the StringJoiner?

tiny dagger
#

i did something

#

tho not the best example

jagged torrent
#
Player player = ...;
Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins();
String formatted = Arrays.stream(plugins).map(Plugin::getName).sort(String.CASE_INSENSITIVE_ORDER).collect(() -> new StringJoiner(", ", "Plugins: ", ""), StringJoiner::add, StringJoiner::merge).toString();
player.sendMessage(formatted);
subtle bison
#

bro these symbols

#

everywhere xd

jagged torrent
#

lambdas make life easy

subtle bison
#

probably time to learn it huh

tiny dagger
#

classic java isn't bad either

jagged torrent
#

true

winged sparrow
#

Is there a significant benefit to lambdas other than making a lot of code use less code?

jagged torrent
#

it is mostly visual

patent monolith
#

dont some lambdas refer to methods instead of creating anonymous classes?

#

like, methods made while compiling

jagged torrent
#

wdym

patent monolith
#

a method called "lambda0" that i didnt code in can be seen with reflection sometimes

#

or lambda1

jagged torrent
#

yes they are anonymous classes

subtle bison
#

thanks yall for teaching me StringJoiner lol kinda useful

pale patio
#

how can i make a command that is able to be toggled?

#

so like /command yes it toggles on

#

/command no it toggles off

#

and when it's on, it does something every 2 seconds

subtle bison
#

to toggle on/off you just have to make a private boolean

#

register it

#

and then in your onCommand put yourBoolean = true / false

lusty gyro
#

sounds too easy

#

let's go make it difficult

subtle bison
#

yeah make an array list and when you type command yes add something to it and when you type command no remove it

lusty gyro
#

So make a website, host it, and then get the fields from the website saying weather or not it's enabled, and set it to your command, then when you want to use it, get the field again to see if it is enabled

subtle bison
#

nah an arraylist is worse

pale patio
#

waitwait, wdym register the boolean?

umbral dirge
#

Can someone check this? I get a ```
[18:18:53] [Server thread/WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'bannedplayers WHERE UUID = 'fdd1a756-d7f0-4629-b72f-6bde5406a408' (UUID, BANN...' at line 1


```java
public static void createPlayer(Player p) {
        PreparedStatement ps;
        try {
            UUID uuid = p.getUniqueId();
            ps = connection.prepareStatement("SELECT * FROM bannedplayers WHERE UUID = ?");
            ps.setString(1, uuid.toString());
            ResultSet set = ps.executeQuery();
            set.next();
            if(!exists(p)) {
                PreparedStatement ps2 = connection.prepareStatement("INSERT IGNORE INFO bannedplayers WHERE UUID = ? (UUID, BANNED, REASON) VALUES(?,?)");
                ps2.setString(1, p.getUniqueId().toString());
                ps2.setBoolean(2, false);
                ps2.setInt(3, 0);
                ps2.executeUpdate();

                return;
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
subtle bison
#

put it in your constructor @pale patio

lusty gyro
#

Just make a boolean variable

#

Start it out as true if you want it to start as enabled

subtle bison
#

public Baby(MainClass plugin) {
this.plugin = plugin;
yourBoolean = false;
}

lusty gyro
#

oh

#

a better method

#

Instead of using a command

#

Just get the amount of entities in the world, and if it is an even number, then have it enable the command, if it isn't then disable it

subtle bison
#

yoo but that would actually be smart ngl

#

@pale patio need more help?

pale patio
#

not rn

bleak osprey
#

hey guys,

i cant use the Port 8195 for Votifier. I entered at the ufw but i dont get a signal

#

anybody knows how to?

lone fog
#

ArrayList<String> pluginList = new ArrayList<String>( );
Plugin[] plugins = player.getServer().getPluginManager().getPlugins();
for (Plugin plugin : plugins) {
pluginList.add(plugin.getName());
}

#

You can replace that with ArrayList<String> pluginList = Arrays.asList(bukkit.getPluginManager().getPlugins())

umbral dirge
#

Can anyone help me?

pale patio
#

oh yes, i do need some help @subtle bison

lusty gyro
#

With?

pale patio
#

how can i make it so that a snippet runs every 2 seconds?

lusty gyro
#

yes

near lodge
#

Can someone check this? I get a ```
[18:18:53] [Server thread/WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'bannedplayers WHERE UUID = 'fdd1a756-d7f0-4629-b72f-6bde5406a408' (UUID, BANN...' at line 1


```java
public static void createPlayer(Player p) {
            PreparedStatement ps2 = connection.prepareStatement("INSERT IGNORE INFO bannedplayers WHERE UUID = ? (UUID, BANNED, REASON) VALUES(?,?)");
@umbral dirge What are you trying to insert?
lusty gyro
#

Have you tried using

subtle bison
#

make a bukkit runnable with delay 40 ticks

lusty gyro
#

BukkitScheduler?

umbral dirge
#

If a player does not exist i wanna create it

#

Its for a ban system

lusty gyro
#

Why

#

If they don't exist, who are you going to ban?

umbral dirge
#

Im inserting UUID, If he is banned, and the reason id

subtle bison
#

check if player instanceof Player

umbral dirge
#

No, im going to make it false

lone fog
#

INSERT IGNORE INFO shouldn't that be INTO

near lodge
#

INSERT INTO bannedplayers(UUID, BANNED, REASON) VALUES (?, ?, ?)

umbral dirge
#

omg

tiny dagger
#

you don't need the (UUID, BANNED, REASON)

#

thingy

umbral dirge
#

thank you guys

near lodge
#

Yeah

umbral dirge
#

it worked

tiny dagger
#

don't extend your query

#

if you have no reason to

umbral dirge
#

ok

near lodge
#

you don't need the (UUID, BANNED, REASON)
@tiny dagger But it helps when you have many tables and don't want to lookup the schema

subtle bison
#

@pale patio
new BukkitRunnable() {

                        @Override
                        public void run() {
                            // your code that will repeat ever 2 seconds
                            
                        }
                        
                    }.runTaskTimer(plugin, 0, 40); // 40 ticks == 2 seconds
pale patio
#

yep

#

thank you

tiny dagger
#

yes but usually it's not needed

pale patio
#

but what do i put at plugin?

near lodge
#

yes but usually it's not needed
@tiny dagger Not needed, but doesn't harm anything

subtle bison
#

@pale patio if you are in your main class put this

lone fog
#

An instance of your main class

tiny dagger
#

ik for a fact that the more columns you have the more tedious is to read them

#

so i remove them

subtle bison
#

othervise yeah instance of it

umbral dirge
#

oh god now i have another error when updting values

#
public static void banPlayer(Player p, int reason) {
        try {
            PreparedStatement ps = connection.prepareStatement("UPDATE bannedplayers SET BANNED = ?  SET REASON = ? WHERE UUID = ?");
            ps.setString(3, p.getUniqueId().toString());
            ps.setBoolean(1, true);
            ps.setInt(2, reason);
            ps.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
[18:30:24] [Server thread/WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET REASON = 1 WHERE UUID = 'e0f6e6e6-b818-45b0-94c1-99b1839ebdbb'' at line 1

quick arch
#

the id already exist error?

#

oh

umbral dirge
#

No

#

I cant change the reason and banned thing

pale patio
#

oh

near lodge
#

UPDATE bannedplayers SET BANNED = ?, REASON = ? WHERE UUID = ?

#

I recommend you to learn the sql syntax

umbral dirge
#

oh

near lodge
#

It will help you tremendously

umbral dirge
#

Yeah its the first time working with it

near lodge
#

A quick crash course will help you in the long run

umbral dirge
#

Works!

#

Thank you so much

#

okay

pale patio
#

and to stop the task?

lone fog
#

You can use cancel() inside the runnable

#

Or make it a variable and then do variable.cancel();

subtle bison
#

wait how do you make a runnable a variable?

lone fog
#

BukkitRunnable runnable = new BukkitRunnable

umbral dirge
#

or use ids

frigid ember
#

The animation for the angel don't work.

balmy sentinel
#

make sure to close your SQL statements

tiny dagger
#

best practice i think is to let the try close it for you

#

try (Closable cl = something.closableAndThrowable())

#

👀

quick arch
#

e_e

pale patio
#

that doesnt work

spare frost
#
        boolean hasBlock = false;

        for (int x = 0; x <= bot.getSize().getLength(); x++) {
            for (int z = 0; z <= bot.getSize().getWidth(); z++) {
                for (int y = 0; y <= bot.getSize().getHeight(); y++) {
                    if (target.getRelative(z, y, z).getType() != Material.AIR) hasBlock = false;
                }
            }
        }
#

is this how I check if a cubiod area with a certain size is empty?

tiny dagger
#

oh not really

#

you only check positive bounds

spare frost
#

wdym

tiny dagger
#

well

spare frost
#

thats what i what i think

tiny dagger
#

you also need to go from negatibe something to positive something

spare frost
#

why cant i upload pictures here

#

the circle thingy is the player

#

the square drawn is the block target

lusty gyro
#

What would be the best method to run a task later by let's say a large amount of time like a Month? Would a bukkit runnable like RunTaskLater() Work just fine, or could there be potential problems with that?

sinful spire
#

bukkit runabble would cancel after a restart if i think correctly

tiny dagger
#

kyrix you need to bind to your spigot account in order to upload stuff

pale patio
#

BukkitRunnable runnable = new BukkitRunnable
@lone fog that doesnt work

#

it spews out error

#

s

#

i can't paste the image though

sinful spire
#

you need to verify

pale patio
#

wdym

balmy sentinel
#

?paste

worldly heathBOT
pale patio
#

Incompatible types. Found: 'org.bukkit.scheduler.BukkitTask', required: 'org.bukkit.scheduler.BukkitRunnable'

spare frost
#

done

tough kraken
#

guys, what would be the best way to find a plains biome on world loading? this seems like its very bad in performance

if (loc.getBlock().getBiome() != Biome.PLAINS) {
            Main.getPlugin().getLogger().warning("Kein Biom gefunden. Suche erneut...");
            searchBiome();
        } else {
            if (xPos.getBlock().getBiome() == Biome.PLAINS
                    && xNeg.getBlock().getBiome() == Biome.PLAINS
                    && zPos.getBlock().getBiome() == Biome.PLAINS
                    && zNeg.getBlock().getBiome() == Biome.PLAINS) {
                Main.getPlugin().getLogger().warning("Biom gefunden. Setze Spawnpoint und Border...");
                world.setSpawnLocation(loc);
                world.getWorldBorder().setCenter(loc);
                world.getWorldBorder().setSize(500);
            } else {
                Main.getPlugin().getLogger().warning("Kein Biom gefunden. Suche erneut...");
                searchBiome();
            }
        }
pale patio
#
                if (toggle) {
                    final BukkitTask runnable = new BukkitRunnable() {
                        @Override
                        public void run() {
                            Block targetBlock = player.getTargetBlock((Set<Material>) null, 10);
                            String readableBlock = targetBlock.getType().toString();
                            player.sendMessage(ChatColor.GOLD + "" + readableBlock);
                        }
                    }.runTaskTimer(this, 0, 20);
                } else {
                    runnable.cancel();
                    player.sendMessage(ChatColor.RED + "Disabled");
                }```
#

this is my code

#

error i'm getting is Cannot resolve symbol 'runnableSwaila'

tough kraken
#

if "runnableSwaila" exists, its probably not reachable

pale patio
#

and that's my problem

#

how do I make it reachable

tough kraken
#

does it have private access?

#

if so, make it public

pale patio
#

if i make it public

#

IDE says no

tough kraken
#

that means?

pale patio
#

that means it doesn't want public to be there

tough kraken
#

please paste your full class/part

#

?paste

worldly heathBOT
pale patio
#

Modifier 'public' not allowed

sturdy oar
#

If you want a bukkit task, why not use Bukkit.getScheduler().runTask

pale patio
#

someone else told me to use the runnable

tough kraken
#

safe it was liketocode lol

#

i dont think theres a big difference

sturdy oar
#

Idk man that code is weird

pale patio
#

was applegod

tough kraken
#

just use a scheduler... doesnt matter i think

sturdy oar
#

Why are you casting null

#

🤔🤔

pale patio
#

if i don't use null

#

it says

#

"Expression expected"

sturdy oar
#

Seems like you need to learn java

pale patio
#

yeah

sturdy oar
#

Public can't be used inside a method

tough kraken
#

btw

#

viper

#

ehm

#

guys, what would be the best way to find a plains biome on world loading? this seems like its very bad in performance

if (loc.getBlock().getBiome() != Biome.PLAINS) {
            Main.getPlugin().getLogger().warning("Kein Biom gefunden. Suche erneut...");
            searchBiome();
        } else {
            if (xPos.getBlock().getBiome() == Biome.PLAINS
                    && xNeg.getBlock().getBiome() == Biome.PLAINS
                    && zPos.getBlock().getBiome() == Biome.PLAINS
                    && zNeg.getBlock().getBiome() == Biome.PLAINS) {
                Main.getPlugin().getLogger().warning("Biom gefunden. Setze Spawnpoint und Border...");
                world.setSpawnLocation(loc);
                world.getWorldBorder().setCenter(loc);
                world.getWorldBorder().setSize(500);
            } else {
                Main.getPlugin().getLogger().warning("Kein Biom gefunden. Suche erneut...");
                searchBiome();
            }
        }
``` you have an idea?
#

because you probably know something

sturdy oar
#

Idk I'd just do something similar

#

I've never used biomes

tough kraken
#

its searching about 5 minutes for the biome

#

and then it has a tps of 18 lol

sturdy oar
#

You can read the world data file I guess

#

or use the seed or something

subtle bison
#

yup

tough kraken
#

well... is #setAutoSave setting the normal save, doing every *** seconds, or the save at restart/stop?

#

then i could just remove the save and done

#

no need for creating the new world every time

#

nope it isnt... lmao

frigid ember
#

Is any alternative for pluginmessage to communicate between bungeecord and spigot, which don't needs player?

inland oxide
#

anyone recall waht mc version material data was deprecated. was that for 1.13?

#

or did that happen before in 1.12?

mellow wave
#

I think it was 1.13

#

Not sure..

frigid ember
#

yes it was

inland oxide
#

ok so pre 1.13 should use material and data to make itemstack, right?

mellow wave
#

Yeah

frigid ember
#

yes

inland oxide
#

ok, thats what i thought.

frigid ember
#

so could someone anwser my question?

#

Is any alternative for pluginmessage to communicate between bungeecord and spigot, which don't needs player?

jagged torrent
#

no

#

you can always setup your own proxy to server connection using sockets

frigid ember
#

But other plugins can do this same and network will be overloaded

quick turtle
#

Check console

subtle bison
#

your name is probably too long fam

#

does your cracked name have 20 chars?

lusty gyro
#

Bukkit.getServer().getScheduler().runTaskLater(plugin, () -> { what should the plugin variable be?

lone fog
#

Instance of your main class

lusty gyro
#

How would I get that from a separate class?

pastel nacelle
#

by learning java

quick arch
#

😐

pastel nacelle
#

either make a static instance getter in your main class and get it in the code in the other class

#

or pass it down to the other class when you construct it, and hold onto it

lusty gyro
#

Sorry, I just blanked there

#

I remembered how to do it, lol

abstract cradle
#

hmm

#

i have question about the /team command

#

im not a coder or anything before you explain complicated language to me

#

but how do you make it so the colors & team name display in chat rather than just tab- i heard on reddit its due to spigot overlapping or interfering with it

#

and its possible to be changed by just opening a bit of code/file idk help me

pastel nacelle
#

there is or was a setting for it in either paper or spigot, but last I checked it was broken

abstract cradle
#

oh alright

ripe narwhal
#

how do I change the view distance only on 1 world

grim halo
#

I only know that Paper has World#setViewDistance(int)
Dont think that Spigot has an API for that.

ripe narwhal
#

oh ok

grim halo
#

I think you can do it via a pretty simple reflection.

#

Or nms

neat willow
#

coding an autosell plugin atm, am i setting up this config correctly?
mines: A-mine: message: |- &6&m---------&8&m------&9&l[ &c&lShop Prices! &9&l]&8&m------&6&m--------- &9&l[&c$&9&l] &a64 Wood = $500 &9&l[&c$&9&l] &a64 Cobblestone = $250 &9&l[&c$&9&l] &a64 Coal = $750 &9&l[&c$&9&l] &a64 Iron = $1,500 &9&l[&c$&9&l] &a1 Diamond = $5,000 &6&m---------&8&m------&9&l[ &c&lShop Prices! &9&l]&8&m------&6&m--------- prices: ACACIA_WOOD: 8 BIRCH_WOOD: 8 COAL: 12 COBBLESTONE: 4 DARK_OAK_WOOD: 8 DIAMOND: 5000 IRON_INGOT: 24 JUNGLE_WOOD: 8 LOG: 8 SPRUCE_WOOD: 8

then trying to access it like
ConfigurationSection sec = plugin.getConfig().getConfigurationSection("mines."+perm+".prices");

it worked for awhile and then i would change a semingly unrelate part of the code (or add something to the config) and then my sec is empty even though there are def values under prices

grim halo
#

Assuming perm is A-mine

neat willow
#

yeah

pastel nacelle
#

well

#

can you paste the config with which it does not work

neat willow
pastel nacelle
#

maybe but I still want to see it

#

and, uh

#

what?

#

like i can get the "mines."+perm+".message" printing out
what does this mean?

neat willow
#

i meant i can access and print out whats under

#

mines:
A-mine:
message:

#

but the prices return an empty config section

#

even though its definitely not empty, is that the best way to format something like that?

pastel nacelle
#

can you paste the code you are using to print out the contents of these sections

neat willow
#

ive tested and can individuall access each price, so if i were to do "mines."+perm+".message.ACACIA_WOOD" i could get the int

#

so i dont print out the "prices" part, i print out the messages part

grim halo
#

Normally you would get the keys of the "mines" section and iterate over the sub sections each representing a mine.

neat willow
#

what do you mean? like get "mines."+perm instead?

grim halo
#

You just get the keys in "mines"

ripe narwhal
#

Theres a spigot setting that says view distance

pastel nacelle
#

it's per-world

#

just set it per-world

ripe narwhal
#

?

#

do I write per-world

pastel nacelle
#

you wanted to set a view distance in a specific world right

ripe narwhal
#

yes

#

so prevent lag

pastel nacelle
#

then... create a section for the world

#

under world settings

#

and set the setting there

ripe narwhal
#

ok

#

do I put it like this?

grim halo
#
    FileConfiguration fc;
    ConfigurationSection mineSection = fc.getConfigurationSection("mines");
    final Set<String> keys = fc.getKeys(false);
    for (final String key : keys) {
      final ConfigurationSection mineConfig = fc.getConfigurationSection(key);
      // Do stuff with each mine
    }

@neat willow

#

@ripe narwhal Not in the server.properties. In the Spigot.yml

ripe narwhal
#

ik

#

Im in spigot.yml

pastel nacelle
#

i thought his issue was that the config section for prices was empty

#

or showed up as empty

#

by sorting the list and then appending it to the stringbuilder

grim halo
#

Collections.sort()

#

Will sort the List in its "natural" order.

#

A bit more context pls

#

?paste

worldly heathBOT
ripe narwhal
#

then... create a section for the world
@pastel nacelle so I just need to copy paste the world settings and put the view distance I want?

bold anchor
#

Clearly a Stringbuilder is not a collection

grim halo
#

StringBuilder is not a collection

lone fog
#

Sort first then build the string

grim halo
#

@ripe narwhal I dont think you need to copy every property.

ripe narwhal
#

Idk what to do

grim halo
ripe narwhal
#

oh ok

#

thx

crimson sandal
#

So I'm attempting to run BuildTools from a Java ProcessBuilder but I keep getting this error, reckon I need to set some environment variables or something? 🤔 'sh' is not recognized as an internal or external command, operable program or batch file. Exception in thread "main" java.lang.RuntimeException: Error running command, return status !=0: [cmd.exe, /D, /C, sh, C:\Users\James\apache-maven-3.6.3/bin/mvn, install:install-file, -Dfile=work\mapped.7bc2ea8b.jar, -Dpackaging=jar, -DgroupId=org.spigotmc, -DartifactId=minecraft-server, -Dversion=1.16.1-SNAPSHOT]

frigid ember
#

sh

#

hmm

ripe narwhal
#

I got this error @grim halo
Time: 02-08-2020 22:10
Description: Exception in server tick loop

java.lang.RuntimeException: org.bukkit.configuration.InvalidConfigurationException: mapping values are not allowed here
in 'string', line 62, column 31:
creative: view-distance: 6
^

frigid ember
#

So I'm attempting to run BuildTools from a Java ProcessBuilder but I keep getting this error, reckon I need to set some environment variables or something? 🤔 'sh' is not recognized as an internal or external command, operable program or batch file. Exception in thread "main" java.lang.RuntimeException: Error running command, return status !=0: [cmd.exe, /D, /C, sh, C:\Users\James\apache-maven-3.6.3/bin/mvn, install:install-file, -Dfile=work\mapped.7bc2ea8b.jar, -Dpackaging=jar, -DgroupId=org.spigotmc, -DartifactId=minecraft-server, -Dversion=1.16.1-SNAPSHOT]
@crimson sandal u on windows?

crimson sandal
#

Yep!

frigid ember
#

'sh' is not recognized as an internal or external command,
operable program or batch file.

bold anchor
#

use git bash

frigid ember
#

self explanatory

#

sh isn't a windows command

crimson sandal
#

Yes...

#

BuildTools normally uses it though

#

It's BuildTools that's crashing

grim halo
#

@ripe narwhal send a screenshot of your config

#

Of this particular section

frigid ember
#

@ripe narwhal send a screenshot of your config
@grim halo i think the issue is his syntax

ripe narwhal
atomic nova
#

okay so i am storing Block data into a list and i was wondering what would be the best way to save that data to a file and then load it back up again for like when the server restarts ?

grim halo
#

@ripe narwhal You need to have a new line for each property.
Just look at my screenshot and copy it 1:1 then change the variables

ripe narwhal
#

oh ok

#

do you have a space between 6 and view distance: ?

grim halo
#

@atomic nova There is probably no "best" way for that. You can get BlockData as a String and let Spigot convert it back.
That would be the simplest way. You can also write your own serializer that uses a less expressive way of storage.
But if you just want to load it on startup then writing it into a plain txt file would be sufficient i guess.

jagged torrent
#

creative: view-distance: 6 is not valid yaml because of the second ':'

#

put the string in quotes

grim halo
#

@frigid ember User name is longer than the allowed 16 chars (normally only happens on cracked clients)

atomic nova
#

@grim halo okay i tried writing the block data into the config file but it messes the config all up so when i try to load it back in it does work

#

the other way i was thinking was taking the block data and converting it to something small like Base64 into the list to make it easier to load/save

grim halo
#

You should create new file for storing data. A config should only be used for configuration and not persistent data storage.

bronze acorn
#

dawn

#

is there a mov

#

mob

#

or an npc

#

or anything

#

thats longer than 16 characters

#

worse case scenario delete your world and let it regenerate

#

also account for color codes numbers and the symbols as well

crimson sandal
#

Does md not want people to do that?

marble geyser
#
        // Mapping string values to int keys 
        hash_map.put(10, "Geeks"); 
        hash_map.put(15, "4"); 
        hash_map.put(20, "Geeks"); 
        hash_map.put(25, "Welcomes"); 
        hash_map.put(30, "You"); 
  
        // Displaying the HashMap 
        System.out.println("Initial Mappings are: " + hash_map.get(10)); 

returns "Geeks"
but how would i make it so that i can do:
hash_map.get("Geeks")
and it would return 10?

grim halo
#

@marble geyser create a Map<String, Integer> or use a BiMap from guava

marble geyser
#

no

#

i mean

#

nvm

wide hawk
#

hi there, does anyone why my spigot server keeps showing hearts above mobs?

marble geyser
#

i want to use .get for the second value

grim halo
#

You cant get from value to key as the values are not unique.
so a map could contain
"A" : 10
"B" : 10
"C" : 10
No way to get the key that is coupled to 10

marble geyser
#

oh

wide hawk
#

it's messing my bossbar settings because it constanlty replace name with hearts

subtle bison
#

lmao

grim halo
#

@wide hawk Hearts above mobs? Sounds like a plugin.

wide hawk
#

ik but there is no plugin

#

well i have some

#

but i never intended to install for hearts

crimson sandal
#

Wait wtf, the latest version of BuildTools is crashing for me altogether O.o

#

Even in the CMD prompt

bold anchor
#

Dafuq did yo udo

wide hawk
#

it seems to come right from the server itself

grim halo
#

@wide hawk Show the plugin list. Maybe i recognise the plugin.

#

And it does not come from the server itself

bold anchor
#

It's mcmmo

#

100%

#

It is known for that lel

crimson sandal
#

Oh weird, looks like the portable git got corrupted

tribal field
#

It it possible to only apply a glowing effect to the armor / items on armor stands? So far from my research it seems it isnt possible as glowing can only be applied to entities, but asking here anyways just to confirm

grim halo
#

Its probably mcmmo. But i was told it was "added after the hearts"

wide hawk
#

i wiped my server for that reason

#

and placed mcmmo after the wipe

grim halo
#

@tribal field You would need multiple armor stands for that.

lone fog
#

Armor stands are entities

#

So you can make them glow

tribal field
#

Yeah, I wanted to make the items themselves glow, not the armor stands

grim halo
#

Yes but he wants a single item on the armorstand to glow

tribal field
#

Also, how would multiple armor stands help?

lone fog
#

Ah

#

Yeah either all the items will glow or none will

grim halo
#

You spawn one armor stand on the position per item slot. Make the armor stands invisible and give the respective armorstand the glow effect.

#

If you dont mind the extra resources

tribal field
#

Even while its invis, you can see the entire glow effect on the armour stand though

lone fog
#

Unless you want them all to glow, in which case you can just use one stand

rustic prism
#

One message removed from a suspended account.

tribal field
#

Im guessing you're figured out what I meant :P

grim halo
#

Wait im tired. Uhm make them a marker

tribal field
#

Aha, all good. and what do you mean by a marker?

grim halo
#

Armor stands have a marker property so they dont have a hitbox anymore

tribal field
#

Oh thats neat, are there methods for that or do I gotta use NMS?

#

Found setMarker()

grim halo
#

There should be an API for that

tribal field
#

I'll give that a shot, thanks 😃

grim halo
#

@rustic prism

#!/bin/sh
while true
do
java -xmx/xms/jar etc stuff here

echo "If you want to completely stop the server process now, press Ctrl+C before
the time is up!"
echo "Rebooting in:"
for i in 5 4 3 2 1
do
echo "$i..."
sleep 1
done
echo "Rebooting now!"
done
#

Its a pretty simple one...

latent pond
#

I’ve been getting periodic lag spikes on my server of 2 people. Only plugin is MemCheck, but problem existed before I added it. Server has 6GB of ram

tribal field
grim halo
#

@latent pond Send your timings report

#

@tribal field nice 👍

latent pond
#

@grim halo okay one minute

#

Is it the file one or the link?

grim halo
#

/timings on
wait for some time
/timings paste

light stone
#

What's CMI? I've read something about it, but nowhere could I find what it is.

grim halo
#

Pretty much a better essentials

#

With a ton of content

light stone
#

I found that link, but I need to be logged in to see it.

grim halo
#

Thats because its a premium plugin

light stone
#

Not libre? Alright, time to hate it.

grim halo
#

I mean its a really good plugin and the devs work is probably worth thousands of dollars now

sturdy oar
#

CMI 😂

lone fog
#

Sounds really bloated

sturdy oar
#

^^^

#

So many useless features, same goes for EssentialsX

wide hawk
#

downloaded a copy of the server on my pc

#

and deleted essentials + mcmmo

pastel nacelle
#

essentials is a better essentials

grim halo
#

Havent used a plugin from someone else in over 2 years but back then CMI was rly feature packed and you could run a server off of it.
Never liked Essentials.

dry horizon
#

How to change the player name tag? And is it possible without scoreboards?

wide hawk
#

so it's from mcmmo wow

#

but i didn't had it before

lone fog
#

You can disable it in the config

grim halo
#

@dry horizon You can just set a players name

dry horizon
#

Im talking about the name above theit head

#

Is that what you mean?

#

Their*

grim halo
#

Yes

dry horizon
#

How?

#

DisplayName?

#

CustomName iirc

grim halo
#
Gist

Change the name of a player using protocollib. GitHub Gist: instantly share code, notes, and snippets.

latent pond
winged sparrow
#

For one who considers themselves decent with nms entities, I will pay $5 for you to write me a custom entity class for a villager that has no pathfinder goals but the one to look at the nearest player. Not setting their movement speed to zero, but to avoid them from seeking jobs entirely by them having no pathfinding except looking at nearby players.

dry horizon
#

Im using spigot 1.8.9

#

Does it matter

sturdy oar
#

Spigot 1.8.9 does not exist fyi

dry horizon
#

Ok

grim halo
#

Yes. If you use an ancient version you need to dig in the archives

dry horizon
#

I-

winged sparrow
#

Unsupported versions = unsupported

tiny dagger
#

@winged sparrow sure can do

dry horizon
#

Aight

tiny dagger
#

tell me the version you want me to code it for 👀

grim halo
#

@latent pond Disable auto saving. It looks like your server uses a lot of time on the main thread saving your world.

winged sparrow
#

Thanks Fr33

latent pond
#

okay, is there any downside to disabling it?

grim halo
#

And what the hell is "Titty-2_nether"

winged sparrow
#

I sent a friend request

#

1.16

#

@tiny dagger

latent pond
#

lol my world name is poopsack and titty

tiny dagger
#

one sec

latent pond
#

tisnt that just the nether region file or something?

grim halo
#

@latent pond I dont think there is a downside. Its only a higher risc if your server crashes.

latent pond
#

well it's been getting there since i switched over to spigot

#

i used to run a modded 1.12 world and it never gave me issues

pastel nacelle
#

or use paper which has incremental autosave 😎

grim halo
#

^

latent pond
#

i switched to spigot so i could run a vanilla 1.16 world

#

nah screw paper. i dont want to have to deal with removed mechanics

grim halo
#

lol... there is literally no removed mechanic

#

unless you are talking about exploits

pastel nacelle
#

unless you count cheats and bugs

#

but we don't want cheaters on paper anyway

latent pond
#

well an smp i'm on had a bunch of redstone machines broken because of paper

grim halo
#

if you consider exploits and bugs a "mechanic" then yes

pastel nacelle
#

paper doesn't even change redstone though

latent pond
#

anyway i'm not switching to paper, is the only recomendation disabling auto-save

lone fog
#

It does if you toggle a config option

#

But it's false by default

grim halo
pastel nacelle
#

eigencraft redstone was dropped in 1.16 if that's what you're referring to

grim halo
#

Oh eigencraft was dropped? Why?

pastel nacelle
#

1.16 changed redstone

#

and updating eigencraft to match the changes was something nobody wanted to do

latent pond
#

i dont know man, i just know the server owner went into the Paper discord and they were a-holes to him when he asked about the things that got broken

pastel nacelle
#

it's in the "will be updated if someone steps up to get cancer" category now

grim halo
#

Oh right. I remember some "physics improvements" from md9....

lone fog
#

Ah I still have it in my config

#

Didn't know it didn't do anything now

grim halo
#

@latent pond Yes i have to admit that the paper discord i hella salty.

pastel nacelle
#

just the way I like it

latent pond
#

so yeah, i'd rather not switch if i might come under fire just for trying to fumble my way around this stuff

#

anyway, thanks guys, will be back if issue persists 👋

grim halo
#

Sure. Your preference. Did you check if autosaving was enabled?

latent pond
#

it is, i get a message everytime the server saves

grim halo
#

aight disable it. And pregenerate your world 😄

latent pond
#

what is that?

pastel nacelle
#

since splögget can't generate chunks asynchronously, it bogs down your main thread and takes a big dump on your tps

#

so, you want to pre-generate the world so it doesn't lag to hell and back when people walk around

grim halo
latent pond
#

okay, my friend and i were going in and out of the nether, and we've been wandering around a lot to look for a spot for a base. so that's the problem?

#

also lots of caving

grim halo
#

probably not the main problem but it will def decrease your TPS if you wander around.

latent pond
#

okay, i'll give that plugin a shot

#

after i install it what would i need to do?

tribal field
#

So, back at it again with another question 😛 Is there any way to keep the fog from a boss bar while having the boss bar not visible to players?

grim halo
#

from console
/fcp start <radius> <world>
Generates the world from the center to the defined radius

latent pond
#

is the center 0,0? our base is 2k from spawn

grim halo
#

@tribal field If there is a way then it will be tricky.

#

@latent pond The center will be the world spawn

tribal field
#

Yeah I figured rip

latent pond
#

okay

#

do you have a recommmended radius?

frigid ember
#

Does anybody knows how can i make a player write something on the chat but not send it? Like, complete a command

#

I mean, when the player click on x item, he is forced to write /command <x> <x> on the chat

sturdy oar
#

dispatchCommand

frigid ember
#

Thanks

grim halo
#

You cannot write something into the client's chat bar, no. The only way would be the client clicking a text component, but that's entirely client-side.

lone fog
#

You can suggest a command with a text component

tacit spoke
#

Any staff who can help me for a moment?

frigid ember
#

You cannot write something into the client's chat bar, no. The only way would be the client clicking a text component, but that's entirely client-side.
Ahh, so if i make a MenuGui, and when the player clicks on any item from it, its not possible?

tacit spoke
#

Any staff who can help me for a moment?

lone fog
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

tacit spoke
#

@lone fog

#

¿Speak spanish?

lone fog
#

No, but I'm sure someone here does

frigid ember
#

I do

tacit spoke
#

Can anyone pass the GoldenCrates plugin link for 1.8 to 1.12? Thank you

grim halo
#

@frigid ember Do you use Featherboard?

#

AnimatedNames=

#

?

#

@frigid ember What version are you on?