#help-archived

1 messages ยท Page 187 of 1

subtle blade
#

BuildTools automatically installs Spigot, CraftBukkit and Bukkit to your local Maven repository

#

You shouldn't need to do it manually

raven flare
#

@subtle blade So what do I need to do to make it work?

fickle flicker
#

Oh ok, should I run BuildTools at the root then?

subtle blade
#

Create a variable called player. Though this is something you should really understand if you want to update a plugin

#

No, create a folder on your desktop or somewhere you'll remember titled "BuildTools". Run it there

#

BT generates a lot of files so it's best to keep it all in a single folder

fickle flicker
#

Ok, thanks ๐Ÿ™‚

raven flare
#

Yeah obviously I need the variable player but how do I set it to the player?

brisk agate
#

either do

#

Player player = event.getPlayer();

#

just do that

#

above the if statement

raven flare
#

okay thanks

brisk agate
#

๐Ÿ™‚ np

wooden patrol
#

Hey guys after I updated to 1.16.1 from 1.15.2 nametags (above player head) stopped working. I removed all my plugins from spigot server and nametags still didn't work anyone have any idea what might cause this? I really spent a whole 2 days figuring out what might cause this but without luck..

raven flare
peak glade
#

hey

#

can help

#

me

#

but this ./server

#

luckperms

raven flare
#

@peak glade it would help if you spoke in sentences

green cedar
#

You mean Server.getWorlds() ?

#

@tranquil edge

bronze acorn
#

@peak glade make sure you have bungeecord.command.server permissions, make sure its linked to a db so your bungee can also read the permissions

latent rock
#

3 of the plugins I'm running can't get InventoryClickEvent passed to them, is there a setting in Spigot that's causing this?

pastel condor
#

it's a plugin @green cedar

wraith thicket
#

I don't think PAPI has one for listing worlds

green cedar
#

So he is asking how to use the features of a specific plugin, not how to code using spigot API?

wraith thicket
#

Yes, which is a totally valid question to ask here.

green cedar
#

Yes, i wasn't knocking the question. Just assumed he was asking how to code. Im not familiar with existing plugins. So i will shhhh now.

wraith thicket
#

@latent rock What do you mean by "can't get InventoryClickEvent passed to them"?
Did you code these plugins or are you simply using them?
Also, inventory clicks don't work the same when you're in creative mode, by the way

#

If you want to code it youself, then sure

opal heron
#

i came across to this thing called sql?

latent rock
#

I'm getting a really strange bug where players' inventories disappear when moving worlds. It's gone visually but comes back if

  1. The player clicks on any slot in the invenotry
  2. The player relogs
#

I thought it might be related to the inventory click event errors

wraith thicket
#

@tranquil edge You can simply Server#getWorlds

opal heron
#

@latent rock do you have a plugin that seperates inventories?

latent rock
#

No

opal heron
#

or do you lose the items when you travel

latent rock
#

It's still there when I use /invsee on them but they can't see it. It's fixed by clicking on an inv slot or relogging

opal heron
#

Hm

crimson sandal
opal heron
#

that's weird

#

Do you have authme?

#

maybe its that plugin

#

@latent rock

frigid ember
#

I'm trying to set up a "bleed" effect on a player, where every 1 second they lose 1/2 a heart for 5 seconds.

#

I implemented the following method to do so:

    private void bleed(Player defendingPlayer, Player attackingPlayer) {
        
        int counter = 0;
        while(counter < 5) {
            
            Bukkit.getScheduler().runTaskLater(Statics.getJavaPlugin(), new Runnable() {

                @Override
                public void run() {
                    
                    defendingPlayer.damage(1.0, attackingPlayer);
                }
                
            }, (counter * 20));
            
            counter++;
        }
        
        
    }
tiny dagger
#

open with a boolean

frigid ember
#

However, it just keeps hurting them and never stops

#

Am I missing something here?

wraith thicket
#

@frigid ember I'm guessing you've implemented that in the EntityDamageEntityEvent? That event will get called again every time you call the #damage method with an entity source

frigid ember
#

oh

#

wow

#

@wraith thicket How do I damage the player then without calling that event

wraith thicket
#

Don't specify the source

#

I'm not that familiar with that specific plugin

#

I know it works well with DeluxeChat

mellow wave
#

Don't they have their own support discord

frigid ember
#

@wraith thicket Thanks man

mellow wave
#

Ask in their discord

wraith thicket
sturdy oar
#

I want to ask a thing: why does everyone use Vault nowadays?

#

Is just because the others do

mellow wave
#

It's easier to support multiple economy and permission plugins

sturdy oar
#

I never liked the Vault API

#

It's really not intuitive

mellow wave
#

eh it works

gusty crane
#

Hey, tried getting dynmap to work on my server but i keep having issues ive got a nice old map on 1.16.1 formerly on 1.18 idk if thats the issue but i keep having my log filled with chunk errors:
[21:41:44] [Server thread/ERROR]: Couldn't load chunk [274, 420] java.lang.ArrayIndexOutOfBoundsException: null
Anyone who knows how to fix this?

half finch
#

This is properly making the Stone Pickaxe use stone instead of cobble, but it is also getting rid of the Blackstone recipe. Can anyone tell me why its getting rid of the Blackstone recipe? https://hastebin.com/utenimuxes.cs

sturdy oar
#

Hey, tried getting dynmap to work on my server but i keep having issues ive got a nice old map on 1.16.1 formerly on 1.18 idk if thats the issue but i keep having my log filled with chunk errors:
[21:41:44] [Server thread/ERROR]: Couldn't load chunk [274, 420] java.lang.ArrayIndexOutOfBoundsException: null
Anyone who knows how to fix this?
@gusty crane excuse me when did 1.18 release

half finch
#

this guy playing in the future

gusty crane
#

Awhile ago the map was created on 1.8 but has been updated t 1.16.1

sturdy oar
#

Oh ๐Ÿง™โ€โ™‚๏ธ

#

1.8

#

Not 1.18

gusty crane
#

yes

#

intelligence = 100

half finch
#

you could try loading the chunk?

sturdy oar
#

Have you upgraded directly from 1.8 to 1.16

#

that's like super no-no

gusty crane
#

not directly over time

sturdy oar
#

Oh ok

gusty crane
#

version from version as they came out

sturdy oar
#

I'm sorry I can't help very much. Dynmap always has some issues for me as well

gusty crane
#

Ye idk ive tried several times before but

#

never managed to do it succesfully

pastel nacelle
#

upgrading from X to Y directly is preferred over upgrading from X one intermediate version at a time

#

this is because the converters used in world conversion do contain some bugs that have usually been fixed with later updates

sturdy oar
#

It depends, sometimes people haven't been able to directly update from X to Y without intermediate steps

half finch
#

mmm, according to md_5's latest post all worlds should be updated to 1.15.2 before being updated to 1.16

pastel nacelle
#

i don't care about what md69 says

half finch
#

But he is spigot god

pastel nacelle
#

fact is that 1.16 converters contain all of the tools and more that were used in 1.15 to convert worlds from pre-1.15

#

said converters have also received bugfixes in 1.16 that those in 1.15 haven't

half finch
#

fact is md_5 said

Upgrading
Although upgrades from between any two version pairs are technically possible, it is recommended that all upgrades are conducted from 1.15.2. This means that you should first upgrade your world completely on 1.15.2 using the --forceUpgrade server argument, and then do the same on 1.16.1.

pastel nacelle
#

i don't care

#

md69 is wrong

half finch
#

md_5 is a god, thus all knowing

#

you are wrong

pastel nacelle
#

jokes aside, using 1.15 to convert pre-1.15 world risks you to the bugs in the converters introduced in 1.15

#

bugs that have been patched in 1.16

half finch
#

I am assuming that he said that as 1.16 is still in the experimental stages and the converter could be more unstable/worse bugs

pastel nacelle
#

the 1.15 converters in 1.16 are the exact same as the 1.15 converters in 1.15, except for bugfixes

half finch
#

ยฏ_(ใƒ„)_/ยฏ

