#help-development

1 messages Β· Page 1834 of 1

somber hull
#

Alright

fervent gate
#

It still doesn't do the damage I want it to do. Is that the correct way of changing the damage? e.setDamage(100); ?

quaint mantle
#

how do I get the number of items in the player's inventory in version 1.8.8?

fervent gate
#

event

tall dragon
#

Player#getInventory().getContent()

#

you would need to loop to determine all stacked items

tender shard
tender shard
fervent gate
fervent gate
quaint mantle
#

example code? pls

#

'-'

#

idk how to get ALL items of inventory

tall dragon
#

why do you need to get all items if i may ask

quaint mantle
tender shard
#

okay first of all @quaint mantle

#

?learnjava

undone axleBOT
tall dragon
quaint mantle
#

yes

#

'-'

tender shard
#

and now: idk if Inventory in 1.8.8 already implements Iterable

tall dragon
#

well you dont need to do that then

tender shard
#

for(ItemStack item : inventory.getContents()) {
// Do stuff

tall dragon
#

player.getInventory().isEmpty()

ancient plank
#

ok so you grab the inventory
picks up inventory
then you look through every item in a loop
looks through every item in the inventory
and if the item you're looking at matches the item you wanna take out, you take it out
grabs stick and cookes marshmallows
gg ez

quaint mantle
#

sorry

mellow gulch
fervent gate
quaint mantle
#

private boolean checkInventoryIsEmpty() {
PlayerInventory inv = player.getInventory();
for (ItemStack i : inv.getContents()) {
if (i != null && !(i.getType() == Material.AIR)) {
return false;
}
}
return true;
}

?

fervent gate
#

the thing is that the if-statement simply doesn't run

tall dragon
quaint mantle
#

no exists

mellow gulch
quaint mantle
#

this is for new versions

tall dragon
#

ugh

fervent gate
tall dragon
ancient plank
#

the guy

tender shard
#

why not? it's totally fine

#

actually in a normal chart the height would be X

hybrid spoke
#

not in germany

tender shard
#

X = height, Y = left/right, Z = forward/backwards

#

that's how it works in normal geometry

#

oh wait

hybrid spoke
#

no

#

y is height

tender shard
#

yeah

oblique wigeon
#

quite a few other programs do happen to use Y as a vertical axis- a primary example would be 3d design/3d printers

hybrid spoke
#

x is length

tender shard
#

X = left/right, Y = height, Z = depth (forward, backward)

#

sorry I was mistaken

#

anyway, Y is always the height

hybrid spoke
#

its like everywhere else

tender shard
#

and in school when you pay attention in math πŸ˜›

hybrid spoke
#

shots fired

onyx fjord
#

Even in Roblox

hybrid spoke
#

even in reallife

#

if you press F3

#

there will be holograms

tender shard
onyx fjord
#

Yoo

tender shard
#

wikipedia tells me I'm right too

proud basin
#

What happens if i cancel AsyncPlayerChatEvent?

tender shard
proud basin
#

k

hybrid spoke
#

you cancel the sending of the message

onyx fjord
#

Cancel playerleaveevent

#

Ez

hybrid spoke
#

you could kick them and remove the "Back to main menu" button

tender shard
hybrid spoke
#

your book is dumb

oblique wigeon
#

^^

tender shard
#

GodCipher you wanna help me translate my adventure game to english? XD

hybrid spoke
#

your adventure game?

tender shard
#

it still has a thousand untranslated lines of text lol

hybrid spoke
#

link

tender shard
#

its not online anywhere yet

#

just a stupid adventure game

hybrid spoke
tender shard
#

it's like monkey island in retarded

hybrid spoke
#

"find the hidden wood stick"

mellow gulch
tender shard
#

where are you from?

#

normally Y is height

#

hm no idea then lol

hybrid spoke
tender shard
#

maybe it's done differently in italy

#

but anyway we had people from 3 different countries, AND wikipedia, claiming that Y is usually height πŸ˜›

#

so it must your country / school that does it differently πŸ˜›

hybrid spoke
#

italy is whack

tender shard
#

wikipedia is the best website on the whole internet except for pr0nhub

mellow gulch
onyx fjord
#

Wikipedia often lies

tender shard
tender shard
hybrid spoke
#

wikipedia is a good source

onyx fjord
#

And fat moderators remove your edits for no reason

tender shard
#

believe it or not but other "encyclopedias" always sometimes "lie"

#

wikipedia is just used by 1000 times more people so obviously you'll find 1000 times more mistakes there

onyx fjord
#
  • Wikipedia leaks your ip
#

To the public

tender shard
tender shard
hybrid spoke
#

in germany we would say untergewichtig

onyx fjord
tender shard
onyx fjord
#

Let's say somebody doesn't like your edit

#

So they decide to turn off your internet

tender shard
#

haha

#

turning off internet by knowing the IP?

#

no

hybrid spoke
#

better than any private website

onyx fjord
#

Yes, you can get ddosed

tender shard
#

EVERY website you visit gets your IP

fervent gate
onyx fjord
oblique wigeon
hybrid spoke
#

teacher always do the "dont use wikipedia as a source" - makes my own website with wrong facts

tender shard
#

if you found any "errors" in wikipedia, feel free to correct them

fervent gate
#

Because yes, I plan on creating a lot of custom items

oblique wigeon
onyx fjord
#

Well

tender shard
#

there is literally no problem at all in knowing your IP

#

even I know your IP

onyx fjord
#

Server owner knows it then

#

Not all fucking players

tender shard
#

at least the one you had when you went to one of my websites

tender shard
kind hatch
#

X, Y, and Z can be relative. If you were to rotate that graph 90deg up, your Y would then be height. This is why when you make the graph, you give the legend. Letting end users know which variable is tied to which axis.

tender shard
#

here's my IP, go DDoS me

onyx fjord
#

Do u allow it tho

tender shard
#

yes I just did

#

go ahead

#

have fun

onyx fjord
#

That's very risky

tender shard
#

go ahead

hard hamlet
#

so, i got a list of all the materials, anyone knows an easy way to filter out all of the whole blocks?

onyx fjord
#

Too late

hard hamlet
#

(first time on spigot)

tender shard
onyx fjord
#

I'm almost asleep

tender shard
#

Material has a method isBlock()

hard hamlet
#

yeah, used that but things like pressure plates and buttons come up

fervent gate
#

@tender shard How long have you been coding MC plugins for?

tender shard
#

e.g. Material.DIAMOND_PICKAXE.isBlock() -> false
Material.DIRT.isBlock() -> true

tender shard
#

why though lol

hard hamlet
#

if(item.isBlock() && !item.isAir() && item.isSolid())

hard hamlet
#

this is my if statement rn

tender shard
#

oh wait

#

sorry

fervent gate
tender shard
#

I didn't see the ! in front of isAir

tender shard
tall dragon
onyx fjord
#

API

ancient plank
#

cringe

hard hamlet
#

yup, but there's still some stuff that i'd like to filter out, like corals, amethyst, dripstone, banners

tender shard
hybrid spoke
#

what is spigot?

fervent gate
# hybrid spoke PDC

Well yea, but the way I would do it is: get the PDC, if it is the item, change the damage of the event. Is that a bad way?

hard hamlet
#

amethyst clusters i mean.

tender shard
tall dragon
hybrid spoke
onyx fjord
#

You might be in serious problem

tender shard
#

to say it in your language @hybrid spoke ITS A WASSERHAAAAAAAHN

mellow gulch
# hybrid spoke PDC

pdc is good if you want to add stuff that isn't in vanilla, but attributes are good if you want to change attributes that are in vanilla

hard hamlet
tender shard
#

or WASSERKRAAAAAAAAAN if you're bavarian

tall dragon
hybrid spoke
fervent gate
hard hamlet
mellow gulch
fervent gate
fervent gate
#

but that is vanilla like you said

#

but I will be doing custom stuff in the future

tender shard
hybrid spoke
#

does chunk/block have an PDC?

mellow gulch
young knoll
#

Chunk yea

tender shard
#

chunk has it since 1.16.3

fervent gate
young knoll
#

Block no

ancient plank
#

persistent data container 🧠

tender shard
#

and block has it when using my CustomBlockData lib

#

πŸ˜›

tender shard
#

it basically uses the chunk to give you a "fake" block PDC

tender shard
#

yeah I know

#

but you get what I wanted to say

mellow gulch
tender shard
#

it's possible to get a PDC for blocks, but it requires a bit of math and actually using the chunk instead.

ancient plank
#

mom can we have pdc?
no bobby, we have pdc at home
pdc at home:

tender shard
#

NBT

#

lol

#

btw who's bobby

kind hatch
#

Issues with Maven Multi Modules

tall dragon
#

does anyone here know how to update an itemstack in a players inventory without resetting it?

#

or is it just not possible

tender shard
#

When you change an itemstack, it gets updated everywhere where it might be

tall dragon
#

for example change its lore

hybrid spoke
#

get meta, change, set meta

earnest tulip
#

im trying to use the persistantdatatypes library but it wont work πŸ₯² idk what i did wrong

tall dragon
#

when i change lore of an itemstack its not updated in the players inventory

hybrid spoke
#

so set the itemstack again

#

to the inventory

tall dragon
#

which is what i want to avoid...

hybrid spoke
#

why?

tall dragon
#

because its expensive

hybrid spoke
#

where is it expensive

earnest tulip
#

i put the stuff in the pom.xml and reloaded and restarted but it still wont work

tall dragon
#

if you do this thousands of times a second

earnest tulip
#

yea

tall dragon
#

it gets expensive

tender shard
#

what does not work?

hybrid spoke
tall dragon
#

so i want to make it as efficient as i can

earnest tulip
#

im trying to use it for storing stuff but it wont set

tender shard
#

someone today claimed using @NotNull is expensive lmao

earnest tulip
#

i imported it

earnest tulip
#

idk

tall dragon
#

but its probably not possible is it

tender shard
earnest tulip
hybrid spoke
tender shard
#

okay now send the class where you are doing PDC stuff @earnest tulip

earnest tulip
#

okee

tender shard
earnest tulip
#

wym

tender shard
#

check your pom

#

anyway it's not important rn

#

should work anyway

#

Ill check your code

earnest tulip
#

aight

tender shard
#

what exactly doesn't work?

earnest tulip
#

it wont set

tender shard
#

player.getPersistentDataContainer().set(new NamespacedKey(getPlugin(), "Shulk"), DataType.STRING, "new ItemStack(Material.SNOW)"); //this line <<<<<<<<

earnest tulip
#

everything else works

tender shard
#

this does NOT look like what you're trying to do

young knoll
#

Some blocks have PDC

earnest tulip
#

?

tender shard
#

you literally just store a string with java code

young knoll
#

Block entities to be exact

tender shard
earnest tulip
#

im confused

#

isnt it supposed to store a string

#

did i do it wrongf

tender shard
#

an itemstack? or a string?

earnest tulip
#

an itemstack but im testing it as a string first

tender shard
#

yeah obviously that's useless

earnest tulip
#

to see if it works

#

?

tender shard
#

you want to use DataType.ITEM_STACK

earnest tulip
#

i did

#

it wont work

#

im testing

#

it wont even work as a string

tender shard
#

it DOES work

earnest tulip
#

so im not sure

#

but

#

i tested it tho

#

is the code wrong>?

tender shard
#

you currently stored "new ItemStack(Material.SNOW)" inside the player object with the key "Shulk"

earnest tulip
#

mhm

tender shard
#

you stored it as String

earnest tulip
#

yesssssss

#

i knowwwwww

#

im testinggg itttt

#

ignore the itemstack

#

it wont work

#

even as a string

ancient plank
#

iiiiiiiiiiiiiiii loveeeeeeeeeeeeeeeeeeeeeeeeeeee marshmallowwwwwwwwwwwssssssss

earnest tulip
#

idk what i did wrong

tender shard
#

o you can now do player.getPersistentDataContainer().get("Shulk", DataType.String) to get that string

tall dragon
earnest tulip
#

ik but it wont set bro

tender shard
#

erm I mean

earnest tulip
#

i checked

tender shard
#

a namespacedkey instead of just "Shulk"

#

it DOES work

#

show the code where you try to get the string

earnest tulip
#

ok

#

player.performCommand("data get entity @p BukkitValues");

#

is it not there

young knoll
#

What

#

Why

tender shard
#

ugh erm

#

why

earnest tulip
#

?

#

wdym

young knoll
#

Also I’m pretty sure it’s PublicBukkitValues

tender shard
#

yes

earnest tulip
#

hold up

#

i has my other tags btw

tender shard
#

sorry but I don't have to debug such lazy attempts

#

get the actual player's PDC

#

it WILL be inside

earnest tulip
#

-_- how would that not show it

tender shard
#

because it's not called BukkitValues

#

oh wait

#

I am surry

#

sorry*

earnest tulip
#

it is lmao i would show u buit i cant sent

#

YEAH

tender shard
#

it IS called BukkitValues

earnest tulip
#

see

tender shard
#

and it works fine for me

earnest tulip
#

dont be mean if u dotn know

tender shard
#

I am not mean

earnest tulip
#

then y u bully me

tender shard
#

I'm out

#

have a nice day

young knoll
#

What

hybrid spoke
#

xD

young knoll
#

Is it just called PublicBukkitValues on itemstacks?

hybrid spoke
earnest tulip
#

im genuinely just trying to get it to work

hybrid spoke
#

seems like your first day here

tender shard
earnest tulip
#

2nd

#

actually lmao

tender shard
#

BukkitValues is indeed correct

earnest tulip
#

xD

#

yes

#

ik

tender shard
#

yeah and I wasn't rude or bullying anyone

earnest tulip
#

it wont show ;-;

hybrid spoke
tender shard
#

enter that command manually @earnest tulip

earnest tulip
#

i did

#

a thousand times

#

jk not athousand

#

but a lot

tender shard
#

I get it

young knoll
#

Who is storing a Boolean as a string

#

Such a waste of bytes smh

earnest tulip
#

lol

#

so the code isnt wrong?

tender shard
#

but you know, backwards compat and stuff

hybrid spoke
#

huh.. a boolean will always be a boolean

buoyant viper
#

fuk compatibility

tender shard
earnest tulip
#

btw i would like to thank u as a member of the community for making such a nice plugin, im just sad at myself that its not working for some reason

#

ok

tender shard
#

πŸ˜„

buoyant viper
#

😼

tender shard
hybrid spoke
earnest tulip
#

urs silly

tender shard
earnest tulip
#

neat

hybrid spoke
#

nice bait

tender shard
#

thanks πŸ˜„

#

but yeah if that doesn't work, something's wrong with your code somehow

#

hm

#

you probably have some command in your plugin right? gimme a sec and then add what I send to your commandexecutors code, just for testing

earnest tulip
#

ok

ivory sleet
#

Asterverse can you confirm that the code is actually running

tender shard
#
Player player = (Player) sender;
        
        player.getPersistentDataContainer().set(new NamespacedKey(yourPlugin, "test"),DataType.STRING, "test12345");
        System.out.println(player.getPersistentDataContainer().get(new NamespacedKey(yourPlugin, "test"), DataType.STRING));
#

add this to one of your commands at the very top

#

it should print "test12345" to console when you run that command as player

#

obviously you'll have to replace yourPlugin with your plugins instance ^^

earnest tulip
#

aight ty

#

btw i tested it with a regular Pdc string and it works

#

its just when i switch to the datatype.string

ivory sleet
#

Oh yeah why aren’t you using the normal pdc string type?

tender shard
#

it's exactly the same thing

earnest tulip
#

exactly

#

which is weird

#

idk why its not orking

#

working*

#

let me try what u sent\

tender shard
#

there is NO WAY that my library is at fault here

#

I do admit that I sometimes fuck things up - but I didn't this time πŸ˜›

young knoll
#

That’s what they all say

tender shard
#

yeah but you can literally see it's the same thing πŸ˜›

ivory sleet
tender shard
ivory sleet
#

No just, why lol

tender shard
#

I made a lib for custom PDC types

earnest tulip
#

i tested it

ivory sleet
#

anyways yeah if that’s the variable value then it should work

#

But why do you have variables which delegate the default ones

tender shard
earnest tulip
#

it works with regular pdc types

tender shard
young knoll
#

Because PeristantDataType is too long duhhh

earnest tulip
#

i feel like i did somethign wrong in the pom but u didnt say anyuthing

tender shard
#

from what I now believe is that you simply didnt shade the lib

earnest tulip
#

i get nothing

#

from the console

#

but when i try the regular it shows

#

in the console

tender shard
#

can you DM me your latest.log pls

earnest tulip
#

yes

tender shard
#

tbh I made that lib to just have shorter names and then decided to add custom data types as well lmao

ivory sleet
#

The name is good imo πŸ˜”

tender shard
#

well I think it's misleading

#

it's about DATA types

ivory sleet
#

Elaborate

tender shard
#

whether they are persistent or not depends on where they are stored

mellow gulch
#

true statement is true

tender shard
#

so it should be called DataType instead of PersistentDataType

earnest tulip
#

oof it wont let me send it

#

is there something i can use

tender shard
#

?paste

undone axleBOT
ivory sleet
#

I mean PersistentTypeSerializer would probably suit better

mellow gulch
#

lol

tender shard
#

and it's still misleading

#

it's not persistent until it gets stored in a PDC

earnest tulip
#

do i copy from the log into that?

tender shard
#

yes

earnest tulip
#

ah

#

my bad

ivory sleet
#

but well Persistent is imho necessary as it serializes and deserializes persistent types

earnest tulip
#

its taking forever to open ;-;

#

ill just copy the console

tender shard
ivory sleet
#

The data types are not to be removed nor changed after a said instance

tender shard
#

only the thing their contents are stored inside are persistent

ivory sleet
#

The data types aim to be persistent tho

#

It’s not like they’re dynamic or provisional

tender shard
#

as I already suspected @earnest tulip

#

You didnt shade my library

#
onnectionUtils.lambda$0(PlayerConnectionUtils.java:30) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.util.thread.IAsyncTaskHandler.executeTask(SourceFile:151) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.util.thread.IAsyncTaskHandler.executeNext(SourceFile:125) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.server.MinecraftServer.bf(MinecraftServer.java:1148) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.server.MinecraftServer.executeNext(MinecraftServer.java:1141) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.util.thread.IAsyncTaskHandler.awaitTasks(SourceFile:134) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.server.MinecraftServer.sleepForTick(MinecraftServer.java:1125) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1054) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.NoClassDefFoundError: de/jeff_media/morepersistentdatatypes/DataType
        at me.asterverse.origins.Traits.Effect2.onPlayerOriginChange(Effect2.java:92) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        ... 28 more
