#help-archived

1 messages Β· Page 80 of 1

marsh nova
#

I love yaml

timber barn
#

lol

marsh nova
#

just use a yaml validator

runic wadi
#

i like hocon, json, and properties files

marsh nova
#

other than that, everything is a nice key : value

naive goblet
#

you cant have it compact?

keen compass
#

I only learned that part with Json because I was curious in how you would know how many arrays an array has, and the answer was you don't and you can't know. So you just have to create a method that keeps looping until it encounters no more arrays XD

runic wadi
#

i think that plugin.yml should instead be plugin.json

timber barn
#

I didn't want to start a discussion

#

lol

keen compass
#

well you did

naive goblet
#

I mean plugin.yml seems more fair, less words and symbols

timber barn
keen compass
#

with no one needing help currently

#

at least I don't think anyone needs help

timber barn
#

touchΓ© @keen compass

runic wadi
#

i don't need help, i'm just here to bitch about yaml

naive goblet
#

I bet everyone would change focus to the ones who need supports once they arrive

keen compass
#

usually that is the case

naive goblet
#

It should be

timber barn
#

they seek help in the wrong channel

#

πŸ”₯

#

oh 7 minutes ago

#

nvm

red zenith
#

yaml: Hold my misplaced space

hallow surge
#
    @EventHandler
    public void onMount(EntityMountEvent e) {
        Entity getent = e.getEntity();
        EntityType typeent = getent.getType();
        if(typeent.equals(EntityType.HORSE)) {
            e.setCancelled(true);
        }
        
    }
    @EventHandler
    public void onMount(EntityInteractEvent e) {
        Entity getent = e.getEntity();
        EntityType typeent = getent.getType();
        if(typeent.equals(EntityType.HORSE)) {
            e.setCancelled(true);
        }
    }``` any idea why this isnt working i know its probably stupid and my variables are also probably very bad xD
keen compass
#

what is it not doing?

naive goblet
#

.equals()

#

Constants / enum elements should be used with a reference comparison. EntityType == EntityType

hallow surge
#

i always get confused with those smh

naive goblet
#

one is for content one is for reference

keen compass
#

it should be

(typeent.getType() == EntityType.HORSE);
timber barn
naive goblet
#

Never used it

timber barn
#

me neither

hallow surge
#

@keen compass wouldnt that be redundant as
typeent = getent.getType()

runic wadi
#

i haven't had an entity mount event in 2 months

keen compass
#

@hallow surge I didn't look at it closely, essentially just get the type of entity compare it to the Constant

boreal tiger
#

What about JBON

red zenith
#

Is that because of Covid, Trapped?

keen compass
#

lmao

naive goblet
#

Y2K no

runic wadi
#

yes

hallow surge
#

should probably look up the propper uses of == versus .equals

timber barn
#

Hmmm is it possible to write a plugin which supports plugins based on .json files instead of .yml?

naive goblet
#

Since EntityType.HORSE is a fixed one

timber barn
#

silly question, but I'm not 100% sure whats possible on the fly with spigot/bukkit/mc

naive goblet
#

Zahl if your plugin is the first it should be

#

(First to be loaded)

timber barn
#

Like a core plugin? @naive goblet

naive goblet
#

Yeah

keen compass
#

I am sure you probably could support .json files. In fact you could just depend on SnakeYamlEngine instead which has the 1.2 Spec of YAML that supports JSON objects

naive goblet
#

load: STARTUP

runic wadi
#

mom said "yo room is dirty, <clinit>." but then i replied, "cmon, it's good enough, <init>?"

naive goblet
#

I mean if your plugin is the core it could manipulate most stuff in the server

runic wadi
#

get it

#

i made up that joke myself

#

just now

silk bane
#

resign

runic wadi
#

ok goodbye

timber barn
#

I'm curios acutally

naive goblet
#

why

timber barn
#

about doing that right now

#

idk

naive goblet
#

useless

timber barn
#

I'm bored

silk bane
#

@timber barn the entire plugin loading mechanism is an implementation detail, so good luck

timber barn
#

yes indeed

keen compass
#

@hallow surge

typeent == EntityType.HORSE;
#

now that I looked at it more

naive goblet
#

if ((!(((typeent == typeent)))))

keen compass
#

lol

marsh nova
#

what

red zenith
#

Not EntityType.HORSE == typeent

timber barn
#

da fuq

keen compass
#

you should make a non-recursive recursive loop @naive goblet

red zenith
#

He’ll get around to it someday

naive goblet
#

Always =}

runic wadi
#
outer: {                            
    slightlyInnerButMostlyOuter: {  
        primarilyInnerButNotQuite: {
            fullyInnerAndNoOuter: { 
                break outer;        
            }                       
        }                           
    }                               
}                                   
```my plugin is supposed to do great things, please leave feedback thank you goodbye.
#

yes that is valid java

#

and yes it is exciting

timber barn
#

How is a core plugin different from a 'normal' plugin?

runic wadi
#

there is no difference

keen compass
#

breaking outer from inner

#

how nice

naive goblet
#

No diff Zahl

marsh nova
#

what is a core plugin?

red zenith
#

It does number crunches?

naive goblet
#

But it's what the project is aimed to be that determines

runic wadi
#

a plugin is a plugin

marsh nova
#

Never heard of a "core plugin"

naive goblet
#

I'd a faction plugin is pretty core

runic wadi
#

if it has extends JavaPlugin it's just like the rest of us

keen compass
#

a core plugin is something that is designed to be depended on, like an API

naive goblet
#

implements IPluginJava

keen compass
#

However most core plugins are not designed properly

#

Since most of them extend JavaPlugin instead of PluginBase

hallow surge
#

@keen compass thx for the help πŸ™‚ already fixed it before you said that

runic wadi
#

wait a plugin can extend something that isn't JavaPlugin?

keen compass
#

yes

red zenith
#

Priority of onEnable and onLoad is higher than that of plugins that aren’t core?

runic wadi
#

wat

keen compass
#

You can extend PluginBase if it is a lib and the server will load it

runic wadi
#

that's a little weird

keen compass
#

but it won't treat it like a normal plugin though

naive goblet
#

Ah yeah

runic wadi
#

a library should be shaded or found in the module path

naive goblet
#

Never seen anyone do it though (plugin base)

runic wadi
#

that is gross

crimson cairn
#

why would you extend PluginBase

runic wadi
#

you would not

#

ever

timber barn
#

Soo.. for example, is PlaceholderAPI a "core" plugin?

naive goblet
#

Not really

marsh nova
#

What is a core plugin?

keen compass
#

so that your lib can be in the same directory as the plugin depending on it without the server complaining about it

naive goblet
#

I mean it has an API

marsh nova
#

Most of my plugins have an API

naive goblet
#

but would say it's softcore

timber barn
#

That what frost described @marsh nova

runic wadi
#

the java 9 module system > spigot pluginbase πŸ™„

#

shadowjar > pluginbase

marsh nova
#

don't ping please, it makes the message harder to read

crimson cairn
#

@keen compass i don't understand

marsh nova
#

jigsaw modules are nice

#

but not fun

keen compass
#

if you extend PluginBase you don't need plugin.yml too if I recall

timber barn
#

Will not happen again

crimson cairn
#

then how does it load the plugin

#

does it just iterate through every class?

