#help-archived

1 messages · Page 211 of 1

peak marten
#

I see

#

I will need to think about this

pastel nacelle
#

alternatively, with the inner class

#
public class TopDog {

    public final BottomDog BOTTOM = new BottomDog();

    public class BottomDog {}

}
#

to get the top from the bottom you would need either fuckery or write a getter, though

#

probably doesn't matter

#

i prefer smaller class files so I'd do the former

subtle wedge
#

Why is it that putting 1.0 as a version in pom.xml pop up with main class not found errors???

#

It works fine if it's like 1.01 or like 1.0-SNAPSHOT so???

keen compass
#

example please?

grim halo
#

This sounds weird...

pastel nacelle
#

this sounds like user error

subtle wedge
#

<version>1.0</version> This pops up with Main class not found errors

<version>1.01</version> or something like <version>1.0-SNAPSHOT</version> works fine?

keen compass
#

that isn't the example I was looking for

#

it would best help to know where in the pom you are messing with

subtle wedge
#

It's the default with the groupId, artifactId, then version

keen compass
#

can you not just show the pom?

subtle wedge
keen compass
#

which IDE are you using intelliJ?

subtle wedge
#

Yeah, it dosen't make sense because it's basically just default

grim halo
#

Shouldnt you at least specify the spigot repo?

keen compass
#

Well it does if intelliJ makes use of profiles to differentiate releases from snapshots

subtle wedge
#

Works fine without @grim halo

#

Yeah I was just interested in why that was happening

grim halo
#

Yes but you will need to run BuildTools every time you want an update

keen compass
#

that is the only thing I can figure @subtle wedge

subtle wedge
#

Alright

#

I'm on 1.15 @grim halo

keen compass
#

a way to test would be to change the profile of the project

#

and see if you encounter the same problem

#

IE, try building a release version instead

subtle wedge
#

Alright thanks

spring coyote
#

How can i set the item an npc has in their main hand using nms?

pastel nacelle
#

don't get from the map every time you need to access something in the player data

#

get the player data, hold it in a var, and access the values from that var

#

doing what you are doing now just fires 10000 million useless and redundant hashmap gets for no reason

frigid ember
#

whats a var?

pastel nacelle
#

short for variable

#

public void doShit() {
Object var = map.get(someKey);
var.doSomething()
}

frigid ember
#

oh so get the player data in the hashmap in a variable

pastel nacelle
#

yes

#

not doing that would be like you going shopping

#

but driving to the grocery store and back

#

for every single item

frigid ember
#

haha

