#help-development

1 messages · Page 123 of 1

eternal oxide
#

you spawn it again

#

and again

cobalt thorn
#

but happens the same

eternal oxide
#

when does it stop? when teh player relogs?

cobalt thorn
#

currently im only testing

eternal oxide
#

Player objects are transient. they are not reused between sessions

#

get the Player by uuid

cobalt thorn
#

yea i know

#

but rn i don't need to do that i only trying the particle if they works

#

and yes but stops immidiantly

eternal oxide
#

yes you do

#

if you are finding the particles stop spawning when teh player relogs, its because you are hard referencing the Player object in your runnable

cobalt thorn
#

I do the command and then the particle spawn but then disappears and never spawns back there and seem a horrible mess of particle

lost matrix
cobalt thorn
winged anvil
#

lmao i’m taking a software development class rn and the teacher is so adamant on writing pseudocode for an entire project before coding

#

probably the worst class ive ever taken

molten hearth
#

in college I had to write pseudocode after writing the real code

#

quite useless

winged anvil
#

i get it if you make like a flowchart but pseudocode for an entire project is redundant

lost matrix
#

Pseudocode is good for scientific definitions. Thats it.

winged anvil
#

i mean she’s also teaching out of a book that’s 8 years old

lost matrix
cobalt thorn
#

where the particle should be

lost matrix
#

And? Whats your result. More infos please.

cobalt thorn
#

inside the map color and position and they are fine

ornate zinc
#

can i ask a question about my plugin ?

lost matrix
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

ornate zinc
#

in this case

    @EventHandler
    public void onDeath(EntityDeathEvent event) {
        if (event.getEntity() instanceof Zombie) {
            Zombie zombie = (Zombie) event.getEntity();
            
            if (zombie.getCustomName().equalsIgnoreCase("Ghost")) {
                if(zombie.getEquipment().getItemInMainHand().getType() == Material.DIAMOND_SWORD){

                    event.getDrops().clear();
                    event.getDrops().add(new ItemStack(Material.DIAMOND_BLOCK , 10));

                }
            }
        }
    }