Caused by: java.lang.ClassNotFoundException: de.jeff_media.morepersistentdatatypes.DataType
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:147) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at me.asterverse.origins.Traits.Effect2.onPlayerOriginChange(Effect2.java:92) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
        ... 28 more
[15:37:05] [Server thread/
earnest tulip
#

aaaahhhh tyyyyyy

tender shard
#

and as you can see there ARE console errors

#

did you actually use maven to build your jar?

earnest tulip
#

yea

tender shard
#

well then you probably did NOT have the maven-shade-plugin in your <plugins> section

earnest tulip
#

yea

#

oh

#

its in there

tender shard
#

one sec

earnest tulip
#

i probably built it wrong or smth idfk

tender shard
#

okay please explain how you built your .jar file

fervent gate
#

Probably a stupid question, but what is the advantage of using Maven to build the jar? I use the standard intelliJ thingy

earnest tulip
#

im using intellij and theres a reload button in the top right of the window when u change the stuff in the pom, so i pressed it when i was done

#

thats probably the issue

#

im guessing

tender shard
tender shard
young knoll
#

It also makes it easier for other devs to work on your project

tender shard
#

exactly, because of No. 1 I sent

#

there is no "hardcoded" dependecy at C:\Users\yourName......

earnest tulip
#

did i create the jar file? 😳

tender shard
#

see this

earnest tulip
#

i do the artifacts trick

tender shard
#

yeah thats wrong, you weren't using maven to compile

#

see my screenshot

#

you need to double click "package"

#

ONLY, and ONLY THEN, maven runs

earnest tulip
#

oh

#

pffff

#

sorry

tender shard
#

no problem

#

I was a noob in maven stuff too 2 years ago

#

someone had to explain it to me and it took very long until I understood everything

#

I actually ranted on github about how stupid maven is

#

but it was just because I didn't understand it at that time

earnest tulip
#

xD

tender shard
#

yeah but they explained it to me and now I never wanna go without maven EVER again

fervent gate
fervent gate
#

I know java, but the spigot API and everything that has to do with Plugin Dev

tender shard
#

ah okay

#

sorry I have no idea. I learnt most stuff by simply trying and reading the javadocs

#

also by decompiling already existing plugins

#

SMALL plugins

#

Feel free to DM me or sth or join my discord if you need any basic help

fervent gate
#

Ooh, that could indeed be interesting

#

I'll try a small plugin

tender shard
#

yes you should get started with something very silly

#

e.g. sending a message to a player when they join

fervent gate
#

I can see some good practices that way maybe

tender shard
#

yes and as said, feel free to DM me πŸ™‚

fervent gate
tender shard
#

aaah okay

#

yeah just ask if you got any questions but tbh there's no "guide to master spigot api"

fervent gate
#

for example, I didn't know the PDC and I would work with DisplayName

tender shard
#

displayname is part of itemmeta, no PDC needed

#

for PDC, I wrote a tiny blog post about it:

fervent gate
tender shard
#

exactly. it was probably me who said that lol

#

this question comes up here about once per day

fervent gate
#

Ah ok lol

#

haha

tender shard
#

check out my blog post and let me know if you still got questions πŸ™‚

fervent gate
#

Reading that rn

earnest tulip
#

im still having trouble, i take the jar file from the targets folder right

tender shard
#

yes

earnest tulip
#

i still cant get it to work, very confused

tender shard
#

?paste your latest.log again pls

undone axleBOT
earnest tulip
#

ok

tender shard
#

and send it here please

earnest tulip
tender shard
#

okay now you have another problem

#

you have a class called Set right?

earnest tulip
#

yea

tender shard
#

?paste your full pom.xml please

undone axleBOT
earnest tulip
#

ok

#

i ahve it bookmarked so no need to do the command every time :3

tender shard
#

hm looks correct to me. please send your .jar file

earnest tulip
#

less trouble that way

#

ok

#

the plugin jar right

#

nvm dumb q

tender shard
#

yes

#

the plugin .jar ^^

earnest tulip
#

dm'd u

#

i have the -shaded.jar as well but im assuming i shudnt use that

tender shard
#

thx

#

oh wait

#

is the shaded jar bigger than the other one?

#

in that case: you MUST use the shaded .jar

earnest tulip
#

no its smaller

tender shard
#

because that's the one that includes the library

#

ugh

#

strange

earnest tulip
#

oof

tender shard
#

I'll check the jar you sent

earnest tulip
#

aight

tender shard
#

okay yes

#

your .jar does NOT contain my library

magic dome
#

anyone got any ideas how i can make a rideable enderdragon?

tender shard
#

please run package again using maven

#

and then send the log that maven creates

earnest tulip
#

weird

#

ok

#

i ran it like 3 times already

earnest tulip
tender shard
#

I see... erm very strange

#

can you upload your WHOLE code to github?

earnest tulip
#

sure

tender shard
#

I will get it fixed. there must be something wrong with your whole setup

#

probably because you only switched to maven now

earnest tulip
#

give me like 5 min to set the github

tender shard
#

starting to use maven can sometimes have the weirdest problems lol

#

yeah no problem, I'm online πŸ˜„

#

even if it takes 20 minutes lol

#

np

fervent gate
#

That is actually a good beginner tutorial on your blog @tender shard

#

(sorry for ping)

tender shard
#

oh I don't hate pings

#

if people don't like pings they should just change their notification settings

fervent gate
#

Yea, some people do, wasn't sure πŸ™‚

tender shard
#

I'd love to add "(feel free to ping)" to my username like @ivory sleet does but I can't since I'm verified and now my username is bound to my spigotmc username lmao

#

a kinda stupid rule if you ask me

#

@ivory sleet is it possible for verified people to change their username anyway or have it changed by staff (on discord, not spigotmc)?

ivory sleet
#

hmm I might take it up with md5, as proven you're active so having that adjacent to your name wouldn't be such a bad one

#

altho its just the "if they has it, why dont I get it"

tender shard
#

it would be nice πŸ™‚ I normally have "[EN/DE]" in my username so people know they can also talk in german to me, but that's not very important. I'd love to have some kind of "feel free to ping me" in my username though πŸ™‚

earnest tulip
#

in all honesty im having a hard time setting this repo xD

#

agh

#

fml

ivory sleet
#

yeah honestly, if we had our own bot we could modify, I'd add some sort of label next to your name feature

tender shard
#

@earnest tulip

earnest tulip
#

ah

ivory sleet
ivory sleet
#

indeed, anyways I will have a word with my higher ups, investigating what they think

tender shard
#

just go to md5's address, show him some SHA256 hashes, he'll get unconscious and now you have access to his PC and do whatever you want

#

I do that every second thursday

ivory sleet
#

lol

tender shard
#

SHA > md5

lavish hemlock
tender shard
#

yeah

lavish hemlock
#

md5 beats uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

I don't fucking know

#

your mom

#

😎

tender shard
#

oh no

#

I always respected this md spigot dude

#

but if he starts to beat my mom...

#

then I'd be upset

#

and stop respecting him

#

pls dont beat my mom @ md_5

earnest tulip
#

finally, after 10 years

tender shard
#

haha

#

did you get it work?

earnest tulip
#

yea

#

i made it private for reasons, so can i add u

tender shard
#

I know maven is a pain in the ass the first time

#

but now that it's working, you'll learn to LOVE IT

earnest tulip
#

it wont bother me as long as i can learn

ivory sleet
earnest tulip
#

but yeah do u make u a collaborator

tender shard
#

it's slow as heck THE FIRST TIME you run it

#

and it has a weird syntax

#

and it invents their own names for everything

lavish hemlock
#

Maven and Gradle are both shit.

tender shard
#

e.g. "shadow"

earnest tulip
#

oof

tender shard
#

why shadow?

#

that doesn't make sense

lavish hemlock
tender shard
#

I can understand words like "fat jar" but "shadow jar"? whyyyy

ivory sleet
#

Yeah kotlin dsl

fervent gate
#

@tender shard p.getInventory().addItem(new ItemStack[] { BowTNT() }); This is the syntax I found in a plugin. What do the {} do? That is something I didn't learn in school lol.

lavish hemlock
earnest tulip
#

@tender shard shud i add u as a collaborator, i made the project private

tender shard
#

sorry but πŸ˜›

#

?learnjava

undone axleBOT
lavish hemlock
#

It does not originate from Gradle.

tender shard
lavish hemlock
tender shard
#

my libs are public, anyone can use them without any mentions

earnest tulip
#

oh so u want me to make it public

tender shard
earnest tulip
#

public*

tender shard
earnest tulip
#

oh

tender shard
#

do whatever you like with my code

lavish hemlock
quaint mantle
#

how to get data id of a item? example, if material type is GLASS, the data, ex: 95:06

earnest tulip
#

wait but u said u wanted to look at the project tho

#

im confused xD

quaint mantle
#

'-'

tender shard
#

oh I forgot you're still on 1.8

#

yeah no idea then

quaint mantle
#

ok

earnest tulip
#

NOT SCIENTIFICALLY POSSIBLE!

fervent gate
# tender shard ?learnjava

Yea, I know arrays, but school is not that good in teaching us so that is probably syntaxt that is way to hard for our teacher to grasp

quaint mantle
#

:)