#

I trust god

gusty crane
#

( อกโ›โ€ฏอœส– อกโ›)

quartz sandal
#

Speaking of bugs (not sure if it's ok to ask here), has anyone had issues with end gateways not spawning after the dragon is killed?

Someone killed the dragon a second time but they said something about how new gateways weren't spawned.

I honestly don't play minecraft much myself, so I wasn't sure if this was a common issue.

#

I saw this was a bug back in 20w20a and 20w21a, but it was patched in 20w22a

pastel nacelle
#

I remember that being reported, but I don't remember if it was an actual issue or just a case of weird misconfiguration

quartz sandal
#

And checking the level.dat confirms they did spawn at some point.

#

Yeah. I wasn't sure if there was supposed to be something specific for multiplayer. Like if there are known things people modify to allow people to play the end dragon like it is always the first time.

#

Or if it is supposed to just work by itself without anyone touching it.

raven flare
#

Is there another way of stopping a player without cancelling the PlayerMoveEvent? So far I've tried this:
event.getPlayer().setWalkSpeed(0); event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 250));
but it still let's people move a tiny bit when they press spacebar

keen compass
#

that is a known thing

#

you will have to handle that

raven flare
#

can you use @?

rotund orbit
#

One of my plugins assigns timestamps to certain items when they spawn. The idea is for crops that get harvested to get a timestamp assigned to them so that they go bad eventually. Unfortunately, it has come to my attention that when players drop items with food stamps and pick them back up, a new food stamp is applied. My question is:

When players drop an item, is the ItemSpawnEvent called? And if so, is there a way to tell if the item was dropped by a player?

pastel nacelle
#

use BlockDropItemEvent

pastel arrow
#

PlayerDropItemEvent... also just check if the item already has a time stamp

green cedar
#

Why not use the block break event to assign the time stamp.
Then no need to mess around with dropped items.

sturdy oar
#

Is there another way of stopping a player without cancelling the PlayerMoveEvent? So far I've tried this:
event.getPlayer().setWalkSpeed(0); event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 250));
but it still let's people move a tiny bit when they press spacebar
@raven flare what's wrong with cancelling move event

pastel nacelle
#

listening to playermove bad

keen compass
#

it isn't bad

sturdy oar
#

it's not that bad I do that in my plugin and the timings are fine

pastel nacelle
#

yeah, it's not bad as long as you don't do anything expensive in it

raven flare
#

@sturdy oar It's looks buggy client side

pastel nacelle
#

people just have the misconception that "playermove listener bad" because a lot of noobie devs mistakenly put some pretty heavy logic in those handlers

raven flare
#

I just don't want it to look buggy that's all, nothing against it

sturdy oar
#

It looks like it snaps back?

pastel nacelle
#

suppose you could set them to be flying and then set flyspeed to 0

raven flare
#

well, yes

sturdy oar
#

You would have to remove ability to walk and jump

#

No other ways

raven flare
#

That's a good idea @pastel nacelle , how would I do that?

pastel nacelle
#

with the methods to do it

#

i don't remember the exact names

sturdy oar
#

Player.setFlySpeed(0)

#

Probably called like this

raven flare
#

yes i know that one, how do i set players to be flying?

pastel nacelle
#

read the docs

#

spoonfeeding is bad

sturdy oar
#

Spigot naming is damn consistent

#

it's usually set or get

pastel nacelle
#

except when spigot naming isn't consistent

#

most of the methods are, though

#

usually

sturdy oar
#

don't get me started on getType and getMaterial

pastel nacelle
#

and then you have fucking gems like VillagePlace

rotund orbit
#

@green cedar I don't use the block break event because it is supposed to work for mob drops as well.

#

When an item spawns from either crops or a animals, a timestamp is assigned to it.

#

Do I just need to use two separate events?

pastel nacelle
#

well tbh

#

you should use that other guy's advice

#

don't assign a timestamp it it exists already

sturdy oar
#

Timestamp like System.getCurrentMillis() ?

pastel nacelle
#

also in my humble opinion the timestamp should be like the current hour and not something like milliseconds

rotund orbit
#

It is the current hour ๐Ÿ˜‰

sturdy oar
#

Bro won't that break on year 2036 ๐Ÿ˜‚ . It will reset back to 1997

pastel nacelle
#

so not every reed or potato needs its own inventory slot

keen compass
#

the only way I can see it not being buggy, if there isn't API methods to do it, is to intercept the incoming packets and silently ignore them

rotund orbit
#

Alright I'll try the not assigning a timestamp if it doesn't already exist

pastel nacelle
#

it's just 1 extra call

#

shouldn't be difficult

sturdy oar
#

Now I got curious

#

I will go read Wikipedia

rotund orbit
#

I added it earlier and it didn't work lol

#

maybe it's a problem with my timestamp system

pastel nacelle
#

maybe...

pastel arrow
#

Just found your plugin @rotund orbit

pastel nacelle
#

I believe I looked at it the other day as well

keen compass
#

Bro won't that break on year 2036 ๐Ÿ˜‚ . It will reset back to 1997
@sturdy oar getCurrentMillis() is backed by the system OS's method call for that, so if you have a 64bit OS the answer is no it won't

sturdy oar
#

So it only affects 32 and lower?

pastel nacelle
#

eventually when I have the effort to write something similar for my server, I will probably let items with different decay values stack and just average the decay value for the resulting stack

keen compass
#

yes

subtle blade
#

Yes which are almost impossible to find now-a-days

sturdy oar
#

Trust me

#

There are in enterprises

#

Also Choco read general

keen compass
#

and you are expecting your plugin to be ran in an enterprise business?

pastel nacelle
#

i actively use a 32bit windows xp machine

sturdy oar
#

and you are expecting your plugin to be ran in an enterprise business?
@keen compass no , spigot won't even start with the java 32bit 1G heap limit

rotund orbit
#

glad to hear @pastel arrow

keen compass
#

32Bit OS's technically will survive after 2036 though

#

only requires 1 modification ๐Ÿ˜‰

sturdy oar
#

Raspberry PI is 32Bit after all

keen compass
#

instead of using 1 address space for the date, you just need to use 2

#

and then you have the equivalent of what 64bit does natively

pastel arrow
#

this is my ItemSpawnEventHandler at the moment
I'd recommend setting some variables. Would clean up that code alot.

Ex;

ItemStack i = event.getEntity().getItemStack();
Material type = event.getEntity().getItemStack().getType();

if(type == Material.POTATO) {}
sturdy oar
#

bruh it's not final

#

I get triggered by non final variables

keen compass
#

it doesn't need to be final o.O

pastel nacelle
#

final is far more informative when only the things that need to be final are final

sturdy oar
#

did you know that final makes compile faster

pastel nacelle
#

not really

keen compass
#

it doesn't

rotund orbit
#

Thanks @pastel arrow

sturdy oar
#

Try yourself

pastel arrow
#

np

sturdy oar
#

I get insane compile time since when I've started using final

opal adder
#

I thought final was just java's way of saying "const" wait am I wrong

sturdy oar
#

Yes

#

At least for variables

opal adder
#

Na I'm not wrong, I googled that shit

sturdy oar
#

I also use it in classes and method parameters

keen compass
#

should really only use final, if you really need the value to not be changed/manipulated

opal adder
#

Yea exactly, okay so I've not been using it wrong

sturdy oar
#

Which is 90% of the times Frostalf

keen compass
#

otherwise, as far as optimizations go, it doesn't do anything really

sturdy oar
#

And that is why Kotlin has final method parameters by default

pastel nacelle
#

"need x to not be changed" is not the same as "don't need x to be changed"

bold anchor
#

Don't you dare dirty kotlin by comparing it to yur shit.

keen compass
#

just because Kotlin does something, doesn't mean it should be the standard

#

or that it is the best way possible

pastel nacelle
#

only cases where you need x to not be changed is like lambdas and shit

keen compass
#

most of the time x won't change on its own anyways

#

usually it is because of some other plugin changing it on you ๐Ÿ˜›

