#help-development

1 messages · Page 300 of 1

remote swallow
#

only file in there, ill check if its correct on ptero rq

#

yeah same format on the ptero files

serene sigil
#

maybe the namespacekey in the crafting recipe must be different????

#

idk

#

just a guess

hushed spindle
#

im guessing the recipe that was registered then had a different key so now you're basically crafting an item with a different key than you're using right now

young knoll
#

Check the items data

#

I forgot the command, guh

remote swallow
#

which

young knoll
#

/data get entity @s SelectedItem

#

iirc

serene sigil
#

it doesnt work

#

its tge ´same

hushed spindle
#

do that command this epic gentleman just shot

serene sigil
remote swallow
#

looks as if that doesnt have pdc on it

serene sigil
#

ye

#

but like...

young knoll
#

Show code

serene sigil
#

.

#

not really much has changed

hushed spindle
#

m

#

im guessing its because you put the PDC in its own variable

#

try doing the set part directly on the meta

#

oh no

#

its because you put itemmeta in its own variable

#

but the pdc part you did on the itemstack.getitemmeta

serene sigil
#

@remote swallow any guesses?

hushed spindle
#

so instead of itemStack.getItemMeta().getPersistent... you do itemMeta.getPersistentDataContainer().set...

serene sigil
#

oh

#

i see

hushed spindle
#

because as far as i know when you get the item meta of an item you actually more just get a clone of it sort of

#

at that point it's separate from the item

young knoll
#

Yes

hushed spindle
#

thats why you cant change the display name of an itemstack directly, gotta do it on the item meta and then re-set the item meta on the item

hushed spindle
#

i already corrected myself

serene sigil
#

IT WORKS!!!!!

#

FILALLY!

young knoll
#

👍

remote swallow
#

okay @tender shard ive figured out an issue

#

the yaml doesnt like the storage section, i changed the yaml and removed storage section and it work

#

okay

#

so

#

snakeyaml was dying because i had stuff in quotes

mighty aurora
#

Quick question. How would I make an Iron Golem always follow a player unless their is a current goal to follow?

#

Meaning that it would follow the player until it needed to attack something and then when its done attacking it would go back to the player.

young knoll
#

AI and pathfinder goals

#

You can probably repurpose the goals from a wolf

proven monolith
#

How could I access a player for a Scoreboard

#

For this

remote swallow
#

placeholder api

proven monolith
#

I have papi

young knoll
#

uhh let me get the method

remote swallow
#

how are you setting the scoreboard for theplayer

young knoll
#

PlaceholderAPI.setPlaceholders(player, string);

remote swallow
#

yeah

#

look at the screenshot

proven monolith
#

Yes but I need the player value

remote swallow
#

where are you running that scheduler

proven monolith
#

Err

#

I ma on phone rn sadly

#

Am*

#

I'll get on pc in a bit real quick

remote swallow
#

mk

proven monolith
remote swallow
#

where is it

#

like what method

proven monolith
#

Errr

remote swallow
#

is it in an event, on enable

proven monolith
#

Event I think

remote swallow
#

event.getPlayer()

proven monolith
remote swallow
#

that would be in a constructor

proven monolith
remote swallow
#

you have a uuid in the boards map

#

you can get a player from that

proven monolith
#

how?

remote swallow
#
        Map<UUID, String> myMap = new HashMap<>();
        for (Map.Entry entry : myMap.entrySet()) {
            entry.getKey(); // returns UUID
            entry.getValue(); // returns string
        }
proven monolith
#

my map is a Private Final

young knoll
#

Okay?

remote swallow
#

thats just an example

#

the map doesnt need to be defined there

tardy delta
#