#

sell items by command

tall dragon
#

Material.SPONGE.getId() would work

tall dragon
#

unless it does not on 1.8

fervent gate
lavish hemlock
#
String[] s = new String[] { "Hello!" };

// OR

String[] s = new String[1];
s[0] = "Hello!";
earnest tulip
#

@tender shard oh my bad, i think i confused u, i got the github project to work but the plugin still wont use the library

#

my bad

tender shard
ivory sleet
lavish hemlock
#

any good class should teach the collections framework :p

ivory sleet
#

True

fervent gate
lavish hemlock
#

you should teach yourself Java as opposed to following the shitty teachings of your school

earnest tulip
#

i gtg for a bit, thanks for all of ur help mfnalex

lavish hemlock
#

?learnjava

undone axleBOT
tender shard
#

LMAO fuck the german administration. it took them TWO MONTHS so I could even get an appointment to "not" inherit 50k in debt. But they only need 2 days to send me an invoice to pay 30€ for declaring to them that I don't want to inherit all those debts lmao. But yeah this is not the right channel to discuss this, I just had to tell it to someone lmao

fervent gate
tender shard
#

you're trying to get into MC coding

#

that's the best way imho

#

because it combines a game you like, and coding

#

sooooo keep it up :3

fervent gate
#

Yea, I have been playing MC for a long time now and I want to code. They taught us java as a first language so I thought, eh why not get into MC plugins