#
                if (players.containsKey(player)) {```
#

so you meant instead of this?

pastel nacelle
#

containskey does the same lookup as get

#

instead of an if clause with contains and then get

#

do get

#

test if null

#

and then do your stuff if it isn't null

#

Object value = map.get(key);
if (value != null) {
//do stuff with value
}

frigid ember
#

but get is Value right

#

if (players.containsKey(player)) {

#

instead of key?

pastel nacelle
#

value is whatever your map contains

#

if it's a Player -> Data map, then value will be Data

frigid ember
#

my server console keeps getting spammed with preparing spawn area: 100% for the past 10+mins

#

yes its Player, Data

#

and data is the data in my data class

#

Required type: boolean Provided: Data

#

@pastel nacelle

steady osprey
golden geyser
frigid ember
#

so whats ur question? @golden geyser

paper compass
#

Should I use a vps for a prison server?

golden geyser
#

@frigid ember I can't use any of my commands, as they return nothing. Could someone help me fix it.

paper compass
#

Instead of == in your commands class please use: .equalsIgnoreCase()

#

For example:

frigid ember
#

yes

#

/Hi & /hi

paper compass
#

Change:
if (label == "hub") {
to:
if (label.equalsIgnoreCase("hub")) {

frigid ember
#

/Hi would be the only one to use

#

is there any way to get pass this preparing spawn area span? its been going on for nearly an hr now

paper compass
#

?

golden geyser
#

@paper compass i will switch gladly... im still lost on why this plugin doesnt work

paper compass
#

Try it once you've switched

steady osprey
paper compass
#

Send the code

steady osprey
#
@EventHandler
    public void onClick(PlayerInteractEvent e) {
        Player p = e.getPlayer();
        Action action = e.getAction();
        if(e.getItem() == null) 
            return;
        if(action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) {
            if(e.getItem().getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', "&e&l» &6&lMob Coin &e&l«"))) {
                ItemStack item = e.getItem();
                p.getInventory().removeItem(item);
                utils.getMobCoinMap().put(p.getUniqueId().toString(), utils.getMobCoinMap().get(p.getUniqueId().toString())+item.getAmount());
                p.sendMessage(ChatColor.translateAlternateColorCodes('&', 
                        "&b&lPrimalMC » &7Redeemed &b" + item.getAmount() + " Mob Coins"));
                return;
            }
        }
        
    }
paper compass
#

Okay

#

You need to do this:

#
    public void onClick(PlayerInteractEvent e) {
        Player p = e.getPlayer();
        Action action = e.getAction();
        if(e.getItem() == null) 
            return;
        if(action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) {
            if(e.getItem().getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', "&e&l» &6&lMob Coin &e&l«"))) {
                e.setCancelled(true);
                ItemStack item = e.getItem();
                p.getInventory().removeItem(item);
                utils.getMobCoinMap().put(p.getUniqueId().toString(), utils.getMobCoinMap().get(p.getUniqueId().toString())+item.getAmount());
                p.sendMessage(ChatColor.translateAlternateColorCodes('&', 
                        "&b&lPrimalMC » &7Redeemed &b" + item.getAmount() + " Mob Coins"));
                return;
            }
        }
        
    }```
#

Try that

steady osprey
#

alr

#

it worked thank you

paper compass
#

Np

steady osprey
#

did you just add the cancel event

paper compass
#

yeah

#

Who pinged me?

frigid ember
#

in 1.12.2 if im looking to check the blocktype of Light Gray Concrete Powder, How would I go about making sure it only checks for the Light Gray variant?

if (block.getType() == Material.CONCRETE_POWDER) {
//code going here ```
paper compass
#

try block.getData() then check if its == 7

#

Not sure if that still exists in 1.12.2 api

frigid ember
#

Looks like it is, thanks 🙂

paper compass
#

np

tiny pebble
#
        Recipe recipe = event.getRecipe();

        event.getWhoClicked().sendMessage(recipe.toString());
        event.getWhoClicked().sendMessage(bottleRecipe().toString());

Why aren't these two the same...? I'm using the bottleRecipe() recipe I made and they both print differently

#

I either need help with that or I need help with adding a custom recipe that has different inputs and different outputs... Basically, let's say I want to put a potion into a recipe along with another item. How can I make the output be based on the potion, yet still be... the same? I'm working with CraftItemEvent in hope to use setResult(), although I'm not sure that's what I want

lone fog
#

Yeah it’s probably best to do that

tiny pebble
#

alright that's what im workin with

#

i just cant check for the recipe since they're considered different

lone fog
#

Check the ingredients and then modify the output based on that

tiny pebble
#

hmmm

#

i'll try that

frigid ember
#

Last thing... what if I wanted to set the block to be the Light Gray concrete powder if it isnt?

pale tapir
#

Hello. Could you help me with a question I have about the bedwars plugin?

tiny pebble
#

?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.

paper compass
#

block.setType()
block.setData

pale tapir
#

Well, I was wondering if the bedwars plugin brings with it achievable achievements, for example killing one and giving you an assassin achievement, can I explain?

frigid ember
#

So to make sure:

block.setData((byte) 8);```
spring coyote
#

can anyone help, ive been having this problem for a while, I cant seem to figure out how to give an entityplayer npc using nms an item in their main hand

upbeat scaffold
#

I deleted my account a few months ago but the google result still pops up

#

does it ever get auto removed or do I have to make one of those requests

pastel condor
#

@upbeat scaffold I mean it will be there forever, someone could just go to archive.org and find it

upbeat scaffold
#

true that

#

but its weird that some things never get auto removed by google

pastel condor
#

🤷‍♂️

upper hearth
#

Does Player#spigot() not work in 1.16?

lone fog
#

It does

upper hearth
inland oxide
#

not needed

#

most of the spigot() functions got folded into the API

upper hearth
#

sendMessage didn't.

#

Unless it's called something else

inland oxide
#

for BaseComponent?

upper hearth
#

Yeah

inland oxide
#

no, i still use spigot() for that

lone fog
#

Docs still says it’s there

inland oxide
#

well, I do have my API at 1.13

upper hearth
#

Yeah I know that's why I have no idea what's happening lol

lone fog
#

I don’t think spigot is a method

upper hearth
#

I just converted my project to gradle, but everything else in the spigot API works

lone fog
#

Isn’t it just a public variable

paper compass
#

It is @lone fog

lone fog
#

Hmm

#

Do you have the right gradle dependencies

#

Or whatever they are called

upper hearth
tiny pebble
#

https://hastebin.com/kemisipozu.cs
At line 10, I get a NullPointerException, as the getString results in null. Although, At line 36, that is when I set the string, meaning getString should call that. Confusion is me

inland oxide
#

just the String ones are availalable from CommandSender

tiny pebble
#

also i'm aware there will be an unholy amount of recipes added, i think that's just kinda how it'll have to work unless i found a work-around

inland oxide
#

what doc says it's there?

upper hearth
inland oxide
#

oh you can't even get the spigot() to work in 1.16.1?

keen compass
#

you are using a new itemStack. ItemStacks don't magically just have customized nbt data. @tiny pebble

upper hearth
#

It's something with gradle. If I run BuildTools and add that generated Spigot JAR to the project spigot() works

inland oxide
#

perhaps
compileOnly('org.spigotmc:spigot:1.16.1-R0.1-SNAPSHOT')

upper hearth
#

Nope, still not there

tiny pebble
#

@keen compass
At line 47 I have the bottleRecipe() method with filledEnchantedSyringe being the parameter, which is itemStack. So since itemStack is used in the other method does it's NBT data not transfer over and rather just create another ItemStack? what do O.o

#

ah hm i could set a temporary itemstack and just make it equal to filledEnchantSyringe

#

ima test something

inland oxide
#

dang discord is messing my text up

spare frost
#

Is saving player data in a yml file bad?

#

and why

tiny pebble
#

I think it depends on the data?

#

Tried something like

        ItemStack item = filledEnchantedSyringe;
        Bukkit.addRecipe(bottleRecipe(item));

But it worked the same

#

gah

keen compass
#

I think you misunderstand how recipes work

tiny pebble
#

this may be true

#

im trying something annoyingly complicated

keen compass
#

while although you can set your own recipe to be crafted, not everything you specify will be saved in the recipe information

tiny pebble
#

ah

#

well

#

could I hypothetically simulate a recipe with an event?

keen compass
#

also it depends on the crafting you want to do as well

#

yes you can simulate a recipe

tiny pebble
#

what event would be the best for that? since CraftItemEvent happens after the item is crafted so

keen compass
#

Depends on which crafting inventory you are using. But you would have to check using click events and what not

tiny pebble
#

Is InventoryType.Crafting the same for crafting table as well as the player crafting inventory?

#

I've tried using InventoryClickEvent and InventoryDragEvent and it hasn't worked the best way although I'm most likely doing something wonky

keen compass
#

no, that is for the crafting table. The crafting in the player inventory is called something else if I remember correctly

#

What you could do, is just keep track of your custom items

#

and apply the customized stuff after the crafting

#

since recipes are just for crafting items upon certain materials being used

tiny pebble
#

Wouldn't that be with setResult(), most likely from CraftItemEvent?

#

Since that will set the result the second I craft it

#

swap it out from uncraftable potion to my intended potion

#

i think

#

man im going braindead

keen compass
#

why would you need to swap it out?

#

o.O

#

just keep track of the custom stuff you want items to have, just apply that custom stuff to the itemstack after it is crafted if it matches your criteria or whatever

tiny pebble
#

Since I don't want it to be uncraftable potion. Would it not need swapping and would it just... be?

keen compass
#

you don't need to swap anything, just apply your custom stuff to the itemstack update it in the inventory as necessary. Don't need a previous item to hold anything

#

also don't need a real item to have a itemStack reference either

tiny pebble
#

hmmm i see

#

alright i'll attempt it with InventoryClickEvent and/or InventoryDragEvent, if that doesn't work I'll resort back to CraftItemEvent

#

but we shall see

upper hearth
#

Sooo.... anyone figure out why spigot() doesn't exist when using Gradle?

#

I looked in the Player.class and it's just straight up non-existent lol

keen compass
#

depends how you are building

#

are you using gradle to build spigot as what buildtools would do?

#

if so then it is because you are missing patches being applied

upper hearth
#

Okay so how do I get those 🤔

keen compass
#

they are in the repo along with the sources

#

there is 2 patch processes that are done

#

well not so much patching but transformations are done first, and that happens when decompiling the minecraft jar

#

then after that is done, patches are applied to CB

#

then a clone copy of the repos is done of CB to create spigot repos

#

all you have to do is just look at the buildtools source to see the exact process

upper hearth
#

I don't think we're on the same page

keen compass
#

never answered what you are doing 😛

upper hearth
#

I'm just adding the spigot-api dependency to my project

#

not actually building the spigot jar myself

keen compass
#

ah, did you use buildtools for the API?

#

can always fetch the api from the spigot repo instead

upper hearth
#

I'm using the spigot repo.

#

But for some reason Player#spigot() doesn't exist when doing it that way

#

When I got the JAR from BuildTools it was there.

keen compass
#

Did you inspect the API jar to ensure it is indeed the same from what is expected?

#

which repo are you using?

upper hearth
#

https://hub.spigotmc.org/nexus/content/repositories/snapshots

frigid vortex
#

How can I install addons to my server?

#

Not plugins. Addons

upper hearth
#

@frigid vortex Addons...? You play on bedrock or something? lol

frigid vortex
#

How can I add a resource pack and behavior pack

keen compass
#

@upper hearth downloaded the latest api from the link you provided, the Player.Spigot() class is there

frigid vortex
#

I use spigot for crossplay

#

I mean geyser

upper hearth
#

@keen compass Do my dependencies look correct then? No idea what I'm doing wrong

keen compass
#

well you don't need both dependencies

#

CB doesn't exist in the spigot repos

#

try removing the CB dependency and keep the spigot-api one

upper hearth
#

Well I need the CB dependency for NMS

frigid vortex
#

How do I add behavior packs?

keen compass
#

then specify the spigot server jar instead

#

however the spigot server jar doesn't exist in the repos either

upper hearth
#

@frigid vortex Addons and Behavior packs are bedrock only

frigid vortex
#

Well that’s donkey crap 😦

#

XD

#

K thx

quick arch
#

CB for nms 🤔

#

just remove CB and remove -api from the spigot dependency

#

Should have nms

upper hearth
#

I'm kinda sad that worked 🤦‍♂️

#

Thanks guys lmao

quick arch
#

nice

dusk shard
#

What is the last moment that a player can sent an unregisterchannel to the PlayerUnregisterChannelEvent ?

knotty citrus
#

Would anyone know of a good lag prevention plugin
Something of that sort

tiny pebble
#

Okay so say I have a list of ItemStacks. If I want to find which out of those ItemStacks has a specific material, how would I do that? But I can't do new ItemStack(), as that would be a completely different ItemStack to the one I am searching for

#

I have

    public int getItemStack(List<ItemStack> list, ItemStack itemStack) {
        int len = list.size();
        return IntStream.range(0, len)
                .filter(i -> itemStack == list.get(i))
                .findFirst()
                .orElse(-1);
    }

Which will go through and search the list for the specific ItemStack I am looking for, but the specific ItemStack I just want to be any ItemStack with a specific material, in this case Material.MUSIC_DISC_CAT

keen compass
#

could just do a contains() @tiny pebble

tiny pebble
#

well yeah I have a contains(), but if it contains said item how would I access that specific item

keen compass
#
if(list.contains(itemStack)) { 
}
tiny pebble
#

hm

keen compass
#

you would need to know where in the list it is at

#

could do a for loop

tiny pebble
#

that's why i tried the getItemStack method up there

keen compass
#
for(Itemstack itemStack2 : list) {
if (itemStack2.equals(itemStack){
}
}
tiny pebble
#

although it isn't meant to be a specific itemstack, as it has many different properties

#

which is why i wanted to see if i could grab it by the material

#
        List<ItemStack> items = Arrays.asList(craftingInventory.getMatrix());
        List<Material> materials = new ArrayList<>();
        ItemStack test = null;
        for (ItemStack item : items) {
            if (item == null) continue;
            materials.add(item.getType());
            if (item.getType().equals(material)) {
                test = item;
            }
        }

Would this do what I want?

#

the materials list is so I can look through the matrix via materials rather than specific itemstacks as the one (as mentioned before) has very unique properties

#

which change

keen compass
#

I am sure quite a few here are @opal ingot

frigid ember
#

every time i restart my server it keeps preparing spawn area and it takes hours, what can i do?

dapper coral
#

I had a working javascript bot trying to use the XenforoAPI, but now it's not working anymore, when I retreive the data it fails to convert to JSON. Can anyone help me?

#
https.get(`https://api.spigotmc.org/simple/0.1/index.php?action=getAuthor&id=${id}`, async res => {
    res.once("data", d => {
        try {
            JSON.parse(d);
        } catch {
            return;
        }
    });
});