marsh nova
#

oh my

naive goblet
#

No lol

keen compass
#

Anyways, its for the purpose that your API or library can exist in the same directory as the plugins needing it, and your plugin does things with the server API. To do things with the server API the server needs to load it

naive goblet
#

I think it just loads the plugin into memory

marsh nova
#

when the class is loaded from the classloader

#

then it can check if it extends PluginBase

#

right?

naive goblet
#

So the classes are visible

keen compass
#

^

hallow surge
#

Forstalf my code still doesnt seem to work? getting no errors this is really odd

    @EventHandler
    public void onMount(EntityMountEvent e) {
        Entity getent = e.getEntity();
        EntityType typeent = getent.getType();
        if(typeent.equals(EntityType.HORSE)) {
            e.setCancelled(true);
        }
        
    }
    @EventHandler
    public void onMount(EntityInteractEvent e) {
        Entity getent = e.getEntity();
        EntityType typeent = getent.getType();
        if(typeent == EntityType.HORSE) {
            e.setCancelled(true);
        }
    }```
crimson cairn
#

yeah but it cant do anything until the main class is loaded

naive goblet
#

u changed one of them

#

bruh

timber barn
#

no errors, no problem

#

Β―_(ツ)_/Β―

hallow surge
#

oops

#

omg

naive goblet
#

Islands we don't need to do anything with a lib ?

#

we just need to keep it loaded

runic wadi
#

e.setCancelled(e.getEntity().getType() == EntityType.HORSE);

#

concisify immediately

crimson cairn
#

im sure protocollib doesn't need to do anything for initialization, right?

naive goblet
#

I think it has to

keen compass
#

libs that extend PluginBase are not supposed to do things on their own. They are merely there to do things when plugins need them to, like an API. But having the server load your lib gives the advantage that you can make use of things in the server API as well.

naive goblet
#

because of the versions and nms stuff

#

iirc

crimson cairn
#

Anyways, its for the purpose that your API or library can exist in the same directory as the plugins needing it, and your plugin does things with the server API. To do things with the server API the server needs to load it
I still don't understand

runic wadi
#

how very dare you disable horses

naive goblet
#

lmao

timber barn
#

now i get it

crimson cairn
#

so

#

it's just a matter of necessity

naive goblet
#

Island well extending PluginBase would basically load the classes into memory so when other plugins can find the classes it doesnt throw an Exception

hallow surge
#

its preventing a dupe

crimson cairn
#

not really a wrong way to do it

hallow surge
#

so i mean

crimson cairn
#

@naive goblet that's the purpose of plugin.yml

keen compass
#

If the server never loaded your lib, you couldn't use the server API in your lib

naive goblet
#

huh

crimson cairn
#

main:

#

otherwise the server wouldn't load your plugin

naive goblet
#

for your own plugin only

crimson cairn
#

or it would need to do some hacky reflection

naive goblet
#

Actually a @interface would have been better

#

in my opinion

#

as main

crimson cairn
#

so Frostalf, then why is it improper to do extends JavaPlugin for a lib

naive goblet
#

Not an API

#

a Lib

keen compass
#

Anyways, most people don't know how to use PluginBase anyways so its fine. Because there is things that are missing that you need to handle yourself that are present in JavaPlugin

#

hence why most go with JavaPlugin

#

but if your plugin is truly an API and doesn't do things on its own, it should extend PluginBase

timber barn
#

I like the way Frost is explaining things

#

tbh

naive goblet
#

Well if its a plugin and and an api no. But yeah if it contains lib classes yeah

crimson cairn
#

why not JavaPlugin

runic wadi
#

... how about providing neither PluginBase nor JavaPlugin and being a true library GASP

naive goblet
#

It's not needed

crimson cairn
#

but it's not wrong

keen compass
#

Because extending PluginBase allows for the lib to exist in the plugins directory and all the plugins that depend on it can use it as well as it doesn't screw up shading.

naive goblet
#

^

crimson cairn
#

so does JavaPlugin?

keen compass
#

JavaPlugin screws up shading

#

if the plugin isn't designed properly

crimson cairn
#

wait what are you trying to shade

keen compass
#

I am not trying to shade anything in. I am merely explaining that if your plugin doesn't do anything on its own and is a library or api, it should be extending PluginBase and not JavaPlugin

runic wadi
#

wdym screw up shading

#

the version of a library your plugin depends on should be shaded and relocated

naive goblet
#

Frostalf it still needs to be declared in plugin yaml ?

keen compass
#

Because the class that extends JavaPlugin gets initialized meaning there is things that are needed that won't happen if you do shading

#

PluginBase doesn't require plugin.yml if I remember correctly

naive goblet
#

Now it makes even more sense

crimson cairn
#

it doesnt

crimson cairn
#

i just looked at that

#

but that doesnt help

naive goblet
#

It would be unecessary to load a plugin if it onle has classes that is needed for other plugins. So PluginBase would be the ultimate thing as the project then only needs to have the lib classes loaded.

crimson cairn
#

ok

naive goblet
#

Including we dont have to shade it.

keen compass
#

PluginBase isn't for normal plugins, as the only thing that happens if you extend that is your classes get loaded onto the classpath. But you need your library to get loaded on the Classpath if it makes use of the Server API otherwise you end up with NoClassDef exception since your library can't see it.

naive goblet
#

Just adding it as a dependency

crimson cairn
#

alright, that makes a bit more sense

#

but weird

naive goblet
#

I mean eventually it is but it's primarily made for simplifying stuff ig

sick citrus
#

Didn't know about PluginBase

#

don't really see much of a point of using it tho

keen compass
#

@crimson cairn If I recall, maven shading wasn't always a thing

sick citrus
#

if you use anything bukkit-related you need JavaPlugin...

keen compass
#

so before maven shading was popular, you needed a way to get your library on the class path πŸ˜›

sick citrus
#

...and even without extending PluginBase you can shade librairies in your Plugin jar without issue

#

Before maven shading, you had... "Extract dependency in project jar" from intellij/eclipse/whatever πŸ˜›

keen compass
#

@sick citrus you can use everything in the Server API from PluginBase just fyi don't need JavaPlugin for that, just that PluginBase was created for true libraries or API's that don't need to be initialized on the start of the server.

sick citrus
#

Hmmm I think I see

#

anything that doesn't need an onEnable() basically

crimson cairn
#

why dont they document this and make it easily accessible

keen compass
#

Have to remember, the API is quite old. And while we have things that make our lives easier in the realms of Java development they didn't always exist either.

sick citrus
#

It seems to be quite limited in usecases anyway

#

I can't think of any of my plugins (even library ones) that could be turned into PluginBase

keen compass
#

Well already stated the advantages of PluginBase over JavaPlugin and where it makes sense to use PluginBase. I also stated why JavaPlugin screws up shading in some cases as well.

sick citrus
#

Good to know it exists tho πŸ™‚

keen compass
#

Yeah not many people know it is there, guess I should add a wiki page for it

crimson cairn
#

as i said

keen compass
#

or see if one can be created

crimson cairn
#

there needs to be documentation

keen compass
#

Well there is not much to document for it other then just describing when it should be used and the advantages of using it and disadvantages of it

crimson cairn
#

cause people go out and ask questions

sick citrus
#

so anything that has commands or listeners is out of the picture

crimson cairn
#

when there isn't really clear documentation

#

and then they get harassed and treated like an idiot

sick citrus
#

^

#

wizjany on EngineHub is an expert for that

#

cough cough

keen compass
#

lmao

crimson cairn
#

like

#

"how do you NOT know about the most simple stuff"

#

im sorry, where's the documentation?

keen compass
#

oh well I don't expect everyone to know everything

#

I am not a fan of treating people like that

crimson cairn
#

"it's right here idiot!"
and then it's really bare bones written by a 13 y/o and incoherent

sick citrus
#

It's in the javadocs isn't it ? πŸ˜›

keen compass
#

only reason I know about it is because I have been around as long as bukkit has πŸ˜›

crimson cairn
#

makes me think of maven

timber barn
#

frost is bedrock here

crimson cairn
#

i feel bad for people who are just starting maven

keen compass
#

yes Weby it is, but if you look at the javadocs for it, there isn't much that is described

sick citrus
#

and for javaplugin...

crimson cairn
#

like, if you're new, you wouldn't have an idea what maven does

#

and by looking at their main website, it doesn't really help either

sick citrus
#

Maven's great tho

crimson cairn
#

that's if you understand what it does, though

keen compass
#

I agree @crimson cairn they could do better on their documentation

sick citrus
#

So "PluginBase" : Extend this class if your plugin is not a javaplugin.
JavaPlugin : Represents a Java Plugin.

most basic description ever.

crimson cairn
#

i hate when these people dont explain things in laymans terms

sick citrus
#

holy crap file sending is slow

crimson cairn
#

it's like they expect beginners to already have all this prior-knowledge

keen compass
#

The thing though is that it doesn't describe the differences @sick citrus

crimson cairn
#

and then going on youtube doesn't help either

sick citrus
#

Just don't be a beginner, duh.

crimson cairn
#

exactly

sick citrus
#

Lol frostalf, I know

#

exactly

#

To be honest

#

I interpreted this as "use this if you use another language than Java for your plugins"

keen compass
#

lol

sick citrus
#

last time I saw it...

#

Also, my Player class is not a JavaPlugin, should it extend pluginBase ?

#

πŸ˜›

keen compass
#

maybe I should start making youtube videos to talk about the API

sick citrus
#

Yeah

timber barn
#

yes pls

#

+1

crimson cairn
#

yes

#

start with the basics

#

and then literally just the layout

tiny dagger
#

yeah create minecraft

sick citrus
#

The one thing that was absolutely missing when I started doing plugins was "How does bukkit and your plugin communicate", in leyman's term.

crimson cairn
#

BukkitRunnables the scheduler, the Player interface, the Entity interface, other utils

sick citrus
#

LIke what methods does bukkit call when something happens

keen compass
#

well, all you have online at the moment @frigid ember is forum staff

naive goblet
#

jeez

frigid ember
#

I have a channel on spigot

sick citrus
#

Does anyone still use the scheduler ?

naive goblet
#

Did I hear BukkitRunnable

crimson cairn
#

cause a lot of these youtube videos just do
"alright we're making a plugin that spams arrows out of your face, now you'll need to type this and this and this...."

sick citrus
#

Runnables are just perfect

crimson cairn
#

sorry bukkitrunnable is outdated

keen compass
#

@sick citrus plenty of plugins make use of the scheduler lol

naive goblet
#

BukkitRunnable is ewwww

crimson cairn
#

but you get the idea

keen compass
#

yeah

crimson cairn
#

but yea, a lot of these videos don't really go over stuff in the api

naive goblet
#

Runnable or BukkitTask sure but BukkitRunnable != usefulness

crimson cairn
#

and you simply dont learn

timber barn
#

im curious, which plugin? @frigid ember

keen compass
#

Alright, I will start on making some videos that goes over the API and some of the quirks that happens as well in regards to doing some things πŸ˜›

crimson cairn
#

and then you get low quality crap on spigotmc

sick citrus
#

@naive goblet BukkitTask is just a scheduled BukkitRunnable...

timber barn
#

thanks frost

crimson cairn
#

have a playlist

naive goblet
#

Still better

sick citrus
#

A task is what you get when you "run" a runnable.

keen compass
#

yeah some of them tutorial videos are not very good quality

sick citrus
#

how is it "better"

#

Also

keen compass
#

about the most you can do with those is just copy what they did

naive goblet
#

BukkitTask can fully replace BukkitRunnable and even better.

sick citrus
#

something that is absolutely definitely missing is a video about the change from data id to blockdata

#

like it's still a proper mess in my head about all those changes

keen compass
#

Ah, I can go over that

crimson cairn
#

yeah just go over the API

sick citrus
#

It used to be very easy

crimson cairn
#

and then make little quick demonstration plugins along the way

naive goblet
#

BukkitScheduler#runTaskLater(Consumer<BukkitTask>)
BukkitScheduler#runTaskLater(Runnable)

sick citrus
#

Material changes

#

data ID deprecation

#

ewww

keen compass
#

I am not a fan that ID's were deprecated, but I can see why they were though

naive goblet
#

iirc BukkitRunnable is even deprecated there

keen compass
#

I mean for Mojang it solved a lot of problems for them

#

ID's can only go so high before you will end up needing 2 id's

#

and that just goes from something simple to twice as hard

crimson cairn
#
long
keen compass
#

not everything in Java is backed by longs though

naive goblet
#

The best thing would to maybe use executor services

keen compass
#

for instance, array's and hashmaps have a limitation in how large they can be because they are backed by an Integer and not long

crimson cairn
#
int
#

even short

naive goblet
#

FatDemical

idle zodiac
#

int

#

@crimson cairn just do one `