tender shard
#

yeah that's awesome πŸ™‚

#

but please please please

#

do yourself a favor

#

use IntelliJ + maven πŸ˜›

#

unless you already do that

ancient plank
#

maven is fkin pog

tender shard
#

it is

ancient plank
#

build systems are fkin pog

fervent gate
#

alright, I will definitely research that

tender shard
#

I have a tiny tutorial about maven

fervent gate
#

Because I have 0 clue what that does instead of building a .jar file

trail lintel
#

If I add a command or an alias that is already in use by another plugin, what determines which plugin actually reserves the command keyword?

tender shard
tender shard
#

e.g.

#

yourplugin:yourcommand
anotherplugin:yourcommand

fervent gate
#

And I don't even know how a jar file is made because they don,'t fkn teach us anything relevant in our school. They are teaching PHP now...

trail lintel
#

But say they BOTH add the /test command. And the user executes /test. Which would execute? The one that appears first when sorting namespace alphabetically? Both?

fervent gate
tender shard
#

I also don't know exactly how the java compiler creates a jar file

#

it's like... a driver doesn't know how to build a car. You just drive it

#

you don't need to know every detail ^^

#

my rule of thumbs: if you didn't code for 20+ years, don't even try to understand how compilers work

fervent gate
#

πŸ˜†

