#help-development

1 messages Β· Page 238 of 1

twin venture
#

i want it only when a player open a chest

white root
#

Easy as that

wet breach
#

I did listen you tried to tell me that it was impossible to lose data even if a connection is live

#

I explained to you how it was not

#

you didn't accept it

eternal oxide
#

If data Is lost the connection dies, so no live connection. It is impossible to lose data over TCP with a Live connection

tardy delta
#

e.getView().getTopInventory()

twin venture
#

what does that do?

tardy delta
#

gets the top inventory, might check the type there

vagrant stratus
#

Time to screw with mysql lmao

wet breach
midnight shore
#

how does shading work?

placid birch
#

Why did you put player in paranthesis? I am aware this is a beginners question but just trying to learn

eternal oxide
wet breach
#

anyways I am not going to talk with you further because you are obviously outdated on your information

tardy delta
placid birch
#

Think i got it. Thanks

twin venture
#

because InventoryOpenEvent give Human entity , so you need to cast it

eternal oxide
#

lol TCP has not changed in many decades

twin venture
#

to Player

gray merlin
#

Ah I see, we can't overwrite vanilla valued with pdc. I assume that if we want to do that, we're still going to have to work with NMS?

midnight shore
#

Why do i get this error when i have an artifact?

wet breach
#

must not worked with enough connections or worked outside of the actual data center

eternal oxide
remote swallow
twin venture
#

or is there a better way?

tardy delta
#

isnt there a getType

placid birch
#

Thanks for helping me understand morice! πŸ˜€

twin venture
twin venture
tardy delta
#

hmm my parser doesnt seem to like precision

#

might wanna add a mode to calculate with bigdecimals

tardy delta
twin venture
#

alr

tardy delta
#

looks like overflow tho

twin venture
#

can i do ?

#

if its not chest , then return

#

alr that's better

#

i learned that the hard way xd

tardy delta
#

its lookin hot

wet breach
#

read up, in there it states intentional packet loss is a thing by routers that are outside of your control and no you won't simply just disconnect

twin venture
#

long story short , iam trying to do something that is a bit hard to do ..
so in skywars , there is islands chest , and center chests , iam trying to first player that open a center chest reward him [finish the Challenge]

wet breach
#

it depends on your logic code for such things

twin venture
#

ok but there is a problem with something ..

wet breach
#

whole wiki just for packet loss and all the ways you can lose packets

twin venture
#

if i open a

wet breach
#

that have nothing to do with your code πŸ™‚

twin venture
#

gui thing , it will run the code

wet breach
#

Also, nothing you can do about packet loss when it is the stuff in the middle choosing to do it

echo basalt
#

y'all mf boomers won't stop arguing

tardy delta
#

insert Map<Inventory, CustomGui> here

eternal oxide
# wet breach https://en.wikipedia.org/wiki/Packet_loss

Lol you still don't get it. I never said packets can;t be lost, I said data can;t be lost with a live connection. TCP is a connection based error corrected protocol. If it finds it impossible to send a packet the connection is dropped. If a packet is lost it is resent. If a packet is received out of order the missing packet is requested. It is IMPOSSIBLE to lose data with a LIVE TCP connection.

twin venture
#

something like this

#

but without foreach ..

gilded seal
#

W

eternal oxide
#

lol

remote swallow
gilded seal
#

and essentials

#

where would we be without ElgarL

#

🫑

twin venture
#

found something πŸ˜„

tardy delta
#

tf am i looking at

twin venture
#

some code for the event xd?

tardy delta
#

exposing collections meh

#

love it when all of my tests are working except a big chunk of these ones

gilded seal
#

LMAO i was gonna say sth

#

not today ill be gentle

tardy delta
#

get ninjad

twin venture
#

darn it , it still send the code !

tardy delta
#

make that a for each lol

twin venture
#

me?

tardy delta
#

no that alien next to me

gilded seal
#

replace return; with continue;

#

unless im missing the point ive just joined

#

oh

twin venture
#

eb i know it

gilded seal
#

ignore what i said

twin venture
#

i must do the other thing , damt ..

tardy delta
#

someone give me some nested expressions lol, like (5*((3+4)%6)) i need to test my parser, got these already

#

looks like everything is working fine so im out of ideas

#

not taking operator priority into account

#
  • or / whatever
#

its doing it all from left to right

twin venture
#

so technaccly i can use it like this right xd?

#

so if its not the same , it will return ? from what i understand?

tardy delta
#

well thats 21 because it sees the parentheses

twin venture
#

i see

#

i already know that

tardy delta
#

3+4*2 would result in 14 instead of 11

#

thats why i need to rewrite my solving algorithm

#

its just a bunch of if elses now

remote swallow
#

is it bidmas or bodmas

tardy delta
#

already got an idea but its awful

rough drift
#

what's the event to stop item frames from popping-off mid air

tardy delta
#

should be comparing a calculation in pairs of one operator and two operands