```  if we have a zombie named Ghost and if zombie had Diamond-sword , our zombie drop 10 diamond blocks . right? but it didnt work. how can i fix this ?
cobalt thorn
#

on the floor

#

where the zombie died

lost matrix
lost matrix
lost matrix
#

Then add debug messages.

#

Is your listener even registered?

ornate zinc
lost matrix
ornate zinc
#

ok

cobalt thorn
lost matrix
cobalt thorn
lost matrix
#

Thats what i was asking earlier... So the location is shifting into oblivion

ornate zinc
#

event.getDrops().add(new ItemStack(Material.DIAMOND_BLOCK , 10)); this change the loot not location

lost matrix
# cobalt thorn yes

Even if you stay perfectly still and dont move?
Because currently your image will kind of follow the player

lost matrix
# cobalt thorn yes

Hm. What version are you using? Because this should not happen in newer versions.

ornate zinc
#

lol

lost matrix
lost matrix
#

so 16x16 or something

lost matrix
#

Whats the size?

cobalt thorn
pulsar parcel
#

Hello, I would like make plugin, witch will show number of players in team in scoreboard and update it every tick (I will change update time later). I have made this so far, but every time I run updatePerLine() method, its showing errors in scoreboard like on picture
https://pastebin.com/SD868ffE

lost matrix
pulsar parcel
lost matrix
#

Here is your problem

pulsar parcel
echo basalt
#

pro tip: don't use toString as if it would return any text contained within the score

lost matrix
echo basalt
#

toString is sometimes useful for debug reasons but overall there's usually a getter

lost matrix
cobalt thorn
#

or i can try making it the size of the image

lost matrix
#

The anchor is at 0, 0 on default

echo basalt
#

pretty sure it's the hashcode actually

cobalt thorn
echo basalt
lost matrix
#

Never looked into that. Always thought it was some mem address

echo basalt
#

you speak about stuff like you're so sure of it, makes me question my own understanding of java sometimes

lost matrix
#

Im glad when i get corrected sometimes

lost matrix
pulsar parcel
cobalt thorn
lost matrix
pulsar parcel
lost matrix
# cobalt thorn idk random number lol
                Vector dist = player.getEyeLocation().getDirection();
                dist.multiply(-0.5);

This will show the particles behind the player. Do you check with 3rd person view?

echo basalt
#

man's tryna make wings

#

Always thought that code would be hard but it's surprisingly easy

cobalt thorn
limber mica
#

Let's say I want a computer program that will add two numbers and output the result on screen with two numbers 18 and 8, add them and out the result.

What would be the two steps needed for a computer to solve the problem?

#

would it be getting the sum and outputing it?

echo basalt
#

yeh

#

man's asking us for homework help

lost matrix
pulsar parcel
echo basalt
#

try it and see

pulsar parcel
#

ok

limber mica
#

7smile7 you made the arithmetic logic part way more complicated than it needed to be

echo basalt
#

I can't tell if you're asking us or testing us at this point

#

man just said the answer in class and replied with the teacher's response

limber mica
#

LMAO

#

I wish

cobalt thorn
# lost matrix oh...

ok what happens its strange the particle spawn in order and make the image but they disappears fast enought to not be seeing

#

they fliker and teleport around

lost matrix
# cobalt thorn nah im using a ps4 controller for testing

Ok try not setting the anchor, increase the ratio to 0.2 and let the image display in from of you. Make sure you are in the air.
We also clone the locations just to be sure.

                Vector dist = player.getEyeLocation().getDirection();
                dist.multiply(-0.5);
                Location location=player.getEyeLocation().add(dist).subtract(0,0.5,0);
                Map<Location, Color> particle = particles.getParticles(location,25,location.getYaw());

->

                Vector dist = player.getEyeLocation().getDirection().multiply(2);
                Location location=player.getEyeLocation().add(dist);
                Map<Location, Color> particle = particles.getParticles(location.clone(),25,location.getYaw());

And then we enhance our loop

                for(Location spot:particle.keySet()) {
                    player.sendMessage(spot.toString());
                    Color color=particle.get(spot);
                    //spawn particle at location "spot" with color "color"
                    player.getWorld().spawnParticle(Particle.REDSTONE,spot,1, new Particle.DustOptions(color, 1));
                }

->

                for(Entry<Location, Color> entry : particle.entrySet()) {
                    Color color = particle.get(entry.getValue());
                    //spawn particle at location "spot" with color "color"
                    player.getWorld().spawnParticle(Particle.REDSTONE,entry.getKey(), 1, 0, 0, 0, new Particle.DustOptions(color, 1));
                }
pulsar parcel
quaint mantle
#

is there anyway to like when someone subscribes to my youtube channel it does a command in my server

fluid river
#

yes

#

string.matches

#

guys basically don't know JDK

lost matrix
#
if(Stream.of("A", "B", "C").anyMatch(player::hasMetadata)) {

}

One example. But i would rather use a field which contains the values.

fluid river
#

he compares ""

#

so that's string

hasty prawn
#

No he's not

lost matrix
#

No he doesnt

fluid river
#

...

hasty prawn
#

hasMetadata is returning a boolean

fluid river
#

hasMetadata(String)

lost matrix
#

Is not a String comparison

hasty prawn
#

Yeah..? String is the argument for the method.

#

There's no String comparison, wheres the equalsIgnoreCase() Thonk

#

or equals()

fluid river
#

i'm not sure about realization but you can use regex in lots of cases in bukkit

#

not string matches only

hasty prawn
#

How does that change the fact that the Strings aren't be compared but passed as arguments

fluid river
#

Sometimes methods eat regex in string params

lost matrix
cobalt thorn
# lost matrix Ok try not setting the anchor, increase the ratio to 0.2 and let the image displ...

[20:20:55 WARN]: [NextBot] Plugin NextBot v1.0-Beta generated an exception while executing task 19
java.lang.IllegalArgumentException: color
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.0.1-jre.jar:?]
at org.bukkit.Particle$DustOptions.<init>(Particle.java:184) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at it.zerotwo.nextbot.commands.MainCommands$1.run(MainCommands.java:67) ~[NextBot-1.0-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.19.2.jar:git-Purpur-1775]
at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.19.2.jar:git-Purpur-1775]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.19.2.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

fluid river
#

if you make it to 1 line

#

By not assigning variable

lost matrix
#

So? Doesnt mean its faster.

vocal cloud
#

You need to add racing stripes to speed things up

hasty prawn
#

And fire decals

fluid river
#

not to run

lost matrix
#

Pretty sure the second one is faster because the static variable is on the stack at all times.

#

Ah i see

fluid river
#

Turning a list into a stream and then using anyMatch is probably slower

#

than just three or

lost matrix
#

For sure

fluid river
#

Cuz stream is not on the stack

lost matrix
#

We shouldnt think about those things. JIT carries our bad code anyways.

fluid river
#

Sometimes even JIT compiler can't help ya know

vocal cloud
#

Gotta outsource it to China

fluid river
#

what

lost matrix
#

Yeah. Let child labour optimize our code.

fluid river
#

true actualy

#

Child with Middle Java level at least

#

Learning java even before being born

vocal cloud
#

Audio tapes in the womb

ivory sleet
#

for instance IntStream will have its values on the stack

rough drift
#

I am trying to use protocol lib to listen for entity movement, and I'd like to figure out previous/current location, however I need the entity's current location, and to get that, I need the entity, how can I get the entity?

this.manager.addPacketListener(new PacketAdapter(
                this.plugin,
                ListenerPriority.MONITOR,
                PacketType.Play.Server.REL_ENTITY_MOVE
        ) {
            @Override
            public void onPacketSending(PacketEvent event) {
                PacketContainer container = event.getPacket();
                short deltaX = container.getShorts().readSafely(0);
                short deltaY = container.getShorts().readSafely(1);
                short deltaZ = container.getShorts().readSafely(2);
            }
        });
fluid river
#

for (var s : "A,B,C".split(",")) {
if (p.hasMetadata(s)) break;
}

torn badge
#

Does someone have an idea how I could vanish a player so he isn’t even recognized in other plugins anymore? So e.g. you cannot /msg him? I was thinking about modifying the field underlying getOnlinePlayers(), but if that’s not only used for Plugin API it would have very bad side effects

ivory sleet
#

split("|") you mean?

rough drift
fluid river
#

there are different split methods as far as i know

torn badge
fluid river
#

one with only int parameter splits by regex and has a limit

rough drift
#

I guess you can

lost matrix
fluid river
#

not true

#

kinda died

torn badge
#

But the player won’t be able to play anymore if the server considers him as offline

vocal cloud
#

Store player join leave and you'll never need to query online

ivory sleet
#

and if you use the regex one thatll ofc decrease performance rather drastically, altho streams probably do it even more

rough drift
fluid river
#

We are not talking about overall speed

#

just about laziness at code writing

ivory sleet
#

well there are different types of laziness

fluid river
#

gonna try shortest code now

fluid river
#

probably the smallest

lost matrix
rough drift
lost matrix
#

How else would the client know which entity to update on his side

rough drift
#

since there is no var ints on the packet container

rough drift
#

talking about the protocollib api

lost matrix
#

int at index 0

rough drift
#

now

#

How do I get the entity from the id

lost matrix
#

I think plib has a util method for that

rough drift
#

can't find

fluid river
#

Are most of the guys here coding on java 8?

rough drift
#

nvm

ivory sleet
#

I think j11

fluid river
#

My laziness is the biggest probably

rough drift
#

16+

ivory sleet
#

j8 is minimum

rough drift
vocal cloud
#

J18 cause 20 can't come soon enough

fluid river
#

Nobody uses var and Pattern matching

rough drift
#

it moved

ivory sleet
fluid river
#

look

#

1 sec

lost matrix
ivory sleet
#

guess its gonna get more popular with switch expressions

rough drift
#

Protocol lib might not be designed the best

rough drift
#

ProtocolManager#getEntityFromId takes a world

#

well what if I don't have a fucking world

fluid river
#

sorry for tagging

lost matrix
#

Java 8 instantly rises suspicion because its a first indicator that you are using the garbage minecraft version.

fluid river
#

But haven't seen anybody using pattern matching

lost matrix
ivory sleet
#

Well I use it for convenience

#

but I haven't done any real bms on whether its performance is actually great

fluid river
#

Idk i'm rly curious about applying to actual job

#

So i learned every freaking thing about new jdks

ivory sleet
#

also btw

hasty prawn
#

Pattern matching is amazing

ivory sleet
#

this is gonna be awesome

ivory sleet
#

and will advocate people to use pattern matching a lot more

fluid river
#

guys on spigotmc will still use if (cringe instanceof Based)

#

))))

lost matrix
fluid river
#

record looks kinda sussy

#

cus instead of actual getValue()

#

you recieve value()

#

maybe it's time to change but idk

#

seems to non-java for me

ivory sleet
#

well, I mean fluent naming

#

yeah

fluid river
#

guys might think it's a method

#

Like mojangs a(), b() and so on

lost matrix
#

Just name your variables int getX, boolean isOnline galaxybrain

fluid river
#

ahahahah

#

exaaaactly

ivory sleet
#

I mean by traditional means a function does something hence the name of it should be a verb

#

but now there are "property functions" and "accessors", "mutators" who are not semantically different but we look upon them with a slightly different aspect

pulsar parcel
#

I made a plugin that should show the number of players in the team in the scoreboard. I made an update per line, so the line in which it is displayed int List0 = blue.getEntries().size();
and then String.valueOf(List0). The problem is that when I join the team, the value does not change. Does anyone know where the error is?

code: https://pastebin.com/HyQWUCSW

wary topaz
#

No errors

vocal mirage
#

Hello!
I use a plugin message to send data between a proxy and a spigot server. The problem is that the message contains UUIDs, and that they aren't formatted correctly by player.getUUID() method on Bungeecord. The Spigot server recieves the correct UUID, without the "-", so server send "Invalid UUID string" error while using it

Can you help?

Thanks

lost matrix
rough drift
#
if (Bukkit.getPluginManager().getPlugin("ProtocolLib") != null) {
    ProtocolHook hook = new ProtocolHook(this);
    hook.attach();
}
public ProtocolHook(Plugin plugin) {
    this.plugin = plugin;
    this.manager = ProtocolLibrary.getProtocolManager();
}

Manager is null when calling #attach, why?

lost matrix
rough drift
#

no?

rough drift
#

I don't do that

lost matrix
#

Do you use maven?

rough drift
#

Ah, fuck maven

#

It auto shaded

#

I never even added shading

lost matrix
#

How do you compile?

rough drift
#

maven package

#

so basically

#

it kind of auto adds shade for me (intellij mc plugin)

lost matrix
#

Alright. Add <scope>provided</scope> to your dependency

rough drift
#

I don't even need that

#

I am not needing to shade anything

lost matrix
#

Its always a good idea to have the maven shade plugin in your pom

vocal mirage
lost matrix
#

Changing the scope is more explicit. Do that instead.

lost matrix
mellow pebble
#

does anyone know how would i spawn like smoke particle on player death

#

i know it was a thing in 1.8 where you could just do playEffect()

lost matrix
mellow pebble
#

in 1.19.2 there is no cush thing

#

such*

mellow pebble
lost matrix
#

get the world -> call spawnParticles

wary topaz
rough drift
lost matrix
lost matrix
vocal cloud
#

dangit smile beat me to it

lost matrix
#

Use 5.0.0-SNAPSHOT for 1.19

rough drift
#

Oh I am categorally bad

mellow pebble
lost matrix
mellow pebble
#

and can it be null

wary topaz
abstract ermine
#

hello, im new, can i ask here for plugin?

#

(if anyone knows that plugin)

wary topaz
#

??

#

This is for coding plugins

#

not requests

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

abstract ermine
#

okay, ty

lost matrix
#

but development related questions only

vocal cloud
#

If you need help setting up or finding a plugin go to #help-server

lost matrix
wary topaz
#

What do you mean?/

#

I gave you all 3 files

#

My question is why wont it use that line

lost matrix
#

Yes. But you should probably use a map for that.

wary topaz
#

it just returns this with

lost matrix
#

You can have it still contain the uuid. Doesnt mean you cant use the uuid as a key suddenly.

vocal cloud
#

plugin.updateLastReceived(receiver.getName(), sender.getName()); what is this method

waxen plinth
#

It's using names which is already a bad sign

vocal cloud
#

I'm aware

wary topaz
vocal cloud
#

I'm asking for the method

#

Not for where you use it

lost matrix
vocal cloud
#

No they're not

#

I have all 3 open

#

Send your plugin class

lost matrix
wary topaz
#

If mike wants to help me I'll let him

vocal cloud
#

Use UUID's. Don't use names

#

I'd refactor the whole thing to use UUID's first.

wary topaz
#

👍

lost matrix
#

Where does the obsession with equalsIgnoreCase coming from btw? Ive seen it so often for no reason.

#

And i havent used this in the last 10k lines i have written for sure.

vocal cloud
#

It's one of those "better safe than sorry" kinda things I see people do

mellow pebble
#

@lost matrix how about spawning particles to player as trails in 1.8.8 ?

undone axleBOT
wary topaz
#

How do I implement a uuid?

chrome beacon
#

1.8 💀

chrome beacon
wary topaz
#

p.uuid?

mellow pebble
# lost matrix ?1.8

yes i know it is old but pvp minigame is not really making sense in 1.19.2

lost matrix
wary topaz
lost matrix
wary topaz
#

Whats the identifier?

chrome beacon
#

Depends on what player you want

lost matrix
wary topaz
#

Args 0

#

I want args 0 to be a uuid

vocal cloud
#

You get the player via name then grab the UUID from the player object

lost matrix
#

You use uuids internally and let user interaction go through names.

chrome beacon
#

/msg d6bdae2a-3d79-4830-857d-b0920016ff59 Hello very nice command

#

You probably want the username not the UUID in your command

wary topaz
#

Player receiversuuid = receiver.getUniqueId ();?

wary topaz
waxen plinth
#

Bukkit.getPlayer?

chrome beacon
#

Did you skip learning Java before trying to make a plugin

wary topaz
wary topaz
lost matrix
waxen plinth
#

Bukkit.getPlayerExact

wary topaz
#

It's the same thing

waxen plinth
#

🤔

#

getPlayerExact should only return the player if the name is an exact match

vocal mirage
wary topaz
#
Operator '==' cannot be applied to 'java.util.UUID', 'org.bukkit.entity.Player'```
#