#

I am going to learn compilers when I am 37 then.

#

Reminder set

tender shard
#

πŸ˜„

quaint mantle
#

helooooo

#

what do we have here?

#

school teaching java?

#

that is the first time i heard it

fervent gate
#

You are correct my friend

tender shard
#

my school taught me java too

#

Hamster Simulator

#

lol

trail lintel
#

Anybody got any idea on the behavior I asked about? The closest I can find on google is that its the plugin that is loaded first that successfully reserves the command. I'm thinking in that case I will need to have a loadBefore in my YAML for every plugin that I know has an equivalent command.

fervent gate
#

They went over Java, HTML&CSS, MySQL, PHP and Python

tender shard
#

currently watching a very intensive breaking bad episode lmao

ancient plank
#

I spent a year taking a level 1 computer science course and it was literally scratch and really basic stuff that I learned in less than a month of self-teaching 😺

trail lintel
#

Hahaha no worries man, GREAT show

fervent gate
#

Because it is def the same for me

trail lintel
#

Its all about that piece of paper boi

#

To get continuous smaller pieces of paper

fervent gate
#

ah yes

#

paper programming

#

I really wonder if anyone did that in their school

trail lintel
#

I think my great great great grand diety may have

fervent gate
#

Lmao

quaint mantle
#