3 * 4 + 5
(3*4)-> operator priority 1
(4+5)-> operator priority 2
the first one is higher so it can be executed
otherwise wait and solve the next```
#

its a mess

round finch
#

i learned a new command

#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
round finch
#

this for the noobs

tardy delta
#

aka you

remote swallow
#

how the hell did they type the first one withou tit becoming a code block

round finch
#

you got me 😦

#
System.out.print("Hello java format")
tardy delta
#

lmao

#

man writing python

round finch
#

haha

tardy delta
#

really dont know how to begin lol

gray merlin
#

Question: Is there a limit for how big my strings can be in pdc?

tardy delta
#

rule 1 is to never touch ancient code and i broke it

#

"a".repeat(Integer.MAX_VALUE) hehe

#

exactly

#

but it doesnt work as expected

#

might aswell works with two stacks

round finch
#

__ self __

glass tangle
#

that's many edits

round finch
#

wouldn't allow me.....

fluid cypress
#

player.setGamemode doesnt work on PlayerChangeWorldEvent, any idea how to deal with it?

#

it doesnt work on PlayerJoinEvent either

gray merlin
tardy delta
#

just discovered IntPredicate exists

glass tangle
#

nice

tardy delta
#

nice and clean tho

fluid cypress
#

i would assume it depends on the client and how long it takes to load, not on the server, maybe there is a client put on world event or something?

fluid cypress
#

really?

#

umm

#

let me check

twin venture
#

so iam creating something :

  • first player open a chest give him reward , i was thinking about creating a list with Integer , and add the Arena.getplayers.size , after that i check :
    int first = firstplayer.get(0);
    if (firstplayer.size() == first) {
tardy delta
#

loopcondition

round finch
#

wait you can use -> true

#

?

gray merlin
tardy delta
#

i use it to create a new expression that only reads between ( and )

#

aka how i handle parentheses

gray merlin
#

It's the event you asked for, and i'm using setGameMode there

tardy delta
twin venture
#

alright will try it ..

fluid cypress
undone axleBOT
gray merlin
tardy delta
#

damn 13ns when no jit compiling is involved

#

2nd run is probably like 80Β΅s

#

love the jit compiler

round finch
#

if i'm lazy ? doWork

tardy delta
#

anyways gn

#

why has there to be college tmrw

#

i gotta fix that im not there so i musnt do my presentation

gray merlin
#

THANK YOU

#

I COMPLETELY FORGOT ABOUT MINE

#

PFFT-

round finch
#

back to study sql sadge

tardy delta
#

i forgot about my assigment webdev

#

probably got 0/10 now

#

ill cry about it

#

i made it but i was four hours to late

round finch
#

at less not -10/10

tardy delta
#

gn

round finch
#

but oof

fluid cypress
#
@EventHandler
public static void onPlayerChangedWorld(PlayerChangedWorldEvent event) {
    System.out.println("hi");
    event.getPlayer().setGameMode(GameMode.CREATIVE);
}
[18:06:13 INFO]: misdocumeno issued server command: /mvtp world
[18:06:13 INFO]: [DatabaseInventories] [STDOUT] hi
[18:06:18 INFO]: misdocumeno issued server command: /mvtp world_nether
[18:06:18 INFO]: [DatabaseInventories] [STDOUT] hi

it may be bc of multiverse now that i think about it

#

i know it sets the gamemode too

#

so i should delay it

#

is there a command to tp to another world without multiverse?

remote swallow
#

essentials has /world iirc

#

that too

fluid cypress
#

yea, it was bc of multiverse

#

didnt know that, ill try it

gray merlin
#

Question: Is there a limit for how big my strings can be in pdc?

fluid cypress
#

yea idk why it does that, ill add that permission to everyone

river oracle
remote swallow
#

thankos the new cereal coming to a store near you

#

yes

twin venture
#

Hello just a nop question , if i add 1 elemnt , to a hashmap , will the size be 0 , or 1 ?

#

obviussly it will be 1 , but in java will it start from 0 as one , or 1 as one ?

#

alright thanks for answering ..

#

i see this chat is active , this last few day's i really like how you guys helping people with their questions , keep it up πŸ˜„

#

and in on finish i clear it ..

#

in what prespective xd?

sterile token
#

Why shity Stream#map() is not finding the EvenPriority#priority() from my annotation?

twin venture
#

that's the only way , i can add the chest

twin venture
#

first player that open a middle chest

#

that's what iam trying to do

#

only first

#

its quest plugin , and a quest that when first player open a center chest , it will finish the quest

sterile token
river oracle
twin venture
#

well it should only be the first ..

river oracle
#

moresoe meant that rather than the annotation

sterile token
#

Dont worry bro i fixed that

#

Just need to fix that - But thanksbroda

twin venture
#

ideas xd?

river oracle
sterile token
twin venture
#

its not my api , iam using UltraSkyWars Api .

#

that's how he named it xd

gray merlin
#

Question: Is there a limit for how big my strings can be in pdc?

wispy flicker
#

Hey guys big newbie here, trying to make a packet only entity. Could i get some assistance?

river oracle
#

you know this guy is about to store unholy amounts of data in PDC

ivory sleet
gray merlin
#

but idk the limits

#

are there downsides to storing unholy amounts though?

quiet ice
#

You can def. store more than 32(*4) bytes on it

river oracle
#

bruh just didn't do the math

#

128bytes

gray merlin
#

oh is that the limit? i see, thanks!

quiet ice
#

The math changes depending on whether you are talking in C-chars or java codepoints

river oracle
#

I can't wait to store a Player Object in my items PDC

#

serialize a world in PDC πŸ’€

quiet ice
#

For C-chars a 32 char long string would be 32 bytes long. With java chars it'd be anywhere between 32 to 128 chars depending on the encoding and with java codepoints (ints) it'd be 32 to 128 chars depending on the encoding and data

gray merlin
river oracle
#

I wonder what would happen if I scraped Google stock prices all time and stored all the data into PDC

river oracle
graceful holly
#

Hey, someone can help me, i'm on maven and i can't use that :(

<dependency>
  <groupId>org.bukkit</groupId>
  <artifactId>craftbukkit</artifactId>
  <version>1.15-R0.1-SNAPSHOT</version>
  <scope>provided</scope>
</dependency>
river oracle
#

πŸ’€

#

no words

vocal cloud
#

Craft bukkit? In this economy?

river oracle
#

^

river oracle
#

❀️ your welcome next time the search engine is very useful

vocal cloud
#

Also 1.15

quiet ice
river oracle
#

yea there are a lot of problems

quiet ice
#

Nothing wrong with depending on cb

river oracle
#

why

serene sigil
#

how do u implement nms in a spigoit plugin?

gray merlin
river oracle
#

why would you ever do that

quiet ice
#

Spigot and cb aren't that different

river oracle
#

personally I use interfaces

remote swallow
quiet ice
#

cb and bukkit on the other hand, large difference

river oracle
#

but some people use pure reflection

undone axleBOT
quiet ice
#

If you use spigot, there is no need for the spigot repo

#

Since you are guaranteed to have the spigot-api (which spigot depends on) in maven local

river oracle
#

I'd reccomend it but you don't have to

serene sigil
#

where are they?

river oracle
#

you run buildtools with the --remapped param

serene sigil
#

in the same folder?

torn shuttle
#

javascript is the most scuffed language on earth

serene sigil
#

true

round finch
vocal cloud
#

Typescript has entered the chat

hybrid spoke
#

brainfuck has entered the chat

vocal cloud
#

Shakespeare is a better eso

torn shuttle
#

you can talk about esoteric languages until your faces turn blue, javascript is worse because it's actually used

serene sigil
#

@river oracle

remote swallow
#

that would be correct

serene sigil
#

but there is an error

remote swallow
#

reload maven

fluid cypress
#

how can i know the level and xp of an offline player?

serene sigil
#

u gotta get it when they leave

#

i think

#

maybe store the uuid in a list until they join back?

fluid cypress
#

why? is that stored client side or what?

serene sigil
#

?paste

undone axleBOT
serene sigil
sonic goblet
fluid cypress
#

ok

#

is there a way to "fake" a player connection?

remote swallow
fluid cypress
#

maybe i can access their xp with that player object

remote swallow
#

might cause some errors on some methods but what you need it for should work

fluid cypress
#

you mean cast?

remote swallow
#

yeah

#

its late and my brain isnt functioning properly

serene sigil
fluid cypress
#

it has to be stored somewhere

serene sigil
#

oh nvm

fluid cypress
#

yea, i get an error when trying to cast offlinePlayer to Player

#

ok, but there is no way to make minecraft believe that a player joined the sv?

#

so it creates the player object and all that

#

why

quiet ice
#

There are limitations to that

#

Mainly that you can't store something from the past

fluid cypress
#

i will store it myself, the thing is i need to know the xp now for that

quiet ice
#

The only issue really is how does one want to read those files. There are probably libraries out there, but those are limited

fluid cypress
#

i dont want to reset everyones level and xp

quiet ice
#

And you can't fake the connection on online-mode servers afaik unless you go into really cursed territory

fluid cypress
#

its offline, just me and some friends, and friends of friends, i could literally join with their names, but i want to automate it

undone axleBOT
quiet ice
#

Eh, you are better off getting some NBT library and reading it from the playeruuid.dat file

fluid cypress
#

yea, i guess ill do that

#

tho, also, for some reason, since upgrading mc versions in the past, there are plugins, like the ones to sell regions, that cant get the name of a uuid

#

but its fixed when the player connects again

#

so, making a fake connection would help with that too, so id like to know how to do that, if possible

quiet ice
#

Most likely because the player is purged from the player name cache

round finch
#

sql join and inner join?
i'm a little confused

quiet ice
#

It's all fine and all but first you gotta get the player entity attached to the player

round finch
#

learning sql for plugins and java applications

quiet ice
#

sourceforge

fluid cypress
quiet ice
#

If "everything" means outdated

round finch
#

ye things changes

quiet ice
fluid cypress
#

so, if i understood correctly, all the nbt tags are stored in that .dat file, as if it were an array or something

fluid cypress
#

and it would be a matter of reading the proper offset, right?

#

and an NBTCompound is like some kind of object? what does it use as a delimiter?

eternal night
#

delimiter ?

#

there isn't a need for a delimiter

fluid cypress
#

so how is it stored, i dont get it

quiet ice
fluid cypress
#

on the player .dat file for example, the first byte is OnGround

#

the second byte is sleeping

quiet ice
#

Those are all binary-encoded objects

#

Not truely

fluid cypress
#

then a short, 2 bytes

eternal night
#

there is no order defined here

#

this isn't a hard coded format for fields and data location

#

it is arbitrary data storage

#

you have to parse the entire thing and traverse it in memory

fluid cypress
#

mmm ok so

fluid cypress
#

i would have to do

quiet ice
#

Yeah

fluid cypress
#
NamedTag playerData = NBTUtil.read("<uuid>.dat");

and then

#

and then what

quiet ice
#

But all these entries are named

eternal night
#

grab the entry you want by its name

#

Β―_(ツ)_/Β―

quiet ice
#

So playerData.get("XpTotal") (or something along the lines of that)

fluid cypress
#

so getByte, getShort, etc, and using a key

quiet ice
#

Yeah

fluid cypress
#

ok, ill do that, thanks

#

now, about the user names cache

fluid cypress
quiet ice
#

Is the decompressed data for example

#

(so you might need to decompress the NBT first I am afraid)

fluid cypress
#

NBTUtil.read() reads any file containing NBT data. No worry about compression, it will automatically uncompress gzip compressed files.

quiet ice
#

In that case you are in luck

round finch
#

wait a sec
you can reset player havn't slept time?
why did i never think to do that

quiet ice
fluid cypress
quiet ice
fluid cypress
#

if its inside the wolrd folder, then indeed it was deleted

quiet ice
#

Yeah

fluid cypress
#

mmm

quiet ice
#

world/playerdata

fluid cypress
#

yea ive done some stuff with that

#

i guess it uses the file inside the world with the name in server.properties -> level-name?

quiet ice
#

No idea. Anyways, I urgently need to go to bed now. Cya!

fluid cypress
#

ok thanks and gn

sterile token
#

@bright plover send error on

#

?paste

undone axleBOT
bright plover
round finch
#

please use link the love of god

#

thanks!

bright plover
#

alright alright

sterile token
#

Where iam?

bright plover
#

my bad

sterile token
#

This is not paper πŸ’€ πŸ’€

round finch
sterile token
#

First read code "io.papermc"

#

🀒

bright plover
#

i cant use this for paper help?

sterile token
#

Definitly not!

round finch
#

omfg

#

the bot

sterile token
#

what?

#

The bot is down?

round finch
#

idk it used to work

sterile token
#

?whereima

#

?whereiam

#

yeah used to work

eternal oxide
#

?whereami

humble tulip
#

Lmaooooo

round finch
sterile token
fluid cypress
#

can i read the config from another plugin?

kind hatch
#

Yes, just point to the file path.

fluid cypress
#

you mean manually?

eternal night
#

I mean, the main config is also available from the instance of the plugin

#

if you have that

fluid cypress
#

cant i just do getServer().getPluginManager().getPlugin("").getConfig() or something like that?

eternal night
#

yea

round finch
#

ye if it is accessible

fluid cypress
#

meaning?

round finch
#

or good luck with fields

fluid cypress
#

getPlugin not returning null?

humble tulip
#

yes or JavaPlugin.getPlugin(Plugin.class).getConfig();

round finch
#

noob detected

humble tulip
#

plugin.class is the main class of the plugin you wanna get

fluid cypress
#

if i do config.getBoolean or something like that with a nested prop, like, settings.something.blabla, will it return null if none of that exists? or will it throw an error and it only returns null if at least settings.something exists?

humble tulip
#

I think it returns false by default

fluid cypress
#

mm

#

right

#

well, now the same question but with strings then

eternal oxide
#

Always javadoc```
getBoolean
boolean getBoolean(@NotNull
String path)
Gets the requested boolean by path.