#

unless you are doing something to manipulate the stuff in which it is handy to know the variable you get won't change later after that

pastel nacelle
#

not like final is going to stop anybody from changing it if they really want to change it

keen compass
#

yeah there is that too lol

pastel nacelle
#

i think 14 started to put some stops on that though

keen compass
#

yes they did

#

they changed 2 reflection methods to respect some modifiers

subtle blade
#

should really only use final, if you really need the value to not be changed/manipulated
Or if you don't want a member to be overridden by a child class

pastel nacelle
#

not what we are talking about but yeah technically yes

sturdy oar
#

Yeah I do that too

#

I have many abstract class with final methods

#

It makes sure you can't change that when extending the class

pastel nacelle
#

i'm sure we all know what final does

bold anchor
#

Stop being a fucking weirdo

keen compass
#

Kind of defeats the purpose of abstract in that case but whatever it is your projects ๐Ÿ˜›

sturdy oar
#

I'm not weird I code that way and many others do

bold anchor
#

There is a appropriate places to use final in java, everywhere is not it.

keen compass
#

only thing I am saying is that, it isn't correct to attempt to force people to use final everywhere just because you do ๐Ÿ˜‰

pastel nacelle
#

abstract classes can and should have final methods when necessary

keen compass
#

when necessary yes

#

but it shouldn't be for everything though

#

otherwise you might as well just have a normal class lol

pastel nacelle
#

clearly yeah lol

sturdy oar
#

I also always put child classes final

#

It's really rare that I extend a class

#

Again , Kotlin does that by default

rotund orbit
#

@pastel arrow cleaned up that code, thanks again for the advice

pastel arrow
#

Np

bold anchor
#

Viper, then use kotlin instead of java, don't use java like you would kotlin.

sturdy oar
#

I don't like Kotlin tho

#

Has weird constructors and bitwise operators are ew

#

Not to mention I have to shade the stdlib for each single plugin I make

rustic socket
#

make custom infix operators then

warped shuttle
#

Quite the conversation in here

rustic socket
#

and >caring about filesize in 2020

pastel nacelle
#

i would like unsigned primitives though

rustic socket
#

you can get several hundred gigs of storage for $10/mo nowadays, a little 1MB extra per plugin wont hurt you

pastel nacelle
#

magtape to the rescue

bold anchor
#

Kotlin has unsigned stuff doesn't iot?

rustic socket
#

yep

bold anchor
#

like uint and shit

rustic socket
#

theyre just inline classes tho

bold anchor
#

Meh, it probably behaves somehow similar when you use them PES2_Shrug

rustic socket
#

it behaves as youd expect

sturdy oar
#

C is where you have real unsigned primitive

rustic socket
#

literally any native language actually

wind dock
#

anyone know if theres a way to upload a map faster to muliticraft?

sturdy oar
#

faster

#

Than what

wind dock
#

this map is taking forever, and im uplopading as a zip file

#

so hopefully I can upack it right there

sturdy oar
#

Are you using SFTP?

pastel nacelle
#

well

#

signed slash unsigned doesn't really depend on how you store it

#

java does have methods for unsigned arithmetic as well

wind dock
#

whats SFTP

pastel nacelle
#

it's just not as handy

sturdy oar
#

Wut

#

How do you use Multicraft

#

And not know what SFTP is

bold anchor
#

Multicraft is ftp i think

wind dock
#

Im using filezilla for ftp yeah

sturdy oar
#

Ew ftp

#

So unsecured

bold anchor
#

Rust is bae, C is ew.

wind dock
rustic socket
#

C is equally epic as Rust; it depends on your usecase

opal adder
#

FileZilla is superior, and it's not unsecure if you use FTP over TLS

sturdy oar
#

SFTP ftw I'm sorry

rotund orbit
#

My problem is with my isTimeStampAssigned() method, my bad guys, internal issue

bold anchor
#

Nooo, C is very ugly Rust looks great(sometimes).

sturdy oar
#

Rust is new

wind dock
#

@opal adder when I logged in i got this warning

#

about it not using ftp

#

and using something else

#

so the info will be available over the internet

rustic socket
#

C is pretty in its own ways, and Rust can quickly look awful with generics

sturdy oar
#

U ain't got no generics in c

#

Unless pointers to memory can be considered

bold anchor
#

Meh, i'm only on the rust train cause i found it the same time i found kotlin

opal adder
#

Does anyone know what would cause hoppers to "randomly" stopping functioning? I've had this issue ever since I started running my server. For some reasons my players normal hoppers just kind of stopping transferring items, so they have to re-place their hopper system to get it to work again. I used to think this wasn't even fixable, but maybe one of you guys know

#

I suspect it could be them leaving chunks and re-joining, or maybe during a server reboot whilst the hopper is transferring items that could cause it, but I honestly don't know

pastel nacelle
#

sounds like a dumb plugin tbh

#

maybe clearlag ๐Ÿ˜‰

opal adder
#

I have no idea what plugin would even cause that, I don't use special hopper plugins

#

LOL, you would fucking say that

#

I swear to god if it actually was

pastel nacelle
#

i don't think clearlag does anything with hoppers

#

but "lag fix" plugins are the usual suspect when things stop working

opal adder
#

Well, I don't really have many of those Tbh, maybe it's the fact that it's 1.8. I guess I don't remember people complaining about that on my newer version servers

#

Could just be an old bug

wise flame
#

Let's say I was making a vote currency where 1 vote = 1 (insert currency name here)
What would be the best way to store how much of the currency each player has?

opal adder
#

HashMap

#

You could do per player files for their balance storage I guess

#

That's what essentials does

#

Or, you could be disgusting and give them a permission for it "votecurrency.<amount>" and unset/set that every time it updates, though, that's a really gross way to do it

quick arch
#

or be lazy and use nbt/PersistentDataContainer to store them >:)

sturdy oar
#

N o

opal adder
#

Is that a new thing? that's the second time that's been mentioned in her

#

I never even knew that was an option

quick arch
#

They're quite new

sturdy oar
#

Database FTW

quick arch
#

PersistentDataContainer is an NBT wrapper but it's missing a few things

#

like booleans, uuids, etc.

opal adder
#

I mean is it really a practical thing to do though?

quick arch
#

no

opal adder
#

Ah okay

quartz trench
#

you can make your own data types though

quick arch
#

yeah, I've already made 3 types

#

well, 2, edited 1.

wise flame
#

This might be a really, really dumb question, but what's the best way to store my hashmap or a list of objects on my drive?

opal adder
#

I'm confused what?

quick arch
#

sqlite?

quartz trench
#

use a database or store it using gson

opal adder
#

If you're going to use it globally, you need a database, but if it will be used on 1 server, then normal file storage, yml or sql is all you need

wise flame
#

Yeah, sorry. I haven't really done too much with data storage thus far.

quick arch
#

^^

sturdy oar
#

Hell no don't use YAML for storage

#

SQL is hundreds of time faster

wise flame
#

isn't sql a database?

pastel nacelle
#

implement bukkit serializable on the objects you store in it ๐Ÿ˜Ž

wise flame
#

wait

opal adder
#

I personally prefer YML, but that's only because I've not dabbled in sql, and with YML I can very easily view individual player files

wise flame
#

okay wait

#

nvm

pastel nacelle
#

and then just getConfig().set("myshit", storage);

#

big brain

quartz trench
#

using gson is slower than sql but it's better than yaml

#

and it's shaded into the server

sturdy oar
#

SQLite is as well

#

And MySQL is shaded also

pastel nacelle
#

access speed is almost literally a nonfactor 99% of the time

opal adder
#

Why does YML = bad?

quick arch
#

it's not meant for storing big amount of data

quartz trench
#

its a slow ass format

sturdy oar
#

You're working with files

wise flame
#

okay so about SQL. Isn't it usually like an external program that you run? I have experience with MySQL, and I had to host a database to store data. Is that really the best way?

sturdy oar
#

Also isn't SQLite driver written in native

opal adder
#