if (receiveruuid == p) {

vocal mirage
lost matrix
chrome beacon
wary topaz
#

o

lost matrix
wary topaz
#

I'll make a uuid string for player too

waxen plinth
#

Call .toString() on it

lost matrix
#

^

#

Our write 2 longs

#

msb and lsb

chrome beacon
#

^

waxen plinth
#

I hate doing it that way

lost matrix
#

That would be faster

#

But more error prone

waxen plinth
#

It would be nice if it had the option to give you a byte[16]

wary topaz
vocal mirage
vocal cloud
wary topaz
#

I'll pay someone nitro if they do some tasks for me (coding) DM me (Nitro classic)

#

Must be a 10 star coder

chrome beacon
#

?services

undone axleBOT
wary topaz
#

alr

old cloud
eternal night
#

see the UPDATE instruction

vocal mirage
remote swallow
#
    public static byte[] getBytesFromUUID(UUID uuid) {
        ByteBuffer bb = ByteBuffer.wrap(new byte[16]);
        bb.putLong(uuid.getMostSignificantBits());
        bb.putLong(uuid.getLeastSignificantBits());

        return bb.array();
    }

    public static UUID getUUIDFromBytes(byte[] bytes) {
        ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
        return new UUID(byteBuffer.getLong(), byteBuffer.getLong());
    }

could be used for uuid in bytes

old cloud
#

epic

eternal night
#

update updates a row

#

what condition

#

yea ? What about that

#

I am confused as to what your question is here

#

it doesn't upsert

#

if that is your question

#

e.g. if no line matches the WHERE case it just does nothing

#

checkout UPSERT

steady warren
#

Working on a plugin that will likely have a lot of holograms, *surely more than 500 (when some time has passed), up to 1000 (well I think it's a lot) * and I'm planning to use Holographic Displays. Do you guys think it can handle this well?

eternal night
#

its UPDATE if present or INSERT if not

#

MYSQL iirc has a specific command for that

remote swallow
eternal night
#

very specific to the DB

#

UPSERT is not a standard SQL command

#

so each SQL server might have its own syntax for it

#

Well, on the SQL server

#

your mysql upsert syntax won't work for sqlite

#

or postgres

#

for example

#

tho like, mysql iirc does not really have a built in upsert

vocal mirage
steady warren
# remote swallow depends what you plan on having on them

The hologram will be spawned on top of a mob spawner (modified, not like vanilla) that a player will place. It will displays info like what type of mob that is, and the amount of spawners there are on that 'stack', as well as the owner's name of it.

#

sorry, if it's too confusing, english is not my first language

dusk flicker
#

personally in that case; to reduce the amount of holograms

#

id only create it if a person is within like 15 blocks

remote swallow
steady warren
eternal night
#

just, google

dusk flicker
#

or if you are fancy you can

#

?bing it

undone axleBOT
eternal night
#

at least duckduckgo it then

#

"how to UPSERT in mysql"

#

I presume you are using mysql ?

#

yea I think you said that somewhere

steady warren
# steady warren This is what I was thinking

I'd have to create a repeating task and iterate in all the spawners, get the location calculate if the player's in the radius, then change the hologram visibility setting for that player

eternal night
#

should be something along the lines of INSERT ... ON DUPLICATE KEY UPDATE

#

if my mysql knowledge did not forsaken me

steady warren
fickle helm
#

hello, apparently this method only exists on 1.18 and newer servers. what is the method to get it on a 1.17 server?

Bukkit.getUnsafe().getTranslationKey(EntityType)```
lost matrix
lost matrix
#

Or by doing some bootleg String assembling

fickle helm
#

🤷‍♂️

final String translationKey = "entity.minecraft." + livingEntity.getType().toString().toLowerCase();```
#

you're right, thanks

tender shard
#

neither in UnsafeValues nor in CraftMagicNumbers

fickle helm
#

UnsafeValues appears to exist in 1.19

#

but not <= 1.18

#

oh well, I just changed my code to where I don't need that anymore

tender shard
#

UnsafeValues exists in all versions. but getTrsnaltionKey is in no spigot version, you are using Paper API

fickle helm
#

oh right, yes that

#

yeah it was annoying to have everything working in paper 1.19 then finding all the broken stuff in spigot

tender shard
#

that's what happens when you use paper specific features 😄

#

you can ofc use NMS to get the translation keys within one line

fickle helm
#

if I have the option to drive the Mercedes or the Hyundai I'm picking the Mercedes

tender shard
#

that's how paper does it

tender shard
#

it's like building a road (a plugin) where only mercedes can drive on (only paper servers can run it)

#

instead of buying a mercedes for yourself

fickle helm
#

ah good, I am using nms so nice to know that's an option

kind hatch
tender shard
#

    public String getTranslationKey(org.bukkit.entity.EntityType type) {
        return net.minecraft.world.entity.EntityType.byString(type.getName()).map(net.minecraft.world.entity.EntityType::getDescriptionId).orElse(null);
    }
#

i wonder why they added this to Unsafe instead of adding it to EntityType directly o0

#

EntityType.ZOMBIE.getTranslationKey() would make kinda more sense

fickle helm
#

cough paper

#

you mean like someothersite/1.19/org/bukkit/entity/EntityType.html#getTranslationKey()

iron glade
#

How do you guys manage your TODO's in your IDE? So far every time I have an idea I add a comment at the top of my main class :D On my current project I have like 8 todo's rn

tender shard
#

lol

#

IntelliJ also warns when committing TODO comments

#

and it also mentions those when using "Analyze code"

#

I also set it to show // debug comments

#

and yell at me when using System.out

tender shard
iron glade
#

what's a kanban?

tender shard
#

I just have one board per project or a "General" thing for projects that only have one or two TODOs

#

the general board is then just divided by project per swimlane

iron glade
#

Looks pretty cool nice

tender shard
#

yeah kanban is the general name for these kind of boards, e.g. trello is also a kanban board

#

I'm using selfhosted "wekan" which is free

#

it also supports a ton of things that I never use, like deadlines, images, time tracking, checklists, subtasks, attachments, labels, bla bla bla

#

or assigning certain members to each entry, having different organizations with different permissions, ... and installed with just one command lol snap install wekan

tender shard
#

what database

#

if you're talking about a java.util.List, i doubt that ANY database has support for that lol

kind hatch
#

I think that's what they were getting at. They want to know how to store a list in a database.

tender shard
#

you'll have to serialize that yourself into some datatype the database understands, then deserialize it later

#

e.g. if you have a List<String>, you could turn it into a json string

#

or even just comma-separated if your strings don't have commas, whatever, it depends on what you wanna store exactly

#

alternatively you could just use a new table, e.g.

your current table:
| key        | listId |
|------------|--------|
| first list | 1      |
| second list| 2      |

your list table:
| listId | i | value                        |
|--------|---|------------------------------|
| 1      | 1 | first value in "first list"  |
| 1      | 2 | second value in "first list" |
| 2      | 1 | first value in "second list" |
#

directly trying to store a list in a table sounds like the data isn't normalized properly, unless it's really basic stuff like a json or csv string though

tender shard
#

so e.g. imagine you have a class like this

public record Person(String name, int age, List<Person> friends) { }

You'd have a table like this to store name and age and the reference to the friends list

CREATE TABLE `Person` (
    `id` INT NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(32) NOT NULL,
    `age` INT NOT NULL
);

and another table to store the friends, where "id" is the owner of the friends list, and "friend_id" is the id of the other person in that list

CREATE TABLE `Person_friends` (
    `id` INT NOT NULL,
    `friend_id` INT NOT NULL
);

can't think of any better way rn

torn oyster
#

what would be the best way to have an entity's name be different for certain players

#

i'm using invisible armorstands to make a hologram library for myself

#

and i was wondering if there is a way i could make it so the hologram's text is different for certain players

#

i believe it will require nms or something

tender shard
# torn oyster i believe it will require nms or something

yes, you need to change the NMS' entity's name, and then send a ClientboundSetEntityDataPacket. For example something like this (haven't tested):

public void changeNMSEntityName(Entity nmsEntity, String name) {
    entity.setCustomName(CraftChatMessage.fromString(name)[0]);
    for (final Player player : Bukkit.getOnlinePlayers()) {
        sendPacket(player, new ClientboundSetEntityDataPacket(nmsEntity.getId(), nmsEntity.getEntityData(), true));
    }
}
#

except that you wouldnt loop over all players ofc

torn oyster
#

yep

#

thanks

tender shard
#

np, but as said- havent tested

torn oyster
#

alright

torn oyster
tender shard
#

erm

torn oyster
#

wait nevermind i'm stupid

#

i think

tender shard
#

that's just something like this

void sendPacket(Player bukkitPlayer, Packet<?> packet) {
  ((CraftPlayer)bukkitPlayer).getHandle().connection.send(packet);
torn oyster
#

okay thanks

vagrant stratus
vocal cloud
#

Stop modifying event outcomes and breaking them upsetLiz

vagrant stratus
#

I didn't modify an event lmao

vocal cloud
#

How'd you do it

vagrant stratus
#

Was screwing around w/ having items execute commands @vocal cloud

torn oyster
#

ClientboundSetEntityDataPacket doesn't exist

vocal cloud
#

Oh my

vagrant stratus
#

Right Click -> /kill Optic_Fusion1 -> Server Crash

#

why? Who the fuck knows

tender shard
# vagrant stratus lmao

this happens when you have fucked up items, e.g. books with too long meta, or when you downgraded the server but still have some "newer" items in some chest or whatever

torn oyster
tender shard
vagrant stratus
torn oyster
#

how?

tender shard
#

are you using maven?

torn oyster
#

yes

vagrant stratus
#

time to check the NBT lmao

tender shard
#

the "legacy" name of that packet is PacketPlayOutEntityMetadata btw

vagrant stratus
#

lol I wonder what in the PDC caused it to break 🤔

torn oyster
#

i have the spigot repository in the pom.xml

vagrant stratus
#

@tender shard

tender shard
mighty aurora
#

This p.getScoreboardTags().contains("shadowsneak") would check to see if a player has the tag shadowsneak right

torn oyster
#

i'm probably really stupid but anyway

#

¯_(ツ)_/¯

vagrant stratus
#

Literally just using PDC for this lol

#

Guess I need to dig into the src code lol

tender shard
#

this is the exception you get

#

your itemstack is somehow null

vagrant stratus
#

lmao I guess having it run the kill command on yourself breaks it somehow

#

I'll try again, see what happens lol

#

better yet, I'll record it. Gotta get some use out of my YT channel xD

tender shard
#

I mean wtf is TRAP even supposed to mean lol

kind hatch
#

That's what I was going to ask. lol

#

It gives off kernel panic vibes.

tender shard
#

I thought more about sth else lol

vagrant stratus
#

hold plz, uploading lmao

tender shard
#

all I can tell you is your exception was thrown because nms' ItemStack#setCount(int) called nms' ItemStack#updateEmptyCacheFlag() and then came to the conclusion that the emptyCacheFlag flag was set and that the new ItemStack equals ItemStack.EMPTY

#

but why, or what this means, no fucking clue

vagrant stratus
#

I'm not too sure the Mojang devs took this dumb shit into account @tender shard lol

#

hmm, maybe a different command. I'll try that

torn oyster
vagrant stratus
#

@tender shard
If it's give Optic_Fusion diamond 10 it's fine.
kill @e[type=!player] it's also fine

#

but as soon as I kms it's like no lol

#

Maybe I need a blacklist 😂

kind hatch
#

Are you removing the item after the command is executed? Cause that could be the only reason #setAmount() would be called.

vagrant stratus
#

I kill myself, ofc it gets removed

kind hatch
#

I mean manually. It would drop otherwise.

vagrant stratus
#

No

tender shard
#

is the NMS Entity class

#

which method can't it find?

torn oyster
#

these

#

but i think it's cause its using the spigot entity class

tender shard
#

because you're not using mojang mappings

torn oyster
#

it isn't sending

#

hold on

tender shard
#

in spigot mappings, the methods are called a(), b(), c() etc

torn oyster
#

nevermind i'm stupid...

#

it just took a while

vagrant stratus
#

ig if anything I just blacklist certain functionality since server commits die

tender shard
tender shard
#

show your pom.xml pls

#

?paste

undone axleBOT
torn oyster
tender shard
#

whenever I call something "nmsEntity", you must use this import instead of the bukkit one

torn oyster
#

isn't it supposed to use net.minecraft.world.entity.Entity

#

yeah

#

ok it works, thanks

tender shard
#

np

#

don't forget to use mvn package to compile, instead of intellij 😛

#

otherwise the remapping won't work

torn oyster
#

or well - clean package

tender shard
#

yeah many people don't

#

and then they wonder why their pom adjustments dont change anything

vagrant stratus
#

Yea, might just put a blacklist on the plugin lmao

kind hatch
tender shard
torn oyster
#

the -remapped

#

the -remapped-obf

#

the original-

tender shard
torn oyster
#

ok cool

tender shard
velvet viper
#

is there a way to turn off "This message has been modified by the server"?

tender shard
vagrant stratus
#

but yea, literally anything else works @tender shard but as soon as it ends w/ the executor dying it crashes.

I'm guessing something about the death & holding the item that caused it creates issues

vagrant stratus
#

It's literally just PDC handling @tender shard

set PDC, check PDC & run command

tender shard
vagrant stratus
#

Nope lmao

tender shard
#

hm idk

vagrant stratus
#

Literally just a has correct PDC? Yes? Cool, run command that's stored

tender shard
#

no idea, what happens if you, just for fun, catch the AssertionError, then print the full stacktrace in the catch block?

vagrant stratus
#

There's a validation check, but that doesn't cause it since it makes it to right after the command

tender shard
#

oh wait

#

it happens after you killed yourself right?

vagrant stratus
#

Ye

tender shard
#

because then the item will be set to 0

#

since it was dropped

#

the itemstack is gone

vagrant stratus
#

Ah, hmm

#

Doubt that's fixable lol

vagrant stratus
tender shard
#

why do you need to get the PDC value right after you set it anyway, I wonder?

vagrant stratus
#

item interact, can happen any time

#

PDC is just so I don't have to store non-global commands that way it's tied to a specific item instead of the material

tender shard
#

there's surely an easy fix but it's hard to tell without seeing code and I gotta go to bed in... 2 hours ago lol

vagrant stratus
#

hmm, try-catch and it didn't break. Weird

tender shard
#

for example why not just clone the itemstack before executing the commands?

mighty aurora
#
``` Would this run if a player has either the shadowsneak or shadowhunt tag? meaning a player like the one in the screenshot would trigger the if statement?(sorry I just need a sanity check as this doesn't seem to be working)
vagrant stratus
#

tbf I didn't expect a server crash @tender shard

tender shard
#

yeah that's because it throws an Error and not an Exception

vagrant stratus
#

lets try error

tender shard
#

the eventhandler only catches Exception and not Throwable

vagrant stratus
#

Either way, it didn't crash lmao

tender shard
#

Throwable
| - Exception
| - Error

vagrant stratus
#

so I might just try/catch it and leave it lmao

tender shard
#

just check if the itemstack's new amount is 0 before getting the PDC again

vagrant stratus
#

It gets it exactly once

#
        ItemMeta itemMeta = itemStack.getItemMeta();
        PersistentDataContainer container = itemMeta.getPersistentDataContainer();
        Player player = event.getPlayer();
        if (container.has(key, PersistentDataType.STRING)) {
            String command = container.get(key, PersistentDataType.STRING);
            performCommand(player, command);
            return;
        }
tender shard
#

what's performanCommand look like?

vagrant stratus
#
    private void performCommand(Player player, String command) {
        // TODO: Add a fake operator or something so this is still possible without needing to op the player
        boolean wasOp = player.isOp();
        player.setOp(true);
        try {
            player.performCommand(command);
        } catch (Error e) {
            System.out.println("SHIT BROKE, FIX IT");
        }
        player.setOp(wasOp);
    }
#

generic thing, since I cba to make a fake op impl

tender shard
#

instead of souting "SHIT BROKE", do e.printStackTrace()

#

then it should show your plugin in the stacktrace

vagrant stratus
#

I'll shout as much as I want

tender shard
#

yeah but don't you wanna find a proper fix? 😄

vagrant stratus
#

Nothing related to the plugin

tender shard
#

hm then let's go through the whole stacktrace again

vagrant stratus
#

Exact same stacktrace as the original

tender shard
#

send it again please, as text please

#

then I can rund it through the remapping thing

#

and see the actual stacktrace, with mojang mappings

vagrant stratus
tender shard
#

thx

vagrant stratus
#

If anything I just blacklist the ability to commit suicide lol

tender shard
#

okay so
at ItemStack.doUpdateChacheThingy()
at ItemStack.setCount(int)
at PlayerInteractManager.a() which is either getGameModeForPlayer or setGameModeForPlayer or tick() (probably it's the tick() method, or are you changing gamemodes somewhere?

vagrant stratus
#

nope

#

I'll try it in survival though

tender shard
#

do you execute the command when the player tries to place a block?

vagrant stratus
#

It doesn't crash when in survival and yea, but non-suicidal commands don't break it 🤔

tender shard
#

okay I got one step further

#

the third line of the stacktrace is ServerPlayerGameMode#useItem, this line:

#

and yeha, it only runs when in creative

#

so that matches what you said

vagrant stratus
#

huh, wonder if there's a proper fix for this 🤔

#

ig checking for null or something?

tender shard
#

yeah I have to through the whole stack one by one, since the stacktrace doesn't tell me "which" a method they use >.< 😄

vagrant stratus
#

lmao

tender shard
#

it definitely happens while placing blocks in creative mode when the itemstack was already invalidated because it got dropped since you killed the player before the interact manager finished everything. The easiest fix by far would be to run your command on next tick, I guess

vagrant stratus
#

unless md applied a fix to spigot directly, anyways

#

maybe cancelling the block place 🤔

tender shard
#

this can't be fixed at this point without breaking tons of other things, I guess

#

the whole blockplace logic was always weird

#

when you place a block, it gets placed, but when some plugin cancels this event, then the block is basically removed again

#

I always call this schrödinger's blockplace

vagrant stratus
#

lol

#

I'll see if cancelling the fix at least makes it usable lol

tender shard
#

basically the whole logic for calling the blockplace event happens too late in craftbukkit but I doubt that someone will ever change this again

#

but isn't there any problem in delaying the performCommand by one tick?

#

that's definitely how I'd just do it

vagrant stratus
#

Gonna see if cancelling the block place does anything, if not then I'll try by one tick

tender shard
#

oki

vagrant stratus
#

If that doesn't work, blacklist it is lmao

#

Cancelling seemed to fix it

tender shard
#

I doubt that cancelling the BlockPlaceEvent would change anything since it's called after the block was already set

#

huh

#

weird

#

oh wait

#

you cancelled the INTERACT event, right?

vagrant stratus
#

lmao

#

PlayerInteractEvent

#

Yes

tender shard
#

aaaah yes, now it also makes sense why the stacktrace didnt show your plugin

vagrant stratus
#

oh?

tender shard
#

yeah sorry it was so obvious, I was a bit slow

vagrant stratus
#

lmao

tender shard
#

it's such an easy problem

#

Let me explain

#
  1. InteractEvent happens. You kill the player
  2. Server thinks: "Interact wasnt cancelled, so let's go for BlockPlaceEvent now with the following item:"
  3. Item is gone, since you already dropped it
vagrant stratus
#

tldr; Check if itemstack is null, problem fixed in spigot

tender shard
#

yeaaah that might do it

#

it all makes total sense now

vagrant stratus
#

:p

tender shard
#

so we got this fixed now? :3

vagrant stratus
#

Ye, now people can be as suicidal as they want 😂

tender shard
#

great XD

vagrant stratus
#

:p

#

Ahhh, doubt QA expected that shit lmao

tender shard
#

but yeah, I loved this. most people here are like "how can I set lore, its not working". finally this was an interesting problem again

vagrant stratus
#

:3

#

tbf I know coding, just didn't know how I got the server to commit die

tender shard
#

yeah especially if the stacktrace is only NMS stuff

vagrant stratus
#

Praise be shit QA doesn't expect

tender shard
#

I mean I said at the beginning that the itemstack's amount must be zero but i totally overlooked that it was because BlockPlace inevidintly (correct word? idk) gets called after InteractEvent, no matter whether you change the itemstack or not

vagrant stratus
tender shard
#

and then there's barney gumble

vagrant stratus
#

or me "No one would ever think to kill themselves using a command that's on an item"

tender shard
#

oh I can think of many usecases

#

e.g.

#

a revamped pufferfish

vagrant stratus
#

Yes, tell that to the server crash

tender shard
#

has a 10% chance of killing yourself, or 90% chance of tasting delicious

vagrant stratus
#

yea but that doesn't need commands, just setHealth or whatever

tender shard
#

yeah but I mean you could do something like this

my-awesome-pufferfish:
  commands:
    10%: kill %p
    90%: - sendmessage %p Wow, that was tasty!
           heal %p
vagrant stratus
#

true

#

md plz fix

tender shard
#

well

#

`jira

#

?jira

undone axleBOT
tender shard
#

lol

vagrant stratus
#

I haven't signed the CLA

tender shard
#

isnt the jira open to anyone, and only stash isnt open?

vagrant stratus
#

hmmm

tender shard
#

I am not sure

vagrant stratus
#

not even sure I remember my creds lol

tender shard
#

I mean it would really just need to check if the itemstack is equal to ItemStack.EMPTY before continueing

#

it's either only one line, or it's way more complex and unfixable lol

#

although I vaguely remember that a "similar" issue existed

vagrant stratus
#

I'm making an issue lol

tender shard
#

would be worth checking if the same things happens if one doesnt kill the player, but just set the itemstack's amount to 0

#

in the interactevent, without cancelling it

#

because I think, it should also TRAP then

vagrant stratus
#

lets seeee

#

Different one actually @tender shard

#

?paste

undone axleBOT
vagrant stratus
tender shard
#

yeah but that's because you get the PDC

#

I meant just a plain easy thing like this:

#
on interact:
  if is rightclick on block
    currentItem.setAMount(0)
#

and see if that causes this TRAP thing

vagrant stratus
#

Nope

#

Just removes the item

tender shard
#

okay good, then I'd suggest that you report it rn 😛

vagrant stratus
#

That's what I'm doing lmao

tender shard
#

why dont you try it?

vagrant stratus
#

Using PDC to commit die causes the server to crash
best summary

tender shard
#

it doesnt even have anything to do with the PDC

vagrant stratus
#

shhh

#

It's 9 PM

#

rwiorjeiojreioj

tender shard
#

Hm let's try this

#

on interact event:
if is about to place a block:
kill player but NOT cancel interact event

#

i think thats all it needs

vagrant stratus
#
        Action action = event.getAction();
        if (action != Action.RIGHT_CLICK_AIR && action != Action.RIGHT_CLICK_BLOCK) {
            return;
        }
        event.getPlayer().setHealth(0);

yea?

#

That doesn't break the server

#
    @EventHandler
    public void on(PlayerInteractEvent event) {
        Action action = event.getAction();
        if (action != Action.RIGHT_CLICK_AIR && action != Action.RIGHT_CLICK_BLOCK) {
            return;
        }
        Player player = event.getPlayer();
        player.setOp(true);
        player.performCommand("kill " + player.getName());
        player.setOp(false);
}

this doesn't break the server either @tender shard

tender shard
#

no no

#

you're doing it the wrong way around

#

don't check for the action at all

#

oh no wait

#

hmm weird

#

okay then report it as you wanted to earlier

#

including the PDC part

vagrant stratus
#

My guess is it's something related to the ItemStack & it affecting the player holding it

vagrant stratus
tender shard
#

it only happened in creative anyway, right?

vagrant stratus
#

Correct, however this should be fixed nonetheless, since it can be exploited for malicious purposes

#

or non-malicious purposes, if you were doing something

#

e.g. creative server

tender shard
#

some people really don't understand the help-dev forum

#

shit 4am, and I gotta go to a concert today. good night everyone lol

iron glade
#

He works for someone who needs plugins but has no time to learn how to code plugins

#

Asks other people to code it

tender shard
#

i'd do it for... erm... 12 million €

vagrant stratus
#

hmm

#

so er @tender shard
apparently w/o fixes it decides to work as expected tf🤔

snow lava
#

how can i avoid this exception

tender shard
tall crow
#

Help me

tender shard
undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

vagrant stratus
tall crow
#

@tender shard help me pls

tender shard
undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

tender shard
#

here you go ^

tall crow
#

I can't pickup all drop items in server

tender shard
vagrant stratus
#

I'll create a plugin w/o the extra functionality & see if that causes a crash

tender shard
#

I also tried to reproduce it but couldnt

#

very weird 😄

vagrant stratus
#

hmm

#

if I get it working, I'll send you the jar lol

tender shard
#

I just tried some simple stuff like this

#

(while in creative, trying to place blocks)

#

worked fine :/

vagrant stratus
#

I didn't do the health part

#

I'll send you what I did lmao

tender shard
#

oh right

vagrant stratus
#

gimme a sec

tender shard
#

you used the kill command

#

that might change everything

vagrant stratus
#

ye

#

If this jar works I'll DM it lol

tender shard
#

still working fine with "/kill mfnalex"

vagrant stratus
#

hmm

#

gimme a bit lol

tender shard
#

omg @vagrant stratus

#

I feel like this dude in help-server wants to get kicked lol

vagrant stratus
#

?

#

:p

#

Gimme a sec, trying to reproduce this w/o all the extra shit

tender shard
#

it's so weird lol

vagrant stratus
#

?tas

undone axleBOT
mighty aurora
#

I tried it

#

and it doesn't seem to work

lost matrix
#

Or else its interpreted as (x and y) or z

tender shard
#

what even is PacketType.Player.Server.ENTITY_EQUIPMENT

#

what are you trying to do

#

what is supposed to happen

vagrant stratus
#

tf, bare minimum and it still doesn't crash the server

#

weird

#

well..... kind of hard to make an issue if I can't reproduce it reliably lmao

lost matrix
#

Whats broken?

vagrant stratus
#

Trying to figure out why and make it reproduceable lmao

lost matrix
#

The heck?

vagrant stratus
#

Originally it was from me running /kill <my_own_username> on an ItemStack which had it as its PDC, but that same thing is no longer working

tender shard
#

during the interactevent without cancelling it, while placing blocks in creative

#

(important info)

vagrant stratus
#

yea, that too lmao

vagrant stratus
mighty aurora
tender shard
mighty aurora
#

The entire if statement is supposed to make a player's armor and held items disapear. it works but after adding the tag requirement it stopped working. I need it to only be active at specific times though.

tender shard
#

but WHEN is it going to make it disappear? it looks like some kind of protocollib listener?

mighty aurora
#

I use PacketEvents(an api) that without the tag check it will always make the armor and items disapear. after the check its supposed to make them disapear only on players that have the specific tag.

vagrant stratus
#

okay, yea. I still have it reproduceable @lost matrix lmao

#

need to see if I can limit how to cause said crash

tender shard
#

do some debugging and see whether your if statement actually runs. something like this

boolean firstCondition = ...;
boolean secondCondition = ...;
boolean thirdCondition = ...;
System.out.println("first: " + firstCondition);
// same for second and third

if(firstCondition && (secondCondition || thirdCondition) {
  System.out.println("my if runs");
  // other stuff
}
#

then see what it prints

vagrant stratus
#

So, remember the diamond thing @tender shard ?

#

Works as expected when right clicking a block, but as soon as it's air.. server crashes

vagrant stratus
#

hmm

tender shard
#

might be because DIAMOND is an Item while AIR is a block

vagrant stratus
#

Possibly, gonna remove that Action return and see if that does anything lol

#

Pretty sure it's useless anyways unless it's left click lmao

tender shard
#

still wokring fine for me with diamond

#

both with and without chaning the diamond's PDC before killing the player

vagrant stratus
#

Gimme a sec to re-double check w/ my plugin, then I'll send it if it works lol

mighty aurora
# lost matrix yes

So basically I need to make it if ((event.getPacketType() == PacketType.Play.Server.ENTITY_EQUIPMENT) && (p.getScoreboardTags().contains("shadowsneak") || p.getScoreboardTags().contains("shadowhunt"))) {

vagrant stratus
#

@tender shard

steps:

  1. Give yourself item
  2. /commanditem assign kill <your_username>
  3. Right click block, verify it works as expected
  4. Repeat 1 & 2, but rightclick air
tender shard
fossil lily
#

What gameprofile field has the UUID?

tender shard
#

"id"

#

why?

#

this is a weird question

#

I mean why don't you just look at the GameProfile class

fossil lily
#

because im dumb

#

thanks

tender shard
#

np lol

tender shard
vagrant stratus
#

and I'll upload it to JIRA first and apply a temp-fix for the spigot release

tender shard
#

yeah "why" is hard to tell without the full source code and decompiling it is annoying since I can't just throw it into intellij then

tender shard
vagrant stratus
#

The fun part is why, I doubt it's going far into the block place stuff @tender shard

tender shard
vagrant stratus
#

but again, it seems to break only if it's on the PDC @tender shard

#

Remember, we tested that lmao

#

player.setHealth(0) & player.performCommand("kill <own_player_name>") all work on their own, but once it's pulled from the PDC & executed that way the server commits die

ornate zinc
#
     Player player = (Player) sender;
        Location spawnLocation = player.getLocation();
        World myWorld = Bukkit.getWorld("world");
        Zombie zombie = (Zombie) myWorld.spawn(spawnLocation, Zombie.class);

        if(sender instanceof Player){
            zombie.setAdult();
            zombie.setCustomName(ChatColor.RED + "" + ChatColor.BOLD + "Ghost");
            zombie.setCustomNameVisible(true);
            ((Attributable)zombie).getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(100.0);
            zombie.setHealth(100);



            NamespacedKey key = new NamespacedKey(pluginInstance, "our-custom-key");
            
            PersistentDataContainer container = zombie.getPersistentDataContainer();

            if(container.has(key , PersistentDataType.DOUBLE)) {
                double foundValue = container.get(key, PersistentDataType.DOUBLE);
            return true ;
        }
```how can i use  PDC  .i want my zombie(ENTITY) have a data and i need that data to set it custom drop . pls help
drowsy helm
#

so you want a custom drop pool?

ornate zinc
#

no i made a command spawn a custom zombie and i want to change my zombie drop

vagrant stratus
#

still not signing the CLA though lmao

tender shard
#

you'll have to strip everything from your plugin that's possible to strip without the bug NOT happening

#

e.g. I cannot just copy your listener part because it's missing so many other things then

#

so yeah upload it to github or sth

vagrant stratus
#

Yea, that's what I attempted before yet it worked as expected 🤔

tender shard
vagrant stratus
#

Gimme a sec, I'll upload src lol

ornate zinc
#

i have my zombie but i need a special thing (metadata ,pdd or somthing else) to call him in another class

vagrant stratus
tender shard
#

lets try

vagrant stratus
#

That's the above plugin, currently removing a bunch of stuff

tender shard
#

huh

#

when I compile and run this, then nothing happens when I right click

#

and yes, I assigned the command

vagrant stratus
#

oh? 🤔

#

tf

tender shard
#

i gave myself a diamond, held it in mainhand, then did /commanditems assign kill mfnalex

#

then I rightclick and I dont die

#

also no errors

vagrant stratus
#

Gonna try a clean & build

tender shard
#

well I just cloned it 😄

#

but yeah lets try

vagrant stratus
#

this is sus

tender shard
#

nothing

#

it says I assigned it, but nothing happens

vagrant stratus
#

breh

#

did i break it in general lmao

ancient plank
#

Smh

vagrant stratus
#

LMAO

tender shard
#

you fucked up the first part of the listener somehow

vagrant stratus
#

okay, gonna remove that and try again lmao

ancient plank
#

time to make a forceop exploit with your plugin ✓

tender shard
#

after removing the return part, it works perfectly again, without errors or crashes

ornate zinc
vagrant stratus
#

strange

#

tf

vagrant stratus
#

bare minimum, just say ==test in chat

tender shard
#

==test gives me a stone. right clicking air with that, in creative, kills me, no crash

vagrant stratus
#

breh

tender shard
#

and trying to place it just prevents placement

vagrant stratus
#

hmmm

#

ig I'll like.. idk, try updating spigot lmao

#

but that's the exact jar I'm using 😂

tender shard
#

your former .jars also crashed my spigot AND paper

#

but not this one

#

nor the github one

vagrant stratus
#

weird

#

tf

#

hold on, I'll give you my jars SHA1 lol

tender shard
#

I really gotta go to sleep

#

it's 5.20 am now lol

vagrant stratus
#

I lied, md5 2D058D1DB921B26B3F130B4C9B36E311

vagrant stratus
#

lmao would of been faster to just verify the md5 hash lol

tender shard
#

of what?

#

of your crash.jar file?

vagrant stratus
#

Ye, see if I provided the right one lol

#

Fucking weird if it's the same one but has issues being reproduced

tender shard
#

its the same md5

vagrant stratus
#

REJRIOEWJKREIJRIOEWJRIOWEJRIOEJRIOEW

tender shard
#

2d058d1db921b26b3f130b4c9b36e311 */c/mctest/plugins/Crash.jar

vagrant stratus
#

weird, go sleep I'll bug you about the issue report later lol

tender shard
#

ill try once more, on spigot

#

last try was paper

#

but your ealier thing also crashed on paper

vagrant stratus
#

hmm, happen to remember which lol

tender shard
#

HAH INDEED

#

on spigot your Crash.jar crashes

#

by rightclicking air

vagrant stratus
#

So it seems like paper fixed it, while spigot still has said issue

tender shard
#

I gotta admin, my spigot 1.19.2 is a few weeks old though

#

admit*

vagrant stratus
#

I'm latest afaik and it crashes still

tender shard
#

I'll build it again rn

vagrant stratus
#

lmao so much for sleep

tender shard
#

i said that I'll go to sleep now since 4.5 hours soooo

#

lol

vagrant stratus
#

😛

tender shard
#

another 5 minutes "won't make the roast any fattier" as we say in germany lm ao

vagrant stratus
#

:3

tender shard
#

ok done

#

lets see

#

yes, still happening