If the boolean does not exist but a default value has been specified, this will return the default value. If the boolean does not exist and no default value was specified, this will return false.

Parameters:
path - Path of the boolean to get.
Returns:
Requested boolean.```

maiden thicket
#

😭

round finch
#

ez make it exist

maiden thicket
#

shouldn't it be

round finch
#

smh

maiden thicket
#

if the path does not exist

round finch
#

then make it exist

eternal oxide
#

javadoc tells you, just read it

round finch
#

set Path and vaule
if it doesn't exist

#

before getting it

maiden thicket
#

oh the boolean does not exist as in the value 😭

echo basalt
#

taah is blind

round finch
#

.set("path", true);

#

not that freaking hard bruh

#

remember to save

#

plus you can do a null check

maiden thicket
echo basalt
#

πŸ‘¨β€πŸ¦―

maiden thicket
echo basalt
#

addDefault

maiden thicket
#

i prefer the name getOrSet

echo basalt
#

sounds confusing

maiden thicket
#

πŸ™πŸ½

echo basalt
#

I commited a major mistake in actually opening up my NMS guide and continuing writing a bit

#

100 lines in and I'm barely scratching the surface

maiden thicket
#

just write faster lol

echo basalt
#

I started talking about how TCP headers work

round finch
#

BE_KannaScary NMS

#

oh god

maiden thicket
#

M&Ms?

echo basalt
#

sure

#

currently at this stage

round finch
#

i like the survey

dry forum
#

````Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftRotatable cannot be cast to class org.bukkit.block.data.Rotatable```

        ```Rotatable bmeta = (Rotatable) block.getState().getBlockData();
        section.set("facing", String.valueOf(bmeta.getRotation()));``` im trying to get the rotation of a block