I mean but if you read to the file when the plugin starts, and only places values into it when the plugin disables, is that really in-efficient?

quartz trench
#

it obviously works its just many times slower

#

the point of yaml is that it's human readable

#

not for storing data

opal adder
#

Ah I see

#

So then that's probably why essentials does it then

sturdy oar
#

Essentials uses JSON

#

and also CSV

opal adder
#

Da fuck? They use YML storage, at least that I know of. When I look players up in the plugin, it's all yml

wise flame
#

okay so about SQL. Isn't it usually like an external program that you run? I have experience with MySQL, and I had to host a database to store data. Is that really the best way?
Too dumb of a question?

sturdy oar
#

Isn't player data JSON on EssentialsX

#

Weird

quick arch
#

You can use SQLite, which is a flat file version of MySQL

wise flame
#

Ah I see

pastel nacelle
#

there is no need to overengineer everything

sturdy oar
#

SQLite Is not really flatfile database

pastel nacelle
#

many plugins persist literally all of their data into a single yml using bukkit's shitty configuration api, load it all into memory on startup, and still perform completely fine

#

unless you are storing gigabytes of information it very much doesn't matter how wrong you're doing it

quick arch
#

many plugins persist literally all of their data into a single yml
Essentials' config.yml e_e

pastel nacelle
#

i mean more like pex

#

it literally stores every user and group in one giant permissions.yml

quick arch
#

๐Ÿคข

pastel nacelle
#

i know right

opal adder
#

Pex is disgusting

#

How dare you even mention it

pastel nacelle
#

but it still works fine, data persistence wise

quick arch
#

no one's really planning to make thousands of groups with pex ._.

pastel nacelle
#

so; don't sweat it

#

there won't be thousands of groups

#

but there will be tens of thousands of users

bold anchor
#

I got 523 pex groups

pastel nacelle
#

each with their set of groups and permissions

quick arch
#

I got 523 pex groups
why

pastel nacelle
#

even if they only take 3 lines each, that is still one massive blob

quick arch
#

are they atleast converted into lp

balmy sentinel
#

What is the advantage of using packets and does anyone have a good resource on packets and NMS? Looking to get into it

pastel nacelle
#

there is no way to tell the "advantage of packets" when you don't specify what you think they are advantageous over

wise flame
#

afaik you only use packets for things the API can't help you with

bold anchor
#

I was joking i've never used pex for anything real.

#

packets can also be used to overwrite api components hehehe

#

Like not allowing it through

#

and shit.

pastel nacelle
#

myes

#

a thorough tutorial to packets

#

๐Ÿ‘๐Ÿฟ

bold anchor
#

Np

balmy sentinel
#

@pastel nacelle I don't know thats why I'm asking??? I see a lot of forms and servers that want to hire people with experience in packets and NMS so I was wondering why that is and if anyone had some good resources so I could dive into it.

pastel nacelle
#

packets are what the server and the client communicate to one another with

winged sparrow
#

Iโ€™m about to delve into it myself for holograms that only appear for players within a certain distance of a location

#

Wish me luck

pastel nacelle
#

myes

#

recently did some packet fucknuggetry myself

winged sparrow
#

Unless thereโ€™s a resource that does that

#

Then I would GLADLY take the lazy route

pastel nacelle
#

a dark souls bonfire plugin shit that uses packets to send different lit states of campfires to different players

#

based on whether the bonfire is discovered or not

balmy sentinel
#

@pastel nacelle do you know of any good recommended resources?

pastel nacelle
#

protocollib i guess

winged sparrow
#

My question is how did you manage sending the packet when the player comes into range of the campfire

quick arch
#

the packet wrapper can help a lot too

wise flame
#

tl:dr if you know how to work with packets, you can make some things far, far beyond what the API would allow.

#

what's NMS?

pastel nacelle
#

i didn't really do anything range related

wise flame
#

lol

pastel nacelle
#

i just listen to chunk map packets and spoof the campfire state after sending them

winged sparrow
#

You just sent the packet for all the campfires to the player?

#

Ah

pastel nacelle
#

so whenever the player gets a serverside chunk update, the campfire is also sent

winged sparrow
#

Do you scan each chunk for a campfire or check for specific locations

quick arch
pastel nacelle
#

i have a cache where i store the chunk coordinates that contain campfires

winged sparrow
#

Ah ok.

pastel nacelle
#

if the chunk coords are in the cache i get the bonfires from the cache in that chunk and send the packets for them

winged sparrow
#

I have no idea how Iโ€™m going to approach mine

pastel nacelle
#

probably just sending create/destroy entity packets depending on how far the player is from each hologram

balmy sentinel
#

@wise flame NMS = net.minecraft.server

quick arch
#

inb4 he wants true packet

#

creating entities was hell with ProtocolLib

pastel nacelle
#

the route i see most people take is create the entity using nms without adding it to the world

winged sparrow
#

Iโ€™d probably just.. want to modify the text line for the entity when players come within range

#

Just have it be a blank line instead of generating a new armor stand

wise flame
quick arch
#

yes, but that's insanely outdated

winged sparrow
#

Youโ€™ll have to decompile it yourself for more current code

#

Good luck lmao

#

Obfuscation be like

pastel nacelle
#

maybe just change the data that determines whether the custom name of the armorstand is displayed or not

quick arch
#

Mini's Mappings ๐Ÿ‘€

winged sparrow
#

Ooh thatโ€™s a great idea

pastel nacelle
#

that way you can keep the text and just flip a single boolean back and forth

balmy sentinel
pastel nacelle
#

what an angry looking weebio

quick arch
#

Should've seen Choco

wise flame
#

What's the benefit of having experience with NMS?

#

Like what can it do?

pastel nacelle
#

many things

#

for example, using NMS, my spawner plugin removes spawner tile entities from the world's ticklist so they don't get ticked at all

wise flame
#

that's super cool

pastel nacelle
#

i'm a super cool guy

wise flame
#

how do I get access to NMS?

pastel nacelle
#

read the tutorial i guess

wise flame
#

lol

#

good point

quick arch
#

you'll be doing a lot of work btw

#

nms changes every version

balmy sentinel
#

I'm just going to skip nms for now and just learn about sending/using packets

bold anchor
#

What

wise flame
#

yeah I'd imagine so

#

but it seems like it could be fun

keen compass
#

you need NMS for packets o.O

#

unless you are just going to use protocollib

pastel nacelle
#

and sometimes with protocollib too

frigid ember
#

Basically I want to make a plugin which makes all trapdoors placed down make them placed at the bottom half:
https://i.imgur.com/IM9kd5Z.png

This is my current code. It does detect trapdoors placed but cannot change them so they would be at the bottom half. Any tips?

    @EventHandler
    public void onPlace(BlockPlaceEvent event) {
        Block block = event.getBlock();
        Material material = block.getType();
        if(
            material == Material.ACACIA_TRAPDOOR ||
            material == Material.BIRCH_TRAPDOOR ||
            material == Material.DARK_OAK_TRAPDOOR ||
            material == Material.IRON_TRAPDOOR ||
            material == Material.JUNGLE_TRAPDOOR ||
            material == Material.OAK_TRAPDOOR ||
            material == Material.SPRUCE_TRAPDOOR
            //material == Material.LEGACY_IRON_TRAPDOOR
        ){
              // not working
              //block.setMetadata("half", new FixedMetadataValue(RocketRoam.plugin, "bottom"));
        }
    }
pastel nacelle
#

use an enumset, a tag, or a switch

#

insead of if or or or or or spaghetti

#

also, that metadata value is keyed by your plugin

boreal tiger
#

a switch would be unnecessary if its a single if statement

pastel nacelle
#

nah

#

look at how bukkit/spigot implements Material.isBlock and similar

frigid ember
#

Okay, but what about the problem I'm having?

subtle blade
#

Just for later reference

boreal tiger
#

oh nice TIL

#

thanks

subtle blade
#

As for what you're doing, that's not how you update block data

pastel nacelle
#

does bukkit call block state metadata

#

or is this just wrong

subtle blade
#