man it just sucks to think about school teaching me c++ in a few more years

wicked lake
#

Is there any way to "naturally" spawn new mobs without hijacking another entity's spawn?

fervent gate
#

Our teacher was the one to state that MS word is the best IDE for programming

quaint mantle
#

oh that is true

#

πŸ˜‚

fervent gate
quaint mantle
#

LOL

#

LOL

#

LOL

trail lintel
#

REDUNDANT CHECK REEEEEEE where are my custom emojis lelel

ancient plank
#

don't spam!

quaint mantle
trail lintel
#

I'm sorry am drink tonight

tender shard
#

drunk high five 3️⃣

trail lintel
#

HELL YEH BRUTHA

tender shard
#

haha

#

JÀÀÀÀgermeister

trail lintel
#

Ohhh snap hahah good choice. I'm just drinkin some crap wine I had left from makin dinner

magic dome
#

can someone help me im trying to include a api in my plugin using the jar

#

the jar is in the resources folder in the path

magic dome
#

i included this in maven

#

<dependency>
<groupId>com.ericdebouwer</groupId>
<artifactId>PetDragon</artifactId>
<version>1.5.2</version> <!-- replace with the latest version -->
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/PetDragon-1.5.2-sources.jar</systemPath>
</dependency>

tender shard
#