eternal oxide
#

what block are you testing?

#

sign?

dry forum
#

it could be any block but im testing with stairs

eternal oxide
#

stairs are not rotatable

dry forum
#

wdym?

dry forum
#

i just wanna get the direction a block is facing and stairs can face a dirrection

eternal oxide
#

yes, Directional not Rotatable

dry forum
#

when i cast to directional i get the same error

#

but with directional cast

eternal oxide
#

Works fine for me on Stairsjava Directional dir = (Directional)loc.getBlock().getBlockData();

warm trout
#

What's that website where I can see the nms obfuscations for each version

#

I forgot what it was called

vestal matrix
river oracle
#

is there a good way to do custom block textures without raytracing with armor stands and player heads

#

or is it still hacky hell for blocks

fervent panther
#

I'm trying to create a system like hypixel skyblock where weapons and armor have attributes like "2x Lifesteal" or "+15 Lifesteal" which all get added up. In this case I would get 30 lifesteal. How would you guys go about doing this?

dry forum
#
            for(int z = (int) e.getBlockPlaced().getZ() - 11; z <= (int) e.getBlockPlaced().getZ() + 11; z++) {
                e.getBlock().getWorld().getBlockAt(x, e.getBlock().getY() - 1, z).setType(Material.RED_WOOL);
            }
        }``` makes a square of red wool but i just want to make it a border of red wool, how would i do this
river oracle
#

that seems like fairly simple math you just have to skip iterations in the second for loop as long its not the last and first iteration

tulip nimbus
# fervent panther I'm trying to create a system like hypixel skyblock where weapons and armor have...

You could parse the lore line by line and if the line has β€œx”, extract the numerical value and use it as a multiplying factor whereas if it has a β€œ+” extract the numerical value and use it as an adding factor. Multiplying and adding factors can be stored in arrays I guess? You can extract the numerical values by splitting the lore string.

Just make sure to use order of operations and multiply after doing all the additions.

river oracle
river oracle
#

?pdc

tulip nimbus
#

Oh that’s really cool, I didn’t know about it

river oracle
#

PDC offers a Map like operations. TBH I think a custom PDC type could work here best

dry forum
river oracle
#

you should sometimes just figure logic out yourself

#

especially something this simple

dry forum
#

i havent done something like this before and i dont know what to do which is why im here

river oracle
#

your working with 2d system here so thats why you got 2 loops

#

if you want a full first row and last row to make the top and bottom of the rectangle/square

#

and the hollow insides of the rest of the rows

#

seems like a simple if statement to me

dry forum
#

i just want the square to be hollow

#

not a full on cube

river oracle
#

I never said cube

#

the only thing you need is one if statement

#

x == 0 || x == x+11

fresh timber
#

so I have a variable that has many players in it and an integer stat and you can obtain the stat by putting in the player's uuid one at a time and I want to make a list of the top 10 of these players does anyone know how I can do this

river oracle
#

would be the boolean header

river oracle
#

I'll show an example

fresh timber
#

mk

dry forum
#
            for(int z = (int) e.getBlockPlaced().getZ() - 11; z <= (int) e.getBlockPlaced().getZ() + 11; z++) {

                if (x == 11) {
                    e.getBlock().getWorld().getBlockAt(x, e.getBlock().getY() - 1, z).setType(Material.RED_WOOL);
                }
            }
        }``` now no blocks are set & ```x == x+11``` is always false