Metadata is a completely different concept. In-fact, it's a plugin-exclusive concept

#

You want to modify BlockData

frigid ember
#

I tried checking BlockData and it only gives me a string of it

#

I don't know what to do with it

subtle blade
#

Cast, change what you need, re-set it with Block#setBlockData()

frigid ember
#

oh there is!?

#

It worked out!

subtle blade
#

For the sake of clarification, what you were using - metadata - is a plugin concept to temporarily attach non-persistent data to a metadatable object (entities and blocks)

#

A way for mods to communicate with one another that gets fairly under-used

frigid ember
#

Oh

#

I never knew about BlockData and other stuff to be honest, I started programming one plugin like 3 days ago

subtle blade
#

BlockData is used to change a block's states (i.e. half, facing, waterlogged, etc. - the things you'd see in the F3 debug screen on the right), BlockState is used to interact with a block's tile entity (chest contents, furnaces, brewing stands, etc.)

frigid ember
#

Yes, I see

#

I now understand

subtle blade
#

๐Ÿ‘Œ

hardy cedar
#

1 small question why when i use p.gettworld(). getname() doesn't work on PlayerChangedWorldEvent

frigid ember
#

May I ask, where can I find all events that I can use? Like onLogin, onPlace, onBreak and etc

pastel nacelle
#

in the docs

subtle blade
#

Player#getWorld() will be the world the player is currently in

#

Events are called immediately before an action occurs

#

Any new state is passed to the event. If you want the name of the new world, PlayerChangedWorldEvent should have a method to get the new world

#

I think it's getTo()?

halcyon snow
frigid ember
#

Found it... org.bukkit.event.*

#

oh

hardy cedar
#

I mean im trying to get the world name he joines in so if(p.getworld().getname() == "name"){
Do something
}

#

Im using phone

#

Oof

heavy urchin
subtle blade
#

ArmorEquipEvent is not part of the Spigot API

heavy urchin
#

I have a package for it tho

subtle blade
#

@hardy cedar , Strings cannot be compared with == in the majority of cases

heavy urchin
#

in the plugin jar

subtle blade
#

So then two things. (1) Check to make sure your event is actually calling, (2) Ensure that you've registered your event listeners

hardy cedar
#

@hardy cedar , Strings cannot be compared with == in the majority of cases
I wasted my life on nothing oof

subtle blade
#

.equals()

#

== is referential equality, meaning the objects are the exact same instance in memory.

#

Because Strings are immutable and created every time an operation is performed on it, more often than not, they're not == comparable

quick arch
#

ArmorEquipEvent is from a lib

#

It's from that lib

hardy cedar
#

So that method can be for example a player name @subtle blade ?

subtle blade
#

Anything that's a String, really. Strings should be compared with .equals()

#

Or, rather, most things should be

#

General rule of thumb is that if it's not a primitive (int, boolean, long, etc.) or a constant (enum), you should be comparing with .equals()

hardy cedar
#

Also that didn't work btw to get the world name oof

pastel nacelle
#

let us start an argument on whether we should use == or eq for enums

heavy urchin
#

choco I am have that in the plugin

subtle blade
#

No. If you use .equals() for enums, you're stupid and that's final

pastel nacelle
#

but muh primitives and things

quick arch
#

I think I used it once ๐Ÿค”

pastel nacelle
#

i actually don't remember what the argument is for using eq on enums

#

i remember seeing a whole shitstorm about it a while ago

wise flame
#

I just imported nms and I don't see any obfuscation

quick arch
#

Choco it's ok, let them be Bob

wise flame
#

Isn't it supposed to be hellish?

quick arch
#

๐Ÿ˜‰

subtle blade
#

Not sure but it wouldn't be valid considering enums can't even override equals()

#

Skyy, CraftBukkit maps a small part of NMS. It maps what it uses

wise flame
#

well yeah, I know that, but what about what it doesn't map? Why don't I see any of that?

subtle blade
#

All class names are mapped, though methods, fields and nested classes aren't all mapped

#

In fact, most aren't

wise flame
#

Ah, that makes more sense

hardy cedar
#

The event doesn't even work for me i just used it to say hi and it didn't

frigid ember
#

Replacing that big IF statement with ```java
if (block.getState() instanceof TrapDoor)

Is it the correct way of implementing it?
subtle blade
#

No because it's not a state, it's a BlockData

wise flame
#

NMS actually seems like a lot of fun. I know what I'm getting myself into.

subtle blade
#

Though you're probably best to use the Tag.TRAPDOORS.isTagged(block.getType())

frigid ember
#

oh

subtle blade
#

Slightly faster

#

Also avoids unnecessary BlockData creation

frigid ember
#

Thank you!

hardy cedar
#
    public void WorldChange(PlayerChangedWorldEvent e) {
        Player p = e.getPlayer();
            p.sendMessage("HI");
        }```
#

if i did something else kill me .-.

subtle blade
#

Missing an @EventHandler?

#

And has it been registered?

hardy cedar
#

i will restart eclipse maybe an unimported thing bc my pc suck so its glitchy for some reason

#

yup it was

#

i hate my 2gb ram pc

heavy urchin
#

is it possible to give players effects if their wearing an armor with a specific lore with armor equip event?

frigid ember
#

Oh, right, where do I find the names for functions?
example BlockPlaceEvent has onPlace function name.
Or can I put any function name?

pastel nacelle
#

yes

frigid ember
#

just tried it out, yes... unexpected...

pastel nacelle
#

they're called methods, by the way

#

functions mean something else

frigid ember
#

Ah right, I haven't coded in java for 3 years

dense escarp
#

how can i make big server dedicated like hypixel

pastel nacelle
#

๐Ÿ˜ฌ

lone fog
#

Umm

#

With lots of experience, and money

dense escarp
#

Do you have experience

#

?

lone fog
#

I mean, yeah Iโ€™ve got some

#

Not sure Iโ€™m quite ready to host a 100k player network

quick arch
#

๐Ÿคจ

ionic hound
#

does anyone know how to be able to run a command from the console of a spigot server and then it would run on bungee console?

marsh hawk
#

To host something like Hypixel would take ALOT of money, time and a huge team

#

not something that can be done by yourself

hardy cedar
#

does anyone know how to be able to run a command from the console of a spigot server and then it would run on bungee console?
i cant believe that's a thing

#

how to give a player his skull as a join item and add a command to it ? ๐Ÿค” i think thats just hard idk

grim halo
#

@hardy cedar Getting the head of an online player is pretty easy:

  private ItemStack getHead(final Player player) {
    final ItemStack itemSkull = new ItemStack(Material.PLAYER_HEAD);
    final SkullMeta skullMeta = (SkullMeta) itemSkull.getItemMeta();

    skullMeta.setDisplayName("ยงfSkull of " + player.getName());
    skullMeta.setOwningPlayer(player);

    itemSkull.setItemMeta(skullMeta);
    return itemSkull;
  }

Adding a command to it could be done in a similarly simple fashion or very modular.

hardy cedar
#

ik hot to get it but to add a command on right click is hard

#

PlayerInteractEvent

#

doesnt help me

grim halo
#

Do you want to run a command when the player holds it in his hand and interacts with it?

hardy cedar
#

yes

grim halo
#

Why does PlayerInteractEvent not help you then?

hardy cedar
#

becouse i cant put the ItemStack item in when i do have a private / public method

grim halo
#

I dont understand that sentence. Could you give me a bit more context?

hardy cedar
#

i cant do e.getItem and item name in that case u sent to me

#

if(event.getItem().equals(yourCustomItemStack))โ€‹

#

icant call it in the itemstack point

grim halo
#
  @EventHandler
  public void onInteract(final PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) {
      return;
    }
    final ItemStack item = event.getItem();
    if (item == null || item.getType() != Material.PLAYER_HEAD) {
      return;
    }

    // Here you can use the item

  }
#

Ah ok your problem is equals.

#

You dont need to check if one item equals the other.
It is sufficient to check the name for example.

hardy cedar
#

event.getHand?