Every time it calls the return method

frigid ember
#

anyone of u know

#

a voting plugin

#

that gives u rank up after hitting a certain vote?

lone fog
#

Could do it with any voting plugin that has milestones

distant rapids
#

How long does it take staff to finally remove your resource?

#

Because the idiotic site doesn't let you remove your own resource yourself

spare frost
#
        Inventory inventory = Bukkit.createInventory(null, InventoryType.PLAYER);
        inventory.setContents(event.getEntity().getInventory().getContents());

        inventories.put(player, inventory);
        //respawns.put(player, respawnTime.get(player.getGame()));

        event.getEntity().getInventory().clear();
#

Is this how i save an inventor

#

y

peak marten
#

Well, that could work indeed

#

assuming that inventories is a map

frigid ember
#

Anyone know why im getting: "The method runTaskLater(Plugin, long) in the type BukkitRunnable is not applicable for the arguments (Indy, int)" from this:

    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (cmd.getName().equalsIgnoreCase("spiel")) {
            final World dl = Bukkit.getWorld("world");
            Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "playsound indie_movie_01 master @a[x=319,y=63,z=38,r=15] 319 63 38 1.5");
            dl.getBlockAt(328, 59, 31).setType(Material.AIR);
            dl.getBlockAt(314, 25, 29).setType(Material.REDSTONE_BLOCK);
            new BukkitRunnable() {
                @Override
                public void run() {
                    //add summon of armorstand
                }
            }.runTaskLater(this, 64);
}
      return false;
      }
}```
spare frost
#

yes

#

it is

peak marten
#

Then it should work

spare frost
#

is there a better way?

#

inventory doesnt have a .clone

#

unfortunately

peak marten
#

Well, I came across one issue while storing inventories

#

When I linked this to an entity, and the entity got teleported to a different world, the UUID would be the same, but the reference is actually lost

#

So what I do, by default

#

Which could be a help for you , is storing the inventory in a map <UUID, Inventory>

#

And so you would retrieve the inventory using the UUID instead

spare frost
#

yeah

west gull
#

Ok, I am new to the plugins and spigot itself, so this may sound weird, but bear with me.

Can I add any of the pluggins without spiggot?

spare frost
#

no

west gull
#

If I install spiggot, how do I get it on my server?

peak marten
#

He said bear with me , so I believe there is an argument coming

west gull
#

^^^

spare frost
#

put them in the plugins folder

peak marten
#

You need to use buildtools

#

^^^^

west gull
#

Where do I find plugins folder?

peak marten
#

It would be there automatically

#

After booting up the server

west gull
#

ok

peak marten
#

Don't forget to accept the EULA 🙂

west gull
#

how do I get it into the server in the first place

#

What is EULA?

#

sorry

#

once again new

peak marten
#

First you need to install the server using BuildTools

#

Instructions are there

west gull
#

so I have to make a new server then?

peak marten
#

Yes

#

A server is nothing more then running an application on your machine

west gull
#

Ok,
once last question before some more reaserch

I am trying to setup some plugins,

Witch is better?
Bukkit
spiggot
BungeeCord
Others?

peak marten
#

They all have their own purpose

west gull
#

ok

peak marten
#

Except for bukkit and spiggot

#

Spigot is a fork of bukkit

#

But spigot is more optimized

west gull
#

I was just warned

#

why

#

spamming?

peak marten
#

Bungeecord is used for linking multiple servers together

west gull
#

ok

But spigot is more optimized

#

ok

peak marten
#

And others , well you guessed it

steady osprey
#

when i click on a item in an inv that takes me to another inv 2 different inv click events get called 1 for each inv even tho i didnt click in the 2nd inv

peak marten
#

@steady osprey , which event are you using?

steady osprey
#

InventoryClickEvent

west gull
#

for moderation related plugins, im guessing spigot?

#

just does the most

#

most generalized?

peak marten
#

@west gull , spigot is the most famous. There are others, but no need for them.

west gull
#

ok

#

thank you

peak marten
#

@steady osprey , How are you bringing the user from one to the other inventory? Are you closing the first?

steady osprey
#

yeah

#

i cancel the event, close the inv then take them to the next inventory class

west gull
#

Can I also ask a question about the server here?

peak marten
#

I would need to see your code @steady osprey

west gull
#

discord server*

peak marten
#

@west gull , yes

west gull
#

ok

#

I was just warned for spamming by Not CafeBabe

steady osprey
west gull
#

why was I?

#

I was only typing here

peak marten
#

I'm not sure. Most likely sending too many messages in a shorter period of time?

west gull
#

ok

#

well

#

thank you for your help

peak marten
#

@steady osprey checking

steady osprey
#

Main inv listener:
https://pastebin.com/QFtMdp8P
the 2nd inv listener:
https://pastebin.com/H9QMdy1x

peak marten
#

Okay, jus a moment please

#

Well, it looks like you got many different listeners for the inventory click

#

Did you already do some debugging so you know which listener is triggering?

steady osprey
#

yeah

peak marten
#

You are trying to open an inventory, from another inventory

#

I think your problem is that you got many many different classes listening for the InventoryClickEvent

#

Certainly, one of these is getting triggered simultaneously with another one.

steady osprey
#

i dont think it is cause i check if its the correct inv title and if it isnt it returns

peak marten
#

Okay, now I see

#

So

#

You are using titles to identify inventories?

steady osprey
#

yes

peak marten
#

I see, I would go a different approach

#

These inventories, they are always the same? People cannot put things inside this inventory right?

steady osprey
#

yea

peak marten
#

It has a GUI purpose?

#

Okay so:

steady osprey
#

yes

peak marten
#

What I would do instead, I would create a map and a nice enumerable. Like this:

#
HashMap<InventoryGUI, Inventory> iventoryGUIPages = new HashMap<>();
#

And then, I would just retrieve the inventories required from the map based on the type

#

And in your onEnable() you can populate this map like this:

#

@Override
void onEnable(){

this.inventoryGUIPages.put(InventoryGUI.MAIN_PAGE, Bukkkit.createInventory(...))

}
#

And so whenever you need to open up an inventory page, you just retrieve it by using the InventoryGUI enumerable

#
Inventory mainMenu = inventoryGUIPages.get(InventoryGUI.MAIN_PAGE);
#

It's never good to use the title as the identifier

#

@steady osprey , that should solve your issue.

steady osprey
#

oh boy

peak marten
#

The actual organization on where you store the HashMap itself , etc ... that you need to decide yourself ofcourse. I always work with services calling repositories

#

StringBuilder() builder = new StrinBuilder();
builder.append("something");

buoyant path
#

is the stream code for collect really bad performance wise or decent enough?

peak marten
#

If you ask me, it really depends on how much data you are speaking of. stream is for iterating over a collection and is very powerful for filtering in collections

#

I use it quite often, no performance issues whatsoever

#

If anyone else has a different opinion on that, feel free to share 😄

buoyant path
#

this is what I've found

#

lambda looks so fucking good

#

but its shit

quick turtle
#

Anyone know how to turn a FileWriter -> async writing and BufferedReader -> async reading?

#

Im writing a custom yaml parser kek

peak marten
#

@buoyant path , as I said, I'm using it very often, no issues 🙂

#

But that's just me

buoyant path
#

Im assuming to have a playerbase of like 100 concurrent players

#

so Idk if I can use stream

#

especially because most stuff is custom

#

it might be great for creating your own game and stuff but minecraft does not handle it well lol

peak marten
#

@buoyant path , what are you trying?

buoyant path
#

its a large concept

#

basically a prison system with custom cells, gangs, levelling system (you can wear armor when you reach a certain level), you have custom mining with packets, custom loot systems

#

Its a lot

#

also like tons of animations with armorstands

peak marten
#

Sounds interesting, but you could always store your objects with a unique identifier in a hashmap so that you don't need to use a stream

buoyant path
#

I guess so

peak marten
#

That should do the trick

frigid ember
#

Hello! I been trying to fix this issue but i can't! Please help!

#

Could not load 'plugins\Hello World.jar' in folder 'plugins': uses the space-character (0x20) in its name

quick turtle
#

it literally fucking tells you the problem

#

in the one line error

#

"uses the space-character (0x20) in its name"

#

plugins cant have spaces in their names

peak marten
#

@frigid ember , you need to remove the whitespace in the name of your plugin.yml

frigid ember
#

anyone know a good

#

free CPanel

#

host

#

that isnt Linux and is web based

quick turtle
#

a free web based host that isnt on linux

#

i dont know any cpanel hosts but those are pretty damn specific xd

frigid ember
#

That worked @peak marten Thanks

#

a good mysql

#

database host

#

that is free

quick turtle
#

you want a free database

frigid ember
#

yes

peak marten
#

free doesn't exist

#

but you could host the server on your own machine

frigid ember
#

Ok

#

i found one

#

how do i enable remote host

#

remote host access

alpine yoke
#

Hello. Why my server motd is not displayed? Its bungeecord. I justused serverPing event

#

Sometimes it is, sometimes is not. Literally like once I click refresh on server list it sometimes shows up or sometimes not

peak marten
#

This is just because of minecraft. This is no issue related to your server

alpine yoke
#

nonono, not this lag. I mean, it loads up, however the motd is blank, or it works

peak marten
#

You got any motd plugins?

alpine yoke
#

I made one

peak marten
#

Okay, can you show the code?

alpine yoke
#

And when its fine its like this

#

sure I can gimme a sec

#
@EventHandler(
            priority = 64
    )
    public void onServerListPing(ProxyPingEvent event) {
        if (this.getConfig().getString("motd") != null) {
            ServerPing ping = event.getResponse();
            String motd = ChatColor.translateAlternateColorCodes('&', this.getConfig().getString("motd"));
            motd = motd.replace("{newline}", "\n");
            ping.setDescription(motd);
            if (this.favicon != null) {
                ping.setFavicon(this.favicon);
            }

            String hovermsg = ChatColor.translateAlternateColorCodes('&', this.getConfig().getString("hover"));
            ping.getPlayers().setSample(new ServerPing.PlayerInfo[]{
                    new ServerPing.PlayerInfo(hovermsg, UUID.fromString("0-0-0-0-0"))
            });

            event.setResponse(ping);
        }

    }```