oh ouch

ivory sleet
#

Ah such a shame you don’t use gradle

tender shard
#

system scope

magic dome
#

intelij seems to have no problems until i try to go and access the api class it just doesnt show up

tender shard
ivory sleet
#

I’m sorry, it’s just so tempting

trail lintel
#

Lmfao the build tools wars begin.

tender shard
#

maven > gradle

ivory sleet
#

Living the life as a gradle enthusiast

magic dome
#

anyone know how i could include the jar?

ivory sleet
#

Maven shade plugin maybe

tender shard
#

maven can read XML files. gradle seems to be too stupid for that πŸ˜›

ivory sleet
#

Or gradle danceDog

trail lintel
#

Hot take, grade / maven whatever who needs it javac and blood and tears baby

ivory sleet
magic dome
#

please guys im just tryna get some help here idk what to do

ivory sleet
#

Lol

tender shard
ivory sleet
#

MrPeters

runic mesa
#

I’m having a special zombie spawn I want to listen to an event but only for that zombie, is it possible after all the conditionals to use the event in the same file and have it do stuff

ivory sleet
#

Cant you use the shade plugin?

tender shard
#

sorry I don't understand

trail lintel
#

really wish I could use my thonk emojis lmao

ivory sleet
#

Or maybe @magic dome maven add jars plugin would solve it

tender shard
#

add jars plugin?

#

what does it do?

ivory sleet
#

Yes it’s archived because google isn’t using maven any longer but it’s probably still valid

tender shard
#

ugh that plugin violates everything was made for

ivory sleet
#

Lol probably

tender shard
#

isn't there a reason why <scope>system</scope> causes warnings?

ivory sleet
#

Yeah

tender shard
#

I mean yeah, sometimes(!!!!) it makes sense

#

but in 99.99% of cases just install the jars you need using mvn install

ivory sleet
#

I think the biggest issue is transivity

#

And versioning probably

lavish hemlock
lavish hemlock
#

Maven can only read XML as the API is only geared towards it.

#

And XML is a terrible format.

#

TOML ftw.

tender shard
#

why? I like XML πŸ˜›

#

and I also like maven

#

it's easy to use

magic dome
#

ok so its seems to be including directories but none of the calsees are there... but when i look at the jar they are there sooooo

tender shard
#

and it doesnt invent new things for stuff that already exists

#

and it doesnt need to download a huge 150MB wrapper from slow-as-hell servers everytime I clone a repo

#

everytime I clone some repo requiring gradle it takes at least a minute until gradle is done with its bullshit

#

maven just works because... I ALREADY HAVE IT INSTALLED

#

gradle insists on downloading itself every time again

tender shard
trail lintel
#

We got like the same specs haha, you on a 5800x mf?

tender shard
tall dragon
#

priced at a mere 3.5 k

trail lintel
#

Oh you got a fancy pants graphics card haha im still on the 1080ti

tender shard
#

I needed it for MSFS2020 πŸ˜„

trail lintel
#

HAd to google that one haha I have heard good things about this new version actually

#

I played the old microsoft flight sim ages ago

tender shard
#

tbh

#

MSFS2020 is the BEST flight sim ever

#

I used to have them all

#

X-Plane, old MSFS, ...

#

2020 is the best one for flying civ aircraft

trail lintel
#

I'm waiting on kerbal space program 2. They better have native linux builds, going to consoles scares me

tender shard
#

yeah :3

#

I'm also waiting for KSP2

trail lintel
#

Gonna be legendary for sure, no way they can mess it up

tender shard
#

I learnt more in KSP about how space things work then in ANY classes

tender shard
#

but maybe #general

trail lintel
#

Dude same lol its amazing how it really clicks in your head when you can play it. Understand that everything is just equal and opposite. You put the energy in to get up into orbit, you fling yourself off the planet with a gravity assist, you just took away that much energy from the orbital system (negligible in planetary scale)

lavish hemlock
# tender shard it's easy to use

I like Gradle because it's easy to use and doesn't require me to write 30+ line files as part of a "simple" build configuration.

ivory sleet
#

Yuh, and for people who say gradle isn’t declarative, it can be just as declarative as maven

lavish hemlock
# tall dragon ctrl C + ctrl V

Well then I still have to navigate over to my other projects to CTRL+C, then CTRL+V and change all the project-specific values, and I'm still left with verbose bullshit compared to the 5-7 line Gradle Kotlin buildscript.

ivory sleet
#

'group:artifactId:version'

<group>group</group>
<artifactId>artifactId</artifactId>
<version>version</version>

lavish hemlock
#

I don't think Gradle's perfect, I just don't like Maven.

tall dragon
#

well everyone has their preference

ivory sleet
#

I’d say gradle belongs more to the solution set compared to what maven does

lavish hemlock
#

If I had the skills to write a buildsystem, I'd make one inspired by Cargo.

runic mesa
#

Can I check if a mob is spawned by a spawned?

#

Spawner?

tall dragon
#

yes you can

low temple
#

Is anyone aware of an API that lets you save a config yml file without removing the comments?

runic mesa
ivory sleet
low temple
#

id like to be able to update yml files in real time

ivory sleet
#

There exist certain libs which tries to keep comments innocently

#

But thing is

tall dragon
# runic mesa How?

well you can but in a limited way, i believe its only possible inside CreatureSpawnEvent