grim halo
#
  @EventHandler
  public void onInteract(final PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) {
      return;
    }
    final ItemStack item = event.getItem();
    if (item == null || item.getType() != Material.PLAYER_HEAD) {
      return;
    }

    final ItemMeta skullMeta = (SkullMeta) item.getItemMeta();
    final String itemName = skullMeta.getDisplayName();
    if (!itemName.startsWith("ยงfSkull of ")) {
      return;
    }

    final String playerName = itemName.replace("ยงfSkull of ", "");

  }

That would be one examle on how to check some values of the item

hardy cedar
#

gethand isnt a thing for me

grim halo
#

The interact event is fired for the left hand and the right hand. We only want the event with the right hand

#

Are you on 1.8?

hardy cedar
#

yes

#

The method getHand() is undefined for the type PlayerInteractEvent

grim halo
#

I dont care then. The version 6 years old.

#

You can just leave the check away then.

#

If there is only one hand then the first 3 lines are obsolete

hardy cedar
#

i think also its SKULL_ITEM

#

but tysm โค๏ธ no homo xd

grim halo
#

In 1.8 you can still use byte values for your meta

#

its rly different

deft epoch
#

Hey y'all! I'm having an issue where my server crashes when I enter a specific area of the nether. Is this the right place to ask for help/send my crash logs from console?

grim halo
#

If you have craslogs you can post them here

#

?paste

worldly heathBOT
deft epoch
#

I've already tried deleting the area in the region folder using MCAselector and reloading it

grim halo
#

Could you pls post the full log?

deft epoch
#

Oops

#

Where do I get the full log?

pastel condor
#

latest.log

deft epoch
#

ok lmk if this works

#

tysm!!

grim halo
#

Did you generate the world with 1.14?

deft epoch
#

The server was created around 1.13/1.14 ish, but I don't know if I went to the part of the nether that's crashing my game then. Since then I've deleted most of the chunks in the nether and reset for 1.16 using MCAselector

#

The chunk that's crashing the server should be among the chunks that I deleted and reset for the nether update

grim halo
#

Would it be ok for you to delete the nether completely?

deft epoch
#

I'd prefer not to ๐Ÿ˜ฆ

#

if it's the only option though...

grim halo
#

Then try running your server with the --forceUpgrade parameter once

#

java -Xms4G -Xmx4G -jar server.jar --forceUpgrade

#

Something like this

deft epoch
#

Sorry, how do I do that? My server is hosted through ApexMinecraft

#

(I'm pretty clueless, sorry abt that ๐Ÿ˜ฆ )

grim halo
#

No idea. I guess you cant add java parameters there?

#

Then... download the world and forceUpgrade on your local machine?

deft epoch
#

Actually I just found the parameters section

grim halo
#

Ah ok

deft epoch
#

Should I get on the server and see if the problem persists after the startup

grim halo
#

sure

wise flame
#

this isn't exactly related to Spigot, but I have a question. I tend to use static variables pretty often. Is that a bad thing for any reason?

#

I figure it's not but I want to make sure lol

grim halo
#

static variables have their place but they are pretty rare in java.
90% of spigot plugins should not need any static variables. In fact you could probably
Write every plugin without the use of a single static keyword.

Its not inherently bad to use them but in many cases the static keyword gets abused by
ppl who did not take the time to properly learn how to write proper java code and just jumped into
spigot heads first.

If you send me some code examples i am happy to give you some advice.

old solar
#

Anyone know how to set a beehive to full of honey?

frigid ember
#

Help anyone?

deft epoch
#

@grim halo Just tried the force upgrade, no sauce ๐Ÿ˜ฆ

frigid ember
#

Anyone??

grim halo
#

@frigid ember Is this from your own plugin?

frigid ember
#

What do you mean by "own"

grim halo
#

Did you write a plugin that tries to interact with the citizens api?

frigid ember
#

no

rotund orbit
#

What event is called when a player cooks food on a campfire?

grim halo
#

Then you have a plugin that doesnt know how to properly register citizens traits.

rotund orbit
#

I tried looking it up and thought it might be BlockCookEvent but I couldn't find documentation on it.

frigid ember
#

what plugin would it be though

grim halo
#

@rotund orbit BlockCookEvent

rotund orbit
#

Thank you

grim halo
#

@frigid ember i have a 1 in 55000 chance to guess what plugin could cause this...

#

Want me to start from "a" ?

frigid ember
#

sure

grim halo
#

@frigid ember sure... he sais. Ok here we go.
Is it "AdminOnly AdminOnly 1.3" ?

scenic whale
#

Can I just add permission commands everywhere on the console or it needs a specific location?

frigid ember
#

AdminOnly I don't have that plugin?

grim halo
#

Ok next one.
Is it " AdminOnlyChat 1.2 " from "Slayde_Blayde"

frigid ember
#

I have no plugins that have admin in the name

grim halo
#

Ok skipping all plugins with admin in the name.
Only 54985 plugins to go...
Is it " Advanced Slots Manager 1.0.0 "

frigid ember
#

LOL no

grim halo
#

Is it " Advanced Spawners 1.3 - 1.4.4 "

lapis abyss
#

anyone else having trouble logging in to the spigotmc website? the login button is redirecting me to the account signup page

frigid ember
#

couldn't I just tell you what plugins i have?

#

that would make it way faster

grim halo
#

Ah so you see whats missing. XDDD Did take a while.

frigid ember
#

lol

grim halo
#

I pushed my sarcasm lvl to 300% percent and you just kept going

frigid ember
#

all my plugins

grim halo
#

?push

#

?paste

worldly heathBOT
grim halo
#

You paste stuff like this here pls

frigid ember
#

honestly I think you should of just kept naming plugins lol

grim halo
#

Now only list plugins that have Citizens as dependency. dtlTraders for example

frigid ember
#

CitizensCMD

torn robin
#

is it CitizensExtension2

frigid ember
#

?

#

CitizensCMD
dtlTraders

#

those I think are the only dependency's right?

grim halo
#

Didnt read the list. Try disabling both and see if the server starts. If yes -> install dtl -> if it still starts well then CitizensCMD is broken and vice versa.

frigid ember
#

ok

#

It just spams this in console when I try and start up the server

#

and I cannot join

grim halo
#

--forceUpgrade your chunks

frigid ember
#

?

grim halo
#

Are you on 1.16?

frigid ember
#

1.15.2

#

?

deft epoch
#

@grim halo I tried restarting my server with the --forceUpgrade parameter but it still crashes when I try to load a specific region in the nether. Are there any other possible fixes?

sage summit
#

I just got on my laptop and there is an error in every place that has something to do with the spigotapi...

red zenith
#

That's a pretty broad statement, can you provide some context? Do you mean in your IDE?

#

Are you using Intellij?

sage summit
#

i use intelliJ, so i just opned up my plugin and there is errors everywhere, all the Bukkit and Spigot imports are broken, the only thing that has no errors is just the normal java parts, I dont know hot to explain it:/ ill send a screen shot

frigid ember
#

check ur dependencies

quartz trench
#

reimport/refresh the pom.xml

sage summit
#

thanks!

#

works now

#

:)

sage summit
#

im trying to import vault or whatever but its not working

#

Dependency 'com.github.MilkBowl:VaultAPI:1.7' not found

scenic whale
#

Is there a problem with the spigot verification? cant seem to get a verification in discord and the in browser

sage summit
#

also says Cannot resolve com.github.MilkBowl:VaultAPI:1.7

frigid ember
#

Hello, i'm having an error connecting to my bungee server. I can connect to the servers without bungee but cant connect with bungee. Someone please help me

wraith thicket
#

@sage summit Do you have the appopriate repository? I believe they use jitpack

sage summit
#

Ummm, idk

frigid ember
#

how to upload the plugin after the build immediately to the folder plugins?

latent rock
#

any way to nerf end farms?the spawn rates are crazy

vernal spruce
#

explain more

#

end farms?

#

you mean the huge enderman xp builds

latent rock
#

@vernal spruce yea

vernal spruce
#