peak marten
#

What is it with the priority?

alpine yoke
#

It specifies priority of the event

#

Like 64 is the highest

peak marten
#

Yes, but why do you need that?

alpine yoke
#

If some other plugin such as NetworkManager decided to mess up, mine will be 1st

#

So the motd will be as it should be

peak marten
#

@EventHandler(priority = EventPriority.HIGHEST)

alpine yoke
#

In bytes, 64

#

As I did

peak marten
#

Okay, so can you try changing your code so it only shows a small message

alpine yoke
#

It loads up motd from config file

peak marten
#

Because the ✅ is still there

#

yes

alpine yoke
#

this.getConfig

peak marten
#

I know

alpine yoke
#

ikr it is

#

the ✅ is becasue its bungeecord

#

FML compatible

peak marten
#

Oh, okay, didn't knew that

#

Try changing the motd to something simple without colours

#

and a short text, and check if it still gives issues then

alpine yoke
#

Maybe this is reason

#

its depreciated

peak marten
#

very possible haha

alpine yoke
#

yeah

#

component

#

this should fix it

#

letme try to compile and upload

peak marten
#

what did you do?

alpine yoke
#

this

peak marten
#

Okay, try that

alpine yoke
#

Hmm

#

seems to work so far

#

Idk i just lagged server list

#

Yah seems to work fine

peak marten
#

most likely there is a reason it got deprecated

alpine yoke
#

Yeah, when I made this plugin it did not be though

peak marten
#

Ah well, it works, that all that counts 😄

alpine yoke
#

Yup

#

hehe

#

Also can I make this server list not lag when I spam refresh?

peak marten
#

No idea

#

I guess not ,this is running on the client

#

Only the server Ping is not

alpine yoke
#

True

#

1.16 though has fixed this

peak marten
#

ah really?

alpine yoke
#

Yes

#

I guess 1.13 was the 1st fixing this

peak marten
#

no idea

warm stirrup
#

neither remove that scaling information

alpine yoke
#

I have the same problem, I ain't fixed that :/

#

Therefore +1 to ur question

warm stirrup
#

yikes i swear ive seen on servers that some dont have that