ivory sleet
#

Comments can be placed and cluttered anywhere in a yaml. They’re not to be associated nor attached to any value nor node which makes it hard to track where the comments should be if you decide to change the format.

tall dragon
low temple
#

like values organized like "Section.Data"

ivory sleet
#

it does have node comments

low temple
#

no could you link it?

ivory sleet
#

So it KINDA supports comments

low temple
#

interesting

ivory sleet
#

I’ll leave you with that. Best of luck.

fervent gate
#

I'm really confused on the Gradle vs Maven thing (mostly because of my lack of knowledge about any). Is it all personal opinion or is there really a better one?

low temple
tall dragon
fervent gate
#

Ok

ivory sleet
#

There is some objective facts to the matter @fervent gate

#

In a multi module project, gradle has been benchmarked and the conclusion is that it’s faster in that case

#

it is also objectively less verbose (verbose = many words/semantic terms)

quaint mantle
#

An internal error occurred while attempting to perform this command

fervent gate
#

Hmm ok. I'll look into gradle then.

tall dragon
#

you got yourself a nullpointer at line 40

quaint mantle
tall dragon
#

check if the itemstack is null

#

before that code

quaint mantle
#

ok

tall dragon
#

when a slot is empty, it will return null. so you cannot perform getAmount()

quaint mantle
#

if(i.equals(null)) return true; ?

tall dragon
#

nah use ==

quaint mantle
#

if(i == null) return true;
int amount = i.getAmount();

#

?

tall dragon
#

sure, that should work

#

but

#

when an item is null

#

the loop will stop

#

is that what you want?

quaint mantle
#

i have a solution

tall dragon
#

then you should use continue;

#

that will skip the code and go to the next loop

quaint mantle
#

for (ItemStack i : p.getInventory().getContents()) {

quaint mantle
tall dragon
#

you really dont have to

ancient plank
#

or simply just continue

tall dragon
#

just use continue;

quaint mantle
#

oh

#

'-'

#

i'm new in java, sorry for my inteligencie

ancient plank
#

man I'm really glad I learned java before trying to make spigot plugins!

quaint mantle
#

'-'

#

I'm trying in hard :)

ivory sleet
#

But instead learn and don’t forget (:

ancient plank
#

true

quaint mantle
#

;)

#

:)))))

#

stonks

#

learn java, after, learn how to make spigot plugins ❌

make spigot plugins without learned the java: βœ…

tall dragon
#

🧒

ivory sleet
quaint mantle
#

yes!

#

i learn java trying to make any codes

#

oh imagine learning java in the first place bro

#

i use bash scripts!

#

:O

quaint mantle
tall dragon
#

for (ItemStack i : p.getInventory().getContents()) {
            if (i == null) continue;
            String Type = String.valueOf(plugin.getConfig().getString("Items."+key+".Item"));
            Double Price = plugin.getConfig().getDouble("Items."+key+".Price");
            int amount = i.getAmount();

            if(i.getType().name().equalsIgnoreCase(Type)) {
                items += amount;
                moneyGanhar.set(moneyGanhar.get() + (Price * amount));
                p.getInventory().remove(i);
            } else return false;
        }
quaint mantle
#

?learnjava hmmm no one was using this command?

undone axleBOT
tall dragon
tall dragon
#

try to understand though

quaint mantle
tall dragon
#

continue will skip the code

#

and go on to the next item

fervent gate
#

I'm really confused with Gradle and setting up the project. Instead of creating a spigot project, I created a gradle one, now I can't do things like "extends JavaPlugin" and such. How do I add these manually or is there something I am missing?

ancient plank
#
String Type = String.valueOf(plugin.getConfig().getString("Items."+key+".Item"));

why string#valueOf()

tall dragon
#

idk, i copied his code

ivory sleet
#

int[] a = new int[]{1,2,3,4,5};
for (int i = 0; i<a.length;i++){
int element = a[i];
if (element == 5) {
continue;
}
out.println(element);
}

Here, we print every number in a except 5 @quaint mantle

quaint mantle
#

you forgot system

#

System.out

ivory sleet
#

It’s statically imported derp

quaint mantle
#

huh?

#

hey @tall dragon

tall dragon
#

hey

ivory sleet
#

import static System.out; is possible iirc

quaint mantle
#

Did I tell you?

tall dragon
#

no you did not

quaint mantle
quaint mantle
ivory sleet
#

Tho it’s dangerous if you use it erroneously PINGu

quaint mantle
#

wat dangerous?

ancient plank
quaint mantle
#

static? performance?

quaint mantle
tall dragon
#

of course

quaint mantle
#

Thanks to everyone who helped me.

ivory sleet
#

People will think that the method is just an instance method but then it turns out to be a static function from another class

tall dragon
ivory sleet
#

if they look at the code on GitHub or smtng

#

But what does hit performance is wildcard imports

ancient plank
#

yes make sure to learn the code and not copy paste the spoon feed!

ivory sleet
#

Altho not during runtime

quaint mantle
#

thx

ivory sleet
#

But they take some extra as opposed to just import what you need explicitly

ancient plank
#

if u come back tomorrow and go "what does continue do again" I'm ignoring you :kitten_thumbs_up:

quaint mantle
#

I learn java knowing the basics of English and translating the words I don't know :_:

#

'-

ivory sleet
#

Yeah, which country are you from?

quaint mantle
#

Brazil =)

ancient plank
#

πŸ‡§πŸ‡·

ivory sleet
#

it’s a shame we don’t have Brazilian Java

ancient plank
#

;;;