Most common way

#

is to simply modify the mob per player limit

frigid ember
#

help me please

vernal spruce
#

So there can only be a certain amount of mobs spawning/staying

#

there is the config option

#

in either bukkit.yml or spigot.yml

tough cedar
#

Hey ppls, Is there any way to disable regular players from doing /plugins

pastel condor
#

Remove the bukkit.command.plugin perm I think

kind crow
#

Does somebody know a ChatCo plugin alternative that isn't abadoned/is in active development?

bold anchor
#

chatco?*

kind crow
#

chatco?*
@bold anchor yes

bold anchor
#

What is chatco

kind crow
#

Latest release was in 2017 and there is no source code available

nova mural
#

@frigid ember file > project settings

#

artifacts

#

create an artifact

#

or edit if you have a current artifact

#

make sure your plugin and plugin.yml are in there, then change the output directory of your artifact to wherever it should go

#

then just build that artifact

open ibex
#

Is that for Maven

silver pewter
#

Hello, what's the best way to format money like ```
K
M
B
T
Qd
Qt
Ht

sturdy oar
#

Latest release was in 2017 and there is no source code available
@kind crow that's what happens to non open-source plugins

#

You don't update it? It dies forever.

rare prairie
#

Hello, what's the best way to format money like ```
K
M
B
T
Qd
Qt
Ht

decimalformat

silver pewter
#

Okay thanks

sturdy oar
#

Scientific notation smh

kind crow
#

You don't update it? It dies forever.
@sturdy oar I would pick an open source one if I had a choice, but there is none or I couldn't find it

sturdy oar
#

10ยณ = K, 10โถ = M, 10โน = G, etcetera

plush kraken
#

How do I change my spigot mc account name?

sturdy oar
#

You have to be a donor

#

Send spigot some cash

plush kraken
#

wtfd

sturdy oar
#

Come on the website is free

plush kraken
#

well thats stupid

sturdy oar
#

Just do it

plush kraken
#

might as well just create a new account

sturdy oar
#

Lmao

#

I have a 10$ donation on my account and I changed my username recently

#

You also get other cool perks

plush kraken
#

bruh im too poor for that shit

sturdy oar
#

I get things for free usually

#

I didn't donate myself

#

Simpleauthority sent money for me

#

@pale crow bruh ๐Ÿฅฐ ๐Ÿฅฐ ๐Ÿฅฐ

#

I love u

tough kraken
#

is there a way to limit perChunk entities?

kind crow
tough kraken
#

that wont work, that are custom entities, they got spawned infinitely, i mean can i check if there already are for example 32 entities in the chunk where the entity spawns?

#

i am manually spawning them per plugin

#

can i use this?
if (event.getLocation().getChunk().getEntities().length == 16) { return; } else { loc.getWorld().spawnEntity(loc, randomEntities); }

#

and if yes, what would be a good amount of entities per chunk? would 45 work for most Servers?

pale crow
#

@plush kraken Alt account is against the rules.

plush kraken
#

???

#

What do you mean?

#

I do not have an alt account? xD

grim halo
#

@tough kraken Yes you could use this to limit your spawn rate. For most Mobs 4 per chunk is more than sufficient.

vernal spruce
#

to prevent this
@tough kraken thats not vanilla settings

#

thats a plugin doing

tough kraken
#

i know that, but that was my problem, but fixed it

light geyser
#

lil query, I want to add a ShapedRecipe that has a bucket in it, I dont want to consume the bucket, just the contents of it. How would I do this with the shapedRecipe? or is this not possible?

#

or do I have to add an EventListener for this?

grim halo
#

Doesnt this happen automatically if you create a recipe with a Water bucket?

vernal spruce
#

i think it should

light geyser
#

Hm not sure, ill test it out ๐Ÿ˜„

#

And you were correct ๐Ÿ˜„

#

With that, thats the only working recipe. My other ShapedRecipes, dont work. I register them as follows: Bukkit.addRecipe(new RecipeLightAnvil().getRecipe());
The recipe class: https://paste.md-5.net/lanehiteyi.cpp
Mc 1.8.8, I added the recipe the same way I would on 1.16, yet it doesnt work here ๐Ÿ˜„

#

Figured that one out, it didnt likje the way I set the empty spaces ๐Ÿ˜„

grim halo
#

Yes dont use Material.AIR for those. Just leave a space in your shape like. " b "

marsh hawk
#

Anyone ever tried making music on noteblocks purely through code?

#

im extremely bored and wanna try it lol

grim halo
#

Yes there is even a api for that.

marsh hawk
#

oh right noteblock api

#

forgot all about that lol

tiny dagger
#

is there any function that accepts var args ? ๐Ÿค”

grim halo
#

You mean generally?

#
  public int sumUp(final int... numbers) {
    int sum = 0;
    for (final int i : numbers) {
      sum += i;
    }
    return sum;
  }

I wrote you a quick example

#
    final int a = this.sumUp(1);
    final int b = this.sumUp(1, 2, 3, 4);
    final int c = this.sumUp(new int[]{10, 11, 13});
    final int d = this.sumUp();

Those are some valid method calls. However new int[] is redundant here.

tiny dagger
#

a functional interface

#

it would seem useful

#

i could make it

#

but i was just wondering

#

if there was already one

grim halo
#

You mean a functional interface for var args like "VarArgs"?

#

Im not sure... what something like that would look like or be used for.

tiny dagger
#

i was gonna use it for a string array that changes overtime

grim halo
#

And a List<String> wouldnt be sufficient there?

frigid ember
#

Is there a difference between ArrayList and List?

tiny dagger
#

yes

grim halo
#

Yes-ish

tiny dagger
#

one it's a general interface

#

arraylist is the logic holder

frigid ember
#

so List just extends ArrayList?

grim halo
#

ArrayList is always a List but a List does not have to be a ArrayList

frigid ember
#

or the opposite

tiny dagger
#

implements list

#

basically

#

it's an interface

frigid ember
#

hmm

#

I'll take a look at it later on

tiny dagger
#

the list is used for compatibility

#

like if you change from arraylist to something else that implements list too

#

it won't break

frigid ember
#

Anyone Have A Good Voucher Plugin? I Need it To Give Kits Out Of Crates.

grim halo
#

ArrayList > List > Collection > Iterable
Thats the hirarchy

#

Same goes for LinkedList (It also implements Deque and other stuff)
LinkedList > List > Collection > Iterable

But essentially you can always cast a LinkedList or ArrayList to a List but not the other way around.

#

Wait is this from a mod? @frigid ember

frigid ember
#

it's a resource pack

winged umbra
frigid ember
#

I need to modify the rails logic to connect to trap door

grim halo
#

Oh so its not even redstone...

#

What do you mean by "rails logic"

vernal spruce
#

the redstone engineer deep inside us cry rn

#

cause its not redstone

naive goblet
#

Good thing with linkedlist is that it technically has no max size

#

Though arraylist is faster iirc

grim halo
#

LinkedList is horrible. After i made my jmh benchmarks with it i have never used it once

frigid ember
#

@grim halo I mean how rails can connect

naive goblet
#

Itโ€™s really not

frigid ember
#

I just want to modify that it would connect to trapdoors

grim halo
#

What exactly is good at a LinkedList*?

frigid ember
#

what kind of event shall I look at, guys?

grim halo
#

BlockPlaceEvent? You want them to rotate so the show at the trapdoors right?

frigid ember
#

Hmm actually right that could solve the problem, I'm stupid.

grim halo
#

@naive goblet So pls enlighten me. I think there is only one very specific case where you would use a LinkedList other than that its rly bad.

naive goblet
#

7smile7 I think you need to read some before going with massive fud https://en.m.wikipedia.org/wiki/Linked_list

In computer science, a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes which together represent a sequence. ...

#

There is probably thousands of more sites explaining it

#

And pros and cons

#

Not really in for an argument right now

grim halo
#

Yes. I know all of that and have written multiple benchamarks with the JMH to test a lot of cases that where not covered in articles and whitepapers.
My conclusion: Its horrible