#

hmmm wait a minute that map is 358:126 while my map is only 358 maybe thats how you do it?

#

i mean item ids were discontinued though

bold anchor
#

Using outdated versions

open ibex
#

Technically you can turn it off by disabling advanced item tooltips but that's probably not the solution you're looking for

#

I'd say nms

warm stirrup
#

didnt even know that was an advanced tooltip thing but yeah thats not exactly what im looking for

chrome heron
#

the player inventory lost when i update the server from 1.15 to 1.16 ,anyone have the same problem and how to solve it?

bold anchor
#

@chrome lark Is this the same guy?

chrome lark
#

ye

bold anchor
#

Okay, sry for tag

neat oxide
#

Hey guys im trying to get custom loottable to work but its not going great everytime i try it it just do not work at all here is my code

#

LootTable

nova mural
#

is adding enchantments to arrows as simple as casting Arrow#addCustomEffects() ?

#

wait i can't pull an itemstack from that

#

can i just add an enchantment to arrow itemstacks?

frigid ember
#

hey can anyone help me and see what is wront with my plugin?

#

package me.nary.helloworld.commands;

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

import me.nary.helloworld.Main;

public class NickCommand implements CommandExecutor {

private Main plugin;

public NickCommand(Main plugin){
    this.plugin = plugin;
    plugin.getCommand("hello").setExecutor(this);
}

@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if (!(sender instanceof Player)){
        sender.sendMessage("Only Players May Execute This Command!");
        return true;
    }
    
    Player p = (Player) sender;
    
    if (p.hasPermission("hello.use")){
        p.sendMessage("hi!");
        return true;
     } else {

p.sendMessage("You do not have permission to execute this command!"); }
return false;
}

}

sturdy oar
#

What's the issue

digital cipher
#

package me.nary.helloworld.commands;

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

import me.nary.helloworld.Main;

public class NickCommand implements CommandExecutor {

private Main plugin;

public NickCommand(Main plugin){
    this.plugin = plugin;
    plugin.getCommand("hello").setExecutor(this);
}

@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if (!(sender instanceof Player)){
        sender.sendMessage("Only Players May Execute This Command!");
        return true;
    }
    
    Player p = (Player) sender;
    
    if (p.hasPermission("hello.use")){
        p.sendMessage("hi!");
        return true;
     } else {

p.sendMessage("You do not have permission to execute this command!"); }
return false;
}

}
@frigid ember you initialized constructor?

frigid ember
#

what does that mean

#

im new to java

#

i started yesterday

sturdy oar
#

What's the error ???

#

I can't really help much if you don't tell me a Java error

frigid ember
#

main cannot be resolved as atype

sturdy oar
#

use Plugin

digital cipher
#

what does that mean
@frigid ember You have written "public NickCommand(plugin) ....".Have you instantiated this class somewhere? ex. new NickCommand(plugin)

frigid ember
#

idk

sturdy oar
#

I don't really recommend passing the instance of your main plugin unless you have some fields or methods there

#

You could just pass "Plugin"

frigid ember
#

thats my screen

sturdy oar
#

I see

digital cipher
#

I recommend doing this.

// Main class
public void onEnable() {
  this.getCommand("hello").setExecutor(new NickCommand(this)
);
}

// NickCommand.java

public NickCommand(Main plugin) {
  this.plugin = plugin
}
#

oh

frigid ember
#

where do i put that?

sturdy oar
#

on you main class

digital cipher
#

edit

sturdy oar
#

the one that extends javaPlugin

frigid ember
sturdy oar
#

I recommend doing this.

// Main class
public void onEnable() {
  this.getCommand("hello").setExecutor(new NickCommand(this)
);
}

// NickCommand.java

public NickCommand(Main plugin) {
  this.plugin = plugin
}

@digital cipher do what this man said

frigid ember
#

but where do i put that

#

also how do i do that little box thing you have

#

do i replace the entire main class with that?

digital cipher
#

put this on your main class method onEnable this.getCommand("hello").setExecutor(new NickCommand(this));

#

and edit your constructor in NickCommand.java

public NickCommand(Main plugin) {
  this.plugin = plugin;
}
frigid ember
#

i have no idea what your talking about

digital cipher
#
package me.nary.helloworld.commands;

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

import me.nary.helloworld.Main;

public class NickCommand implements CommandExecutor {

    private Main plugin;

    public NickCommand(Main plugin){
        this.plugin = plugin;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)){
            sender.sendMessage("Only Players May Execute This Command!");
            return true;
        }

        Player p = (Player) sender;

        if (p.hasPermission("hello.use")){
            p.sendMessage("hi!");
            return true;
         } else {
p.sendMessage("You do not have permission to execute this command!");        }
        return false;
    }

}
sturdy oar
#
@Override
public final void onEnable(){
Bukkit.getPluginCommand("your-command-name").setExecutor(new MainCommand(this));
}
digital cipher
#
@Override
public void onEnable() {
  this.getCommand("hello").setExecutor(new NickCommand(this));
}
sturdy oar
#

And register the command inside the plugin.yml if you haven't already done it

frigid ember
#

i dont have a plugin.yml

sturdy oar
#

Dude

#

Xd

digital cipher
#

lol

sturdy oar
#

You should read the bukkit documentation

#

I can't spoonfeed all day

frigid ember
#

k

sturdy oar
#
BukkitWiki

When Bukkit loads a plugin, it needs to know some basic information about it. It reads this information from a YAML file, 'plugin.yml'. This file consists of a set of attributes, each defined on a new line and with no indentation.

A command block starts with the command's na...

frigid ember
#

how do you do that box thing with the colors and stuff for java

sturdy oar
#
\\ code
frigid ember
#

?

digital cipher
#

no

sturdy oar
#

Please use hastebin

#

?paste

worldly heathBOT
frigid ember
#

it didnt work

sturdy oar
#

.A???

#

Wut

#

Just use what I send and write your plugin.Yml

digital cipher
sturdy oar
#
@Override
public final void onEnable(){
Bukkit.getPluginCommand("your-command-name").setExecutor(new MainCommand(this));
}

@sturdy oar you need to use this in your main class

frigid ember
#

' ' '

digital cipher
#

`

sturdy oar
#

Those are not backticks

frigid ember
#

what are they?

sturdy oar
#

Backticks `````

frigid ember
#
package me.nary.helloworld.commands;

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

import me.nary.helloworld.Main;

public class NickCommand implements CommandExecutor {
    
    private Main plugin;
    
    public NickCommand(Main plugin){
        this.plugin = plugin;
        plugin.getCommand("hello");
    }
    
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)){
            sender.sendMessage("Only Players May Execute This Command!");
            return true;
        }
        
        Player p = (Player) sender;
        
        if (p.hasPermission("hello.use")){
            p.sendMessage("hi!");
            return true;
         } else {
p.sendMessage("You do not have permission to execute this command!");        }
        return false;
    }

}
#

ooh

#

no colors tho 😦

digital cipher
#

without space

sturdy oar
#

Then newline

frigid ember
#

ok

#

i now have pluygin.yml

#

can someone call me ad ill share scree and ye but i wonnt talk

sturdy oar
#

I can't I'm sorry

frigid ember
#

its ok

#

u dont ned to be sorry

sturdy oar
#

Just watch some tutorial

frigid ember
#

i am

sturdy oar
#

Do you already know Java?

frigid ember
#

no

sturdy oar
#

That's the issue

digital cipher
frigid ember
#

how do i learn java

sturdy oar
#