real chads do java map.forEach((id, str) -> { // code })

remote swallow
#

no

tardy delta
#

why dont i have syntax highlighting

remote swallow
#

it doesnt like forEach

tardy delta
#

i used to always use forEach when i was younger

#

it looked horrible but whatever

proven monolith
remote swallow
#

replace your for statement to match that

#

change FastBoard board to Map.Entry entry

#

then replace board.values to board.entrySet

naive bolt
#

Im trying to find a nice and simple config updater to update configs keeping peoples changes but adding new defaults etc

#

I have seen Jeff Media's one on github but seems a little complicated for my use case ngl

naive bolt
#

i dont get what the config.java class does

#

this one

tender shard
#

oh that's just an incomplete list of the config options

#

e.g. imagine this:

#
String myString = getConfig().getString("my.string");
#

instead I'd rather do

String myString = getConfig().getString(Config.MY_STRING);
#

so that you avoid typos in "my.string"

naive bolt
#

Ahh and it nicely adds IDE auto complete

#

I see

tender shard
#

yep

remote swallow
#

would i use Material.matchMaterial for something that is just the material name but lowercase?

#

or should i just uppercase it and valueOf

naive bolt
tender shard
#

wdym?

naive bolt
#

like this

#

abc.123.string

pale pendant
#

can i somehow convert my screen into maps?

tender shard
#

you'd just say

public class Config {
  public static final String SELF_SPECTATE_MESSAGE = "language.commands.sepctate.self-spectate";
tardy delta
#

you need an image for that

tender shard
tardy delta
#

i did it before and imgurs and stuff work

proven monolith
#

My friend is telling me to do it like this

tardy delta
#

🤔

dry yacht
#

Does anybody know how one can increase IntelliJ's available RAM? My IDE literally crashes when trying to decompile simple classes like the Material class. I know, a sources-jar would probably be preferred, but this is just a sad thing over all, because I have 32 gigs laying around...

remote swallow
#

vault api

remote swallow
undone axleBOT
hushed spindle
hushed spindle
#

unless you go way over the top and calculate how the screen should be rendered which is just way overcomplicated

pale pendant
#

okay, im gonna try everything i can

vast raven
#

Why do I get ConcurrentModificationException in this line of code, I mean what am I changing during the iteration.

dry yacht
remote swallow
#

what is autopsia line 88

tender shard
tender shard
remote swallow
tardy delta
#

everyone knows what happens when you decompile the Material class

#

cant you just download sources?

remote swallow
#

i added more once but i forgot howto

vast raven
tender shard
#

the material class is a joke

remote swallow
#

yeah

vast raven
tender shard
#

ah, easy

#
List<HumanEntity> v = new ArrayList<>(inventogy.getViewers);

this fixes it

vast raven
#

Is the the viewers changing the problem?

tender shard
#

yes

dry yacht
tender shard
#

so just create a copy of the list

remote swallow
#

hm i just found that i can do configSection.getName. if were to use it on configSection("vote-gui.1") on ```yml
items:
elytra: &elytraitem
Enchants:
MENDING: 1
DURABILITY: 3
Lore:
- Lore Line 1
- Lore Line 2
Name: Epic Elytra name
Material: elytra

vote-gui:
1: *elytraitem

#

im gonna get tas'd

tardy delta
#

how do you get a cme in that way?

remote swallow
#

i know it

remote swallow
#

no its actually pretty cool

tardy delta
#

or is openInv removing them from the viewers?

#

assuming the inv where viewers cames from and inv as parameter are the same

tender shard
#
List<...> viewers = inventory.getViewers(); // Okay, we got a list of all viewers now

for(HumanEntity viewer : viewers) { // Now we loop over the list
  viewer.closeInventory(); // FAIL! We now changed the list we currently loop over - that is not allowed!
tardy delta
#

ah what i thought

tender shard
#

that's why you need a copy of the list, e.g. ```java
List<...> viewers = new ArrayList<>(inventory.getViewers);

tardy delta
#

or Collections.unmodifiableList

dry yacht
tardy delta
#

which creates a view and doesnt copy them

hushed spindle
#

does anyone happen to know how to get removed vanilla recipes back lol

#

doesnt have to be through code

remote swallow
#

errrr

#

one sec

remote swallow
#

one sec i need to boot mc

hushed spindle
#

every time i google it, it tells me how to REMOVE recipes

#

which obviously, i know, thats my issue

remote swallow
#

theres a command i know i just cant remember its format

vast raven
dry yacht
hushed spindle
#

theres a command for it? that would be amazing

dry yacht
remote swallow
tender shard
remote swallow
#

just not the elytra for getName

tender shard
#

I've been using anchors since ages. SnakeYaml "replaces" them while parsing the file

vast raven
dry yacht
vast raven
tardy delta
#

why do people do (p) and not just p

dry yacht
remote swallow
#

you would need some code to run if its all vanilla recipes

vast raven
remote swallow
#

it doesnt appear to have a way to give all just recipes

vast raven
naive bolt
#

mfalex can i make the Config.NOTIFY_UPDATES return boolean not string?

remote swallow
#

getBoolean

vast raven
remote swallow
#

not getString

tardy delta
#

cant you just send a packet to change title?

#

or do those not exist

remote swallow
#

thats the one thing we dont have iirc

dry yacht
naive bolt
remote swallow
#

you want a bool

#

so get it as a bool

naive bolt
remote swallow
#

change String to Boolean

vast raven
#

?paste

undone axleBOT
remote swallow
#

seems pretty basic

naive bolt
tardy delta
#

same thing for numbers

remote swallow
#

make it a boolean then

#

return true or fale

#

?learnjava!

undone axleBOT
humble tulip
tardy delta
#

things like getDouble just get an Object and see if its a Number and then call Number::doubleValue()

naive bolt
#

no that "notify_updates" is the config path

remote swallow
#

so you dont need it as a boolean then

naive bolt
#

like language.commands.no-permissions

remote swallow
#

the paths are all strings

#

you should never have a boolean path

naive bolt
#

I know but

hushed spindle
remote swallow
#

yeah

#

recipes are advancements for some reason

naive bolt
#

i wanna be able to do this

hushed spindle
#

seems the paths are a bit wack but its better than nothing

remote swallow
#

you would still have to do config.getBoolean(Config.PATH)

naive bolt
#

oh

#

ah

remote swallow
#

the config.something is just a path

#

not the actual variable

young knoll
#

Are we changing the name of an open inventory?

naive bolt
vast raven
dry yacht
#

I cannot find those mentioned line numbers with out-of-context snippets. You'd have to go look them up.

vast raven
tender shard
naive bolt
#

ik im using a bool now

tender shard
#

NOTIFY_UPDATES would have to be a boolean, yes

dry yacht
# vast raven

I would just advise you to also give my approach a shot first, as that doesn't needlessly allocate any new memory.

tender shard
#

create a NEW list

#

then loop over that

#
new ArrayList<>(inventory.getViewers()).forEach(HumanEntity::closeInventory);
vast raven
#

okkkkk

dry yacht
tardy delta
#

Collections.unmodifiableList if u wanna do it good

vast raven
dry yacht
#

You're not concurrently modifying the list anymore, as you iterate it in reverse based on integer indices and are thus allowed to remove items through the side effects of #closeInventory

#

Could also use a while size > 0 close viewer 0 loop, but that's just taste at this point.

vast raven
vast raven
#

I think I'll use that

tardy delta
#

does removing in a while throw a cme?

#

had to learn that for my exam but alraedy forgot

dry yacht
dry yacht
vast raven
#

I couldn't know this on my own

#

Not before testing it

rotund ravine
#

?learnjava

undone axleBOT
rotund ravine
#

?learnjava!

undone axleBOT
vast raven
#

so I'm glad to listen you

dry yacht
onyx fjord
balmy valve
#

When using ItemStack#isSimilar(ItemStack), it works unless its an player head, is there any way to fix that

vast raven
#

actually I know java, I saw lack of times this exception

dry yacht
balmy valve
vast raven
#

the alex's way worked, but I think I'll use the while (viewers.size() >0)

dry yacht
onyx fjord
#

IJ wont even let me do the classic

#

but thats for good

dry yacht
dry yacht
remote swallow
onyx fjord
#

for (HumanEntity viewer : viewers ) {}
❤️

vast raven
#

and gaves the same exception tho

tardy delta
#

does a regular for loop like that throws a cme?

#

i really should learn

onyx fjord
#

what exception u mean

#

i didnt follow the convo

dry yacht
vast raven
onyx fjord
#

ah

tardy delta
#

as a for loop is implemented with an iterator

#

internally

vast raven
# onyx fjord ah

I've wrote the foreach using lambda but it's the same thing using a for

onyx fjord
#

well u gotta make a new list add elements to remove and after for loop remove items from new list from the first one

#

pretty annoying

dry yacht
#

Guys, I lost hope in humanity

tardy delta
#

i already did long ago

vast raven
#

while (viewers.size() > 0) it's one of the best snippet I heard in 3 months

#

actually this could save a lot of memory

onyx fjord
#

CopyOnWriteArrayList?

#

why skull

#

its thread safe

#

u can do shit on it

dry yacht
#

please read

A ConcurrentModificationException is basically only a protection, protecting you against ruining your own iteration process. If you iterate a list front to back, with indices, and you remove items while iterating, all indices shift. You removed index 0, advance to index 1 in your for-loop, but the list item 1 actually shifted back to index 0 and you will never reach it in your loop anymore. You'll run off the end of the list and get an index out of bounds exception.

This is why list removals are done tail to head, iterating backwards, as lists shrink back to front, so indices won't shift.

And the most elegant, most beautiful solution is a while (size > 0) remove(0), as you'll always pop off the head while there are any items left, as long as the list still has items.

tardy delta
#

and then saying you can easily create your own list impl that doesnt throw a cme

dry yacht
vast raven
#

thanks @dry yacht

dry yacht
#

That's also not it

vast raven
#

whut

tardy delta
#

looks terrible

onyx fjord
#

digitalocean says to just use an Iterator and CopyOnWriteArrayList

        Iterator<String> it = myList.iterator();
        while (it.hasNext()) {
            String value = it.next();
            System.out.println("List Value:" + value);
            if (value.equals("3"))
                myList.remove(value);
        }
mighty aurora
#

Anyone know how to remove an entities loot table from being executed?(Meaning they won't drop anything)

dry yacht
#

You pop off the head as long as there are still items left, by getting the item at index zero.

mighty aurora
#

Not sure i understand

dry yacht
vast raven
#

I need to assign the i to the size

#

and i--

#

right

dry yacht
remote swallow
#

fortune 3

onyx fjord
#

whys that?

dry yacht
dry yacht
tardy delta
naive bolt
#

whys my config var not work here

#

wait

remote swallow
#

is that a var in your pom and do you have resource filtering on

vast raven
vast raven
#

good logic

dry yacht
dry yacht
# vast raven good logic

Read the comments please, I hope you understand what I mean. I tried to explain it as clearly as possible.

tardy delta
#

this world is fucked up

dry yacht
# tardy delta this world is fucked up

Humanity is literally lost. We get dumber by the minute. Technology will not advance by itself if we ruin each other. We will die as a species way quicker than people believe is possible. This is a real concern.

vast raven
#

right?

dry yacht
#

So that's like list.remove(0), in essence

#

You have to know that tho, which is called a "side-effect", as the method is not only affecting it's own state, but the state around it.

remote swallow
#

anyone here that yamls much would this be valid ```yaml
vote-gui:
- 1: *elytraitem
cost: 150

naive bolt
#

why can i not parse 2.1 with Long.parseLong

dry yacht
tardy delta
#

inline cost under *elytraitem

vast raven
dry yacht
remote swallow
#

also i answered my own question

#

found an ss off alex

tardy delta
#

like that

#

a list of sections

dry yacht
remote swallow
#

it is just a list of config sections

dry yacht
# tardy delta isnt it a list

It's a list, but why indent to the level of the anchor. Btw, list items are not indented, this is a common misconception because it also works.

remote swallow
tardy delta
#

ye it works but it looks weird imo

remote swallow
#

you look weird

#

also blame alex for me knowing that

vast raven
#

I mean, if you don't know how to fix the problem, you will be stucked

dry yacht
dry yacht
vast raven
#

Thanks btw

remote swallow
#

yaml is cool tbh

naive bolt
#

can 2.1 not be parsed as a long?

remote swallow
#

that is a double

tardy delta
#

in config? it can

remote swallow
#

Long.paseLong might work

dry yacht
# vast raven Thanks btw

No worries! I'd love for people to really understand these cases, I'm pretty invested in that, which is why I want to explain it as clearly as possible. Happy that I could help!

naive bolt
tardy delta
#

what are we talking about

naive bolt
#

get this

#
    private static long getNewConfigVersion() {

        final InputStream in = StaffSpectate.getInstance().getClass().getResourceAsStream("/config-version.txt");
        final BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        try {
            return Long.parseLong(reader.readLine());
        } catch (final IOException ioException) {
            ioException.printStackTrace();
            return 0;
        }

    }
tardy delta
#

just use a scanner lol

austere cove
#

fam 2.1 is not a long

remote swallow
#

why is that a text file

dry yacht
remote swallow
naive bolt
dry yacht
remote swallow
#

shut up

#

its british

#

we say our t's

austere cove
#
String[] parts = input.split("\\.");
long major = Long.parseLong(parts[0]);
long minor = Long.parseLong(parts[1]);
buoyant viper
austere cove
#

I'm not british

remote swallow
#

how could you

austere cove
#

my teeth look good

remote swallow
#

so do mine

hardy garnet
#

Is it possible to have too many entities on a server in such a way as the entities are laggy and tp around, but the server itself (and breaking and placing blocks) has no issues?

remote swallow
#

tps issues be like

slim kernel
#

Can I somehow get the code back into intelliJ from the .jar file? I somehow lost the correct version while pushing and pulling to github idk... But I still have the jar with the correct code...

hardy garnet
remote swallow
dry yacht
remote swallow
#

it would give you the .class files that you can open with intellij to see what the code is

austere cove
buoyant viper
#

BytecodeViewer 💪

dry yacht
slim kernel
austere cove
#

that being said, what's wrong with just using plugin.getDescription().getVersion()

slim kernel
hardy garnet
remote swallow
#

you would have to manually change the var back to name

dry yacht
slim kernel
#

hmm and what code gets changed and what doesnt?

remote swallow
#

hard to say

dry yacht
jagged monolith
#

Export the jar into a folder, then open that folder in the ide

remote swallow
#

from checking decompiled code i think iteration gets changed, var names

dry yacht
dry yacht
slim kernel
hardy garnet
#

it could just be the connection idk

onyx fjord
#

Good idea to push your code to git repo

slim kernel
#

only the decoomplied up to date one and the old normal one

hardy garnet
#

i'm doing a continuious ping and sometimes it jumps quite a bit

dry yacht
hardy garnet
#

and it doesn't mess with mobs at all

dry yacht
dry yacht
dry yacht
hardy garnet
dry yacht
# hardy garnet Lol well my plugin isn't interacting with the mobs so

As Bukkit's API abstracts implementation details away, you have no direct way of knowing what you affect and how you affect it. You're not in full control, and maybe you misunderstood something (as I often have too in the past). Just saying that you shouldn't exclude the "impossible" so quickly.

hardy garnet
humble tulip
#

Learning java with spigot is def more fun

hardy garnet
#

the ping jumps drastically and the entities stop moving and tp

dry yacht
#

Ping is the time it takes for the keep alive packet to be acknowledged, IIRC. That's not entirely network only, but can also have something to do with the server itself lagging. Packet I/O is not synchronous either. It's hard to draw a conclusion from that.

#

Do you have access to the OS terminal of your server?

#

Or easier, just ping your server from your local terminal and check the response time. No need to do it the other way around.

#

This excludes minecraft

dry yacht
hardy garnet
#

Nope, ping ip -t

dry yacht
#

Well, it those response times are messed up, then you already know what's up.

hardy garnet
#

Yea, I gotta contact the host tomorrow

#

bright side is that its not my fault thank god

dry yacht
hardy garnet
#

bisect on the other hand, stay away from their VPS servers holy

#

absolute doo doo

vast raven
#

Is this clone method good?

#

private static Inventory clone(Inventory inventory, String newTitle) { Inventory inv = Bukkit.createInventory(null, inventory.getSize(), newTitle); ItemStack[] is = inv.getContents(); inv.setContents(is); return inv; }

#

It doesn't seem to work, idk why even after I tried debugging

hazy parrot
#

You probably want to get content from inventory, not inv

vast raven
#

dasdasdhsuadhasdhsaiud

#

trueee

hazy parrot
#

BTW your ide should tell you that inventory is not even used

vast raven
#

Sometimes I feel stupid but after hours you don't even care on basic stuff

vast raven
hazy parrot
#

Oh I'm blind

proven monolith
tardy delta
#

?learnjava

undone axleBOT
tardy delta
#

it literally tells you

vast raven
sly acorn
#

does anyone have/know a skript or plugin that gives the player infinite blocks (if they use blocks in their inventory, it automatically goes back to 64)?

runic island
#

Is there something i can use in spigot/bukkit to get only what version the server is running? Like 1.14 or 1.15.2

remote swallow
#

there is one moment

remote swallow
#

that would return something like 1.19.1 ect

runic island
#

Because i want to use a part of the api that only works on 1.13 and i would have to code it differently on 1.14 and up

remote swallow
#

i could code a plugin with the api on 1.8 and it would still work on 1.19

runic island
#

Ah

runic island
remote swallow
#

no clue

#

the api would get better methods in newer versions

#

so its probably that

#

actually

#

its probably pdc

runic island
#

It's on how to check what gui the player is in. So if below 1.14 you should use

if (e.getClickedInventory().getTitle)
remote swallow
#

oh god no

#

check the inventory instance

naive bolt
remote swallow
#

hih

#

thats weird

#

i was having yaml problems earlier

#

and it was the exact same error

runic island
remote swallow
#

that is wrong in many ways

#

never check if its your inventory by title

naive bolt
remote swallow
#

use the inventory instance

remote swallow
naive bolt
#

mine does have some weird memory thing in

#

I didnt add it

runic island
# remote swallow use the inventory instance

Is that by creating the whole inventory in a seperate class then just calling that class when the gui command is ran and compare the inventory with the inventory in the seperate class in the listener?

remote swallow
#

if your checking for stuff on that inv in a listener just make the listener in that class

#

use di and register the listener in the constructor

runic island
remote swallow
#

?di

undone axleBOT
remote swallow
#

the simple answer is lets say you need your JavaPlugin instance for a scheduler or something you can pass that to another class

tardy delta
# naive bolt I didnt add it

you expected the path you entered in getString to contain a string but it was the path of a config section (hence MemorySection#toString being called)

naive bolt
#

hmm

remote swallow
#

okay so ive just made an entire plugin and all ive tested about it is the yaml formatting

#

and it has an inventory

#

chances are its correct

#

im saying about 20%

naive bolt
#

i don’t think i try to get a string that doesn’t exist

trim lake
#

Im trying to get ConfigurationSection and sometimes is working and sometimes I get error. Im not changing any values. Just only using code again.

Error:

remote swallow
#

?paste the config

undone axleBOT
trim lake
#

Im trying to detect, if inventory is empty or not.

#

If is not empty is should look like:

invnentory:
  1: ItemStack
remote swallow
#

whats char-id

trim lake
#

int-UUID

remote swallow
#

well whats the id in your getConfigSection

trim lake
#

im not sure what do you mean...

remote swallow
#

what is charID

trim lake
#

this is charID for ex. 0-688df4f5-1dd4-3554-bf78-7b490244c6f3:

remote swallow
#

what is the id you are wanting to get the configsection for

trim lake
#

this 0-688df4f5-1dd4-3554-bf78-7b490244c6f3 the inventory section is same for both of them

#

Im trying to detect, if it empty or not

remote swallow
#

if (getConfig().get("chars.id.inventory") == null)

trim lake
#

Im making charselect plugin. If I click in GUI on character, it should check if player has saved some inventory. If I click first time no error and it returns false in that if state. If I click second time, Im getting that error.

public static void getCharInventory(Player player, String charID) {
        if (RoleEngine.chars.getConfig().getConfigurationSection("chars." + charID + ".inventory").getKeys(false).isEmpty()){
            player.sendMessage(ChatColor.GOLD + "test");
        }
        else {
            player.sendMessage(ChatColor.AQUA + "bis not null");
        }
}```
trim lake
#

I already try that

remote swallow
#

get it as a list and check if its empty maybe

trim lake
#

there is some error with getting confSection, if I click one there is no error(executed method)

#

If I try more times Im getting error

trim lake
#

for the path chars.0-688df4f5-1dd4-3554-bf78-7b490244c6f3.inventory

terse panther
#

How can I obsfucate a plugin?

#

It's to a comission, the client ask me to do it

jagged monolith
#

There are a few free tools you can use. I can't remember off the top of my head for the best ones to use. But generally you want one that only just changes variable names etc.. nothing too extreme

jagged monolith
remote swallow
#

spectator

#

spectator has that

white dew
#

Hi guys, I'm not sure if this is an appropriate server for this, but I'm trying to create a custom resource pack for my server, to play with friends. My resource pack folder looks like this for now:

#

wait, I can't print the screen here D: my bad

jagged monolith
#

?img

undone axleBOT
remote swallow
white dew
#

Hi, I'm back

#

my resource pack folder looks like this

remote swallow
#

that looks corrrect

white dew
#

It seems to be missing the "sounds" folder

remote swallow
#

just create it

white dew
#

I will need to follow the right structure, tho, right?

remote swallow
#

correct

white dew
#

right

#

I will try to follow these information online

#

wait

#

I can just copy from my minecraft folder, can't I?

#

:o

remote swallow
white dew
#

Woah

#

thank you!

#

that was exactly what I needed

#

If I make a folder like "ambient", but not put anything in

#

It will just use the default resource pack, right?

jagged monolith
remote swallow
#

yeah that part i get i just dont know which is the LinkedHashMap that im attempting to cast

jagged monolith
#

It's the for loop in the getItemsAndCost method it doesn't like

remote swallow
#

i dont cast anything there so how is there a class cast exception

jagged monolith
#

It's refering to List<ConfigurationSection> configurationSections from what I can tell

#

Which is weird.

#

It shouldn't be giving the error

humble tulip
#

@remote swallow do yk how to setup pterodactyl?

remote swallow
#

no idea

#

alex might

remote swallow
#

because adventure/minimessage has now started crying if i have an ampersand in a string

humble tulip
#

ok i give up

#

gonna continue using screens

river oracle
#

Depends

hazy parrot
#

You can just use list collector?

#

Also there is just Arrays.toList

#

Oh it's not returning array

zealous scroll
#

can you not just pass the collection ConfigurationSection#getKeys returns into the constructor of ArrayList without creating a stream for it

remote swallow
#

its on a for loop, that runs on ConfigParser.getItem((List<ConfigurationSection>) plugin.getConfig().getList("vote-gui")))

#

so im guessing its that cast which is the issue

jagged monolith
#

Yeah it would be

remote swallow
#

but how would ```yaml
vote-gui:
- 1: *elytraitem
cost: 150

#

thats a config section list

#

@tender shard are you awake

remote swallow
# jagged monolith Yeah it would be

i just printed the config list of ```yaml
vote-gui:

  • 1: *elytraitem
    cost: 150
  • 2: *elytraitem
    cost: 900
    ``` to console and it printed [{1={Enchants={MENDING=1, DURABILITY=3}, Lore=[Lore Line 1, Lore Line 2], Name=Epic Elytra name, Material=elytra}, cost=150}, {2={Enchants={MENDING=1, DURABILITY=3}, Lore=[Lore Line 1, Lore Line 2], Name=Epic Elytra name, Material=elytra}, cost=900}], would that tell what might fix my issue?
mighty aurora
#

Is their a way to put the player in spectator mode and allow them to completely control an entity?

#

Or at least make it so that the players hitbox doesn't affect anything while they are controlling the entity?

muted thorn
#

Hi, I want to attach a player to a shield for 20 seconds using player.set Cooldown(Material.SHIELD, 400);
but this is not subject to the item ban when the player is using it now. So if a player is holding a shield and I'm giving him a shield cooldown, get that cooldown but he'll still be holding a shield.

player.setCooldown(Material.SHIELD, 20 * 20);

Do you know, how can I stop him from holding a shield?

mighty aurora
#

Packets?

muted thorn
mighty aurora
#

@muted thorn ^

muted thorn
mighty aurora
#

Hide the item?

muted thorn
#

He is holding a shield up and i want to put it down

mighty aurora
#

You could replace the item with the item thats already their

#

it should do that

opaque scarab
#

Any idea how to apply a withering effect on the client only using Packets with the mojang remmaps?

mighty aurora
#

I think he wants it to not be real wither

muted thorn
zealous scroll
opaque scarab
#

@zealous scroll I thought of that, but I was hoping for a solution that would be more optimized. Not needing to constantly cancel the damage

#

@mighty aurora @last temple Exactly. I could apply a withering effect, but I need it to be client side only. Using a resource pack, I want to hide hearts when they are using the withering texture

idle loom
#

What's a good inventory management thingy I can use for my plugin
to make guis, ykyk

idle loom
#

ok

chrome beacon
daring elm
opaque scarab
#

@idle loom I’m fairly certain ItemsAdder has a gui api, but it cost $20

#

Worth it for what it adds imo

idle loom
opaque scarab
#

@last temple In my opinion, it’s not worth it for the gui, but for it’s overall features such as a custom creature animation system, it’s worth it

#

It’s not just an api, as it was developed to be able to be used just through commands, but it has an api

daring elm
chrome beacon
#

?patience

#

;/

remote swallow
#

pinned message lol

pseudo hazel
#

how do I create a spawn egg itemstack of an entitytype?

#

spawneggmeta methods are like all deprecated

#

pls tag me in your reply 🙂

pseudo hazel
#

the image is way too small

#

so stop crossposting please

rough bear
#

sorry user I don't understand your message since I'm in the help section so if you don't give any help please with all due respect do not interfere so this mistake of mine may help someone else

pseudo hazel
#

I was saying that should not be posting your questions in two channels as thats unfair for the other people trying to get help

remote swallow
#

this is help dev, so help if your server is crashing from plugin development

#

help server is the correct category for that

rough bear
pseudo hazel
#

what?

#

relax, i just wanted to point out that you have used both channels to post your problem

rough bear
#

Please, if you will not help, I sincerely ask you not to obstruct my search for help.

pseudo hazel
#

okay sir

rough bear
#

thank you very much for understanding

#

Good evening, I need some urgent help for my server that is crashing for no apparent reason, since it does not exceed the maximum ram (8 ram) nor does it reach the maximum storage and the image that I will send is the only thing I have before what crashes my server

mighty aurora
#

Does anyone know why the item given by this command : /give @p scute{display:{Name:'[{"text":"Ability:","color":"gray","bold":true},{"text":"Iron Defense","color":"##6D91A3"}]'}} 1 doesn't trigger this if (p.getInventory().getItemInMainHand().getItemMeta().getDisplayName() == ChatColor.BOLD.GRAY + "Ability:" + MiniMessage.miniMessage().deserialize("<#6D91A3>Iron Defense"))?

chrome beacon
#

You're comparing strings with ==

#

And you're comparing a component with a legacy string text

mighty aurora
#

Legacy string text?

chrome beacon
#
  • appending the adventure component like that won't work either
pseudo hazel
#

and im pretty sure that your second string would make everything bold and gray instead of only the Ability part

#

but yeah thats handled by the component in the first string

mighty aurora
#

The deserialize part changes the color of the second part

chrome beacon
#

That won't match either way

#

The give command makes an item with a component name

#

You're trying to compare that with a string rather than the component

#

Anyways... I wouldn't detect custom items by their name

#

Attach a PDC tag instead

#

?pdc

mighty aurora
#

How would I assign a PDC tag with a command?

#

or is that not possible?

chrome beacon
#

PDC is stored in nbt

#

So you can use the give command

gleaming grove
#

Does Record takes more ram memory than variable pass or same amount?

pseudo hazel
#

not an expert but I would assume more because it also needs the info on the record itself

#

but then again if its just like C++ or C struct, then its the same

#

because it gets compiled to the same in that case im pretty sure

chrome beacon
#

It should be more since it's an object

#

But if you're trying to optimize on that level Java is the wrong programming language

#

It really doesn't matter

gleaming grove
#

even if my function has 4 parameters and is called 1-30 times per second?

chrome beacon
#

That's like nothing

pseudo hazel
#

yes even then

gleaming grove
#

just asking, ok

pseudo hazel
#

come back when you mean a million times per second xD

gleaming grove
#

ye when I get outofmemoryException I will be back XD

pseudo hazel
#

but yeah fyi like thousands of things happen every minecraft tick which is like 24x a second

chrome beacon
#

Mojang uses immutable block pos everywhere

remote swallow
#

20 ticks is 1 second

pseudo hazel
#

oh 20 mb

digital plinth
#

anyone know how i can send a sound packet to a player

#

PacketPlayOutNamedSoundEffect didnt work

chrome beacon
#

...

#

Use the API

digital plinth
#

.playsound?

chrome beacon
#

Yes

digital plinth
#

players around can hear

chrome beacon
#

No if you send it only to one player

digital plinth
#

really

chrome beacon
#

By calling it on the player object

digital plinth
#

ok imma test it out thx

#

i thought it was based on loc

errant narwhal
#

Hi i want to use nms to make pathfinder goal but i got this error can someone help

goalSelector cannot be resolved or is not a field
targetSelector cannot be resolved or is not a field
chrome beacon
#

What version?

errant narwhal
chrome beacon
#

And how are you trying to access those fields

humble tulip
#

are you using reflection?

errant narwhal
humble tulip
#

lol

chrome beacon
#

Bruh

remote swallow
#

is there any reason a config section in a config section might be null even though it exists and im printing stuff from it on another method

remote swallow
#

but there identical

chrome beacon
#

Typo could also be a problem

remote swallow
#

im even printing it before passing the section

still holly
#

Hi, Im starting to create plugins and I am having some troubles with my plugin.
I create Custom Totems using ItemStacks and I want to give potion effects when some player use the custom totem, I try a lot of ways, but nothing works.
Some One Can Help Me?

This is my actual Code:


    @EventHandler
    public void onEntityResurrect(EntityResurrectEvent e) {
        Entity entity = e.getEntity();

        World world = entity.getWorld();
        Location loc = entity.getLocation();


        if (entity instanceof Player p) {

            PlayerInventory inv = p.getInventory();
            ItemStack hand = inv.getItemInMainHand();
            ItemStack offHand = inv.getItemInOffHand();


            if (hand.getItemMeta().hasCustomModelData() && hand.getItemMeta().getCustomModelData() == 25) {


                Bukkit.broadcastMessage(Formatter.format(Formatter.getPrefix() + "&7El jugador &c&l" + p.getName() + " &7ha consumido un &3&lVex &6&lTotem &7(Causa: " + Formatter.getLastCause(p.getLastDamageCause()) + "&7) Totem Numero:&6&l " + p.getStatistic(Statistic.USE_ITEM, Material.TOTEM_OF_UNDYING)));

                Bukkit.getScheduler().runTaskLater(Utils.getPlugin(), () -> {

                    p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 20 * 10, 0));
                    p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, 20 * 15, 0));

                }, 1);
            }
        }
    }
}

sorry for the bad inglish

(When some one use the totem the server sends a message in the chat withe the name of the person that use it totem)

chrome beacon
#

And what's not working?

still holly
#

when i use the custom totem

remote swallow
#

you have the amplifier as 0

still holly
#

nothing happends

remote swallow
#

its adding an effect level 0

still holly
remote swallow
#

lol

still holly
#

but

#

the custom message in the chat is not working

chrome beacon
still holly
#

ok

#

but

#

if i put lvl 1

remote swallow
# remote swallow im even printing it before passing the section

this is the codejava public static List<ItemStack> getItems(VotingPointsSpigot plugin, List<Map<String, Object>> jnak) { List<ItemStack> items = new ArrayList<>(); for (int i = 0; i <= jnak.size(); i++) { System.out.println(jnak.size()); for (String value : plugin.getConfig().createSection("blank.path", jnak.get(i)).getKeys(true)) { System.out.println(value); } items.add(toItemStack(parseSection(plugin.getConfig().createSection("blank.path", jnak.get(i))))); } return items; } and the method that gives the npeis ```java
public static ConfigItemData parseSection(ConfigurationSection configSection) {
Material material = Material.getMaterial(configSection.getString("Material"));
String itemName = configSection.getString("Name");
List<String> lore = configSection.getStringList("Lore");
Map<Enchantment, Integer> enchantLevelMap = new HashMap<>();
for (String key : configSection.getConfigurationSection("Enchants").getKeys(false)) {
enchantLevelMap.put(Enchantment.getByName(key), configSection.getInt("Enchants." + key));
}
Integer cost = configSection.getInt("cost");
return new ConfigItemData(material, enchantLevelMap, lore, itemName, cost);
}

still holly
#

theres lvl 2 rigth?

remote swallow
#

probably

chrome beacon
still holly
#

but

#

I try with the main and off

chrome beacon
#

You're only checking main hand

remote swallow
# remote swallow this is the code```java public static List<ItemStack> getItems(VotingPointsSpigo...

this prints ```
[04:38:23 INFO]: [VotingPointsSpigot] [STDOUT] elytra
[04:38:23 INFO]: [VotingPointsSpigot] [STDOUT] elytra.Enchants
[04:38:23 INFO]: [VotingPointsSpigot] [STDOUT] elytra.Enchants.MENDING
[04:38:23 INFO]: [VotingPointsSpigot] [STDOUT] elytra.Enchants.DURABILITY
[04:38:23 INFO]: [VotingPointsSpigot] [STDOUT] elytra.Lore
[04:38:23 INFO]: [VotingPointsSpigot] [STDOUT] elytra.Name
[04:38:23 INFO]: [VotingPointsSpigot] [STDOUT] elytra.Material
[04:38:23 INFO]: [VotingPointsSpigot] [STDOUT] cost

still holly
remote swallow
#

you are only checking offhand

#

actually

#

you are checking only main hand

#

does the totem have custom model data

still holly
#

well

#

no one works

still holly
#

i try it

#

but

remote swallow
#

print it when the event runs

#

also is the event registered

still holly
#

yes

remote swallow
#

add debug statements

still holly
#

how? sry am starting with this

chrome beacon
#

Just sysout or smth

still holly
#

well, I finally make the message works, but the effects dididnt work

#

using this

if (hand.getItemMeta().hasCustomModelData() && hand.getItemMeta().getCustomModelData() == 25) {

#

but the effects dosent works

Bukkit.getScheduler().runTaskLater(Utils.getPlugin(), () -> {

                p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 20 * 10, 1));
                p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, 20 * 15, 1));

            }, 1);
remote swallow
remote swallow
#

print what the model data is

#

above that if statement

still holly
#

the totem have that cdm

#

but

remote swallow
#

print it anyway

still holly
#

know I try to detect in the second hand if (hand.getItemMeta().hasCustomModelData() && hand.getItemMeta().getCustomModelData() == 25 || offHand.getItemMeta().hasCustomModelData() && offHand.getItemMeta().getCustomModelData() == 25) {

chrome beacon
#

Get the hand from the event

#

Then check the item in that hand

remote swallow
chrome beacon
#

Add some more debug

remote swallow
#

what else could i debug

#

ive printed everything that might cause that section to be null

#

the only thing i can see causing that is some problem in bukkit

chrome beacon
#

Actually wait...

#

That config doesn't look right thinking_blob

remote swallow
#

the yaml anchors?

chrome beacon
#

Elytra can't have a value and be a section at the same time

remote swallow
#

i can get other values though

#

also that value isnt technically a value

#

putting the &elytraitem on the line lower makes it not work

chrome beacon
#

Get that fixed

#

Ah wait I didn't know yaml anchors existed

#

Ignore what I said

remote swallow
#

okay im confused

young knoll
#

On todays episode of spigot discord

remote swallow
#

i just restarted an now im getting a new error

young knoll
#

Everyone learns about yaml anchors

remote swallow
#

ah wait i know why im getting that error

#

ignore

#

im gonna say its time to ping choco

#

@worldly ingot mr choco i think bukkit has an issue with creating config sections

worldly ingot
#

I mean that error is coming straight from your class

remote swallow
#

slight problem

#

i print the config section with keys

#

and it exists

#

but bukkit says that "Enchants" is not set when it is and the values were printed before

#

@wet breach you yaml right? ive tried everything to get this to work and it just confuses me how the section is null when its had its values printed

errant narwhal
#

is it impossible to make player npc could attack Player?

chrome beacon
#

No

#

You can make it do that

errant narwhal
#

can you send a guide please

chrome beacon
#

Not with the target selctor though

errant narwhal
#

i had going everywhere in internet but no one said about that

chrome beacon
#

Why would the player be able to pathfind

#

A human is supposed to control them not the computer

#

Anyways use the Citizens plugin and their api

errant narwhal
echo basalt
#

I've been enjoying the PlayerNPC library a lot more honestly

#

client-sided npcs

#

sign me up

chrome beacon
#

Client sided npcs are kind of pointless if you then try to get them to interact with the world

#

Just more work

echo basalt
#

the lib supports a lot of stuff

#

like following other npcs and all

young knoll
#

What about attacking players

#

Or right click detection

chrome beacon
#

The Citizens API is great and many already use that plugin so no libs needed

echo basalt
young knoll
#

I…

#

Okay then

remote swallow
#

i need to complain to md

#

when will he appear in here again

#

i could just email support

echo basalt
#

decembruary 32nd

young knoll
#

I foresee you getting owned

remote swallow
#

what could md tell me to try that i havent already

white root
#

I feel really dumb, and like this should be simple, Buttt...
How do you add hover and click events to a book?
<BookMeta>.setPages() only seems to accepts strings, not text components

young knoll
#

Uhh

#

I don’t think we have api for that

magic dome
#

hello... I don't know if anyone here is very well versed on the "ChunkGenerator" mechanics and how to use them, but I was wondering what the best way would be to keep everything the same about minecraft terrain generation, just adjust the heights of the ground level of the world accordingly. For a little more context. I have an 2d array of height values and i loop through the chunk and find the value in the array using something like this. (obv things arent initialized but they are in original code)

for (int x = 0; x < 16; x++) {
  for (int z = 0; z < 16; z++) {
    int height = getBlockHeight(heights,chunkX*16+x,chunkZ*16+z,min_height,max_height);
    for (int y = 0; y < height; y++) {
      chunkData.setBlock(x, y, z, Material.STONE);
    }
  }
}
#

my problem is i want a bit more than just stone

still holly
#

I Fix my error with my totems, but now the effects when the totem is used didint works

        if (hand.equals((Items.VexTotem())) || offHand.equals((Items.VexTotem()))) {
            Bukkit.broadcastMessage(Formatter.format(Formatter.getPrefix() + "&7El jugador &c&l" + p.getName() + " &7ha consumido un &8&lTótem Oscuro &7(Causa: " + Formatter.getLastCause(p.getLastDamageCause()) + "&7)"));
            Bukkit.getScheduler().runTaskLater(Utils.getPlugin(), () -> {
                p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 20 * 10, 0));
                p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 20 * 10, 2));
                p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 20 * 5, 0));
                p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 20 * 5, 4));
            }, 20);
                }
            }

Y dont know why

magic dome
#

paste the whole method?

#

is that an event listener?

chrome beacon
#

Don't compare items like that

#

It never ends well

still holly
still holly
magic dome
#

what event are you listening to?

still holly
#

The totem use

magic dome
#

when you post code type three backticks before hand

still holly
#

RerueccionEvent

chrome beacon
undone axleBOT
mighty aurora
#

I got this error. I know that it means that I messed up in my code and defined the plugin as the wrong class but I don't remember how to fix it. Basically I defined the plugin as the class that the code is stored in rather than my main class that is the plugin. I don't remember how to pull the required piece across classes to allow the interface to properly work

magic dome
#

ok so my initial thoughts are that by the time you are checking if the item in hand is a totem the totem is already gone...

remote swallow
undone axleBOT
magic dome
#

because resurrection is most likely called after the item use

still holly
#

yes

#

that the reason the delay

magic dome
#

does your check work

mighty aurora
# remote swallow ?paste where you initialize thecommand
    public void onEnable() {
        instance = this;
        // Plugin startup logic
        this.getCommand("items").setExecutor(new CommandItem());
        getLogger().info("Plugin Enabled");
        getServer().getPluginManager().registerEvents(new darkMist(this), this);
    }```My onEnable function
magic dome
#

does the broadcast function?

still holly
#

yes

mighty aurora
#

Or do you need the item class

magic dome
still holly
#

the broadcast is good

remote swallow
#

create a constructor for CommandItem and add di to it

mighty aurora
#

This my CommandItem class... I'm pretty sure its the line that says static Plugin instance

remote swallow
#

simple answer of dont do that

#

?di

undone axleBOT
magic dome
remote swallow
#

unless theres another error thats the wrong error for plugin.yml issues

magic dome
#

you are right i didnt read the trace oops

#

epic do you know anything about chunkgenerators?

remote swallow
#

havent really had a need to touch chunk generation

young knoll
#

Oh god

#

screams

remote swallow
#

josh remember slimefun

echo basalt
#

that lovely plugin

young knoll
#

I remember worldgen in general

#

It’s painful

#

And I still haven’t fully got a grasp on noise generators

remote swallow
#

there dropping 1.14 and 1.15 support soon

#

so

#

more servers that arent using it

#

when will it end

#

when is slimefun 6

#

when is the recode

charred crown
#

can i ask some1 to make a plugin .-.

echo basalt
#

?services

undone axleBOT
charred crown
#

its nothing complicated

mighty aurora
#

Whats the best way for me to color item names?

charred crown
chrome beacon
#

Put a request on the forums and wait

#

?services

undone axleBOT
echo basalt
#

If it's that small, learn and make it yourself

charred crown
#

ok then ty

charred crown
echo basalt
#

That's where you come and ask for help

charred crown
#

i have 0 experience with coding so feel shy

echo basalt
#

We'd rather see you ask for help, than to ask us to do our job for free

chrome beacon
undone axleBOT
sonic goblet
#

Check DMs yoshi

chrome beacon
#

Components if you're on Paper

#

Regular strings with legacy colors if on Spigot

mighty aurora
#

Using §?

#

for Legacy

chrome beacon
#

Yeah or & with translate alternate color codes

young knoll
#

Omg p word

summer scroll
#

Is there in any way to detect when fish bite on the FishHook?

young knoll
#

PlayerFishEvent

#

With state BITE

summer scroll
#

Right, thank you so much

drowsy cloud
#

How to detect a interactions with chest, trapdoor or fence gate

chrome beacon
#

PlayerInteractEvent

drowsy cloud
#

Ok

twin venture
#

hi , so about perks for a pvp game [skypvp ] :
i was thinking i make only specfic perks? and that's it , users can edit the name , other stuff

#

price to buy it , lore , name , etc all is editable , but he can't make his own perks :_:

#

and iam also try to make a dataconverter from the old sql database to the new one , its changed everything is diffrent . how i can do that?

chrome beacon
#

Why do you need to do that?

tall dragon
#

im pretty sure you can just remove the advancements

#

could be wrong there

chrome beacon
#

Yeah just disable their messages or remove them completely

#

/gamerule announceAdvancements false

tall dragon
#

if it does not

#

disable them in ur spigot.yml

#

can do that like so

advancements:
  disable-saving: false
  disabled:
  - '*'
gleaming grove
#

I'seen this idea of color pallet, how it is possible to pase text to player chat input like on this video?

jagged monolith
#

Honestly, that is actually cool

gleaming grove
#

I ask about putting text to input field

#

Never seen this before

#

Unfortunately I have only this gif from some forum

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

It all works but the lore

#

Everything works perfectly

tall dragon
#

is ur path to the String list correct?

quaint mantle
#

oh ignore me I'm stupid I put wrong menu name 0_o

cobalt thorn
#

Hi, I had an idea is possible to make the world appear totally blank and then make it appear, a solution is creating another world blank, but I don't want to occupy memory only for a test, there's another method I can use?

acoustic widget
#

Hello, is org.bukkit.World is an implementation of org.bukkit.craftBukkit.CraftWorld ? I think yes but why I can't see this implementation in World class ?

tall dragon
#

no its the other way arround

#

CraftWorld is an implementation of World

acoustic widget
#

oh ok, when I do like location.getWorld, it returns bukkit.world right ? not craftworld ? How an implementation can be instancied and returned ?

tall dragon
#

u want an instance of CraftWorld im guessing?

acoustic widget
#

yes I know how to have it by forcing the type of (CraftWorld) bukkit.world

#

But i'm trying to understand

tall dragon
#

if thats the case u can just cast a World to CraftWorld

#

getWorld indeed returns a World. but thats also a CraftWorld

acoustic widget
#

Ok, I see, but How can I know that ? Because in my IDE if I use CTRL + LEFT LICK it's only shown that

#

I'm new on java, so i'm trying to understand how can I have this info

#

whitout asking or searching

tall dragon
#

i mean i guess u just know

#

if u have a bukkit interface. usually the implementation is "Craft<Interface>"

tall dragon
#

the arrow i mean *

tardy delta
#

why do you need an impl?

tall dragon
#

@acoustic widget

tardy delta
#

?stash

undone axleBOT
acoustic widget
#

oh yeah i see

acoustic widget
tall dragon
terse ore
#

How did you register an event?

terse ore
#
Bukkit.getServer().getPluginManager().registerEvents(new OnRightClick(), this);```
tall dragon
#

yea thats correct

terse ore
#

'registerEvents(org.bukkit.event.Listener, org.bukkit.plugin.Plugin)' in 'org.bukkit.plugin.PluginManager' cannot be applied to '(dev.akex.villagerinvview.listeners.OnRightClick, dev.akex.villagerinvview.VillagerInvView)'

#

why it cannot be applied

undone axleBOT
terse ore
#

I am in the main file

tall dragon
#

Does inRightClick even implement Listener

#

ur listener has to implement Listener

terse ore
#
public class OnRightClick implements EventListener {
    @EventHandler
    public static void onRightClick(PlayerInteractEntityEvent event) {
        Player player = event.getPlayer();
        if (player.isSneaking()) {
            Villager villager = (Villager) event.getRightClicked();
            player.sendMessage(String.valueOf(villager.getInventory().getSize()));
        }
    }
}```
#

that's the event

#

oh

#

is it just Listener

tall dragon
#

yea

terse ore
#

too much time since I last coded in Java, ty guys

#

oki

tall dragon
#

i mean there are good uses for static too

terse ore
#

one last question