#

it's cleaner

#

for one lin things

crimson cairn
#

looks better with the gold

idle zodiac
#

ye...

naive goblet
#

gold?

timber barn
#

ok then, keep your secrets

keen compass
#

It would be nice if Oracle would update the Java JVM to move things to be backed by longs instead of ints though

idle zodiac
#

green

#

lime

#

olive

naive goblet
#

it's the ewwgreen

sick citrus
#

I mean for Mojang it solved a lot of problems for them
@keen compass Yeah definitely.
But it broke creative resourcepacks forever, and I'm still angry about that.

naive goblet
#

lol

#

tru

keen compass
#

Don't worry, Mojang killed my beloved API because of 1.8 😦

sick citrus
#

And WHY THE FUCK do we still not have an easy-to-use NBT api in spigot ?

timber barn
#

lol

sick citrus
#

And why the heck can't we just settle on having resource-packs reading NBT tags ? Like "resourcepack-id: xxx, resourcepack-variant: yyy"

naive goblet
#

You got a point ngl

marsh nova
#

if you have more tasks than Integer.MAX_VALUE, something is wrong

#

if you have more tasks than Integer.MAX_VALUE - Integer.MIN_VALUE, something is really wrong

timber barn
#

πŸ˜‰

sick citrus
#

with your JVM

marsh nova
#

so task IDs being int is not a problem

timber barn
#

lets test it out

marsh nova
#

If I had to guess I'd say they were removed because it's too similar to a magic value

#

but I never had a problem with them being ints

sick citrus
#

I'm not against magic values as long as they're documented

#

...and obviously if they don't change

naive goblet
#

Player#damage(Double.MAX_VALUE)