river oracle
#

looks like your best option is a TreeMap

fresh timber
#

ok

river oracle
fresh timber
#

oh nvm that will actually work the same

river oracle
#

You might have to use a bimap tbh

quiet ice
#

You cannot Sort hashmaps without creating another map

#

Well I guess one could Copy the Keyset as a list and then sort that but that has it's inefficencies

sinful wave
#

To update players belowname health value should I run a task that fires very often? If so, how often should I update?

hybrid spoke
sinful wave
#

ik the belowname can be set through a scoreboard

#

but how would i go about updating this

hybrid spoke
#

it does by itself iirc

sinful wave
#

im confused bro

#

i thought a scoreboard was a constant

#

that had to be updated

wet breach
#

not everything in a scoreboard needs manual updating, it just depends on what it is and whether the scoreboard supports it already or not lol

earnest forum
#

health for example

#

can be automatically done using scoreboards

sinful wave
wet breach
#

hmm

#

?scoreboard

#

thought maybe we might have had a command

#

can't really vouch for quality, but nonetheless should still be able to learn something between those two

earnest forum
#

ik its possible using in game commands

#

idk how its done using coding

undone axleBOT
twin venture
#

Good morning , i finished all quests for skywars , i only have 3 challenges left ..
its the hardest , i tried allot of things , and it still not working probbly the challenges are left is :
1- drop 2 player's into void and when they die , will you get the challenge done .
2- this one is a bit hard : when a player collect 8 ender pearl , finish the challenge.
3- if the player is the first one to open a center chest , then finish the challenge ..

i worked on number 2 , 3 .. but didn't really finish them

#

anyone have ideas on how to do these challenges?

#

i have the core code , for registering the challenge , guis , etc everything finished , iam talking about the event part ..

hybrid spoke
#
  1. check if the last damage cause is void
  2. listen to pickupitemevent and count for each player
  3. do i even have to explain this?
twin venture
#
  1. will the pickupitemEvent be triggered when you take an item from the chest?
  2. there is islands chests , and center chest
hybrid spoke
#

no,
keep track of the center chest then

#

?jd-s

undone axleBOT
twin venture
#

why internet on my pc just cut off xd?

hybrid spoke
#

ddos

twin venture
#

why no internet 😐

twin venture
twin venture
hybrid spoke
#

an NPE isnt "plugin development specific"

twin venture
#

i hope you understand xd

#

InventoryOpenEvent maybe?

#

or PlayerInteractEvent , get the block , and the type?

hybrid spoke
#

nullpointerexception

twin venture
#

hhh xd

#

yes

twin venture
hybrid spoke
twin venture
#

what do you think the best aproch for this

#

there is also a map with loc , and chest

hybrid spoke
#

i would probably use the PlayerInteractEvent and have a boolean somewhere which you simply set to true once a player opened a center chest

twin venture
#

how would that work?

hybrid spoke
#

just like i wrote it

#

somewhere you will most likely have a GameHandler or whatever

twin venture
#

something like this right?

#

but need a boolean

hybrid spoke
#

i mean your api doesnt makes sense to me but anyways, you should have a central point for your game session or whatsoever where you can put a boolean hasCenterChestBeenOpenedYet.
once a player opens a chest, Γ‘ rightclicks, Γ‘ PlayerInteractEvent at a center point, which you stored, check if the boolean is false and if, set it to true and reward the player.

tender shard
#

btw do not call your event handler "interact", but rather "onChestOpen" or something similar

pseudo sluice
#
 SELECT * FROM player WHERE uuid = e0b0c9be-944b-43c1-a84f-54c48a25c4e7
[2022-11-28 16:46:43] [42S22][1054] (conn=37) Unknown column 'e0b0c9be' in 'where clause'
#

why is it only taking the first part of the uuid

hazy parrot
pseudo sluice
#
    public PlayerStats findPlayerStatsByUUID(String uuid) throws SQLException, ClassNotFoundException {
        Statement statement = getConnection().createStatement();
        String executeCommand = "SELECT * FROM player WHERE uuid = " + uuid;
        System.out.println(executeCommand);
        ResultSet results = statement.executeQuery(executeCommand);

        if(results.next()){

            long firstLogin = results.getLong("firstLogin");

            PlayerStats playerStats = new PlayerStats(uuid, firstLogin);

            statement.close();
            return playerStats;
        }

        return null;
    }
#

this is mariadb btw

wise pumice
#

Hello, is there any good way to create nametags above the player or some api besides nametagedit?

ivory sleet
#

TAB + luckperms usually works (maybe you need vault also idr) (or well at least PAPI)

weak token
#

Hey, I am trying to build my Minecraft spigot plugin with Maven, but I receive this error:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM [my POM-path]: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1)  @ line 1, column 1
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project  ([my POM-path]) has 1 error
[ERROR]     Non-parseable POM [my POM-path]: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1)  @ line 1, column 1 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException

Here is my pom.xml: https://hastebin.com/nigiqaxixe.xml

hybrid spoke
weak token
wet breach
#

check file endconding

#

it is the only thing I can think of

