#development

1 messages · Page 21 of 1

lyric gyro
#

yeah well

merry knoll
#

just checked the repo

lyric gyro
#

that's the significance of major versions

merry knoll
#

ah its the formatting

#

ye mb

lyric gyro
#

i mean tbf this is a rule of thumb in general for all kind of development (especially cuz "public" stuff can change between individual snapshots)

#

but bukkit did ya bad

merry knoll
#

what are you using for dependency handling?

#

maven? gradle?

sonic quartz
#

maven

merry knoll
#

then put it there

#

<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.9</version>
<scope>provided</scope>
</dependency>

sonic quartz
#

<dependency>
<groupId>com.sk89q.worldedit:worldedit-bukkit</groupId>
<artifactId>worldedit-core</artifactId>
<version>7.2.9-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

merry knoll
#

you gotta add repo too obv

merry knoll
#

if you want core then you need to do

<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
<version>7.2.12</version>
<scope>provided</scope>
</dependency>

#

you can explore the repo yourself

#

here exactly

#

but if you are developing for bukkit

#

then use the bukkit implementation, not core

sonic quartz
#

It works now, thanks

sonic quartz
sonic quartz
#

I should've used getShapshotInventory

dusky harness
proud pebble
sonic quartz
#

Anyway I changed getInventory to getSnapshotInventory in the code and it worked

proud pebble
#

fair

queen plank
#

I have a class with the generic <T extends Number> and want to test a predicate Predicate<T> with the absolute of T val. How do I do this the best way? Is it even possible or do I have to change Predicate<T> to Predicate<Double> or something?

lyric gyro
#

huh

#
class Foo<T extends Number> {
  T number;
  Predicate<T> pred;
}
merry knoll
#

i am not sure if abs works with Number

queen plank
queen plank
#

Guess I'll have to do my own wrapper or smth then

merry knoll
#

then you need your own method for taking abs of number

#

with all the subclasses

#

so.. int double float etc

queen plank
#

Ik :V

#

Thx tho

#

:>

lyric gyro
#

I mean given that Number is a freely extendible abstract class, you can't possibly consider all implementations

merry knoll
#

in his implementation, he probably can though

lyric gyro
#

how come?

merry knoll
#

as in, unless the method is open he knows what types are going in there

lyric gyro
#

I suppose, though a "proper" solution would be to do the abs inside the pred itself given that it is type aware

merry knoll
#

kinda the same issue though i feel like

lyric gyro
#

how come?

merry knoll
#

its type aware but its still freely extendable

#

guess you could just throw an exception

lyric gyro
#

not sure what you mean

#

new Foo(BigDecimal.TEN, bd -> bd.abs().compareTo(BD.ZERO) > 0)
new Foo(-7L, l -> Math.abs(l) > 100L)
etc

merry knoll
#

ah, thats what you meant

#

yeah thats cleaner

#

actually might yoink for my vector classes eyes_zoom

lyric gyro
#

lmao

merry knoll
#

for block vectors

#

i normally just extend this to make a separate block vector

lyric gyro
#

could also take a UnaryOperator<T> abs so new Foo(num, Math::abs/BigDecimal::abs/etc, predicate)

#

that's probably the best approach

icy shadow
#

yeah

merry knoll
#

👀

#

im guessing its similar to C++ one?

#

okay, apparently its quite different just a shorthand for lambda one liners?

icy shadow
#

it's a method reference yeah

merry knoll
#

hm, kinda useful i guess

#

a bit more concise than going{ x.foo(bar) }

lyric gyro
#

point-free code 😌

icy shadow
#

relieved

#

now give us composition as an operator

lyric gyro
#

. pleasing face

icy shadow
#

or at least a::b.then(c::d)

lyric gyro
#

pleasing

icy shadow
#

pleasing

lyric gyro
#

pleasing

#

pleading

#

aaaaaaaa

lyric gyro
#

((Function<I, O>) a::b).andThen(c::d) nerd

icy shadow
#

fuck that

#

i hate casting i hate casting

lyric gyro
#

pensive

merry knoll
#

nokotlin has it too nice

icy shadow
#

looks shit

merry knoll
#

actually allows me to lift the {} out of the method

#

way better than this

lyric gyro
charred ravine
#

how can i replace a specific word or line in a lore? i've tried iteratiing through it but to no avail

dense drift
#

Get the lore, put it in a variable, replace the string, set the lore and meta back to the item

sonic quartz
#

If I use getPlayer with UUID parameter, will it get me the player if he's offline?

broken elbow
#

if you use getOfflinePlayer then yes.

dense drift
#

Yeah

proud pebble
#

the docs do say that if the player is offlune then getPlayer returns null

floral beacon
#

Hello
for PlayerInteractEntityEvent bukkit/spigot event, how can i detect if player's hand is empty / no items in his hand?
i know how to check if he is holding with hand he's interacting with a specific item, but not no item

 if (player.getInventory().getItemInMainHand().equals(Material.DIAMOND_SWORD))
#

so how to check if his hand is empty

stuck hearth
#

d; spigot Player#getInventory