a regular minecraft plugin looks like this
@digital cipher it's most common to have the plugin.yml inside a /resources folder

bold anchor
#

Viper only if you have a buildtool smh

sturdy oar
#

Maven

digital cipher
frigid ember
#

bruh

#

wat is that#

sturdy oar
#

A plug-in?

frigid ember
#

how do i start to lern java?

sturdy oar
#

This is good in my opinion

frigid ember
#

thx

sturdy oar
#

There's an enormous amount of tutorial in that website, you probably don't even need them all

sinful spire
#

also i didnt know he is in this discord lol

frigid ember
#

this is impossible

#

ye im just gonna not

sinful spire
#

not that hard to understand if you dont touch kotlin

sturdy oar
#

I don't like some things about that tutorial tho

sinful spire
#

wut

#

why did it delete

sturdy oar
#

I don't like the fact that he is sending a link that links to an illegal website that redistributes spigot

sinful spire
#

oof, wait what

sturdy oar
#

Look in his description

sinful spire
sturdy oar
#

But above

sinful spire
#

wait is g*tb**k* illegal?

sturdy oar
#

Yes

sinful spire
#

welp

sturdy oar
#

Otherwise my message wouldn't be getting deleted

#

Also I don't really recommend installing Oracle JDKs

#

But that's a minor issue

dusky sigil
#

how can i test multiple player plugins in a localhost?

sinful spire
#

welp i guess they could keep like minecraft 1.4.7 on there

#

yeah, why not?

sturdy oar
#

how can i test multiple player plugins in a localhost?
@dusky sigil offline mode I guess

dusky sigil
#

@sturdy oar elaborate?

sinful spire
#

server.properties => online-mode: false

sturdy oar
#

Do you need lot of players to test your plugin?

dusky sigil
#

2 or 3

sturdy oar
#

You can just make some bots join I guess

dusky sigil
#

its.. a localhost

sinful spire
#

yes?

sturdy oar
#

Exactly

dusky sigil
#

hmm ill look this upu

#

up**

sturdy oar
#

Do they have to also move?

#

Or they stand still

sinful spire
#

viper can i say the name of lam***at***k or not

dusky sigil
#

they just have to execute commands

sinful spire
#

oh

#

then you gotta custom code a bot or just run 2 minecraft instances

scenic carbon
#

Wait

sturdy oar
#

Yeah you can still do this with a bot or a offline mode account

scenic carbon
#

Are you not allowed to download jars from websites

sinful spire
#

no

sturdy oar
#

Nope

scenic carbon
#

oof

dusky sigil
#

k ill try

sinful spire
#

buildtools just builds it on your pc

scenic carbon
#

sticking with paper then :))))

sinful spire
#

paper sucks

tiny dagger
#

jeez

scenic carbon
#

How come it’s not allowed

sinful spire
#

because minecraft

scenic carbon
#

ah yes mc = uwu

tiny dagger
#

5 min to use build tools is too much apparently

sinful spire
#

yeah

scenic carbon
#

lmao

#

nah

#

it’s just long af

sinful spire
#

its just 5 minutes,

#

like wow.

scenic carbon
#

I can’t be bothered to build it on my computer then transfer it to pyterdactyl panel

tiny dagger
#

wastes more time watching youtube, can't be bothered to start build tools meanwhile

#

👀

scenic carbon
#

👀

#

What’s the best midrange dedi to get

sinful spire
#

doesnt pterodactyl technically download it from a website?

scenic carbon
#

Wdym

sturdy oar
#
var mineflayer = require('mineflayer') var bot = mineflayer.createBot({ host: 'localhost', // optional port: 25565, // optional
username: user }) bot.on('chat', function (username, message) { if (username === bot.username) return bot.chat(message) }) bot.on('error', err => console.log(err))
sinful spire
sturdy oar
#

Here a bot

tiny dagger
#

you need something that has the best cpu freq per thread per price

sinful spire
scenic carbon
#

true

blazing burrow
#

how would i change the amount dropped from a block?

sturdy oar
#

Depends

#

Usually I cancel default drop the event and spawn the items naturally

blazing burrow
#

yeah thats what i saw on a thread

#

so like
event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation(), new ItemStack(event.getBlock().getType(), 6);
would drop 6 of the same block that was broken right

torn robin
#

What event are we taking about

fringe shore
#