keen compass
#

magic values are not always bad

naive goblet
#

Indeed

#

I found it exceptionally useful

#

When overkill comes to the topic atleast

keen compass
#

I dislike when something gets deprecated becase "magic value" lol

#

and then no alternative is given

naive goblet
#

Yeah but I guess mercy is a thing

keen compass
#

not everything can be coded to not have a magic value somewhere

#

Well, if I do youtube videos, video quality may not be so great as well as I don't have a decent setup for doing video processing either lol

#

quality as in HD quality not quality as in the video substance lmao

naive goblet
#

I mean you got a yt channel?

hallow surge
#

why can i still ride horses -_- i cancelled the mount event

#

and interact event

keen compass
#

@naive goblet I don't no

#

never really had a reason to create one until now

naive goblet
#

now?

#

Y2K make the player dismount it ?

keen compass
#

Well, some have clearly approved of me making some youtube videos that basically goes over the API and some of its less documented things. Such as the discussion earlier where some didn't know about PluginBase lol

tiny dagger
#

i feel like i'm going crazy but wasn't there an event that you could set the location of a player on join? πŸ€”

subtle blade
#

I dislike when something gets deprecated becase "magic value" lol
and then no alternative is given
MaterialData was a decent API to try and hide those magic values but man was it ever incomplete