uneven lanternBOT
#
@NotNull
PlayerInventory getInventory()```
Description:

Get the player's inventory.

Returns:

The inventory of the player, this also contains the armor slots.

stuck hearth
#

Alternatively, just log what the empty item is

floral beacon
#

ok i logged as

Bukkit.getConsoleSender().sendMessage(" " + player.getInventory().getItemInMainHand())

it outputs (when i interact with hand)
ItemStack{AIR x 0}

proud pebble
#

so try player.getInventory().getItemInMainHand().getType().equals(Material.AIR)

#

getType() returns the material that the itemstack is.

#

if its air, then its empty

floral beacon
#

thank you very much

proud pebble
# floral beacon this worked

when comparing something in the future, make sure that the 2 things you are comparing are of the same type otherwise it will always return false.

#

i bet someone will now tell me thats not always the case for whatever reason and ill become the stupid one lol

lyric gyro
#

well

#

it isn't strictly true

#

but it's "true enough"

proud pebble
#

i bloody knew it

high sigil
#
    @Override
    public String onRequest(Player player, String params) {
        if(params.equalsIgnoreCase("towny_kasaba")){
            if(PlaceholderAPI.setPlaceholders(player, "%advancement_has_town%")) == "true") {
                return "sa";
            }
        }
#

how i can do this?

proud pebble
high sigil
#

but idk how can i get it

merry knoll
#

you cant compare strings directly

#

like that

high sigil
#

how i can do that?

#

theres a example or

merry knoll
#

.equals kullan onun yerine

high sigil
proud pebble
merry knoll
#

dm for turkish lets not spam here with another language

worn jasper
#

any ideas if it's still possible to send a message above the actionbar?

#

Aka you have the actionbar, then that message and only then title and subtitle.

#

I think it's where item names are displayed.

dense drift
#

no

worn jasper
#

Oh okay, I can't remember when that was possible, think 1.8

#

thanks anyways

dense drift
#

I dont think it was ever possible?

worn jasper
#

it was.

hoary scarab
#

You can probs send a switch item packet.

worn jasper
#

let me see if I can get a screenshot

dense drift
#

it was probably done by replacing the item in hand for a tick

worn jasper
worn jasper
dense drift
worn jasper
#

aka it would also only display the name for only a tick

hoary scarab
#

Maybe you can find the held item packet and set the name If the switch item packet isn't what you're looking for.

worn jasper
#

thanks

hoary scarab
#

Yeah with the spigot api it's missing things like that and then they complain when you don't use the api lol

sonic quartz
#

how can I destroy pasted scheme with worldedit? I want to remove all the pasted blocks but leave other blocks within scheme area which were placed manually. It's like pasting a scheme without replacing existing blocks with air, but replacing blocks that belong to the scheme with air

proud pebble
slim estuary
dense drift
#

there's also SlotType#RESULT

#

d;inventorytype$slottype%result

uneven lanternBOT
slim estuary
#

Thanks

trail burrow
#

been looking for a place to read up on how to upgrade my plugin to minimessage, anyone know of such a doc?

merry knoll
#

minimessage docs

trail burrow
#

thanks

merry knoll
#

is the player location in playerRespawnEvent

#

the death location?

proud pebble
merry knoll
#

there is a seperate spawnlocation defined

#

so i am not sure honestly

proud pebble
#

hmm

#

id say try it and find out

merry knoll
#

lemme be lazy sleepybro

trail burrow
#

after adding these lines I get an error``` private BukkitAudiences adventure;

public @NonNull BukkitAudiences adventure() {
    if(this.adventure == null) {
        throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!");
    }
    return this.adventure;
}