naive goblet
#

Because?

frigid ember
#

but wait, if rail would be placed next to it, it will change the direction of the one which is next to it

karmic sable
#

@grim halo yo, I'm trying to implement that custom arrow thing you showed me yesterday but I'm having some troubles. Can I take it to DM and show my current code?

tiny dagger
#

linked list is good at adding and removing

grim halo
#

High ram usage. O(n) index access O(n) index insert O(n) index removal.
Rly slow iteration time. 5x slower than a ArrayDeque when used as a queue.
Hundrets of nodes clogging up your ram.

naive goblet
#

Yes itโ€™s known for slowness thatโ€™s true

#

Well I donโ€™t know why you would use it in that case when you need something faster

#

ยฏ_(ใƒ„)_/ยฏ

grim halo
#

There is one case i would use it:
You want ordered element iteration with O(1) remove and O(1) insert time while doing so.

#

@frigid ember I think you do not want to worry about the rotation at plugin level.
If you use your own resourcepack you can as well just implement rotation based on
surrounding blocks there.

#

Wait let me think if thats possible without Optifine...

#

?paste

worldly heathBOT
grim halo
#

Pls paste code here

naive goblet
#

There is one case i would use it:
You want ordered element iteration with O(1) remove and O(1) insert time while doing so.
Yup

karmic sable
#

it says "SSomething went wrong" when I try to use paste.md-5

grim halo
karmic sable
grim halo
#

Ok i see several things that could create a problem here. Whats yours?

karmic sable
#

Hahaha

#

Well for starters I don't know how to implement it where I want it. I'm not very experienced when it comes to OOP tbh

#

Not with NMS either

gaunt fern
#

hey I keep getting a build error for Spigot 1.16.1. I tried updating BuildTools, different command syntax etc

karmic sable
#

Can you show logs DanDeMedicMan

grim halo
#

Ok then i think its a better aproach not using nms.
So dont create a class that extends EntityArrow.

Spigot alternative:

  1. Create a manager class. For example called "ArrowManager"
  2. You will have only one instance of this class so you will create one in your onEnable.
  3. For the sake of ease you implement Listener and Runnable
  4. This manager maintains a private final Set<Arrow> of tracked arrows.
  5. create EventHandler methods that add the arrows to the List when theyve been shot
  6. create EventHandler methods that remove the arrow when it hits somethin (or gets unloaded!)
  7. In your run method you write a for each that iterates over every arrow and spwans particles on their location.
  8. Register this one instance of your manager with the PluginManager as Listener
  9. Use the same instance to schedule a task that runs ever or every other tick with the BukkitScheduler
karmic sable
#

I'll try that, 7smile7, thanks

gaunt fern
#

nvm i fixed i reckon

#

was running in cmd not git bash lol

frigid ember
#

I need help with permissions

#

I need to add COP.Password to the default rank

vernal spruce
#

Thats more of a "plugin wiki" problem rather than spigot

naive goblet
#

@frigid ember what permission plugin?

#

You might even be able to change that in plugin.yml

frigid ember
#

nvm managed to resolve it

#

some guy told pe to use luckperms

naive goblet
#

Good

#

How you didnโ€™t use pex or groupmanager before

plush kraken
#

Why are chunks loading so slow?

vernal spruce
#

Bad ram/cpu or overloaded

karmic sable
#

How do I check if an arrow is unloaded then?

#

Last question, I promise ;p

frigid ember
#

i have a issue. Getting a offlineplayer by name seems deprecated. But i need getting the player via name for my plugin. The UUID way seems not deprecated, but noone knows their UUID.

karmic sable
frigid ember
#

hm

#

Does it support offline servers too? I may want to support a wide range of servers

karmic sable
#

I don't know I just found it on google tbh

frigid ember
#

ok

cerulean gust
#

What is the alternative for HoverEvent? - Just noticed it got deprecated.

frigid ember
#

really?

vernal spruce
#

There is no such thing as hoverevent

#

you mean gliding?

frigid ember
#

no hovering over text in chat

cerulean gust
#

^^

frigid ember
#

Can show items and text

#

one sec im searching it

#

@cerulean gust found it

#

It seems partially deprecated

#

You need to give it a content

#

not a basecomponent

cerulean gust
#

Ahh

frigid ember
#

hi i have this ``` List<String> badWords = getMain().getConfig().getStringList("chat-filter.list");

raven hound
#

I got essentialsxchat, edited the config but still shows <> in name

frigid ember
#

hi i have this ``` List<String> badWords = getMain().getConfig().getStringList("chat-filter.list");

@frigid ember seems like a job for iterating it

#

what?

vernal spruce
#

@frigid ember string should also extend charsequence

frigid ember
#

just a for loop

vernal spruce
#

If you need to pass a charsequence you can also pass a string

frigid ember
#

yeah

vernal spruce
#

As a string is a charsequence

frigid ember
#

pls just write some code how it looks i dont understand

vernal spruce
#

String test = "Noice testing"; CharSequence cs = test;

frigid ember
#

but thats list

#

iterating

vernal spruce
#

then create a charsequence list

frigid ember
#

a for loop

vernal spruce
#

and loop over all entrys

frigid ember
#

@frigid ember I think you do not want to worry about the rotation at plugin level.
If you use your own resourcepack you can as well just implement rotation based on
surrounding blocks there.
@grim halo
I cannot.

#

hi i have this ``` List<String> badWords = getMain().getConfig().getStringList("chat-filter.list");

^^^^

#

not charsequence[]

#

we already told you it

vernal spruce
#

Im not even gonna bother

rare prairie
#

@frigid ember If you don't know what is for loop/iterate we recommend to you to learn java.

frigid ember
#

โ†‘

keen compass
#
for(CharSequence sequence : badWords) {
 //do whatever with sequence
}```
vernal spruce
#

nice spoon

#

Kappa

#

also wrong type is loop through the string inside the list to add in a sequence list

keen compass
#

was very simple, not like it was anything overly complex

rare prairie
vernal spruce
#

i mean having to describe something very simple is not a good thing

frigid ember
#

i have a issue. Getting a offlineplayer by name seems deprecated. But i need getting the player via name for my plugin. The UUID way seems not deprecated, but noone knows their UUID.
um can someone help me?

#

Converting UUIDs to player won't really work for me

vernal spruce
#

You might be able to acces the player data by name

#

But that still doesnt work if they never joined your server

frigid ember
#

there are two uuids

#

offline and online

#

no

#

yes

#

they are unique

#

to the player

#

offline and online

vernal spruce
#

indeed

frigid ember
#

You might be able to acces the player data by name
but if the player is offline it return null

#

When i try to get a onlineplayer

vernal spruce
#

And by that i mean getting the player from the world saves

frigid ember
#

oof

vernal spruce
#

But i think best way would be to store a player data if it joins the server

frigid ember
#

some low level stuff?

vernal spruce
#

Save the players yourself

frigid ember
#

hm

#

Yeah seems reasonable

#

If it ever gets removed i will use this way

#

But why is it even deprecated?

rare prairie
#

Probably because the player never on the server, so it retrieves offline player by name from GameProfile

vernal spruce
#

Deprecated. Persistent storage of users should be by UUID as names are no longer unique past a single session.

frigid ember
#

if your server is set to offline

vernal spruce
#

Its because you can change

frigid ember
#

your uuids will be offline

vernal spruce
#

names

frigid ember
#

ah

vernal spruce
#

but uuid will always be the same

frigid ember
#

wasn't it displayname?

#

if its online mode it will be online

#
OfflinePlayer op = Bukkit.getOfflinePlayer(/* your name to lookup*/);
if (op.hasPlayedBefore()) {
    UUID uuid = op.getUniqueId();
} else {
    //hasn't played before
}```
#

no

#

bro offlineplayer means hes not on the server

#

and onlineplayer means hes online

keen compass
#

UUID's are generated from player names if server is offline mode, so there is no guarantee that any two players are the same

vernal spruce
#

^

frigid ember
#

Why do i even need to explain you that?