#

also, it does no good that you pasted the pom to a paste site

#

as this doesn't actually let us inspect the actual file

#

odds are if you copied the contents from the paste site back to your original pom it may just fix your problem

hybrid spoke
#

just write a program that replaces any \u0 with

wet breach
#

only thing I can say then is check file encoding

#

or delete and remake the pom file

#

I don't have the file, so I can't really say what it might be etc

weak token
#

I created a new project with the same main class etc. and copied the pom.xml to my old project. Works now and I have no idea why

wet breach
#

could have been the IDE then being dumb

weak token
#

so frustrating

tender shard
#

no idea why lol

tall dragon
#

Does any1 here know how one would make furnaces faster. Say like x2 speed. ?

tender shard
#

Furnace interface has a method "setCookTime"

#

but

#

you could also loop over all registered furnace recipes and set their smelt time to currentSmeltTime / 2

#

that's probably the easiest solution I guess

#

FurnaceRecipe has an integer called "cookingTime" (which probably is in ticks)

tall dragon
#

Each player has a personal furnace

tender shard
#

oh well. Okay, then you have to do it like this I guess:

  1. Whenever a player puts something in a furnace (InventoryClickEvent or however it's called)
  2. check if it's a player who has this "fast cook" feature
  3. Set cooking time to maxCookingTime/2
#

that should do it

#

but

#

that would only work if they only cook 1 item, not for a full stack :/

tall dragon
#

Ahhh thats friking unfortunate

tender shard
#

If you wanna do it per-player and for a full stack, then it gets a bit complicated

#

you need a runnable that does this for every new item

tall dragon
#

Do you think i could just somehow tick the furnace manually?

tender shard
#

I don't think so. I mean, you could ofc, but then the GUI would be fucked up

tall dragon
#

Rightt..

tender shard
#

Do you really want to do it "per-player" or just "per-furnace"?

#

E.g. imagine only mfnalex has "fast-cooking" perms, then I'd simply make every furnace faster that mfnalex "placed", and not every furnace that mfnalex "uses"

#

then it'd be quite easy

tall dragon
#

Well the furnaces dont rlly exist in the world. Its sort of an "ender furnace" that just opens when u click a furnacr

tender shard
tall dragon
#

So its per player ig

tender shard
#

well if you want to do it per-player, then

#

erm

#

do you also care about hoppers?

tall dragon
#

No

tender shard
#

or only about "normal" interactions with this furnace?

#

ok

#

then I would do it like this:

tall dragon
#

Only normal

glossy venture
#

cant you match the recipe and put the result manually

tender shard
#

Whenever someone puts something inside the furnace, store the dude who did it (their UUID) using the lib I sent above directly inside the furnace

#

then schedule a runnable and always just add maxCookTime / 2 to the cookTime when it starts

#

and when someone else interacts with this furnace (puts something inside), you just reset the UUID

glossy venture
#

yo how can i get the 5 if i have a permission set a.b.5

#

maybe luckperms api

tender shard
#

you can do player.getEffectivePermissions() or sth like that

#

then loop over that, and check if it startsWith("a.b.")

#

that's how it's usually done

glossy venture
#

doesnt sound very fast

tender shard
#

well how often are you going to check it?

glossy venture
#

if luckperms has a node based permission structure i can probably use the api

tender shard
#

not everyone uses luckperms though

tall dragon
glossy venture
glossy venture
tender shard
#

especially big servers very often are still using PermissionsEx etc

#

oh ok

#

well anyway, it's not slow - I would only worry about it once it causes lag

glossy venture
#

ill make a util function so i can change it later

#

ill use your method for now and see how it goes

wet breach
#

this is how I do perms

#

even for perms that are unknown

glossy venture
#

using vault sus.* should work

#

for checking sus.a

tender shard
glossy venture
#

yeah

tender shard
#

(This will ofc only work if a player only has exactly one a.b.5 perm)

glossy venture
#

thahhnsk

tender shard
#

if they can have more, then you have to create a list or sth before returning it

tall dragon
tender shard
#

I didnt know that this event exists

tender shard
# glossy venture thahhnsk
    public static int getMaxPlayerValue(Player player) {
        int value = 0;
        for(PermissionAttachmentInfo perm : player.getEffectivePermissions()) {
            if(perm.getPermission().startsWith("a.b.")) {
                value = Math.max(value, Integer.parseInt(perm.getPermission().substring(4)));
            }
        }
        return value;
    }
#

this should work even when they have more than one perm called like that

#

and it should always return the max value

#

and you really don't have to worry about performance tbh

#

unless you call this 185162 times per tick

glossy venture
#

actually i bet ill have to use luckperms api anyways

#

i need to get this for a uuid

#

as well

tender shard
quaint mantle
#

Hey guys, How Can I remove entity even where unloaded chunk?
I tried like below but it didn't work

     armorStand.getLocation().getChunk().setForceLoaded(true);
      armorStand.remove();
tender shard
quaint mantle
#

Yeah I knew that already

tender shard
#

you first of all have to load the chunk. You can use a plugin ticket to force load a chunk

#

I think that setForceLoaded does not load it immediately

#

but I am not sure

quaint mantle
#

ahh hm...

tender shard
#

are you on 1.16+?

quaint mantle
#

yeah 1.19.2

tender shard
#

Chunk#addPluginChunkTicket(Plugin) or sth like this

quaint mantle
#

Oh thx I'll try it

tender shard
#

np, if this doesnt work, lemme know pls

quaint mantle
#

okk

tender shard
#

you can also force load a chunk by simply doing World#getChunk(int,int)

#

but that requires the CHUNK coordinates and not normal world coords

quaint mantle
tender shard
#

you don't have to force load it if you only need it for one tick

quaint mantle
#

andddd I'll try like this

      Chunk chunk = armorStand.getLocation().getChunk();
            chunk.addPluginChunkTicket(SkyExcelNetworkMain.getPlugin());
            armorStand.remove();
tender shard
#

you can basically do sth like this:

Entity entity = ...;
Chunk chunkWhereThisEntityIs = entity.getWorld().getChunkAt(entity.getLocation().getX() / 16, entity.getLocation().getZ() / 16);
entity.remove();
quaint mantle
#

Oh

tender shard
#

sth like this ( I only wrote it by hand, might have some syntax error, but in theory, this should work)

quaint mantle
#

Lmao I see

quaint mantle
tender shard
#

no need to, just calling getChunkAt(...) is enough

#

you don't need a variable

quaint mantle
#

Ahh ok

quaint mantle
tender shard
#

no problem πŸ™‚

quaint mantle
#

πŸ‘

tender shard
#

this will however only work if you remove the entity in the same tick where you call getChunkAt, but I guess that's no problem in your case

quaint mantle
tender shard
#

oki

eternal oxide
#

there is a Location#getChunk

quaint mantle
#

GOOD!

tender shard
eternal oxide
#

yep, just shorter

#

So must be better πŸ˜›

tender shard
#

yeah, just use entity.getLocation().getChunk()

remote swallow
#

anyone know of actually good gson docs

glossy venture
#

how do these both match

#

since when is a UUID a command sender

tender shard
#

at least not in 1.19.2 πŸ˜„

glossy venture
#

yeah i know

tender shard
#

what does getSender() return?

#

just a CommandSender?

glossy venture
#

the decl is the first img

#

something which is a command sender

tender shard
#

yeah but why claim it returns a generic

#

just make it return COmmandSender

glossy venture
#

no

tender shard
#

why not?

glossy venture
#

because then i have to cast it

#

the sender

tender shard
#

you cast it to (S) anyway?

glossy venture
#

now i can do

if (!ctx.senderIs(Player.class))
  return;
Player p = ctx.getSender();
#

ez

tender shard
#

oh ok

#

yeah I see

#

makes sense

glossy venture
#

but i can just cast the result to CommandSender

#

just confused why it allows both

#

or thinks it should allow both

tender shard
#

yeah I also don't understand this

#

Weird :/

glossy venture
#

fancy

#

found out luckperms appereantly doesnt use a tree structure

#

arent streams optionally multithreaded as well

tender shard
#

last time I checked, LuckPerms used a totally normal HashMap<String,Boolean>

glossy venture
#

lmao

#

bruh

tender shard
#

but that was like 4 years ago, maybe it has changed meanwhile

#

wait, I'm talking bullshit

#

LuckPerms uses this "Context" thing

glossy venture
#

yeah

tender shard
#

yeah sorry I confused it with PermsEx or sth

#

idk lol

glossy venture
#

the data is stored as a Map<ImmutableContextSet, Node> i think

tender shard
#

hm maybe

#

anyway, if I was you, I wouldnt depend on LuckPerms but rather use spigot's perms system

#

I mean, just imagine you sometime switch to another perm plugin

glossy venture
#

why would i switch to another

#

except maybe my own if i make a tree based one which should be faster

#

for this kind of shit

#

with a String -> boolean cache

tender shard
#

idk 10 years ago, everyone was like "PermissionsEx is the shit, I will never switch" and now everyone uses luckperms

#

sooooo

#

you can never know what happens in 5 years πŸ˜„

tardy delta
#

me casually having no idea what im doing

glossy venture
#

too

#

so yeah i cant

remote swallow
#

but what could be better than luckperms

tender shard
glossy venture
#

javascript vibes

tardy delta
glossy venture
#

[] = 0 or something

tardy delta
#

i told i have no idea what im doing

#

lets not put true and false in

glossy venture
#

yo @tender shard can you test the plugin ill give u admin

#

to see if u can ban me

tardy delta
#

then taking over the server

tender shard
glossy venture
#

yeah

tender shard
#

1.19.2?

glossy venture
#

still gotta set up a few perms

#

yes

#

2 perms tho so nothing

tender shard
#

ok ping me when you're done

glossy venture
#

ill dm u the ip

tender shard
#

sure

#

but gimme a minute pls

wet breach
#

never used anything else

remote swallow
quiet ice
tardy delta
#

error

humble tulip
#

Should use Map.of(stuff here) instead

hybrid spoke
tardy delta
#

changed it

#

well wanted to allow things like true && false or 1 && 0

tender shard
#

just a tiny thing but I'd put the invalid name into quotes

#

e.g. "Constant "mfnalex" does not exist"

hybrid spoke
#

"Constant >>>mfnalex<<< does not exist"

#

to be extra clear

tardy delta
#

i will probably throw an exception

tender shard
#

and then add a delayed message, 20 seconds later

tardy delta
#

ah that way

tender shard
#

"IT DOESNT EXIST!!! GET OVER IT"

hybrid spoke
#

"nope"

#

"nah"

#

"still not"

#

"maybe now?"

#

"jebaited"

hybrid spoke
humble tulip
#

Wait a sec

tardy delta
#

im not even sure the user entered a constant that doesnt exist or just a random char

humble tulip
#

Just use actual constants

sinful wave
#

How would I setup a scoreboard that shows online players and ping for players

#

and then a new scoreboard for players in a duel

tardy delta
humble tulip
#

Like public static final fields

#

Ohhh

#

Nvm

tardy delta
#

so the user doesnt have to write it themselves

humble tulip
#

I understand

#

Then enums?

tardy delta
#

hmm i could do that

#

wondering about performance

humble tulip
#

Ah ye true

#

The constantpool should have a set of static final strings such as PI

#

Which are equal to the string constant "pi"

#

If you get what i mean

hybrid spoke
#

yeah i would give it a key

#

other than a string

wet breach
hybrid spoke
#

but well i dont understand that approach anyways

civic zenith
#

hi

hybrid spoke
#

Math.pow doesnt exist for nothing

tender shard
civic zenith
onyx fjord
#

How does itemstack in the config look

onyx fjord
#

But it has different identifier

hybrid spoke
tender shard
#

So ist es, der Herr

#

Pferzeihung!

hybrid spoke
#

that was just a german sprichwort, chill out

tender shard
#

thanks ❀️

sinful wave
#

For players in the lobby, I want to display the player's ping on a scoreboard? How would I do this and update it regularly

tender shard
#

are you looking for help on how to do this yourself, or are you just looking for an already done plugin?

sinful wave
#

im making a plugin

tender shard
#

that's the only option if you want to display stuff in the tab menu

#

you can get a player's ping using Player#getPing() if I am not mistaken

sinful wave
#

i mean a scoreboard not tab menu...

tender shard
#

wait ugh

sinful wave
#

and Player#getPing() is not a function

tender shard
#

oh yeah, but still, you need to create a new scoreboard for every player

tender shard
#

Player#getPing() definitely exists

sinful wave
#

im on 1.8 api rn...

tender shard
#

oh well

#

no idea about this outdated version, it's like 10 years old

remote swallow
#

?1.8

undone axleBOT
remote swallow
#

7 years, 4 months, and 5 day

tender shard
#

why don't you just use a supported, recent version of MC?

sinful wave
#

cause im developing for a 1.8 server

tender shard
#

well then I cannot help you

#

send the stacktrace you get

river oracle
#

Damn 1.8 devs must have depression or something

tender shard
#

?paste

undone axleBOT
tender shard
river oracle
#

I deved for 1.8 when o started realized it sucked and upgraded to latest all within a week

sinful wave
#

yea but like what choice do i have

#

if im doing a 1.8 server...

tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

river oracle
#

Easy fix

sinful wave
#

ok but i want 1.8 mechanics

tender shard
river oracle
#

Plugins exist

tender shard
#

that's like saying "I am developing an app for Windows 98"

sinful wave
#

except that 1.8 is a part of minecraft that is still extremely heavily played

#

while windows 98 is obselete

tender shard
#

nah

remote swallow
#

you can get a plugin to return 1.8 pvp

tender shard
#

windows 98 is still used by many banks etc

sinful wave
#

yes i know

tender shard
#

minecraft 1.8 is obsolete

sinful wave
#

but ive had troubles with

tender shard
#

noone uses it

sinful wave
#

turning 1.19 -> 1.8

river oracle
tender shard
#

1.8 is just extremely outdated, it's over 7 years old

river oracle
#

He should ask them

#

Surprisingly only around 6% last time I checked

#

Bad example lol

buoyant violet
#

Guys can I skip the assignment of Compareto?

#

Or it's necessary

vocal cloud
#

The only reason hypixel uses it is because they can't afford to migrate that much legacy code

river oracle
#

No stats on that, but probably not as much as you think

sinful wave
#

1.8 pvp is still extremely played

#

and its alot easier to run 1.8 pvp natively

#

than using plugins to restore 1.8 on 1.9+

#

as ive tried

onyx fjord
sinful wave
#

bro what...

#

how can u disagree

onyx fjord
#

Because it's a cap

sinful wave
#

its still a significant part of minecraft

onyx fjord
#

Servers are like 6% now

buoyant violet
#

@onyx fjord yo

sinful wave
#

servers != players

onyx fjord
#

Kinda yes tho

sinful wave
#

ofc alot of tiny smps will be running 1.19

buoyant violet
#

Can i skip the tocompare?

onyx fjord
#

What

buoyant violet
#

Part on java

onyx fjord
#

Idk why ask me

tender shard
#

idk, maybe 5?

onyx fjord
#

L

tender shard
#

it's 6%, not 5

#

my bad

onyx fjord
#

Just accept the information

tender shard
#

I also wish you a very pleasant day

onyx fjord
#

That 1.7πŸ˜‚πŸ’€

tender shard
#

I won't go away from here anytime soon

granite tulip
#

anyone know how to change plugin Category?

remote swallow
#

dont say that about alex

tender shard
#

it's you who will leave here

tender shard
onyx fjord
#

What about we all leave at the same time

sinful wave
tender shard
onyx fjord
sinful wave
#

ok

#

well that is my point anyway

onyx fjord
#

If there are no servers there are no players

tender shard
#

Are we now going to discuss my sexuality?

sinful wave
#

kacper

#

but there is a very good chance

#

that alot of 1.8 servers

#

will have a vastly higher player base

#

than 1.19 servers

onyx fjord
#

1.19 servers are also big

sinful wave
#

such as hypixel

onyx fjord
#

Look at mcci

tender shard
#

@smoky yoke

hybrid spoke
onyx fjord
#

Closed beta but has 1.5k players

sinful wave
#

yes i get that 1.19 servers can also be big

tender shard
#

see you

sinful wave
#

that is not my point

#

i think it is likely

#

that 1.8 servers on average

#

are alot bigger

hybrid spoke
#

how to get banned fast

sinful wave
#

as they do not include small servers

#

such as smps

#

that are often idle

#

or have very little player bases

hybrid spoke
#

then leave

sinful wave
#

i dont think u can say that 1.8 is not a significant part of minecraft

#

cause it still is

#

it is dying

#

but it still is significant

tender shard
#

is this new?

onyx fjord
#

It's dead and more dead every year

vagrant stratus
sinful wave
#

yes

#

that is the definition of dying

tender shard
sinful wave
#

but it is still significant

#

every point i make

river oracle
#

Woh

sinful wave
#

u make a point that disregards my point

tender shard
#

just fuck up

granite tulip
onyx fjord
#

Idk any popular legacy server Apart from hypixel

hybrid spoke
#

@vagrant stratus your time to shine

tender shard
#

Stop talking shit about me

onyx fjord
#

Even cubecraft is updating

river oracle
#

think you need to grow up

granite tulip