public void onEnable() {
    this.adventure = BukkitAudiences.create(this);``` https://paste.helpch.at/uxeqovobek.css
winged pebble
#

What error

trail burrow
#

did you look at the link?

winged pebble
#

ngl, assumed it was the code in pastebin form

trail burrow
#

I will label next time to be less confusing

winged pebble
#

How are you providing Adventure at runtime?

trail burrow
#

? I don't always understand the language, the above code is in my main class

winged pebble
#

The issue you're having is that the code doesn't know how to find adventure at runtime

trail burrow
#

I thought I followed the video's instructions

winged pebble
#

It seems like you've shown the IDE how to see what library you are using, but the library isn't available at runtime

#

Which video?

trail burrow
winged pebble
#

Are you using maven?

#

Also, are you using spigot or paper?

#

I'm going to assume you're just using spigot

trail burrow
#

server is paper, or did you mean in code

winged pebble
#

the server

trail burrow
#

paper-1.19.2-142

winged pebble
#

let me see your pom.xml

trail burrow
dense drift
#

You dont need buķkit platform if you will always use paper

#

Paper has native support for adventure, e.g. you can just do Player#sendMessage(Component)

trail burrow
#

OK, what if the plugin is run on Spigot servers?

icy shadow
#

then it wont work

#

without shading

#

and the bukkit platform

trail burrow
#

if I make it work on Spigot then it will work on Paper also?

icy shadow
#

yes

dense drift
#
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>adventure-platform-bukkit</artifactId>
            <version>4.1.2</version>
        </dependency>```
make this `compile` and shaded it to a package
#

and you also need adventure-api I think

lyric gyro
#

it's transitive

dense drift
#

great

worn jasper
#

if I use #sendRichMessage() I don't need to deserialize it anymore right?

dense drift
worn jasper
#

ok so yes, thx

shell moon
#

If a player with a custom health amount (using setMaxHealth or modifying attribute) dies

#

it resets back to normal? (after death)

dense drift
#

No

#

I believe it will start from 20hp (or max if it is lower than 20) though

shell moon
#

ahhh so to remove custom health i need to set max to 20 then

sonic quartz
sterile hinge
#

Don’t do all that Bukkit.getWorld stuff all the time

proud pebble
#

bukkit setblock should beable to do like 60k blocks a second and that doesnt look like more but tbh it depends how often the blocks are changed

#

nms is definitly the way to go if your gunna be doing somelike like prison mines for example

merry knoll
#

tbf i didnt check the code posted, on phone atm

#

isnt there a normal bukkit method to setting blocks without light updates?

merry knoll
#

or physics

sonic quartz
#

what is nms?

merry knoll
#

then defo dont do it through nms

#

you access internal mc server

#

and set block directly

#

instead of doing through the api

proud pebble
#

depending on the method it can update up to like 14million blocks a second

merry knoll
#

it avoids all light - physics updates

#

but you need to care to not set blocks on unloaded chunks etc

#

so not for the inexperienced

proud pebble
#

i always got stuck cus of the 2048 long bitsets

#

i just gave it null

merry knoll
sonic quartz
#

after my question I thought that maybe I can just send a few commands from WorldEdit in the console for each type of block like set 2 edges of the area and then /replace

merry knoll
#

then use world edit api

#

why are you using commands

sterile hinge
merry knoll
#

yeah, i am just asking if they are hashed

sterile hinge
#

I think so

merry knoll
#

my guess would be that its hashed against world uuid

lyric gyro
#

it's funny because world uuid is just a bukkit construct, not a vanilla thing

sonic quartz
merry knoll
merry knoll
#

uuid use case is quite rare i feel like

#

and its hashed against the name

#

apparently

lyric gyro
#

but like there is no world uuid in vanilla, idk why it's a thing in bukkit

hoary scarab
#

Well you can't have 2 worlds with the same name. (Pretty sure) so there is no point in a uuid

merry knoll
#

uuid in general is a bit better imho as an actual id

#

size is known etc

#

but on use cases, where user needs to put something in as name it becomes kinda impractical

#

at least they are still hashing against the name

lyric gyro
#

it's just a dumb introduction

dense drift
#

Bukkit moment

queen plank
#

How does this make any sense? I get Type mismatch: cannot convert from element type Object to Player from the method. The class Driver has the generic <E extends Event>. I've suppressed the rawtypes warning on Driver d

stuck hearth
#

Smells like Type Erasure, but more importantly you probably shouldn't suppress errors if they're fixable, which I imagine in your situation is very doable.

queen plank
#

I can´t set d to the type Driver<?> as then I can't call getUsers(<E extends Event>) at all. I don't know what type/class the event is.

#

So idk how to fix it other than not using generics for d

stuck hearth
#

Why doesn't getUsers just take an Event as a parameter?

queen plank
#

Cuz depending on the event I want to use PlayerEvent#getPlayer (or other event-specific methods) and didn't want to cast in the classes where I know the event type. Ig I can change E to Event for that method though

#

My big fat brain just remembered I can just cast the Set lol (Set<Player>) d.getUsers(event)

#

Thx any ways :>

sterile hinge
#

that looks really really bad

queen plank
#

Ik :V

#

But I want to avoid using Event as a parameter as then I'll have to cast the event a billion times in subclasses...

sterile hinge
#

the issue basically is the getKey call, whatever that is doing

queen plank
#

It's way too much for me to explain, but essentially I have a Map<Driver<?>, "CustomDataClass"> which I iterate over using Map#entySet

sterile hinge
#

build a proper heterogeneous container and you're fine

queen plank
#

Ig

queen plank
#

I guess this is an eclipse bug? The top one works, the bottom one does not lol```java
Set<Player> users = l.getUsers(event);
for (Player p : users)

for (Player p : l.getUsers(event))

lyric gyro
#

depends

#

a) does it compile? b) what does it say?

#

if getUsers is generic on T and returns Set<T> then it is not a bug

sterile hinge
#

yeah there are rules about when inferences behaves how

queen plank
sonic quartz
#

Why when I put a block in a hashmap and later get this block and modify it, it doesn't get modified?

#

How can I modify it properly?

merry knoll
#

block returns clone

#

store location reference

sonic quartz
#

I've tried hashmap.get(..).getLocation and it didn't work

queen plank
#

Inner i gives me the warning Outer.Inner is a raw type. References to generic type Outer<T>.Inner should be parameterized. How do I get rid of it?

public final class Outer<T> {
  class Inner {
  }
}

public class Foo {
  static Outer<String> o = new Outer<>();

  public static void bar() {
    Inner i = o.new Inner();
  }
}

Generics are difficult :<

icy shadow
#

possibly Outer<String>.Inner

#

idk i dont think ive used inner classes ever

queen plank
#

Yup, that seemed to fix it. Ig I'll go for that one

#

Tnx :>

dark garnet
open citrus
#

Hey guys I need help with my discord account I can’t login because I lost my 2fa codes and I have lost my backup code

bright pier
open citrus
#

I have and it sent me this discord invite

bright pier
#

We can't help you get your discord account back. Your account - Your Responsibility - Take it up with discord.

jade wave
#

?not-discord

neat pierBOT
#
FAQ Answer:

Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.

jade wave
#

@open citrus

stuck canopy
bright pier
#

^ That would be the more recommended way of doing it

queen plank
#

Is there a way to do something like this? Where you create an interface with more than one method in a constructor?

class Foo {
  Foo f = new Foo(
    class X implements Bar {
      void a() { /*Whatever*/ }
      void b() { /*Whatever*/ }
    });

  Foo(Bar b) {}
}

interface Bar {
  void a();
  void b();
}
#

Or is it just easier to create two SAM interfaces?

merry knoll
queen plank
#

Because I don't know how to create a double method interface in a constructor. Or what do you mean?

#

I could make a bunch of inner classes for Foo that implements Bar but I have a lot of Foo constants so I'd rather not

merry knoll
#

you can just pass this into its constructor:

new Bar() {
  a() {}
  b() {}
}
#

sorry for shit format, typin from phone

#

just make an anonymous class implementing your interface

#

and pass it to constructor

queen plank
merry knoll
#

here take a look here, they are quite useful

queen plank
#

I will, thanks :>

lyric gyro
#

well it's not specific to a constructor but yeah

queen plank
#

Ik, but that was the case here so :>

stuck canopy
#

why is getClickedInventory() method in InventoryClickEvent not working for me

#

It was working before

lyric gyro
#

what api version do you have in your pom/build.gradle

stuck canopy
#

1.19.2-R0.1-SNAPSHOT

lyric gyro
#

share your pom/gradle file please

#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

stuck canopy
lyric gyro
#

Ah, Vault brings in an old version of Bukkit, add this to the Vault dependency

<exclusions>
    <exclusion>
        <groupId>org.bukkit</groupId>
        <artifactId>bukkit</artifactId>
    </exclusion>
</exclusions>
stuck canopy
#

oh

stuck canopy
#

It worked, Thanks for the info

winter nimbus
#

Anyone know how to bypass, change this?

proud pebble
#

or you can send the message as a server message instead of a player message

dusky harness
#

or disable chat reporting

#

in server.properties

winter nimbus
#

Which setting may that be?

lyric gyro
#

Setting enforce-secure-profile to false will disable chat reporting feature and the client will show a warning on joining the server

#

It's so painful i have to learn blockchain technologies just to send messages using packets... absurd chat reporting feature

proud pebble
#

it doesnt disable it what so ever

proud pebble
dark garnet
stuck hearth
#

No idea what sound, but a bird would probably sound better

dusky harness
#

like .2 seconds or smth

#

like a pew pew sound

#

yk

stuck hearth
#

I Kinda like Silverfish hurt, but it's still not quite right

#

Parrot hurt feels pretty close

dusky harness
#

why you targeting all the hurt sounds 😭

#

this is a sign

dark garnet
dusky harness
#

oh my that would be epic

dark garnet
dusky harness
#

yes

#

i remember i came back to that after like 2 years

dark garnet
dusky harness
#

nope

#

I haven't played it in so long

#

🥴

dark garnet
dusky harness
#

💀

#

self recorded?

dark garnet
#

i assume

#

but its modified im pretty sure (so that it sounds good)

#

i should just go on cameo and pay a celebrity to say "pew" for me and no one would ever know

dusky harness
#

👀

dark garnet
dark garnet
dusky harness
#

hearing a parrot get hurt every time you shoot 😭

dark garnet
dusky harness
#

lol

dusky harness
#

wb a higher pitch

dark garnet
#

cant :(

dusky harness
#

or is 2 max

#

oh

dark garnet
dusky harness
#

hmm

lyric gyro
#

Pls help. I have a config that contains a world.getName() value (a String) that a plugin needs to read and add that world to a Location variable

#

But a Location can only contain World and not a world.getName()

#

Do I have to loop through every world on the server and check if the getName() is equals to the one in the config? Or is there a better solution?

dense drift
#

d;Bukkit#getWorld

uneven lanternBOT
#
@Nullable
public static World getWorld(@NotNull String name)```
Description:

Gets the world with the given name.

Returns:

a world with the given name, or null if none exists

Parameters:

name - the name of the world to retrieve

lyric gyro
#

Thanks!

#

Ok why is it complaining about this?

dense drift
#

Location location = null;

#

Just use the constructor

#

d;Location#Location

uneven lanternBOT
#
public  Location(@Nullable World world, double x, double y, double z)```
Description:

Constructs a new Location with the given coordinates

Parameters:

world - The world in which this location resides
x - The x-coordinate of this new location
y - The y-coordinate of this new location
z - The z-coordinate of this new location

lyric gyro
#

Oh yeah you can do that lool sorry it's been a while, thanks again

tough nacelle
#

Yeah, a lot of people write down the whole everything, pitch, yaw, xyz world etc.. in the newer versions they did this so its saves everything in the correct way and if u do it with this method then there will be no errors at all

sterile hinge
# uneven lantern

Oh god I just saw there are two spaces between public and Location

tough nacelle
#

xd

stuck canopy
#

how can I make my plugin work for every minecraft version?

dense drift
#

oh no, two spaces

sterile hinge
worn jasper
#

any ideas on what could be causing this? (not my server)

#

I assume it's related to getting an item but couldn't get much more from it

#

besides it's also related to a player

#

for reference, this was that player's inventory

high edge
#

Odd

worn jasper
#

indeed very odd

#

trying to find an explanation lol

high edge
#

What's the nugget item

worn jasper
#

so I think I might know the issue

#

aka the issue is excellentcrates

#

my client has an "afk region" which gives an excellentcrates key every x minutes

#

I assume the issue is with excellentcrates in this case then?

#

(cause the location where the player was, was inside the afk region)

high edge
#

Possibly

worn jasper
#

have an idea on a way to test if it's rlly it, thanks for the help either way, will update ya afterwards if ya want

high edge
#

Go to the location he was, and stay there for a bit, if you can turn on debug for the crates if it has any

worn jasper
#

Uhm would a method checking if a player has a permission or is console be able to be static without issues?

lyric gyro
#

yeah

queen plank
#

I have a class roughly like this. What is the best way to avoid the massive else if chunk?

public class Foo<T> {
  public static final Foo<Boolean> BOOLEAN = new Foo<>();
  public static final Foo<Integer> INTEGER = new Foo<>();
  public static final Foo<Double> DOUBLE = new Foo<>();
  /* etc.. */

  public void something(T t) {}

  public static void whatever(Object o) {
    if (o instanceof Boolean)
      BOOLEAN.something((Boolean) o);
    else if (o instanceof Integer)
      INTEGER.something((Integer) o);
    else if (o instanceof Double)
      DOUBLE.something((Double) o);
  }
}
dusky harness
#

unless you have like 20 of those that's the best way I can think of

queen plank
#

I do lol

#

~15

#

Guess I’ll do that, will look great

dusky harness
#

what

queen plank
#

Hmm?

lyric gyro
#

Map<Class<?>, Foo<Object>> map

map.get(o.getClass()).something(o)

dusky harness
#

ye that was what i was thinking at first

#

but

#

you could do something else that doesn't have the unchecked cast warning

queen plank
#

Yeah

dusky harness
#

wait idk if you can actually

queen plank
#

😦

pine flax
#

Pattern switch?

queen plank
#

Ig, but isn’t that pretty much the same?

pine flax
#

Looks nicer imo

queen plank
#

Ig

dusky harness
#

oh if java has it then use it 👍

queen plank
#

I have a ’type’ string linked to the Object so I could switch that otherwise

stuck hearth
warm steppe
#

Asked

stuck hearth
#

Your website looks a little broke

agile urchin
warm steppe
#

Really?

#

Like i didnt know that

stuck hearth
#

Personally I don't advertise broken websites, I guess I just assumed you wouldn't either

coarse gulch
#

Hello guys
How can i make a item glowing?
without adding enchantments

dense galleon
#
                    Location loc = new Location(world, clickLoc.getX() + x, clickLoc.getY() + y, clickLoc.getZ() + z);
                    Block block = world.getBlockAt(loc);
                    world.spawnFallingBlock(loc, block.getBlockData());
                    block.setType(Material.AIR);```

Trying to make any block I click on be affected by gravity, though I notice that the fallen block entity that spawns spawns in a slightly wrong location
#

I'll show you a short video in a sec

#

The block seems to spawn with an offset, causing it to not place properly when hitting the ground

modern warren
#

Offset is consistant so you could probably just add x and y to the location so its correct again

dense galleon
#

It works when clicking

#

Now the issue is that I want that to happen when a player moves

#

That's the code I have, in a PlayerMoveEvent

#

I'm just doing this to test falling blocks, i know it's very slow on the server

proud pebble
#

i pwrsonally give an item protection 0, dows the same job and doesnt boost an item.

#

tho can cause a fewissues potentially

stuck hearth
#

Custom enchant moment

dense drift
#

Fr

#

Good thing about custom enchantments is that they dont even show in lore kekW

hoary scarab
#

Or just add the hide enchantments flag.

coarse gulch
#

Yo guys, any way to edit how enchants look in tools & stuff?

#

Something like this

worn jasper
#

you hide the enchants and display them in the lore with your formatting

coarse gulch
worn jasper
#

or whatever ya want

coarse gulch
#

It would become to much complicate

worn jasper
#

?

#

what's complicated about that?

coarse gulch
#

handle everything regarding enchatments & stuff

#

you would need to pay attention the the grindstone too

worn jasper
#

not complicated lol

coarse gulch
#

iirc there's no event for the grindstone

#

i mean

#

isn't there a easier way with a resource pack?

dusky harness
worn jasper
#

that seems harder than without resource pack lmao

worn jasper
#

but yes

dusky harness
#

it should all be "cached" although idk what would happen if you had like 200 players

coarse gulch
#

yeah we'll probably have around 150 players online

dusky harness
tired olive
dense drift
coarse gulch
dense drift
#

you just have to add the symbol before enchantment name

coarse gulch
coarse gulch
dense drift
#

idk if it supports colors, but worth a try

coarse gulch
#

love you mate

dusky harness
dense drift
#

you only need to override the enchantment keys @coarse gulch, the pmc link is a texture that does the same thing, you can follow that

coarse gulch
#

yeah i figured it out

#

thanks!

dense drift
#

np

coarse gulch
#

yessir

#

thanks

dense drift
#

nice

coarse gulch
#

What about color?

#

Do you think it's possible to use colors?

dense drift
#

\u00a7 and then the code (a-f 0-9) - \u00a78<star> \u00a77Efficienza

coarse gulch
#

yeah that's perfect

#

does R works as in minecraft

#

so it reset the color?

#

i mean, can i do something like \u00a7r

worn jasper
#

confused is this texture pack or not?

dense drift
#

that is minecraft's coloring system, so yes, it does

coarse gulch
coarse gulch
#

Love ya, thanks again

#

for real

#

Is it normal that opening it back from the pack it just fucked up all the lines?

#

o.o

dense drift
#

uh not really

#

but don't keep all keys

#

override only the enchantment names, anything else will have the default value

coarse gulch
#

Like this?

dense drift
#

yes

coarse gulch
#

let's see if it breaks again

worn jasper
coarse gulch
#

client files

#

both

#

you can do it both way

dense drift
#

yo wtf is swift sneak

coarse gulch
#

?

#

tffffff

#

that's probably something they wanted to add and the thrown in the bin

#

no

#

wait

#

that's a thing

dense drift
#

what is a thing?

coarse gulch
#

like

#

it does exist

dense drift
#

yes, it was added in 1.19

coarse gulch
#

i didn't know it existed

dense drift
#

Added Swift Sneak. It is currently applied to boots, and is not compatible with Frost Walker, Depth Strider, or Soul Speed.
F

#

ah nvm, it was later moved to leggings

coarse gulch
#

are you supposed to go faster when sneaking with it?

dense drift
#

yea

coarse gulch
#

i have it at level 3 and i'm moving at the same speed

stuck hearth
#

Skill issue

sonic wedge
trail burrow
#

can someone help with maven shading

dense drift
#

wrong channel, dont you think @sonic wedge

#

what do you need help with @trail burrow

trail burrow
#

trying to shade kyiro adventure-platform-bukkit

dense drift
#

and make sure you build the project using package

trail burrow
#

I have that in my pom, build using package?

dense drift
#

yeah, use the package task, not build

#

if you use intellij, from the maven tab, go to lifecycle and select package

dusky harness
#

I haven't looked line by line to see if there's some small mistake or typo but in general their pom looked fine

#

@trail burrow just to make sure - does the jar have the dependencies in the jar? And make sure you're using the shaded jar, not the normal one

trail burrow
#

it only creates one jar, Not sure where lifecycle is

dense drift
dusky harness
dusky harness
#

so that someone here can look through it

#

someone who uses maven instead of me just scanning through it

dense drift
dusky harness
trail burrow
dense drift
#

<pattern>net.kyiro</pattern> this should be net.kyori

dusky harness
#

💀

#

I'd recommend just opening up the jar and relocating everything you see

#

that's what i do

dense drift
#

and don't relocated to shaded.net.kyori, that will cause problems if you/someone else use the same package in other plugins

trail burrow
#

I hate typos

dense drift
#

use something like <group>.<project name>.libs.kyori

dusky harness
#

@trail burrow pinging since you haven't responded with any other details and it's been a while
Can you upload the project, or a separate project meant to just reproduce this issue to github?

trail burrow
#

somehow I broke my project and trying to fix it

dusky harness
#

💀 i guess show the bug or when you get it back to the "original" state try uploading a test project for us to reproduce

#

also seems like mbaxter in kyori discord is also willing to help - so if they do end up getting the solution plz update here too (so that people don't waste their time looking into an already-solved issue)

trail burrow
#

it will not build correctly, jar is 1/3 the size now

dusky harness
trail burrow
#

maybe but the code for minimessages is all gone

trail burrow
#

not sure how world got added to the end on my project name

dark garnet
#

how do i make mobs hostile at each other (ex: skeletons)? but only if the other mob tests positive for a predicate
i have 2 skeletons, one is on blue team, one is on red. there's also 2 players, one on blue, one on red. currently, the blue skeletons will only shoot red players, and vise-versa (so the skeletons r friendly to their "teammates"). however, i want the skeletons to be able to shoot each other so that they are besties: https://media.srnyx.xyz/java_6wMSp6dvzX.png

#

also, while writing this, i noticed some of the skeletons despawned, even though they were in my render distance (not in view tho, i just saw their glow) and set to persistent

leaden sinew
#

D;spigot LivingEntity#setTarget

uneven lanternBOT
#
void setGravity(boolean gravity)```
Description:

Sets whether gravity applies to this entity.

Parameters:

gravity - whether gravity should apply

leaden sinew
#

D;spigot Creature#setTarget

uneven lanternBOT
#
void setTarget(@Nullable LivingEntity target)```
Description:

Instructs this Mob to set the specified LivingEntity as its target.

Hostile creatures may attack their target, and friendly creatures may follow their target.

Parameters:

target - New LivingEntity to target, or null to clear the target

sudden pendant
#

PlayerMoveEvent.getFrom() returns a Location without pitch and yaw any idea why?

high edge
#

cause it's not relevant information?

sudden pendant
#

it is

high edge
#

For that event it's not really

sudden pendant
#

oh so how would i get it then?

#

its for a back command i need to set the prev location with pitch and yaw

dense drift
#

what has player move event to do with a back command?

sudden pendant
#

i use getFrom method for getting last position

high edge
#

That's probably not what you should be using

sudden pendant
#

i saw this being used on advanced tp thats why im using it

warm steppe
high edge
#

You don't cursed_fingerguns

leaden sinew
dark garnet
leaden sinew
dark garnet
#

cause i want them to shoot at each other even when there arent any players around

dark garnet
leaden sinew
dark garnet
#

the player could be invisible tho

#

or move out of the way before the skeletons target them

leaden sinew
#

You said they’re targeting skeletons though

leaden sinew
dark garnet
#

what would i set it target to tho? would i have to calculate the closeset enemy that's in range and in view?

leaden sinew
#

Yes

#

You should store them in a collection

#

Then loop over those

dark garnet
queen plank
#

How tf does this "Diamond Pickaxe".replaceAll("^[\\w]", "") return iamondPickaxe?

#

and "Diamond Pickaxe".replaceAll("[\\W]", "") return DiamondPickaxe

#

Isn't D a part of \\w or wat

dark garnet
#

and there arent any other target in-range until an enemy skeleton walks in front of them

dusky harness
#

D is a "word" and is not a "word"

#

so the first one removes the D, and the second one removes the non-word

dark garnet
#

LivingEntity#hasLineOfSight(Entity) says

This uses the same algorithm that hostile mobs use to find the closest player.
does that mean it also takes into account invisibility, gamemode, etc...?

dark garnet
#

ok i fixed everything by just using a bukkitrunnable to check the target every second for all the spawned mobs (which i hate)

leaden sinew
#

@dark garnet
Could you explain everything you are trying to do?
It might help me understand how to help more

dark garnet
#

there we go

#

that last blue almost clutched

jade wave
#

Noiceee

dark garnet
#

how do i override a minecraft command? specifically when registering my own command

#

cause when i use Bukkit.getPluginCommand("enchant"), it returns null

dark garnet
dense drift
#

try to unregister the command by deleting it from the command map

dark garnet
dense drift
#

Yeah it is a class and has a Map<String, Command> field named knownCommands iirc

queen plank
#

Shouldn't that remove all letters in the first one?

#

Why only the D

dusky harness
#

so it sees one D (as specified in the regex), and since it can only start at the beginning, it stops

#

if you remove the ^ (which means to start at the beginning), it works how you want it to

#

and the same goes for your second regex

queen plank
#

I placed the ^ before the [ by mistake...

#

Bruh

dusky harness
#

the [] isn't needed either

queen plank
#

Oh

dusky harness
#

that's for like [abcdefg] so that you don't have to put it in a group like (a|b|c|d|e|f|g)

queen plank
#

Ahh

#

I see

#

I understood it as all "collections" (like \w) has to be in []

dusky harness
#

oh

#

yeah I think it's basically (?:a|b|c|d|e) but shorter and easier (into [abde])

#

OH and it has ^

#

so all characters besides abcde

#

I forgot about that

#

so like [^abc] will match every letter except for a, b, and c

#

regex can be pretty fun 😌

queen plank
#

Very...

dusky harness
#

there should be like a website for regex puzzles

#

lol

queen plank
#

Yeah lol

dark garnet
dark garnet
#

it could give u start and end words then ask u how to get the end word via regex (from start word) (it replaces matches with "" [empty])

#

example: start: boat, end: oa, answer: b|t (ok maybe it'd have to be different so its actually hard)

lyric gyro
#

bro what

dark garnet
#

fr

lyric gyro
#

why do

#

hexcolors not work

#

on deluxechat?

bright pier
trail burrow
#

I finally fixed my github so I can push and pull, do I select all in commit tab or just the class files?

dusky harness
#

intellij also has a gitignore generator

#

or maybe its a plugin

#

i have gittoolbox 🤷

#

anyways just post it on github and we'll see

trail burrow
#

I use intellij and I updated all that has changed, I have many that is Unversioned files

dusky harness
#

do you have a .gitignore file

trail burrow
#

I would assume

dusky harness
#

post it on github

#

select all files

trail burrow
#

there is a .git folder

dusky harness
#

yes, that is the git repository

dusky harness
trail burrow
#

I think the unVersioned files are because on how I uploaded the first files

dusky harness
#

open intellij terminal and type git add .

#
git rm -rf --cached .
git add .
git commit -a -m "Cool Commit"
git push --force
#

just copy and paste these lines

#

later it's either ```
git commit -a -m "Cool Commit"
git push

#

but for now just copy and paste those four lines into the terminal

trail burrow
#

a forced push is the finial thing that fixed it

dusky harness
#

if it worked then send github link plz

trail burrow
dusky harness
#

so seems like you don't have .gitignore so if you want you can create a file .gitignore in your root project directory and add: ```
.idea/
target/
*.iml


Then in terminal type: (in order) ```
git rm -rf --cached .
git add .
```and then from here it'll be like any other commit and push - press Control K (or go to Commit tab if you changed keybinds), select all of the modifications/files, type in a commit message and `Commit And Push`
#

just letting you know how to do this now for future projects

#

IntelliJ or a plugin of intellij can also generate .gitignores but I won't go into that right now

trail burrow
#

thanks, I might be able to fix my other repos, will work on them tomorrow

dusky harness
#

atm cloned your repo and building it rn

trail burrow
#

I had .gitignore file before I started this repair they got remove in some of the commands I ran to fix it

dusky harness
#

you had an extra .

#

at the end of the relocation

#

actually that should still work though

#

try without the dot

#

also you should be getting two jars: ```
Autorank-5.1.6.jar
original-Autorank-5.1.6.jar

trail burrow
#

I uploaded the unversioned files and everything looks normal

dusky harness
#

and you can delete world.iml I think

#

not sure what that's for

trail burrow
#

do I need .gitignore

dusky harness
#

you should

#

it makes sure that some files and folders are excluded from git

#

caches and ones that are specific to IDEs should usually be excluded

#

.idea = IDE stuff
target = cache
*.iml = IDE stuff

queen plank
queen plank
#

I'm trying to spawn an item frame on the block face that the player click. I currently have this code but the item frame seems to spawn a bit like it feels like randomly all over the place. Why lol?```java
public void onClick(PlayerInteractEvent event) {
if(event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;

Location l = event.getClickedBlock().getLocation();
ItemFrame f = (ItemFrame) l.getWorld().spawnEntity(l, EntityType.ITEM_FRAME);
f.setFacingDirection(event.getBlockFace());
}

dense drift
#

spawnEntity spawns the entity with a random offset I believe

queen plank
#

That explains a bit. Because sometimes the item frame just decides to move one block over.

next merlin
#

Hiya. Been trying to make a small plugin for Halloween. Want to create a few animal corpses and have them lie around sideways. Pretty much like this: https://imgur.com/a/HeQ6X6L
Thought maybe setPose(EntityPose.DYING) would be what I'd need but that has no effect.

I'm starting to wonder if it's even possible and if so.. how? 🤔

merry knoll
dense drift
#

It might have been spawnItem then

dusky harness
dense drift
#

Yeah ik

supple sparrow
#

Anyone know how to convert a bukkit player to a worldedit player using the 6.0 WE API?

public void onPlayerLeave(PlayerQuitEvent event) {
        org.bukkit.entity.Player player = event.getPlayer();
        com.sk89q.worldedit.entity.Player wePlayer = BukkitAdapter.adapt(player);
}

this works in the v7.2.x but for some reason BukkitAdapter is not a public class in 6.0

formal crane
warm steppe
lyric gyro
#

Good observation

dense drift
sonic quartz
#

what event should I use to detect when a door is opened with redstone?

#

like lever or button

broken elbow
#

d;spigot BlockRedstoneEvent

uneven lanternBOT
#
public class BlockRedstoneEvent
extends BlockEvent```
BlockRedstoneEvent has 1 extensions, and  6 methods.
Description:

Called when a redstone current changes

broken elbow
#

@sonic quartz I believe this is what you're looking for this

dense drift
#

let's say I need a List#forEachIndexed method that gives you access to each item as well its index trough a BiConsumer<T, Integer> or something like that. Would there be another way to skip to the next element, like you would use continue; in a normal loop, in another way that by using return;?

lyric gyro
#

huh?

#

what

dense drift
#
public <T> void forEachIndexed(List<T> list, BiConsumer<T, Integer> consumer) {
  for (int i = 0; i < list.size(); i++) {
    consumer.accept(list.get(i), i);
  }
}```

```java
forEachIndexed(list, (element, index) -> {
  if (element does not meet condition) {
    return; // skip to the next element
  }

  // rest of the code
})```

This would work like this, I was wondering if it is possible to skip an element without using `return`
#

What I want to do with this method, is to avoid a lot of for loops with an index i

lyric gyro
#

that's dumb

#

you still need a variable for the index regardless

#

you just called it index in this case

dense drift
#

yeah but it is not defined explicit for each individual loop

for (int i = 0; i < list1.size(); i++) {
  var element = list1.get(i);
}

for (int i = 0; i < list2.size(); i++) {
  var element = list2.get(i);
}

for (int i = 0; i < list3.size(); i++) {
  var element = list3.get(i);
}```
lyric gyro
#

i don't see how that is different than

forEachIndexed(list1, (element, i) -> {
});

forEachIndexed(list2, (element, i) -> {
});

forEachIndexed(list3, (element, i) -> {
});
dense drift
#

I prefer it over a normal for i loop in this case

lyric gyro
#

well as I said, that's dumb, but you "continue" by returning, because that return exits the consumer function, not the loop, thus skipping to the next element; the downside is you can't break out of the loop without external state (or.. throwing an exception)

dense drift
#

I was hoping I miss something and return is not the only option to skip an element blobsweat thanks emily

lyric gyro
#

it is in fact the only way

dense drift
#

yeah I know

lyric gyro
#

with that abstraction there is no "loop", it's just a function that takes a T and a number, that's all it sees

sonic quartz
#

is there an easy way to get the player who activated RedstoneBlockEvent?

#

I thought about using PlayerInteractEvent to save the player to a hashmap and then use him in RedstoneEvent but It will probably cause problems when handling several players doing the same thing simultaneously

#

I realized that I can't event use Hashmap

lyric gyro
#

I don't think it's an easy thing to do reliably

#

I think Sponge does it or something similar like who pushed a piston, and it's incredibly complex, but it can do things that a bukkit plugin can't given it's basically just a mod

stuck hearth
#

You could check Griefdefender to see if Blood tried to reimplement it in his plugin.

#

I say this because he wrote the notifier system you're referencing in Sponge

ripe island
upper jasper
vernal quail
#

Any efficient way to get list of player who is currently open Custom GUI?

errant pilot
#

im having trouble getting this api to work: https://github.com/WesJD/AnvilGUI

i downloaded the code of it as a zip then added it to my projects library,
i got the dependency and repository to work in pom.xml but cant use any of the functions or import a package from it

errant pilot
#

yeah i followed that but couldnt do any of the example methods

dusky harness
errant pilot
#

oh right okay

#

i deleted it but still same issue

dusky harness
#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

errant pilot
dusky harness
#

what IDE are you using?

#

or what program

errant pilot
#

Intellij

dusky harness
#

lines 21 - 42 and 52 - 67

errant pilot
#

ahh crap yeah

#

deleted it, just the anvilgui shade now

dusky harness
#

and you reloaded the maven config thing?

#

I'm not sure what it's exactly called

#

but intellij should show like a reload button

errant pilot
#

oml refreshing fixed it

#

thanks for the help, havent used APIs alot lol

dusky harness
#

👍 np, just make sure you always refresh (it should pop up whenever you modify the pom.xml)

grand zodiac
#

I have this config file for my Bungeecoord plugin, when reading the file, how can I make the plugin store server1, server2, and server3 as seperate values, rather than storing [server1, server2, server3] as one value?

#

Sorry if that makes no sense I'm not really sure how to word it

lyric gyro
#

how are you saving the config?

grand zodiac
#
    private File file;
    public static Configuration configuration;
    @Override
    public void onEnable() {
        getLogger().info(ChatColor.translateAlternateColorCodes('&', "&a&lMATCHMAKER &8&l» &7Plugin enabled!"));
        registerCommands();

        file = new File(ProxyServer.getInstance().getPluginsFolder() + "/Matchmaker/config.yml");
        // Tries to create & load the file.
        try {
            if(!file.exists()) {
                getDataFolder().mkdir();
                file.createNewFile();
            }
            configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file);
            configuration.set("group1", "[server1, server2, server3]");
            ConfigurationProvider.getProvider(YamlConfiguration.class).save(configuration, file);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }```
icy shadow
#

...

#

lol

grand zodiac
#

like that

grand zodiac
icy shadow
#

funnily enough if you save a string, it will save that string

#

use a list object instead

grand zodiac
#

oh right good point 🤣

#

thanks

icy shadow
#

np

grand zodiac
icy shadow
#

any list-like object

#

but given that i said "list", i was really talking about list

#

not arrays

stuck canopy
#

I have a list of numbers
and I wanna get x amount of unique numbers from the list
how can I do that

dusky harness
#

Also randomize

#

I forgot

#

Randomize the set before you loop it

#

Google like randomize collection java

leaden sinew
broken elbow
broken elbow
#

there's multiple answers to this question. But yeah most of them will include sets. You can do what dkim mentioned but instead of converting the list to a set, just loop thru the list directly and add the elements to the set until the set size is whatever you want.

dusky harness
#

I wasn't really thinking

#

but i said set bc it doesn't have duplicate

#

but i forgot about the ordering thing

stuck canopy
#

just Shuffled the list using Collections.shuffle() method and just got the x amount of beginning numbers of the list

broken elbow
stuck canopy
#
        Collections.shuffle(old);
        List<Integer> newlist = new ArrayList<>();
        for (int i = 0; i < x; i++) {
            newlist.add(old.get(i));
        }```
broken elbow
#

umm. that will not guarantee you the numbers in there are different tho. you could have duplicates

stuck canopy
#

the old list doesnt have any duplicated numbers

#

thats why I wrote "in order"

broken elbow
#

oh... well then java has a sublist method. if all you needed is n elements from another list.

broken elbow
dusky harness
broken elbow
#

I can not find that

stuck canopy
#

how so? never used a sublist

stuck canopy
broken elbow
#

oh. right

sonic quartz
#

How do I change level or duration of the potion effect in potion meta of a tipped arrow itemstack?

#

I want to get arrows just as they are in creative inventory. Can I get them with proper names, duration and lore?

#

without using addCustomEffect

stuck canopy
robust flower
#

hmm, I will probably be the 549687815 person asking this, but how can I generate a server jar (with shaded net.minecraft in it) of version 1.19+? And no, I don't want to use mavenLocal for this, I'm not building a project, I'm experimenting with classes and decompilers

hoary scarab
dusky harness
#

or

#

sponge thing if you don't want spigot

robust flower
#

so paper is no more?

dusky harness
#

wdym

#

no paperweight is a thing

#

sponge also has a gradle plugin

#

but it doesn't include paper and spigot

#

I'm experimenting with classes and decompilers

#

wait what

#

ok I think I misunderstood

robust flower
#

yeah

dusky harness
#

I thought you meant mc internal

#

I don't understand

robust flower
#

well, I want the compiled code of net.minecraft classes bundled together with Spigot (or preferably Paper) in a jar file

dusky harness
#

Paperweight - I'm not exactly sure where the jar is stored but I assume somewhere in the build folder

#

hm I can't find it

#

oh found it

#

.gradle/caches/paperweight/ivyRepository/io/papermc/paper/paper-server

#

I'm not sure exactly what you want

#

since that's basically a maven repository

robust flower
#

is that paper + vanilla in a single jar?

dusky harness
#

yes

#

buildtools can also do it but without paper

robust flower
#

how can I build the server jar using paperweight then?

dusky harness
#

and read the readme

robust flower
dusky harness
#

of how to use paperweight

robust flower
#

I'm not building a project
Nor am I using Gradle, Maven, or any build tool for that matter

#

I have literally 0 code to be compiled in my hands

dusky harness
#

I guess you could try looking at buildtools source code

#

and see how that works

#

well actually

#

without a build tool you can't deobfuscate it I don't think

#

assuming you want it deobfuscated

robust flower
#

but I need exactly the obfuscated code

dusky harness
#

or papermc downloads and run the server to get the jar

#

Minecraft for whatever reason has a 1 page load ratelimit 👍

#

for me

#

you could also download the paper jar, run the server, and go to versions/1.19.2/paper-1.19.2.jar

dusky harness
#

just checked

#

I'm assuming it uses spigot mappings

heavy maple
#

anyone here good with jackson object mappers :p

dusky harness
neat pierBOT
#
FAQ Answer:
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait

Source

heavy maple
dusky harness
icy shadow
#

kotlin

heavy maple
#

my b didn't mean to press enter after just that

so this is the error

[21:25:49 WARN]:  at [Source: (String)"Hat(id=test1, material=FEATHER, displayName=Unnamed, lore=[1, 2, 3, 4, 5], modelID=10000, enchants=[MENDING:1, PROTECTION_ENVIRONMENTAL:4, DURABILITY:3])"; line: 1, column: 4]
[21:25:49 WARN]:     at FruityHats-1.0-SNAPSHOT.jar//com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2391)```
robust flower
dusky harness
#

wait

#

nvm

#

ignore me

#

lol

heavy maple
#

that's where im kinda lost lol

dusky harness
#

wait

#

don't ignore me

heavy maple
#

after that point im not sure where to advance to

dusky harness
#

yeah that's for when the deserializer is registered

robust flower
dusky harness
#

so basically I think this is what's happening:

  1. it tries to deserialize a Hat
  2. the deserialize method calls readValue for Hat
  3. repeat
heavy maple
#

yeah sure no problem uno sec

dusky harness
#

note that I've never used jackson before

#

and all I know about it is that it's a JSON library

#

so I may be very wrong

#

and I think I am very wrong

#

so I think you should be ignoring me

#

yeah ignore me

lyric gyro
#

🤓

dusky harness
#

Emily

lyric gyro
#

kotlin = Emily

#

ew

dusky harness
#

👀

#

😭

#

I can't even change my nickname anymore

#

lol

heavy maple
robust flower
#

oh I think I get it, Jackson is complaining that you gave it this, but this is not a JSON:

Hat(id=test1, material=FEATHER, displayName=Unnamed, lore=[1, 2, 3, 4, 5], modelID=10000, enchants=[MENDING:1, PROTECTION_ENVIRONMENTAL:4, DURABILITY:3])

dusky harness
#

I agree

heavy maple
robust flower
#

yup I was right, see, I made a small, reproducible snippet

fun main(args: Array<String>) {
    val jackson = ObjectMapper().findAndRegisterModules()
    jackson.readValue<Map<String, String>>("TestTILO(dsadasadasdadsa=\"dsadasdas\")")
}

prints

Exception in thread "main" com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'TestTILO': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"TestTILO(dsadasadasdadsa="dsadasdas")"; line: 1, column: 9]
    at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2391)```
#

So your fix is: give JSON parsers valid JSONs 😉

heavy maple
#

big brain i like it

#

OR OR

#

hear me out

dusky harness
#

different purposes

#

that's for config

#

jackson is usually for data

heavy maple
#

yeah i used jackson (atleast the object mapper) for writing and reading to a file

sonic quartz
final jewel
#

[ERROR] Couldn't load server icon

#

My icon is named "server-icon.png" and is 64*64, so whats the issue?

mossy raft
#

hey, i wan't to learn minecraft plugin development, where do i start?

#

seems like some youtube videos are outdated, or is it?

stuck hearth
#

Depends on the video I guess.
For all I know you're looking at cat videos. (Pro tip: cat videos are not up to date)

warped sail
#

im using a bungeecord plugin to store data for every player in a map. is it possible to add placeholderapi into the plugin on bungee, and create a separate expansion for the spigot servers to get data from said bungee? would this have any major performance impacts?

or should i just add mysql support and slap the plugin onto every spigot server? i would still like to know how to do the above though.

warped sail
#

i hope you know a bit of java, though.

dense drift
#

You can not run papi in bungee

warped sail
#

i am aware.
the bungee placeholderapi expansion is a thing, though.

#

any tutorial on how that works?

broken elbow
dusky harness
#

also note that plugin messaging is only useful in certain scenarios

#

since it requires a player on both the receiver and sender server

dusky harness
#

yeah and it also gives you some specific stuff like PlayerCount which is nice

forest jay
#

I have a item, and I want it to show the pickup motion towards the player, but not go into the inventory. Anything I can use to do this? I tried to remove it from the inventory after picking it up but that made it flash if there was a open slot in the hotbar which I don't want

dense drift
#

you can use packets to play the pickup animation

forest jay
#

I have no clue how to do that. Should I google it?

#

Ah

#

I will take a look, thanks

dense drift
#

packets are game internals, spigot just offers an api for some of them

dense drift
dusky harness
#

you don't have to copy the class - in fact I didn't - but you can see an example of the usage

forest jay
#

thanks!

dense drift
#

packetwrapper is useful

dusky harness
#

very useful

#

usually wiki.vg isn't needed with packetwrapper for basic things like this

#

@forest jay if you do use packet stuff in the future, https://wiki.vg/Protocol is very helpful for documentation (and then you can refer to PacketWrapper to see how it's implemented in ProtocolLib since ProtocolLib has some utilities that PacketWrapper uses)

forest jay
#

yeah, I have tried to use packets before, went right over my head lol

dusky harness
#

🥲