hallow surge
#
@EventHandler
    public void onMount(EntityMountEvent e) {
        Entity getent = e.getEntity();
        if(getent.getType() == EntityType.HORSE) {
            e.setCancelled(true);
        }``` i must be so stupid i dont get this am i registering the event wrong in my main class or something
tawdry venture
#

can somebody point out what's wrong with this code? it just doesn't show anything

Objective hp = e.getPlayer().getScoreboard().getObjective("skylist_hp");
if (hp == null)
    hp = e.getPlayer().getScoreboard().registerNewObjective("skylist_hp", "health");
hp.setDisplayName("\u00a74\u2764");//a red heart
hp.setDisplaySlot(DisplaySlot.BELOW_NAME);
naive goblet
#

did u set the sb for the player?

tawdry venture
#

do I have to re set it after the modifications?

naive goblet
#

idk

#

not very experienced in it

sudden elk
#

Hey Im having an issue with PersistentDataContainers... I can't seem to retrieve integers that I'm trying to store...

vernal spruce
#

Show how you set/get

#

the keys

sudden elk
#

WIll do, just have to put them in a paste bin

subtle blade
#

?paste

#

Oh come on, CafeBabe

#

Don't make me look like a fool here

hallow surge
#

CafeBabe bad

#

xD

subtle blade
#

Fine I'll do it myself

hallow surge
#

almost as bad as my plugin

worldly heathBOT
hallow surge
#

LOL

subtle blade
#

oh NOW it works

#

Stupid bot... ffs

vernal spruce
#

bot abuse PepeHands

subtle blade
naive goblet
#

?paste

worldly heathBOT
naive goblet
#

hmmmm

keen compass
#

I think Cafebabe likes to mess with Choco

naive goblet
#

?help

#

?paste

worldly heathBOT
naive goblet
#

?jd

worldly heathBOT
naive goblet
#

not that slow?

keen compass
#

@hallow surge you are testing with spigot right and not CB?

#

it could be because of the API rate limits for the bot being slow earlier

#

messages posted count towards that limit and for bots, messages are lesser priority

naive goblet
#

yeah

sudden elk
#

I'm having an issue with PersistentDataContainers, I can get a string but I can't retrieve anything else (Doubles, integers). I did some debugging and it seems as if it is setting Doubles and integers.
ItemUtils Class: https://paste.md-5.net/qipuxoveve.java
Setting: new ItemUtils(jewel).addJewelKey().addIdKey(id).addRarityKey(pickaxeJewels.getConfig().getString(path + "rarity")).addSuccessKey(success) .addMultiplierKey(pickaxeJewels.getConfig().getDouble(path + "multiplier")). addMinPickaxeLevelKey(pickaxeJewels.getConfig().getInt(path + "min-pickaxe-level")).addUJIDKey(ujid).addDiscoveredKey("false");

Getting: ```ItemStack item = e.getCurrentItem();
ItemMeta itemMeta = item.getItemMeta();
PersistentDataContainer container = itemMeta.getPersistentDataContainer();

System.out.print(container.get(ItemUtils.DISCOVERED_KEY, PersistentDataType.STRING));
System.out.print(container.get(ItemUtils.MULTIPLIER_KEY, PersistentDataType.DOUBLE));```

hallow surge
#

@keen compass yes im testing with spigot

keen compass
#

just making sure because those events are spigot only

hallow surge
#

shouldnt that code work tho πŸ˜„ am i registering an event wrong xD

inland depot
#

could you send a screenshot/link to the code where the method is being registered?

#

also send your full method for handling that event

keen compass
#

@hallow surge I am not particularly sure why it isn't firing. It should be registered just like any other event

#

unless your code for that is incorrect? I guess go over the basics to ensure nothing is wrong

#

like check you are implementing listener, check that you are indeed registering the event in onEnable()

#

But if you want us to check, send the code as per usual

lime mango
#

Hi can anyone point me in the direction for the best quest plugin for my server thx in advance

high basin
#

forge

#

/s

frigid ember
keen compass
#

you need to add another render @frigid ember or replace the one that is there

#

maps can have more then one renderer

#

Best way, is to create 4 renderers to handle each of the zoom levels

frigid ember
#

How do I ignore the teleport from Player has moved too quickly

#

@keen compass so If I clear it like this? This is what Im doing currently

    final WorldMap worldMap = (WorldMap) MinecraftServer.getServer().worlds.get(0).worldMaps.get(WorldMap.class,
        "map_" + view.getId());

    view.getRenderers().clear();
    view.addRenderer(new Render(worldMap));

keen compass
#

Yes, .clear() should remove the render

frigid ember
#

Thats what I'm doing but it's not working

keen compass
#

hmmm I will have to look at the api

#

been a while since I messed with maps

#

last time I really messed with them was like 1.7/1.8 when it suddenly became popular to make map art

#

XD

frigid ember
#

I'm doing it on 1.8 as well

#

i need help

keen compass
#

ah right, then I am not going to be much help then. I only have 1.15 api at the moment

frigid ember
#

im getting a unexpected packet error with bungeecord

keen compass
#

but later tonight I will get 1.8 api to see what needs to be done

#

@frigid ember can you paste the error at the following link

#

?paste

frigid ember
#

how do u use a engnitmica4 with bungeecord

#

or does bungeecord not do modded servers

worldly heathBOT
keen compass
#

bungeecord does not do modded servers

frigid ember
#

why is that

keen compass
#

because mods work differently then plugins do

frigid ember
#

is there anything

#

that works with modded servers

#

like bungeecord

silk gate
#

bungee supports modded backend servers though, no?

sturdy oar
#

Y

silk gate
#

Ive had pixelmon behind bungee

naive goblet
#

Yeah that works iirc

sturdy oar
#

Although it's not usually recommend , you can do it

naive goblet
#

But you need waterfall then?

latent rock
#

any opinions on CMI?

sturdy oar
#

Bad

naive goblet
#

I actually made a plugin working as a mod and plugin and it was little trickier with all the abstraction and encapsulation I had to do

#

Good

latent rock
#

y

high basin
#

Just use reflecfion

naive goblet
#

You can get the features for free but it surely gives you a vary of good features and I believe the code is better there iirc

forest cobalt
#

essentials but paid?

naive goblet
#

β€œJust use reflection”

keen compass
#

have no idea what CMI is

sturdy oar
#

You believe the code is better

#

but you can't confirm it

naive goblet
#

I don’t know

#

It has more features for sure

sturdy oar
#

It's not even open source

high basin
#

Spigot is a an abstraction

naive goblet
#

Just decompile and look for yourself

latent rock
#

yeah but performance wise

frigid ember
#

pretty much a $15 essentials with database support?

forest cobalt
#

decompiled code != source code

naive goblet
#

Trollzer what’s your point?

latent rock
#

ok

naive goblet
#

loid yes you can still see how it’s built up or what?

sturdy oar
#

It probably is obfuscated

forest cobalt
#

Sure but it’s not gonna be the same

frigid ember
#

so how do i get

#

sponge.jar

naive goblet
#

Sure it is but we can still find if it uses static wrong etc

frigid ember
#

wheres sponge.jar

sturdy oar
#

From Sponge website let me guess

keen compass
#

@frigid ember sponge is an entirely different implementation, they have a website

forest cobalt
#

Still don’t know if the compiler optimized shitty stuff away

naive goblet
#

Well, I mean Essentials code ain’t a beautiful look directly so the chance of CMI being better isn’t zero

sturdy oar
#

EssentialsX is a thing

#

Essentials is dead

forest cobalt
#

yeah ik but you can’t be sure

latent rock
#

lmao i just found out spigot icon fills with water

#

thats cool

naive goblet
#

I was generalizing Essentials and the X ver?

sturdy oar
#

yeah they're not the same

naive goblet
#

loid no but I’d certainly think that

forest cobalt
#

EssentialsX is largely the same codebase tho iirc

naive goblet
#

^

keen compass
#

Generally the java compiler will do little in the way of optimizations unless it is told to

naive goblet
#

afaik it’s just a fork

keen compass
#

that is why there is JIT

forest cobalt
#

JIT is cool

keen compass
#

as long as it has the information it needs to do what it needs to

#

which if you told the java compiler to optimize something, JIT can't work like it needs to

#

so, its like a catch 22 with that lmao. Either you optimize using the compiler and hope that your optimization works on all platforms or let the JIT handle it.

#

in most cases JIT will do a better job then you can since it knows the target platform

forest cobalt
#

either way decompiled code can be quite a lot different than original

sturdy oar
#

jit is jni?

forest cobalt
#

just in time compilation

keen compass
#

@forest cobalt depends, in most cases the majority of the code will not be all that different. Some things are lost like generics for instance.

sturdy oar
#

Obfucated code even with proguard is kinda readable

#

Not really, but you can try

keen compass
#

its all readable if you understand it

forest cobalt
#

and then if it’s obfuscated to smithereens, which it probably is

sturdy oar
#

Well there are more advanced obfuscators that turn java into bytecode

#

Then it becomes hell

bronze marten
#

ZKM :)

keen compass
#

even then if you know how to read bytecode it is still readable

#

I routinely look at bytecode all the time

hoary parcel
#

Zkm is fully reverseable anyways

#

The algos have been cracked

sturdy oar
#

Paramorphism

bronze marten
#

F

forest cobalt
#

some people think their shitty obfuscation will hide Ctrl + F > β€œsetOp”

keen compass
#

I mean you could go as far as ASM if you wanted and ASM is still readable so as long as you understand it

hoary parcel
#

You quickly reach a point where it's not worth it

keen compass
#

yep

bronze marten
#

some people think their shitty obfuscation will hide Ctrl + F > β€œsetOp”
@forest cobalt Just do reflection + string obfuscation, will make it a lot harder

hoary parcel
#

String obfuscation is a meme

#

It only protects against skids

keen compass
#

lol

sturdy oar
#

I have fruit obfuscation..m πŸ˜‚

forest cobalt
#

i’ve seen people obfuscate their code to hell then the setop is right there

bronze marten
#

i said harder not impossible lol

keen compass
#

sure, but the people you are making it harder for, isn't all that hard for them to begin with

hoary parcel
#

String obfuscation is the easiest obfuscation to reverse

sturdy oar
#

Nobody can't beat Apple.banana(Orange orange)

hoary parcel
#

And it's 100% reverseable too, flow obfuscation isn't always

forest cobalt
#

key has to be there if strings are encrypted

hoary parcel
#

Heck, you don't even need to write code to crack string obfuscation

#

Just copy and paste stuff

proud quest
#

Hello, i am having a Massive issue and i need help

keen compass
#

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

proud quest
#

i have tried to get rid of my current Help list and replace it with a better one

#

but this one Refuses to leave

keen compass
#

o.O

proud quest
#

i simply Don't want normal players to see every single command

sturdy oar
#

MiniDigger I am currently a security plugin, but I'm not really sure if it should be open or closed source

forest cobalt
#

wat

proud quest
#

i have tried MULTIPLE Plugins,

#

and nothing gets rid of it

sturdy oar
#

tab-completion : -1

hoary parcel
#

Why should it be closed source

keen compass
#

I knew it, you were a plugin all along @sturdy oar

hoary parcel
#

Security should always be open

#

To be validated by 3rd parties

frigid ember
#

i added that to my mods folder

#

and now my server dosent start

sturdy oar
#

Well I guess that's my idea as well

proud quest
#

is there ANYONE that is willing to help me out

keen compass
#

I am sure someone will, just have to be patient. But really does it matter if your players can see certain commands though?

#

I mean as long as they don't have the permissions for the command, not like they can use them anyways

proud quest
#

it does when trying to get permissions to be set up

sturdy oar
#

I don't even have a proper obfuscators so I think I'll just keep everything opensource for everyone

proud quest
#

i want players to be able to see what they can do or nt

#

not*

keen compass
#

@sturdy oar not like obfuscation is going to help with a security plugin anyways

proud quest
#

instead of having to search through 31 PAGES

keen compass
#

in fact I would bet it would hurt the performance of it more then help it

tiny dagger
#

^

sturdy oar
#

But what license would you recommend

keen compass
#

depends on your goal for it

#

GPL is always a nice default

proud quest
#

the help menu is that orange help menu, and i have even installed AdvancedHelp

keen compass
#

or if you really don't care what people do with it, go for MIT

proud quest
#

and it doesn't replace the current help menu

sturdy oar
#

Yeah I have mit

frigid ember
#

no license is great

keen compass
#

lol

sturdy oar
#

Are you dumb

frigid ember
proud quest
#

essentials doesn't work either

frigid ember
#

if i ignored all unknown teleport events, would that cause issues for lets say an anticheat

keen compass
#

@proud quest I can't really help as I am not familiar with plugins that do what you want

#

cause issues in what way?

#

are you developing an anticheat?

frigid ember
#

yes, but the Player moved to quickly teleports the player which makes bypass

proud quest
#

so there is NO Secret setting that i have to turn off

keen compass
#

player moved too quickly happens under certain circumstances

proud quest
#

to be able to Change this horrible menu?

subtle blade
#

More anti cheats?

#

Just what we need!

frigid ember
#

i never said i was going to release it

tiny dagger
#

frCheats incoming choco

forest cobalt
#

anticheats are memes at this point

keen compass
#

I love how Choco comes out of the shadows at very specific times certain topics are being discussed

frigid ember
#

and at least its not thewoosh or funke's tutorial

subtle blade
#

lol my girlfriend's been keeping me busy lately so I've been like... in and out of chat the last week

forest cobalt
#

what’s a girlfriend

hoary parcel
#

Ah so it's offical now

subtle blade
#

It is PepeHeart

hoary parcel
#

Not complicated anymore like the other day?

#

Grats!

#

Glad it worked out

keen compass
#

Guess will be seeing less of Choco now πŸ˜›

#

not always a bad thing to have good things going on in IRL

subtle blade
#

πŸ˜„

#

And no, it's not. Less complicated = gud

proud quest
#

Yes exactly, Less complicated = good, and This is why i want to get rid of this current help system

subtle blade
#

lmao

#

What a transition. I appreciate that

proud quest
#

but clearly no one here is willing to help

subtle blade
#

afaik you can disable the help system with the help.yml?

proud quest
#

cannot find up anything online,

subtle blade
#

I missed out on a lot of conversation here though so maybe you tried that

hoary parcel
#

Less complicated = good, that's why I got rid of my last girlfriend, lol

#

Bukkit has a help map, you can programmatically access that iirc

proud quest
#

as far as i am aware i DID Turn it off

#

@subtle blade it is command-topics-in-master-index, what i got to set to False, right?

keen compass
#

@proud quest Keep in mind, not everyone here is familiar with 100% of everything. Have to be patient and just wait for the right people to get online and provide help πŸ˜‰

#

We are all volunteers here after all

#

πŸ˜„

subtle blade
#

Well you can remove command help pages by setting ignore-plugins: All

#

(I assume that was what you wanted)

proud quest
#

yes but here is the issue, i have been scouring the web, for 2 hours now, and cannot find ANYTHING

#

Choco, i want to fully replace it

keen compass
#

@subtle blade Basically the person wants to remove commands so that players can't see every possible command on the server. IE, restrict what they can see in regards to it.

subtle blade
proud quest
#

i have installed advancedHelp to try to fully replcae it

#

replace it*

subtle blade
#

Was going to say - had assumed there were plugins to do that for you

proud quest
#

but guess what

#

it does not replace a thing

#

the same help menu is there

keen compass
#

could just restrict that command usage

#

do the plugins you have used, have their own command for help?

bronze marten
#

Can you use commands.yml to rewrite the help command to the specific plugin help command?

keen compass
#

that isn't how that file works

#

commands.yml is for aliasing

bronze marten
#

Idk i remember i did something similar, coul be wrong

keen compass
#

Well, you can negate perms for commands on the server

#

such as the help command

#

--bukkit.commands.help

#

that was why I was asking if the plugins that Jim had tried provided their own help pages

proud quest
#

it should

keen compass
#

then you could just negate that perm for your players

#

give them the perm for the help command that the plugin provides

#

and it should accomplish what you are wanting

proud quest
#

let me try that in a sec

frigid ember
#

so i got something called velocity

#

but its saying to enable ip fowarding how do u do that

subtle blade
#

This is not the Velocity server

#

Ask at their means of support. We have no understanding of how their software works

proud quest
#

trying it out Right now

#

something came in between,

runic wadi
#

tux is a nice guy and velocity is better than waterfall and bungee

#

but you must go seek him

proud quest
#

it does NOT Help

#

@keen compass it did not work

runic wadi
#

well tux is a person, not an it

proud quest
#

@subtle blade Is there any way to turn off this forceful help list

#

so something like AdvancedHelp can take it over

#

i have taken a screenshot

#

this is what needs to be turned off

frigid ember
#

Hey guys, is there a way to update map corners

proud quest
#

i am Literally going insane

#

because it Refuses to work

frigid ember
#

i need help

proud quest
#

i have been at the same problem for LITERAL HOURS

frigid ember
#

so im using velocity but it keeps saying i need forge to enter the game

proud quest
#

3 HOURS Stuck with this issue

frigid ember
#

the thing is im running forge

#

so why is it saying im not running forge

strong bear
#

Is it considered as a valid bug report? -- Using WorldGuard plugin with the command /stack, give yourself a full inventory of cakes then /stack it (repeat it a second time to get atleast 64) then put them in a shulker box. Break the shulkerbox and you'll see the contents as "Cake x1, Cake x1, Cake x1" and so on...

Can't test on a vanilla server as this isn't possible (or maybe) to get a stack of cakes in one slot

high basin
#

What happens when you place it?

wanton vine
#

so I reset my xp and found out that the placeholder %player_total_exp% takes all exp you have ever earned. So If I have 400 exp and I buy the book for 400, it stays at 400 even tho my true exp is 0. Why dont they have one that just resets? or is there a placeholder for exp that resets?

frigid ember
#

@keen compass what causes it to be a circle though?

    for (int x = 1; x < 128; ++x) {
        for (int y = 1; y < 128; ++y) {
        canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

I don't get why it wouldn't stay as a square

proud quest
#

Please, i beg of you

#

is there ANYONE here that can help me out

#

i have scoured online, over and over again, NOTHING!

#

and No one here wants to help out

frigid ember
#

Disabling /help?

proud quest
#

Yes, Disabling this FORCED help system

#

i do NOT! Want normal players to see EVERY Single command

#

Look at this! this is from a normal player's perspective!

#

31 PAGES!

runic wadi
#

@proud quest this is a spigot problem. brigadier doesn't do that πŸ˜›

proud quest
#

SO WHAT am i supposed to do!

#

I Want this issue to be gone!

#

i have been trying to get this horrible issue to be gone, for 3 hours now

#

tried Multiple plugins

frigid ember
#

ok

proud quest
#

nothing works

frigid ember
#

i need help too

#

this isnt the one man show here

proud quest
#

AdvancedHelp, also Doesn't work

frigid ember
#

so someone can help him and someone can help me

#

https://bukkit.gamepedia.com/Commands.yml

bukkit.command.help

This is the permission, you can take away the permission using a permissions plugin, if your using Essentials you can modify help, you can put the command under ban: in commands.yml,
or put this in your help.yml

ignore-plugins:
    - PluginNameOne
    - PluginNameTwo
    - PluginNameThree
#

i need help

#

why velocity isnt recognizing

#

my client as a forge client

runic wadi
#

y'all need jesus

#

will pray for you

proud quest
#

No we do not

frigid ember
runic wadi
#

forge and velocity have nothing to do with spigot

frigid ember
#

@proud quest this is in help.yml

wanton vine
#

@proud quest uou can use deluxe menus to grab the help command and make a custom GUI that they will see showing them help info instead of the list in chat

proud quest
#

i already tried a different plugin

#

and it does NOT Replace the help menu

#

i tried AdvancedHelp

frigid ember
#

Use the help.yml, it should be in the same folder as spigot.jar

#

@proud quest

proud quest
#

Yes, and What do i need to do, to FULLY Replace it with one from a Different plugin

#

because honestly, it feels like its trying to FORCE it onto people

frigid ember
#

what

proud quest
#

That this awful help system from bukkit is forcing itself onto people

#

refusing to budge

frigid ember
#

No...

proud quest
#

then why can't i make a difference

#

that other plugins just Don't work

frigid ember
#

It's not the plugins that don't work, its you thats using them wrong

proud quest
#

HOW AM I USING IT WRONG

frigid ember
#

Is it working

#

No, your using it wrong

proud quest
#

Something not working isn't always the Users fault

frigid ember
#

I never said that it was

proud quest
#

yet you are blaming ME

frigid ember
#

What have you tried

proud quest
#

I have done Everything you have said and Nothing worked

frigid ember
#

So your doing it wrong then

proud quest
#

i have messed with that help.yml before

frigid ember
#

Paste your config here

proud quest
#

i have even changed ignore-plugins to "All" like it states

#

and it does NOT! Work!

frigid ember
#
ignore-plugins:
 - All
proud quest
#

yes

#

and THAT is what it says

#

for Me

#

LITERALLY EXACTLY That

#

and guess what

#

it does not work

#

@frigid ember is that my fault then?

frigid ember
#

YES

proud quest
#

HOW IS IT MY FAULT

frigid ember
#

?paste

worldly heathBOT
frigid ember
#

Hey guys, how do I update the sides of a map?

torn robin
#

@frigid ember walk around

#

It renders the nearby areas of the map as you go near them

frigid ember
#

No how do I render it without walking around

#

@torn robin

torn robin
#

you can't if you manually generated it

#

i imagine you can setup a custom maprender and fill it in with the plugin

#

though it seems like more work than necessary

frigid ember
#

I have but it's not working

    @Override
    public void render(MapView map, MapCanvas canvas, Player player) {

    int mY = maxValue(map.getScale());

    for (int x = 1; x < 128; ++x) {
        for (int y = 1; y < 128; ++y) {
        canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    worldMap.decorations.clear();
    map.setCenterX(player.getLocation().getBlockX());
    map.setCenterZ(player.getLocation().getBlockZ());
    map.setWorld(player.getWorld());
    }

    public int maxValue(Scale scale) {
    int s = 0;

    switch (scale) {
    case CLOSEST:
        s = 0;
        break;

    case CLOSE:
        s = 2;
        break;

    case FAR:
        s = 4;
        break;
    case NORMAL:
        s = 8;
        break;

    default:
        s = 16;
        break;
    }
    return s;
    }

proud quest
#

Note to everybody, Don't listen to Phase, he Clearly wants to decide For you, instead of wanting to listen to what you want

#

i have mentioned a Billion times that i want to Get rid of that awful bukkit help system and Replace it with a plugin, And all he thinks is that i want to Edit that bukkit help system

#

all the help he has given is to try to get me to Edit it instead of Disable it

#

and then calling Me arrogant when he refuses to listen to what i want

torn robin
#

Jim your personal experience is unrelated to what he's asking

frigid ember
proud quest
#

it doesn't change the fact that he has been Incredibly rude towards me

torn robin
#

@frigid ember where are you getting worldMap?

frigid ember
#

That litterally replaces /help system but he got mad

#

    final WorldMap worldMap = (WorldMap) MinecraftServer.getServer().worlds.get(0).worldMaps.get(WorldMap.class,
        "map_" + view.getId());
torn robin
#

and is what you showed me in the picture the result of that code?

frigid ember
#

Yeah

proud quest
#

Phaze, you Clearly aren't listening, i don't want to Edit the text file, i want it OUT OF THE WAY! GONE! DISABLED!

torn robin
#

I'm not 100% sure how maps generate but you should probably debug what worldMap looks like

#

@proud quest you should bring those to PMs, it's unrelated.

proud quest
#

He blocked me because he REFUSED TO listen and instead kept whining about the same thing

frigid ember
#

imagine blocking someone on discord

torn robin
#

@frigid ember are you sure worldMap is the entire world map?

proud quest
#

i am done with this shit, Thanks for nothing, assholes

frigid ember
#

he left

grand aurora
#

Hello, I am having some problems with getting my plugin to add and remove people from scoreboard teams

runic wadi
#

he's not mad at you guys, he's mad at his hairline for receding like the 1920s

torn robin
#

@grand aurora what have you tried? Do you have any code yet?

grand aurora
#

Yes: sb.getTeam("ctf-blue").addEntry(p.getDisplayName()); is what I am using to add people to a team. sb is my reference to the current scoreboard. Is the username the proper string to use for addEntry?

#

Also, whenever I add a player manually inside of minecraft using /team join and then print out the scoreboard teams in spigot, the team is still empty, but when I create or remove a team, the change is reflected

frigid ember
#

i would just watch a bunch of tutorials about scoreboards on youtube

grand aurora
#

I have been reading the docs on scoreboards but I can't figure out why it isn't working

frigid ember
#

have you tried some youtube videos

torn robin
#

It should work it looks like, I would try using p.getName() instead of DisplayName

frigid ember
#

il have a look

grand aurora
#

Still doesn't work

frigid ember
#

is ur scoreboard implementation similar to this

#

1:29

grand aurora
#

Quick question: Does using a new scoreboard have any effect, or should I always get the main scoreboard (I only need one but I don't really understand how multiple works)

#

I am using manager.getMainScoreboard()

frigid ember
#

what is that

#

where is manager coming from

grand aurora
#

Bukkit.getServer().getScoreboardManager()

#

Should I remove getServer()?

frigid ember
#

i would really encourage you to watch that video

#

so that you have some idea on how it works

grand aurora
#

I watched it, but I am not using a scoreboard for display purposes, I am using it to track teams and use selectors for a capture the flag game

frigid ember
#

but did the video answer your quick question

grand aurora
#

No, but I just looked it up on the API docs and that answered it. The video was a good resource though that I will probably use in the future

frigid ember
#

so u want to add people to a team

#

what about that

#

question

dusty topaz
#

answer

frigid ember
#

why wont minecraft download my resource pack

#

it said it downloaded it

#

but nothing changed

#

since when does minecraft download resource packs

#

its a server resource pack

#

it should

#

u need to allow it

#

though

grand aurora
#

Thanks, now I have a better idea of what it could be. Do you have to re-set the scoreboard as the modified one?

frigid ember
#

i think if you have a scoreboard object calling methods that start with add or set should update the scoreboard automatically

grand aurora
#

Okay, I think the problem is that it doesn't, because I call addEntry and then check immediately after and the entry has not been added

frigid ember
#

on the guide it shows how to do it does it work?

#

so it downlods

#

but dosent apply

grand aurora
#

I am doing it the same way but it doesn't work

frigid ember
#

let me see

hallow surge
#

okay back at it again

package me.y2k.antidonkeydupe;

import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityInteractEvent;
import org.spigotmc.event.entity.EntityMountEvent;

public class AntiDonkey implements Listener {
    
    @EventHandler
    public void onMount(EntityMountEvent e) {
        Entity getent = e.getEntity();
        if(getent.getType() == EntityType.HORSE) {
            e.setCancelled(true);
        }
        
    }
    @EventHandler
    public void onMount(EntityInteractEvent e) {
        Entity getent = e.getEntity();
        if(getent.getType() == EntityType.HORSE) {
            e.setCancelled(true);
        }
    }
}``` ^ Event Class
```java
package me.y2k.antidonkeydupe;

import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

public class DupeMain extends JavaPlugin {
    @Override
    public void onEnable() {
        getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "Anti Donkey Dupe Enabled");
        getServer().getPluginManager().registerEvents(new AntiDonkey(), this);
    }
    
    @Override
    public void onDisable() {
        getServer().getConsoleSender().sendMessage(ChatColor.RED + "Anti Donkey Dupe Disabled");
    }

}``` Main Class
Goal: Goal is to stop players from being able to ride horses and it doesnt seem to be working
frigid ember
#

wow

hallow surge
#

exactly

wanton vine
#

so I reset my xp and found out that the placeholder %player_total_exp% takes all exp you have ever earned. So If I have 400 exp and I buy the book for 400, it stays at 400 even tho my true exp is 0. Why dont they have one that just resets? or is there a placeholder for exp that resets?

grand aurora
#

Update: It seems that the entry is added to the team, but as soon as I reference the team from a different context it fails

velvet halo
#

EntityType.Donkey πŸ‘€

frigid ember
#

@grand aurora im trying it out now

grand aurora
#

Wait

#

I just deleted another random team we had (that wasn't doing anything) and now it works

frigid ember
#

@hallow surge getent.getType().equals(EntityType.HORSE) maybe that will work?

hallow surge
#

i was told earlier to use ==

#

and not .equals

frigid ember
#

i dont think it will actually make a difference

hallow surge
#

it does

#

in some situations

frigid ember
#

maybe for String

hallow surge
#

plus ive already tried with .equals

#

still didnt work

frigid ember
#

EntityMountEvent

#

are you sure that event is what you want

hallow surge
#

pretty sure

#

its a horse 😐

frigid ember
#

event i meant

hallow surge
#

yea its the right event

#

a horse is an entity

#

and im using the interact event as well

chrome heron
#

Are there a method to disable villager trading in 1.15 spigot

hallow surge
#

cancel the interaction event with villagers

#

im pretty sure

chrome heron
#

are there a plugin

marsh nova
#

if you are not adverse to Skript you can use that

#

if you have a very basic knowledge of Java you can do it very, very easily

chrome heron
#

skript ?

#

I installed

brisk mango
#

@frigid ember enums are compared using == since they are a static finals, meaning there is only one of them

#

and there is a difference when using == or .equals

high basin
#

Yes

marsh nova
#

you can use #equals for enums

#

or you can use reference equality

brisk mango
#

yes, but since they are values, its common practice to use ==

marsh nova
#

either way works

high basin
#

.equals can cause null pointer exception

brisk mango
#

no, it cant

frigid ember
#

i meant in that scenario it wont make a difference

marsh nova
#

lol

high basin
#

== sometimes doesn't work

brisk mango
#

I mean

marsh nova
#

"equals can cause null pointer exceptions"

#

nice joke

brisk mango
#

== can

#

you don't use == for strings because new String could be called twic

marsh nova
#

any invocation on a null object causes a NPE

frigid ember
#

if u have strings

#

i would use CompareTo

#

its safest

runic wadi
#
    public final boolean equals(Object other) {
        return this==other;
    }
```this is the implementation for equals in enum. what the FUCK is that lack of spaces around the `==`
hallow surge
#

🍿 hmhm

brisk mango
#

no its not

runic wadi
#

how can oracle code so hideously

#

put spaces

marsh nova
#

it's not hideous

runic wadi
#

this == other

#

much better

#

literally incestuous comparison

#

they're so close together

marsh nova
#

this really isn't a case where extra readability is required

#

that's just writing boilerplate essentially

runic wadi
#

EXCUSE ME what they are doing is gross

#

what are you on

marsh nova
#

okay

brisk mango
#

its not a gross

#

its fine

marsh nova
#

if you are a better judge of subjective value

runic wadi
#

y'all probably code with control flow all out of whack

#

that curly brace hell

marsh nova
#

double-bracket initialisation for everything

#

that's how you do it, isn't it?

frigid ember
#

imagine doing this: for(inti=0;i<6;i++) {}

#

instead of adding spaces

brisk mango
#

you cant do inti

#

lol

marsh nova
#

so you know, I do prefer == for enums, but it isn't a mistake or anything to use #equals

frigid ember
#

yeah u have to add space there

brisk mango
#

its not a mistake, but its something like naming convetions

#

its a common practice and you should use it @marsh nova

marsh nova
#

there's no convention on using ==

brisk mango
#

i said its like

marsh nova
#

it is also a common practice to use #equals

brisk mango
#

not on enums

marsh nova
#

no

#

it is

brisk mango
#

its not

#

noone uses .equals on enums

marsh nova
#

yes it is

brisk mango
#

its not a common practice

marsh nova
#

a lot of people do

brisk mango
#

wasting time arguing with stupid person

marsh nova
#

i'm merely being correct

#

sorry

brisk mango
#

you are not being correct, .equals on enum is not a common practice but w/e

marsh nova
#

it is a common practice

#

using reference equality is common also

#

they are both widely used

#

i believe there's a stackoverflow question on this very matter

frigid ember
#

i actually used equals for strings and it causes nullpointerexception when string is equal to null

brisk mango
#

You know, that .equals can actually return false when comparing enums?

#

dont tell me its a common practice, no1 uses .equals on enums its just stupid

frigid ember
#

in c u have function called strcmp which is similar to compateTo in java

marsh nova
#

that .equals can actually return false when comparing enums

#

it will return false if they aren't equal

brisk mango
#

nah it can return false even if its equal

#

== is null safe

marsh nova
#

are you being honest?

#

you saw the implementation of Enum#equals

brisk mango
#

Its safer at runtime

marsh nova
#

which only uses a reference condition under the hood

#

so why would you assert the patently incorrect claim that "nah it can return false even if its equal"?

#

You should not mislead others so

brisk mango
#

Im not misleading others, it actually can return false you can google that up.

marsh nova
#

lmao

#

is anyone else seeing this?

brisk mango
#

anyway you know when using == is faster, and safer at run time?

#

youre actually brain damaged

marsh nova
#

you claim that invoking a method which checks for reference equality will produce a different result from using it directly

#

so you know, I do prefer == for enums, but it isn't a mistake or anything to use #equals
allow me to quote myself

#

Using #equals is perfectly fine

brisk mango
#

it can

marsh nova
#

Last time I checked Spigot plugin developers are not writing highly sensitive network-level code where every method call layer matters

runic wadi
#

wtf even is this discussion about

marsh nova
#

user claimed that invoking a method which checks for reference equality will produce a different result from using it directly

#

nah it can return false even if its equal

  • temedy
runic wadi
#

the only difference is the method can throw an NPE while the identity comparison can't

#

that is it

frigid ember
#

Object1 == Object2

runic wadi
#

nothing else is different

frigid ember
#

as simple as that

marsh nova
#

Precisely, which is why I had to correct his odd claim that the true/false results will be different

runic wadi
#

they can only be different if equals is overridden

#

then all bets are off

brisk mango
#

@marsh nova It can be different, for example when you would do if(enum.equals(null)) then it would throw a NPE, but if you would be using the equality operator it would just return false

#

its not the same

runic wadi
#

using .equals on an enum, which is a singleton, is very gross

brisk mango
#

.equals() can return false at runtime

runic wadi
#

don't do that

marsh nova
#

obviously you would include a null check if you were dealing with null enum values