hello i have just started coding a minecraft plugin (and yes i have looked through the documentation and did watch some videos before i started) and i managed to make a plugin that when u type /hello it says hello back but when i put the plugin into my plugin folder i get a error saying invaild.yml so this is my code to my yml ``` main: me.EpicGamese.HelloWorld.Main
name: Hello
version: 1.0
author: EpicGamese

commands:
Hello:

torn robin
#

Try deleting the new line between commands author and hello

#

Remove the space behind main

fringe shore
#

ok

torn robin
#

And indentation should be two spaces, not a tab or 4 spaces

fringe shore
#

like this main: me.EpicGamese.HelloWorld.Main name: Hello version: 1.0 author: EpicGamese commands: Hello:

#

the space of main is not in my editor

torn robin
#

You probably need to also add a description to the command

fringe shore
#

ok

torn robin
#

under Hello:

#

And to be safe I’d add a usage too

fringe shore
#

i typed a description an when i put basic hello world plugin there is a red line under plugin and it says plugin not curently spelled

torn robin
#

Can you send it again?

#

The new version

fringe shore
#

sure

#
name: Hello
description: Basic hello world plugin!
version: 1.0
author: EpicGamese
commands:
  Hello:
sinful spire
#

why is the "main" spaced out?

#

is it discord formatting

torn robin
#
main: me.EpicGamese.HelloWorld.Main
name: Hello
description: Basic hello world plugin!
version: 1.0
author: EpicGamese
commands:
  Hello:
    usage: /<command>
#

I meant like that

fringe shore
#

its the discord formating

#

ok

sinful spire
#

oh you can

torn robin
#

package names should always be lowercase

#

just a btw

sinful spire
#

eclipse says otherwise xD

torn robin
#

pretty sure eclipse also says it lol

fringe shore
#

i just got warned for spamming lol

sinful spire
#

autocorrected "testplug" to "Testplug" so

torn robin
#

curious

blazing burrow
#

@torn robin sorry i didnt see your message i was talking about blockbreakevent

torn robin
#

I know it warns you when you're creating a package

#

so like
event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation(), new ItemStack(event.getBlock().getType(), 6);
would drop 6 of the same block that was broken right

fringe shore
#

it loaded the plugin but it says you do not have perms

sinful spire
#

give yourself op then

torn robin
#

yes that should drop 6 of the same block that was broken

fringe shore
#

i do have op @sinful spire

torn robin
#

What command are you running, and what's your command source (class file)?

sinful spire
#

do you have any permission plugin?

worldly heathBOT
sinful spire
#

?paste

#

it

fringe shore
#

nope

blazing burrow
#

uhh are u asking me about the command @torn robin

torn robin
#

no Atin diff person

blazing burrow
#

oh ok

torn robin
#

yes that should drop 6 of the same block that was broken

blazing burrow
#

Yeah thank you

torn robin
#

the code you gave should do what you asked

blazing burrow
#

Yes okay

torn robin
#

👍

blazing burrow
#

instead of 6 if i add Random.nextInt(1000) it will drop a random from 0 to 1000 blocks right?

fringe shore
#

i fixed my issue thanks guys

torn robin
#

glad to hear it

#

replacing new ItemStack(event.getBlock().getType(), 6) with new ItemStack(event.getBlock().getType(), ThreadLocalRandom.current().nextInt(1000)) would be better

#

TLR should be preferred over new Random() for complicated thread reasons

blazing burrow
#

Okay thanks

#

i see

#

do i have to create an instance of TLR or anything

torn robin
#

the max might be capped at 64 though, not sure

#

The class itself is static (part of why it's safer for multithreads probably) so no

spark phoenix
#

Okay so, the issue I have rn with GriefPrevention is that anything I try to spawn inside a claim disappears immediately, some examples:

  • When a MobSpawner is placed inside a claim, it shows the "fire" particle that suggest it spawned the mob, but you can't see it, it instantly dissappear (but the tick that spawns the mob executes).
  • When spawning anything inside a claim using an Egg, happens exactly the same. Trying with Cow Eggs, you can hear the sound of the cow when it spawns, suggesting that the spawn tick executed, but it disappears immediately and you can't see it.
  • When trying to procreate animals, same happens
  • Is happening even with armor stands (that as far as I know counts as entity spawn as well)
torn robin
#

You can do something like

ThreadLocalRandom random = ThreadLocalRandom.current();
System.out.println("?: " + random.nextInt(50));
#

How long has this issue been occurring? Have you changed anything server wise (Plugins, configs, permissions, etc.)?

tiny dagger
#

not sure which is better threadlocal or secure random 🤔

blazing burrow
#

OKay thanks msws

torn robin
#

yep yep

#

I'm pretty sure secure random is for passwords and stuff

#

no idea what the differences are

tiny dagger
#

it's very fast tho

#

or so i heard

cobalt yoke
#

Random = Easy Brute Froce

#

lol

spark phoenix
#

Weeks by now, and seems to happen since my server opening, I just didn't notice it because I didn't test-play that long, just maked sure that everything worked, commands n that kind of stuff

torn robin
#

If you disable GP does the issue still occur?

spark phoenix
#

Well, this only occurs inside a GP claim

#

you can spawn whatever you want outside

torn robin
#

If possible I'd still like to confirm it's caused by GP

#

it's likely a GP configuration then? have you looked at those?

spark phoenix
#

yup, there's nothing related to spawn

torn robin
#

Hm, I unfortunately don't know then. If they have a discord/support system then I'd use that.

frigid ember
#

players.compute(uuid, (key, value) -> new Data(e.getEntity().getLocation(), e.getDeathMessage(), LocalDateTime.now(ZoneOffset.UTC).format(formatter))); can this actually be done in a hashmultimap

#

To make it UUID, Data

#

And 3 things are stored in data via my Data.java class

kind crow
#

Hi, is there a way to download part of a server map? I have 200gb map and I want to only download the 2k spawn radius (to use in single player)

paper compass
#

UwU

cosmic ivy
#

Hi, what Event Listener should I use when I want to listen when a Bell is activated by redstone? Thx in forward...

frigid ember
#

was I just kicked off the server?

paper compass
#

BlockPoweredEvent i think

frigid ember
#

o, server must've reset or something

paper compass
#

I forgot

#

1 sec

frigid ember
#

ok

cosmic ivy
#

@paper compass that doesn't exist. there is BlockRedstoneEvent, but that only works for redstone emiters (like redstone, levers, ...)

paper compass
#

ah

cosmic ivy
#

or is there no way to check generally if a bell was triggered

warm stirrup
#

why use
commands:
test:
usage: /<command>
in plugin.yml if you could just do

usage: /test

tough crown
#

i did it but it doesn't work

warm stirrup
#

hm

tough crown
warm stirrup
#

I mean like in your case, why not use usage: /lock

#

does that actually not work?

tough crown
#

i tried that but doesn't work

warm stirrup
#

Weird

tough crown
#

the word is still red

#

but when i type /version SimplyLock it's able to read the content in my plugin.yml

#

ohh i found the problem

#

finally

#

because i was using plugman to test

#

i need to reload it in order to get the suggestion

#

so if i have an argument i can just change the usage to usage: /lock <name>?

tough kraken
#
Random randomTree = new Random();
int randomTreeInt = randomTree.nextInt(100);
if (randomTreeInt <= 20) {
world.generateTree(new Location(world, x, y + 1, z), TreeType.TREE);
tiny dagger
#

why did you declared that if you only use it once?

tough kraken
#

declared what lol

tiny dagger
#

Type name;

#

declaration ^

tough kraken
#

i dont think thats the cause for the crash...

tiny dagger
#

it isn't

#

but still

tough kraken
#

so use this?
int randomTreeInt = new Random().nextInt(100);

tiny dagger
#

even better Math.random() <= 0.2

frigid ember
#
dataMap.get(uuid).getLocation().getWorld().getName()```
#

I cant get the loc of a players uuid

#

how would I convert it from uuid to player again :/

tough kraken
#

alright thanks

#

but still, why the crash?

tiny dagger
#

your server seems to crash on world load

tough kraken
#

yep

tiny dagger
#

is it loaded?

tough kraken
#

on creating

frigid ember
#

than I provide player instead of uuid

tiny dagger
#

try generating a tree after the chunk loaded

tough kraken
#
[14:01:35] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
[14:01:36] [Server thread/INFO]: Preparing start region for dimension minecraft:test
[14:01:36] [Worker-Main-15/INFO]: Preparing spawn area: 0%
[14:02:39] [Spigot Watchdog Thread/ERROR]: ------------------------------
[14:02:39] [Spigot Watchdog Thread/ERROR]: The server has stopped responding! This is (probably) not a Spigot bug.
[14:02:39] [Spigot Watchdog Thread/ERROR]: If you see a plugin in the Server thread dump below, then please report it to that author
[14:02:39] [Spigot Watchdog Thread/ERROR]:      *Especially* if it looks like HTTP or MySQL operations are occurring
[14:02:39] [Spigot Watchdog Thread/ERROR]: If you see a world save or edit, then it means you did far more than your server can handle at once
[14:02:39] [Spigot Watchdog Thread/ERROR]:      If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash blablablabla
#

or i did

#

lol

frigid ember
#

nah I just didnt say it correctly

#

so my hashmap is uuid

#

and I need to get the information about the uuid

#

dataMap.get(uuid).getLocation().getWorld().getName()

#

but I cant get the location of a player's uuid

#

so what should I do to do this :/

#

dataMap.get?

#

Multiple things

#

Data class

tough kraken
#

wow my first time generating a custom world an the server crashes... lmao

frigid ember
#

so one is location, one is string, one is string

tough kraken
#

yeah thanks anyway

frigid ember
#

yes

#

uuid of sender

#

the world he previously died in that is stored in the hashmap as location

tough kraken
frigid ember
#

Player player = (Player) sender; UUID uuid = player.getUniqueId();

#

thats done

#

I need to get the info of the player's uuid out of the hashmap

#

but getLocation can't be done to an uuid

lone fog
#

map.get(uuid)

frigid ember
#

yes and .getLocation().getWorld().getName() behind it

#

but that doesnt work

lone fog
#

What does the map contain

balmy sentinel
#

what’s in your data class?

frigid ember
#

uuid, data

balmy sentinel
#

?paste

worldly heathBOT
lone fog
#

Does data have a getLocation method

frigid ember
#

player.sendMessage(applyCC("&6World:&f " + dataMap.get(uuid).getLocation().getWorld().getName()));

balmy sentinel
#

and what’s the problem?

frigid ember
#

this doesnt work

balmy sentinel
#

wdym it doesn’t work

#

error?

frigid ember
#

ohh maybe its the for-loop

#

4

#

Cannot resolve method 'getLocation' in 'Set'

#
                    for (Map.Entry<UUID, Data> plInfo : dataMap.entries()) {```
#

    HashMultimap<UUID,Data> dataMap = HashMultimap.create(1, 5);```
digital cipher
#

Multimap value is Collection

#
Multimap<UUID,Data> dataMap = ArrayListMultimap.create();
dataMap.get(key); // return Collection<Data>
lone fog
#

Why not use a standard hashmap

frigid ember
#

I have to send the message over multiple data stored of that uuid

lone fog
#

Then loop through the returned collection

tiny dagger
#

maybe he needs a multi map

frigid ember
#

yes I do

digital cipher
#

you can do so

for(Data data : dataMap.get(key)) {
  // do something else
}
alpine yoke
#

Hello. Does the EZPlaceholderHook still exist?

tough kraken
#

how can i FULL delete a project in intellij? it just deletes the modules

tiny dagger
#

that confused me as well

#

in eclipse you can just do it

#

that easy

tough kraken
#

yeah

tiny dagger
#

so easy

tough kraken
#

i am using eclipse for forge development... and its so freaking weird for me. no automatic autocorrect/method help etc

#

so weird

chrome lark
#

Just delete it from the disk and hit the remove button or whatever

frigid ember
#

Or go to New recent projects

#

And manage them

chrome lark
#

IJ doesn't have a "delete this project" thing afaik, nor does visual studio last I recall, etc, etc

frigid ember
#

Manage projects

#

Thats where you can delete them

chrome lark
#

don't recall there being a delete button

frigid ember
#

Well its not difficult

#

New -> Recent projects-> manage projects

#

Thats where there is a X

chrome lark
#

Yea, that's not a delete button

#

That just removes it from the recents, not actually deletes it

frigid ember
#

Ahh

bold anchor
#

I usually don’t need to remove it

frigid ember
#

Nah make a new project of it

tough crown
#

how can i use the onBlockPlace event?

balmy sentinel
#

wdym how can you use it?

#

make a listener class that listens for BlockPlaceEvent and it’ll be called whenever a block is placed by a player.

scarlet nova
#

Can someone tell me how can I remove mobs from spawning in a minecraft world with worldguard or multiverse core but keep spawners working?

distant rapids
#

use gamerules on certain worlds with multiverse

balmy sentinel
strong lantern
#

how do I get the list of players on a bukkit server I can't find anything helpful

vernal spruce
#

Bukkit.getOnlinePlayers

strong lantern
#

ty

peak marten
#

Question, what is the correct approach for storing a reference to a world? When I used a property World, for one server, it gave back null. And I'm certain that the world was actually correct.

#

So more specific, in which cases will an earlier reference to a world interface return null?

gilded compass
#

How does one remove the square brackets around a TextComponent ?

#

For some reason it is adding them on its own

#
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        TextComponent message = new TextComponent(TextComponent.fromLegacyText(colorise(EventUtils.parsePlaceholders(locale, locale.getDiscordDefault()))));
        message.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, locale.getDiscordLink()));
        sender.sendMessage(message);
        return true;
    }```
strong lantern
#

wait how do I store the output of Bukkit.getOnlinePlayers

#

what format is it?

vernal spruce
fathom coral
#

Would MySQL Inventory Bridge work with MySQL express?

neat orbit
#

Does anybody know how to possibly remove prefixes from display names in Essentials so they are not visible in BalTop? I have only seen 1 forum surrounding it and I did not fully understand.

alpine kiln
#

You can just delete the module then delete the files/folder

#

requires hitting delete twice

hot anvil
#

hey

balmy sentinel
#

@gilded compass try sender.spigot().sendMessage(message); If that doesn’t fix it it’s something you’re doing that’s adding them

hollow root
#

How does one remove the square brackets around a TextComponent ?
@gilded compass probably some other plugin interfering? a textcomponent should be sent exactly as it is

EDIT: how can you even send that without using .spigot()? I thought bukkits sendMessage only accepts Strings. IntelliJ never let me do that without using sender.spigot()

dry horizon
#

if lets say, i have a bungeecord server but for each server ill make a plugin, can i just code the plugins in Spigot and not bungeecord?

tough kraken
opal adder
#

Spigot plugins are different from bungee plugins. So yes.

tough kraken
#

its btw the exact example from the wiki lol

dry horizon
#

Spigot plugins are different from bungee plugins. So yes.
@opal adder Thank you

distant rapids
#

How come some plugins are universal?

bold anchor
#

Meaning?

distant rapids
#

how do they do that

mellow wave
#

Probably that they work on both spigot and bungee

bold anchor
#

Do what

tough kraken
#

i think he means compatible for multiple versions

distant rapids
#

yes

bold anchor
#

They make them compatible for multiple versions

distant rapids
#

...

tough kraken
#

lol

distant rapids
#

how do they do that
@distant rapids how

mellow wave
#

They use different code depending on version

#

With a selector of some kind

tiny dagger
#

is PlayerResourcePackStatusEvent ran async?

bold anchor
lapis plinth
#

is there a method to send an action bar to a player without NMS? (1.12.2 api)

mellow wave
#

Don't think so

tough kraken
#
if(server.getVersion().equals(1.14)){
//1.14 code
} else if(server.getVersion().equals(1.15)){
//1.15 code
}

etc

lapis plinth
#

so I'd have to use NMS?

tough kraken
#

btw thats no working code lol

tiny dagger
#

better question, is there a bukkit tool to async check?

pastel nacelle
#

whot

tiny dagger
#

i wanna check if an event is async

pastel nacelle
#

the event has a method for that

tiny dagger
#

PlayerResourcePackStatusEvent

#

ah i see

#

lol

tough kraken
#

is there a method to send an action bar to a player without NMS? (1.12.2 api)
@lapis plinth idk if that works for 1.12 but

 players.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(message));
tiny dagger
#

this would be supposed to trigger then

#

i guess is sync

#

lol

#

i'm out of words then

#

hamsterapi is crashing for some reason from this event

#

👀

#

the devs keep pointing at me

#

for some reason 😂

bold anchor
#

Lol

#

Dafuq is up with those weird symbols tho

tiny dagger
#

intellij has them too

#

just smarter and less visible

#

they are lines i think

#

you know to keep your code aligned

bold anchor
#

You got an issue

#

That’s ugly as fuck

tiny dagger
#

you get used to it

dry horizon
#

lmao

tiny dagger
tough kraken
sturdy oar
#

is it a chunk

#

Chunk blocks go to 0-15

#

Since you know a chunk is a 16² square with 256 height

tough kraken
#

yeah

frigid ember
#

How do I code something like watchdog on my Minecraft server to prevent hacking

sturdy oar
#

With java?

tiny dagger
#

here we go again

tough kraken
#

tbh thats just copied from the wiki... so if it doesnt work they made something wrong lol, or i am totally dumb

#

wouldnt be a wonder

frigid ember
#

Bruh what are the basic commands

sturdy oar
#

If you don't have +3 years with Java and good physics / statistics knowledge don't ever consider writing anticheats

frigid ember
#

Rip I can have my cousin do it ig

tough kraken
#

anticheats are harder to code, than break them

sturdy oar
#

I can only write Reach/HitBox checks so far 😢

tough kraken
#

i can not even do THAT lol

#

clickspeed check shouldnt be so hard as well i think

#

but idk

sturdy oar
#

The main issue and annoying thing is to consider about server lag and player latency