#help-development

1 messages · Page 1360 of 1

maiden briar
#

if(DiscordUserManager.getDiscordUserForUUID(UUIDHandler.getUUIDFromPlayer(player.getName())).thenAccept(user -> user == null)) this doesn't work

eternal oxide
#

You can not return a value from your getDiuscordUser.

maiden briar
#

Yes, now I use future

eternal oxide
#

You still can;t get a return in your same code, the future has to run then you can get the result later

#

you simply can not getDiscordUser adn get a result when multithreading

maiden briar
#

Ok but how can I then null check the user?

eternal oxide
#

you have not delt with yrou return

#

your getDiscordUser method needs to change to a void return type

green prism
maiden briar
eternal oxide
maiden briar
#

I just want to get all values from the database (async), and then return the DiscordUser with the UUID if there is one

quaint mantle
#

@maiden briar it seems you need some help. If you need help you can look at my GitHub for a reference.

maiden briar
#

That was the main question 1.5 hours ago

maiden briar
green prism
eternal oxide
#

I'm pretty sure your question 1.5 hours ago was how to get a discord user without crashing the server

maiden briar
#

Yes, and then the question changed to async, because I know that is the solution

eternal oxide
#

yes

quaint mantle
eternal oxide
#

But it seems you are not understanding how to use callbacks

quaint mantle
green prism
maiden briar
#

I will ask on coded red's server

eternal oxide
#

Simply put, you can not fire of anything Async and wait for the answer. You have to fire it and forget about it. The Async has to do its work, then call a method sync with the server thread and deal with the result.

eternal oxide
#

That result could be 10ms later or 30 minutes. You have no control over it.

quaint mantle
eternal oxide
#

Your answers are already in that thread you linked

quaint mantle
#

^

green prism
wet breach
#

need to shade the api into your plugin since you know that api isn't going to be available magically for your plugin

quaint mantle
#

That's the Answer.

eternal oxide
#

Did yoru plugin compile with no errors/warnings?

wet breach
#

most likely if the problem is only noclassdef exception

green prism
eternal oxide
#

Open your resulting jar file and see if it includes a com/warrenstrange folder

quaint mantle
#

hey i wanna ask how do i set a premium (online mode) to player on bungeecord proxy when online mode is off? (something like fastlogin)

green prism
wet breach
quaint mantle
#

well yea but

wet breach
#

This community does not support people who disable online mode for illegitimate reasons

quaint mantle
#

i do not disabling it im just making a plugin

wet breach
#

simple answer is don't even bother with offline mode? Not sure why you would need to even bother supporting that lol

quaint mantle
#

im sorry, but i didnt ask about why to not use offline mode or something im just making a plugin for premium

eternal oxide
wet breach
green prism
eternal oxide
#

No, the jar that is created after you compile, open it with any compression util like 7zip

wet breach
#

maven is just a build tool, still produces a jar

green prism
eternal oxide
#

If its not there I'm betting you are building using Artifacts in InteliJ, which is wrong. Right hand window marked as Maven... Expand lifecycles and run packge. The jar it makes with be in the target folder of your project.

eternal oxide
#

Don;t use artifacts

dry beacon
#

This event is deprecated, what should I use instead? PlayerPickupItemEvent

wet breach
#

lol

green prism
wet breach
dry beacon
#

Thanks!

wet breach
#

you do know the JavaDocs states such

eternal oxide
wet breach
#

?jd

eternal oxide
#

You need to build using maven, not artifacts

eternal oxide
#

Anyone who uses InteliJ please talk @green prism thorugh a maven build. ( I use Eclipse so couldn;t tell you where to find the correct window)

#

and no, thats not the right place

green prism
#

Yea, please

daring sierra
#

Lmfao

wet breach
#

I find it interesting you use eclipse @eternal oxide

#

from now on I will just send people who use that IDE to you 😉

pliant depot
#

So i want smth to auto spawn mobs (Custom nametag ect) in a certain AREA of a certain wORLD WITH CuSTOm name, HeA L Th and wepon/dmg eCT Any plUgins YOu Knmow?

quaint mantle
#

heyo im tryna use enjins api, but i dont understand their docs at all

#

there's no maven repository or anything

unreal quartz
pliant depot
#

Should i ask that qiustiion somejybehwere else

unreal quartz
quaint mantle
unreal quartz
#

with http requests

quaint mantle
#

someone recommended i use the okhttp library but i really do not understand anything about it

unreal quartz
#

yes, you'll need to understand how http requests work

quaint mantle
#

any good tutorials explaining how to use http requests with java?

#

even better if its video, but i dont mind a good read

unreal quartz
#

don't have any suggestions but I'm sure this is something you can google and get plenty of results for

wet breach
quaint mantle
wet breach
#

lol good luck with that then

quaint mantle
#

i already told him that he should be using tebex

wet breach
#

personally I drop people as clients if they insist I use something that is severely broken

dusty herald
#

DogKek remember Bloodmoon?

#

that shit was a disaster

onyx shale
#

wut is that

wet breach
#

a plugin terribly coded

onyx shale
#

link?

dusty herald
#

let me get it rq

onyx shale
#

or does it even exists

green prism
dusty herald
eternal oxide
onyx shale
#

ngl sounds like a rly good ideea

unreal quartz
#

it will say maven

onyx shale
#

considering the lack of tags i assume this is old af

wet breach
#

@onyx shale it is a good idea, but the source code is just atrocious though

onyx shale
#

oh yeah 2015

dusty herald
wet breach
#

like updating the existing code will take many hours XD

dusty herald
#

original source code was compiled for 1.7.10

green prism
dusty herald
#

and yes, it uses NMS

unreal quartz
#

package

onyx shale
#

wha

#

did he rly attempt to recreate a enitty from the ground up?

dusty herald
#

🤷

onyx shale
#

good ideea still gonna add it for reproduction

quiet ice
unreal quartz
#

I think he wants to rename it to 1.8

green prism
onyx shale
#

arent u spending more time fixing maven than actually coding?

#

seems non productive for me

unreal quartz
#

what are you actually doing

#

it looks like you're interfacing with google... which isn't exactly spigot related

green prism
eternal oxide
#

Your error is now that you are using teh library incorrectly.

unreal quartz
unreal quartz
#

i doubt you're using it correctly if you're blindly copying code snippets from spigot

opal sluice
#

Does somebody has an idea ?

green prism
unreal quartz
#

the problem is no longer maven related, you have the classes you need, the problem now is that you're incorrectly using whatever library you have just shaded

eternal oxide
#

no

unreal quartz
#

I just said it was no longer maven related

green prism
vapid oyster
#

Hey is it possible to hook into the PAPI API and use that to parse Placeholder within your own Plugin?
More specific example String name = %player_name%

#

I don't actually want to parse that placeholder, but wanted to be as clear as possible on the question

unreal quartz
#

yes

vapid oyster
#

So I can do this, for a Placeholder which is NOT in my Plugin, but from another?

unreal quartz
#

yes

vapid oyster
unreal quartz
vapid oyster
#

Aw frick ya! Thanks 😄

quaint mantle
#

hey how do i check if player is logging with premium minecraft or is cracked on bungeecord?

unreal quartz
#

if the server is online-mode then everybody is, if not then you cannot check

quaint mantle
#

then how does fastlogin check it?

unreal quartz
#

well.. it's open source

quaint mantle
#

well idk how does it check

#

i literally searched through the src idk how it works

unreal quartz
quaint mantle
#

and how do i do that?

unreal quartz
#

well I'm not gonna write the plugin for you but the steps are described right in front of you

quaint mantle
#

okay

covert urchin
#

Is there a decent plugin for maybe handling database connections in a centralized area (think: instead of multiple mysql pools throughout various plugins, use 1 central plugin api to manage a single pool for other plugins)?
I found something but it wasn't clear to me, without testing with it, whether or not it was secure (prepared statements, etc) or straight up open for injection. :/

quaint mantle
#

@unreal quartz ok so i watched a whole 1 hour series on gson, so now i understand how gson works.

#

but now i still do not get how im supposed to use enjins' api

unreal quartz
#

you perform a get request, or a post request, or whatever to whatever endpoint it is

#

this should be documented somewhere

quaint mantle
#

they documented what we ened to put in the post request, but im still a little confused

#

one sec ill send you what i mean

#

what do they exactly mean by method?

unreal quartz
#

i wouldn't know myself without knowing how enjin works

#

but that is something you supply in the body of your post request

green prism
#

Guys guys guys, very fast question, is possible to make a player directly open a book by clicking on an icon in a GUI?

green prism
cloud berry
#

never done it myself lol or id show u example but i kno u can open books at will serverside

green prism
cloud berry
#

no xD u asked if its possible not how, mi answer still valid

green prism
cloud berry
#

wat

sage swift
cloud berry
#

playerConnection.sendPacket(new PacketPlayOutOpenBook(enumhand));

#

voilá

sage swift
#

wtf you don't need that

#

Player#openBook
very easy

cloud berry
#

its either taht or redbau's reply

#

oh

#

LOL 😄

green prism
#

oh

#

lol

cloud berry
#

@sage swift gets the title of mvp for this period

green prism
#

ahaha

green prism
slim magnet
#

I havent worked with gui's in a couple years

#
    public void onInventoryClick(InventoryClickEvent event) {
        if (!(event.getClickedInventory().getHolder() instanceof AbilitySelector)) return;
        event.setCancelled(true);

        ItemStack item = event.getClickedInventory().getItem(event.getRawSlot());
    }
#

Is this the way to see what item in an inventory is clicked? And does it differ from the upper or lower inventory?

quiet ice
#

Java float to int casts round down, right?

abstract relic
#

ye

#

they floor it

unreal quartz
#

no

unreal quartz
#

it is truncated

abstract relic
#

so yea

#

they round it down

unreal quartz
#

depends which way you consider "down"

#

if you interpret that as closer to 0 then it's wrong

quiet ice
#

The f2i instruction performs a narrowing primitive conversion (JLS §5.1.3).

unreal quartz
#

a negative number will be truncated and produce unexpected results

abstract relic
#

closer to the "main" value

#

thats what I meant ye

quiet ice
#

Here, I got the proper terminology

idle grotto
#

when sending a message in chat, trailing whitespaces are removed. Is there a way to get the message with those whitespaces, or is it done on the client side?

opal juniper
#

why do you need them? @idle grotto

storm tiger
#

on 1.8 when spawning horses i want the nametags near the ground while the horse is around 50 blocks above that y position of the nametag, how would i go about this?

storm tiger
#

this is to support 1.7 players

#

which don't have it

opal juniper
#

Ohhh... we don't really support ~1.8 here

dusk wedge
#

how do I go about stopping the lag from sending packets of blockchange to the client? I can't figure it out

slim magnet
#

Hahahaha

idle grotto
opal juniper
dusk wedge
#

it lags the client

opal juniper
#

i mean, i think that is kinda what happens? A combination of calculating light updates + other calculations

dusk wedge
#

would you know how to go about it without lagging the client?

opal juniper
#

What are you sending in the packet? Just like blocks?

dusk wedge
#

a singular block change yeah

#

every second

opal juniper
#

Hang on... Every second! Im not suprised that it kinda lags the client

dusk wedge
#

new to packets and stuff of that sort

opal juniper
#

It shouldn't be that noticable

#

are you using nms or protocollib?

dusk wedge
#

protocollib

opal juniper
#

Can you send a recording or something of the lag?

dusk wedge
#

yeah give me a sec

opal juniper
storm tiger
#

?

opal juniper
#

Like why are you writing plugins in 1.8, is it not a bit obselete

storm tiger
#

no lol

opal juniper
dusk wedge
#

uhh

#

u wanna hop in a private call?

#

the code is probably bad I haven't coded in a few years

opal juniper
#

It doesn’t matter. I don’t wanna call but if you really want to you can dm it

dusk wedge
#

kk i'll sned u it

obtuse basin
#

Any Ideas why I get this? ```
** BEGIN NESTED EXCEPTION **

javax.net.ssl.SSLException
MESSAGE: closing inbound before receiving peer's close_notify

STACKTRACE:

javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
at sun.security.ssl.Alert.createSSLException(Alert.java:133)
at sun.security.ssl.Alert.createSSLException(Alert.java:117)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:311)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:267)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:258)
at sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:637)
at sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:616)
at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:2249)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4221)
at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1464)
at com.irgendwer.myworlds.MyWorlds.onDisable(MyWorlds.kt:31)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:179)
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:341)
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:417)
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:411)
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.disablePlugins(CraftServer.java:443)
at net.minecraft.server.MinecraftServer.func_71260_j(MinecraftServer.java:512)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:680)
at java.lang.Thread.run(Thread.java:748)the Code:
override fun onDisable() {

    try {
        if(connection!=null && !connection!!.isClosed) {
            connection!!.close()
        }
    } catch(e: Exception) {
        e.printStackTrace()
    }
}```
quiet ice
#

what language is that?

#

Rust?

paper viper
#

its kotlin..

#

lmao

#

MyWorlds.kt:31

opal juniper
#

?jd

paper viper
#

is it the close one?

quiet ice
#

Probably connection!!.close()

obtuse basin
paper viper
#

It says that SSL Connection to the database is failing

quiet ice
#

However don't ask me what !!.close() does

paper viper
#

its just null safety

#

better Java 🌚

quiet ice
#

Ah

paper viper
#

in Kotlin there is no null

#

really

#

its null safe

quiet ice
#

Meanwhile I thought it was double negation

paper viper
#

no lmao

#

Anyways, do you verify that the connection to the database is correct?

obtuse basin
paper viper
#

lmfao

obtuse basin
#

javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify

slim magnet
#

What's the event to detect when the player clicks f?

#

To like swap the item

quiet ice
#

question is whether the issue is at your side of the libraries side

slim magnet
#

Does the event get fired even when there is no item inhand to be swapped?

quiet ice
#

I would look at the docs of close again, maybe it has more info on that matter

slim magnet
#

Ok

obtuse basin
slim magnet
#

there's no info regarding it

slim magnet
slim magnet
#

yeah

#

that's useful too but im looking for the swap key

slim magnet
#

Nice I think that's it

#

@obtuse basin Which event has that info

#

PlayerInteractEvent?

strange elk
#

is there a way to see where the events actually gets called?

lost matrix
obtuse basin
floral kindle
#

I'm developing a Boss Bar Api for my use and I'm having a problem!

And every time I use it it doesn't work perfectly!

#

That's what happens!

slim magnet
floral kindle
#

Does anyone have a better experience?

lost matrix
floral kindle
#

Yes! But I put a check on her not to do that.

slim magnet
#

Oh is it InventoryClickEvent?

lost matrix
obtuse basin
floral kindle
#

More continues to create a new one.

lost matrix
slim magnet
#

No I just wanna detect whenever F is clicked

#

Then cancel any default action (if there's any), then do something

eternal oxide
#

You can not detect a specific key press, only if its bound to somethign that has a server reaction

lost matrix
slim magnet
#

Key*

quaint mantle
#

if(player.hasPermission("astreans.world.") + target.getWorld().getName());

There is an error on this line, where did I go wrong?

slim magnet
strange elk
quaint mantle
slim magnet
#

Because in ClickType there's an enum for that click

lost matrix
quaint mantle
#

Brackets...

#

Ty

lost matrix
strange elk
#

oh, i might just found it

quaint mantle
#

True, however that would just make my code longer

strange elk
#

it is in the nms

drifting halo
#

longer = better

slim magnet
#

anyone know?

quaint mantle
drifting halo
#

lmfao

slim magnet
#

If the event gets fired even when the hand is empty

drifting halo
#

its compiled all the same my dude

eternal oxide
#

longer = more readable. else you may as well strip all whitespace.

drifting halo
#

good job, now its 2 lines shorter and doesnt even work

lost matrix
floral kindle
lost matrix
slim magnet
#

How do I see what version a feature in the API was added?

floral kindle
#

Can you explain to me in writing?

cloud berry
#

in writing? as in pen n paper? xD

lost matrix
floral kindle
#

Can you give me an exampleCan you give me an example?

lost matrix
#

Or get your logger from you JavaPlugin and call info()

sturdy patrol
#

I'm so sad. it seems impossible to get any Hangable to stick on a floating point location, it needs a BlockPosition.

#

Tried using packets, but I wasn't successful.

#

Do you guys think there is a way to get an itemframe to take any position ?

floral kindle
lost matrix
# floral kindle

Ok so the condition is never met even when using the same name?

floral kindle
#

That!

vivid cave
#

i'm making animated image2maps;
in a MapRenderer, i'm currently doing mapcanvas.drawImage(imageFrame) for every frame of a gif; ain't there a more optimised way? so existing pixels don't get redrawn?

lost matrix
# floral kindle That!

That doesnt add up with your code. Are you using only one single instance of your BossBarAPI class?

quaint mantle
#

How can I go about dismounting a rider from a saddled pig?

floral kindle
#

I am!

quaint mantle
#

i've attempted using #eject() but does nothing

sturdy patrol
#

Alexis I don't think so. The most you can do is using a packet to only update a rectangle in the map.

lost matrix
# floral kindle I am!

Then the toCheck method should be true the second time. Do the id Strings match up? What happens if you add the same bar 3 times.

lost matrix
vivid cave
#

ah

#

but like, wouldn't it be interesting to store in memory all the changes that need to be applied from a frame to another? so like a hashlist containing the (x,y) coordinatess of the pixel and its associated color index?

#

so i only change through setPixel what needs to be changed

#

and not the whole picture

lost matrix
#

I would actually just cache the packets from 1 to N and then just send them repeatedly instead of rendering the map again each time.

vivid cave
#

i don't have protocollib

sturdy patrol
#

You don't need protocolib

vivid cave
#

so u mean caching the canvas?

ivory sleet
#

like significantly

#

oh I can imagine spring also

vivid cave
#

i'm a bit confused with the packets thinggie

#

and confused about the page u sent me

lost matrix
# vivid cave so u mean caching the canvas?

I mean caching the actual packet. Spigot actually never re-renders the map. You just send a packet to the client telling him that the map is supposedly rendered with the sent data.
So its a really light task on Spigot because its just sending a packet each tick.

#

This brings me to an idea...

vivid cave
#

how do i handle packets tho?

#

i never did that before

#

i thought this was protocollib

sturdy patrol
# vivid cave so u mean caching the canvas?
((CraftPlayer) player).getHandle().playerConnection.networkManager.sendPacket(new PacketPlayOutMap(yourMapId, 4, false, true, new ArrayList<>(), yourByteArray,0,0,128,128));```
This line can send a map update packet to a given player
vivid cave
#

oh

sturdy patrol
#

"yourByteArray" being a byte[], with every byte représenting a color from MapPalette

lost matrix
#

You could actually make a working internet browser using maps and a selenium docker that creates several screenshots each second which are then send via the map.
All i need to figure out is how to input data to the browser...

vivid cave
#

i saw a static method of MapPalette.imageToBytes but its deprecated

sturdy patrol
#

It's marked as deprecated cause it uses 'Magic Values'. All the colors in MapPalette are magic values too

vivid cave
#

so i shall not care of this depreciation?

sturdy patrol
#

I take note of it, but that's all. It's like NMS, you will have to do a quick check at every minecraft update.

drifting halo
#

deprecated means fuck all in spigot

vivid cave
#

aha

fading lake
#

at this point im pretty sure they deprecate things because the warning looks pretty...

sturdy patrol
#

Yup. Minecraft use a weird indexed color map, and all its uses are marked as 'deprecated, magic values'. But we have no other ways x)

vivid cave
floral kindle
#

@lost matrix I discovered my problem!

#

Error!

#

Correct!

fading lake
#

static

#

is that eclipse white theme

floral kindle
#

After a long time I noticed that it was just that!

sturdy patrol
floral kindle
eternal oxide
#

That theme burns my eyes 😦

fading lake
#

not you

#

wrong pers

sturdy patrol
#

np np x)

fading lake
#

use intellij lol @floral kindle

sturdy patrol
#

I'm using Eclipse with white theme too x)

fading lake
#

do yall wanna see something really hazardous

eternal oxide
#

I use Eclipse with InteliJ theme 🙂

fading lake
vivid cave
#

@sturdy patrol thanks a lot for your help!!!
i think that updating packets like this will make it infinitly faster 😛

sturdy patrol
#

Np alexis ^^ I've been working on something similar for a few weeks, so I got to read some documentation ahah

vivid cave
#

haha i see 🙂 bonne nuit buddy; i spotted ur "é" 😉

sturdy patrol
#

ahah bonne nuit à toi aussi good night to you ^^

fading lake
#

languages

ivory sleet
#

you successfully exploded my eyes

fading lake
#

yw

sturdy patrol
#

Now I'm taking onto myself not to send gifs about the discord white theme flashbang x)

dusk wedge
#

when I use blockchange packet, and the player right clicks the fake block and it updates again it heavily lags the client

#

any idea why?

eternal oxide
#

are you doing anything in the interact event?

dusk wedge
#

no interact event, just when the client realizes it doesn't exist

quaint mantle
#

i dont know if this has to do with spigot but im making a custom crafting recipe and i dont understand how to make it enchanted

fading lake
#

enchant the itemstack result

#

ezpzlemonsquz

quaint mantle
#

oh i forgot to say im really bad at coding ;-;

sturdy patrol
fading lake
#

like you create custom recipes like this, you can enchant it (say I was making the greatsword)

ItemStack greatsword = new ItemStack(Material.DIAMOND_SWORD);
ItemMeta greatswordMeta = greatsword.getItemMeta();
greatswordMeta.setDisplayName(ChatColor.RESET + "Greatsword");
greatswordMeta.spigot().setUnbreakable(true);
greatswordMeta.addEnchantment(Enchantment.ALL_DAMAGE, 1);
greatsword.setItemMeta(greatswordMeta);


ShapedRecipe diamondSword1 = new ShapedRecipe(greatsword);
diamondSword1.shape("**B","**B","**S");
diamondSword1.setIngredient('B', Material.DIAMOND_BLOCK);
diamondSword1.setIngredient('S', Material.STICK);
Bukkit.getServer().addRecipe(diamondSword1);
#

idk if thats right for your version though, adding enchantments is weird between 1.8-1.16

quaint mantle
#

wait i dont think ym thing is related to spigot

#

i found a tutorial with json files

#

sorry

fading lake
#

what

#

that might be assets

dire temple
#

Is it a data pack

fading lake
#

which is diff

quaint mantle
#

yes

fading lake
#

^

#

oh thats def not spigot

quaint mantle
#

soryr

dire temple
#

That also works for doing stuff

fading lake
#

I dont think you can enchant them unless you had your own mod

dire temple
#

Anyone know a good way to add a prefix to a players name in the tab list and in their name tag but not in chat, honestly I couldn’t find a clear way to do it in general so any help is nice

fading lake
#

team prefixes possibly?

#

idk if they affect chat too

dire temple
#

They do but I would prefer to do this without using teams

fading lake
#

uhh

#

you could do it with gameprofiles + nms but thats a really bad idea

#

whats wrong with teams?

dire temple
#

I still want to have players able to join other teams

fading lake
#

oh

dusk wedge
#

anyone know what packet goes through when a player left/right clicks a block?

dire temple
lost matrix
ivory sleet
#

sPeEd

gusty bough
#

Hey , I'm currently trying to deactivate collisions between my players. Using player.setCollideable(false) or p.spigot().setCollidesWithEntities(false) do not work.
Any idea?

minor fox
#

try using scoreboards

gusty bough
#

I tried with ingame scoreboards and collideRule do not work :/

ivory sleet
#

Ferskfisk nice name

minor fox
#

ty

ivory sleet
#

🇩🇰?

gusty bough
#

Do someone have code to share with scoreboards disabling collisions maybe?

minor fox
#

🇳🇴 😉

ivory sleet
#

Ah

#

Well Sweden is superior

minor fox
#

you wish

ivory sleet
#

It’s true tho

minor fox
gusty bough
#

Mhh no code for now using scoreboards in a plugin

#

I used teams ingame and setCollideable in plugin

#

Both don't work

ivory sleet
#

Define don’t work?

#

Sounds like a pebkac issue

mystic lion
#

cap

daring sierra
cursive glen
#

Any way to make a new config?

crisp iron
#

any give me an example that an Attribute would be used for when adding to Items?

fathom timber
#

What do u mean

#

Like enchantment

crisp iron
#

like there's a method to add attributes, but what are they exactly good for

cursive glen
#

uh

#

I can make a config.yml

#

I'm looking to make another yml file

fathom timber
#

Like data.yml?

#

Or Whatever

young knoll
cursive glen
#

yes

crisp iron
#

yeah but does it give damage, attack spped, knockback resistance, max health to the player when they hold the item or something?

young knoll
#

Yes

#

Or wear it

crisp iron
#

Gotcha

#

makes a lot more sense

young knoll
#

You can specify which

crisp iron
#

cause i was going through the package overview but wasn't sure what i was looking at xD

cursive glen
fathom timber
#

Just look up custom files spigot

#

On yt or whatever browser u use

hollow bluff
#

The two test folders that comes with Maven, do I need them or can I delete them?

fathom timber
#

test folders?

hollow bluff
#

src/test/main and src/test/resources i belive

cloud berry
#

quick question guys... if i /stop my server, do players get kicked before or after my plugin's onDisable()? :I eg. do i need to call player cleanup code from onDisable() or can i just rely on player quit event?

random epoch
cloud berry
#

ah 😄 i did find lol ty, guess i used wrong keywords 1st time

sage swift
young knoll
#

Reload isn’t really supported or recommended

#

But it was meant to be at first, and you should design around it properly if possible

west linden
#

How do i make a config for a plugin in bungeecord

sage swift
#

is ConfigurationSection#getKeys mutable?

quaint mantle
#

yes maam

lethal field
#

I don't understand. What do I need to do?

summer scroll
gentle laurel
#

Can someone send link for tab plugin please

gentle laurel
#

Ok

quaint mantle
#

Hello discord! 1. what is name of farm sweet barry? (Right click on sweetbarry) 2. How do I know if it's the bottom or not when I dig up bamboo or churros?

daring sierra
#

wha

#

churros?

#

Sweet barry?

#

Dude tf?

quaint mantle
#

chrous

daring sierra
#

Oooh Chorus fruit

quaint mantle
#

ye

#

I want get name of event that when I farm sweet berry

#

but not blockbreak

daring sierra
#

Lemme check rq I 4got

#

PlayerHarvestBlockEvent iirc

quaint mantle
#

oh thanks!

fringe folio
#

hey so I was trying to make like a bossbar that is constantly going down then like refilling and I tried this but it just goes down instantly even when I set the delay to a whole second

    BossBar bar = Bukkit.createBossBar(ChatColor.BLUE + "" + ChatColor.BOLD + "play.electricraft.net", BarColor.BLUE, BarStyle.SOLID);
    
    @SuppressWarnings("deprecation")
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {
        bar.addPlayer(e.getPlayer());
        Bukkit.getScheduler().scheduleAsyncRepeatingTask(main, new Runnable() {
            public void run() {
                for(int i = 0; i < 10; i++) {
                    bar.setProgress(i / 10);
                    try {
                        TimeUnit.SECONDS.sleep(1);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                bar.setProgress(1.0);
            }
            
        }, 10L, 10L);
    }
quaint mantle
daring sierra
#

y u no use 1.16

fringe folio
quaint mantle
#

ahhhhhhhhhhhhhhhhhhhhhh

#

you are big brain

#

thanks 🙂

fringe folio
#

happy to help

quaint mantle
fringe folio
#

?

hybrid spoke
#

your for loop starts at 0

#

0/10 = 0

fringe folio
#

ohhhh

#

so it sets to zero at the beginning

#

thank you

hybrid spoke
#

nvm, my brain isn't working on maths

fringe folio
#

oh wait it doesn't go down now

hybrid spoke
#

wait wait wait, i think my brain is generally not working right now

fringe folio
#

ok ok try to remember how to breath

#

😄

hybrid spoke
#

starting at 0 was totally fine.
bar.setProgress(1.0); you won't need that, cause your 10/10 is already doing this for you

                    try {
                        TimeUnit.SECONDS.sleep(1);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
``` don't do that. you will sleep the main thread for a whole second which will cause a lag.
fringe folio
#

ok do you have a better solution?

hybrid spoke
#

if you want to have it delayed you could use an index-integer

fringe folio
#

now it goes down (ignoring the delay) and stops there

hybrid spoke
#

maybe because your scheduler isn't coming far

maiden briar
#

In intellij if I go to Editor -> Code Style -> Java, and I change the code in the example it will be automatically set back

#

So I can't use a custom code style

fringe folio
#

I set it to repeat

daring sierra
hybrid spoke
# fringe folio wdym?
double index = 0.0;
on..(yeah.. argument goes brrr) {

scheduler {

if(index != 1.0) {
  index+=0.1;
} else {
  index = 0.0;
}

bar.setProgress(index);

}, 20L, 20L);

}
fringe folio
#

let me try that

hybrid spoke
#

oh, answered on your wrong message.

anyways: your scheduler now is sleeping the main thread ever half a second for a second 10 times

quaint mantle
hybrid spoke
fringe folio
#

Local variable index defined in an enclosing scope must be final or effectively final

hybrid spoke
#

ohh wait, join event. yeah, you shouldn't start a new scheduler everytime a player joins btw

fringe folio
#

it doesn't have to be on join I just want to have a bossbar that is like constantly going down

quaint mantle
#

So right now you have a The join event and when a player joins the server they get a boss bar that is constantly going down correct?

hybrid spoke
quaint mantle
#

^ that should work

maiden briar
#

PlayerDropItemEvent
How can I immediately remove the dropped item? Just despawn, I don't want to cancel because then they get the item in the inventory back

quaint mantle
maiden briar
#

Ok, but I can't find a method .despawn()

hybrid spoke
#

#remove()

split anchor
#

how do i download spigot 1.8.8?

quaint mantle
#

yeah xd happened to me twice septicuss

worn tundra
#

lmao

#

I mean it's understandable

#

why they wouldn't want to violate smth like that

quaint mantle
#

yea but if u can just download jar and not use the buildtools?

#

exactly

worn tundra
#

it is dumb xd

quaint mantle
#

tbh it is

split anchor
#

ok

#

thx

quaint mantle
#

yw

latent vale
#

I am making a plugin but i get this error in console how do i fix it?
Could not load 'plugins\helloworld.jar' in folder 'plugins'

maiden briar
#

If I run this task async nothings happens, if I run this task with "runTask", also nothings happens and the server will crash. What I want is displaying the border of a region

gritty musk
#

anyone who knows anything about dns/domain stuff please friend me i need help diagnosing and solving an issue with my server and domain, it's urgent!!! please friend me!

maiden briar
#

I know things about domains

maiden briar
#

Yes

hybrid spoke
#

?paste

queen dragonBOT
hybrid spoke
#

@maiden briar

maiden briar
#

Ok I will do it

hybrid spoke
#

runTask crashes your server because your while loops and the Thread#sleep sleeps the main thread.
runTaskAsync will not work in combination with the bukkit/spigot api.

you could execute code sync in your async scheduler with #runTask. for example:

//async
while(myBooleanIsTrue) {
  Bukkit.getScheduler().runTask(() -> {
    //sync
  });
//async
}

but in your case you don't need a sleep, neither a while loop nor an async task

green prism
#

Guys, I need help but I would prefer not to send that code here out of respect for my friend who asked me to do it, who can help me write to me privately.

#

pls

hybrid spoke
#

whats the issue?

green prism
#

Write to me privately for code-snippets

hybrid spoke
#

🤔 i would need the code to look over, just sent it to me in private

fringe folio
#

a bit of a delay but thanks

toxic mesa
#

So i'm rlly confused, I have an uuid and just use Bukkit#getPlayer to make it a player, but somehow the player is null?

        List<String> list = plugin.points.getConfig().getStringList("PlayerDataBase");
        Bukkit.broadcastMessage(String.valueOf(list.size()));
        for (int i = 0; i < list.size(); i++) {
            Bukkit.broadcastMessage(list.get(i));
            Player player = Bukkit.getPlayer(list.get(i));
            if (player != null) {
              // other code
            }

What am I missing?

fringe folio
#

how on earth is this causing an error?

    List<String> barText = new ArrayList<>();
    barText.add("play.electricraft.net");
``` this is basic Java
ancient whale
toxic mesa
#

The player is online :/

#

But I guess i'm not completely crazy I guess

#

will look into it again later

quiet ice
#

what is the error?

fringe folio
#
Syntax error on token ".", @ expected after this token
quiet ice
#

Could you give the full method? You should also trace back all your backets to your corresponding closing brackets

fringe folio
#

I am not inside any method

quiet ice
#

So you are within a class?

fringe folio
#

ohh wait when I put it in a method it works

#

and yes

quiet ice
#

Then put the barText.add line in either the constructor, or static init block

urban trout
#

how would i make something that equips zombies with random armour pieces eg, diamond boots with a diamond chestplate, leather pants, etc?

quiet ice
#

Cast the entity to zombie, it should have an inventory method that you can make use

urban trout
#

okay

#

also how would i get something like hypixel so players can only break player placed blocks because i dont want my map to be broken

unreal quartz
#

keep a log of player placed blocks

#

or hook into coreprotect

abstract relic
#

zombies have inventories @quiet ice?

#

like full on inventories

unreal quartz
#

or alternatively keep a log of all non-player placed blocks

quiet ice
#

half

#

They still have some sort of equipment slots

urban trout
#

thanks lmb

quaint mantle
#

how can I spawn something but 1 block in front of the player?

#

I could use setX or setZ but it will spawn in front o in left or right

#

idk if I should use Vectors (and how)

#

you could just check wheres he s facing and then do if to x or z

oblique scaffold
#

When exactly do event listeners catch subclasses of the specified event? E.g. a PlayerMoveEvent seems to catch a subclass of PlayerMoveEvent I defined myself, but not PlayerTeleportEvent which is also a subclass of PlayerMoveEvent.

fading lake
#

when its that type, it'll be an instance of PlayerTeleportEvent when the player teleports

oblique scaffold
fading lake
#

wdym

oblique scaffold
#

I have a subclass of PlayerMoveEvent, but when I send it, my PlayerMoveEvent listener receives it too, presumably because it's a subclass

#

but that doesn't happen for PlayerTeleportEvent, even though it's a subclass too

#

so I don't get the difference

sullen marlin
#

you didnt add an independent HandlerList

oblique scaffold
#

ohhh, that makes sense, thank you!

keen gust
#

I want to program a GUI with Custom Heads in 1.16.4 only the problem is how can I use the textures from texture.minecraft.com?

cold tusk
#

When do you use "==" and when ".equals()"?

chrome beacon
#

== when you want to match the exact instance and .equals when you want to check if the value is the same

#

Iirc

young knoll
#

== is mostly for primitives and enums

opal sluice
#

Hey guys, did someone already worked with animated frames ?

#

Cause there is a kinda strange problem

#

Even if the chunk is kept load

#

The animations when teleporting on an other world just stop working

empty oyster
#
    @EventHandler (priority = EventPriority.HIGHEST)
    public void on(PlayerChatTabCompleteEvent e) {
         if(!e.getChatMessage().startsWith("/")) {
            e.getTabCompletions().clear();
            return;
        }
         if (e.getChatMessage().startsWith("/")) {
                 e.getTabCompletions().clear();
                e.getTabCompletions().addAll(Arrays.asList("command1", "command2", "command3"));
         }
        System.out.println("USED COMMAND....");
    }

#

I dont know why is this not working?, if i remove the if e.getchatmessagesstartswith /, then i type in the chat 7 <- in the chat an then press the tab then the "Commands" will display...

#

anybody can help ?

unreal quartz
#

try TabCompleteEvent

#

PlayerChatTabCompleteEvent is entirely deprecated

empty oyster
#

not working

#

im on 1.8

#

@unreal quartz

#
String msg = e.getChatMessage();
        List<String> items = Bukkit.getServer().getCommandAliases().tabComplete(e.getPlayer(), msg.substring(1));
(this is only a test)
unreal quartz
#

well that event isn't called for tab completing commands

#

the only event I see is the one I sent, but you're not on the latest version so I don't know what to tell you

empty oyster
#

sure, but i still can use if i tye in the chat a int 1-9, then press tab then i get the "Commands"...

#

withaout the e.getchatmessagestartwith/

latent vale
#

My plugin has a problem and it can't be enabled error:
[14:42:00 ERROR]: Could not load 'plugins\houseflipper.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml

empty oyster
#
    @EventHandler (priority = EventPriority.HIGHEST)
    public void on(PlayerChatTabCompleteEvent e) {
         if(!e.getChatMessage().startsWith("/")) {
            e.getTabCompletions().clear();
            return;
        }
         if (e.getChatMessage().startsWith("/")) {
                 e.getTabCompletions().clear();
                e.getTabCompletions().addAll(Arrays.asList("spawn", "kit", "test123123"));
         }
        System.out.println("USED COMMAND....");
    }
unreal quartz
#

Invalid plugin.yml
send that

latent vale
#

name: discord
version: 1.0
main: me.zeprix.house.Main

commands:
discord:
description: Discord invite link!

empty oyster
#

try this

#

name: discord
version: 1.0
main: me.zeprix.house.Main

commands:
discord:
description: Discord invite link!

unreal quartz
latent vale
#

yeah\

unreal quartz
#

and the plugin.yml is packaged with the jar

latent vale
#

yess

empty oyster
#
name: discord
version: 1.0

main: me.zeprix.house.Main


commands:
  discord:
    description: Discord invite link!
latent vale
unreal quartz
latent vale
#

its in me.zeprix.house package

unreal quartz
#

wrong location

#

must be in the base directory

latent vale
#

in src?

unreal quartz
#

yes as long as when the jar is packaged the plugin.yml ends up in the base directory

empty oyster
#

@lost matrix did you have an idea what i can do?,

   @EventHandler (priority = EventPriority.HIGHEST)
   public void on(PlayerChatTabCompleteEvent e) {
        if(!e.getChatMessage().startsWith("/")) {
           e.getTabCompletions().clear();
           return;
       }
        if (e.getChatMessage().startsWith("/")) {
                e.getTabCompletions().clear();
               e.getTabCompletions().addAll(Arrays.asList("spawn", "kit", "test123123"));
        }
       System.out.println("USED COMMAND....");
   }
lethal field
# summer scroll you should really change the package.

I've created a new project.
The following code also did not work.
DebugProject.java

package dp.debugproject;

import org.bukkit.plugin.java.JavaPlugin;
import sun.security.util.Debug;

public final class DebugProject extends JavaPlugin {

    @Override
    public void onEnable() {
        getCommand("").setExecutor(new DebugCommand());
    }

    @Override
    public void onDisable() {

    }
}

DebugCommand.java

package dp.debugproject;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class DebugCommand implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        String Prefix = args[0];
        if (Prefix.equalsIgnoreCase("debugcommand"))
        {
            sender.sendMessage("Command Detected");
        }
        return true;
    }
}

plugin.yml

main: dp.debugproject.DebugProject
name: DebugProject
version: 1.0
commands:
  debugcommand:
    description: DebugCommand

GroupID DP
ArtifactID debugproject

unreal quartz
#

getCommand("").setExecutor(new DebugCommand());

#

that will always return null

#

you want to do getCommand("debugcommand") instead, how it is defined in your plugin.yml

empty oyster
#

@lethal field try this, getCommand("debugcommand").setExecutor(new DebugCommand());

lethal field
#

Fix: getCommand("debugcommand").setExecutor(new DebugCommand());

empty oyster
#

🙂

lethal field
#

I'm trying...

#

I'm sorry. I'm an idiot.

empty oyster
#

Nobody is perfect

latent vale
lethal field
#

[20:56:45 ERROR]: Error occurred while enabling DebugProject v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "dp.debugproject.DebugProject.getCommand(String)" is null
at dp.debugproject.DebugProject.onEnable(DebugProject.java:10) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:403) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:381) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:330) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:422) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:383) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:338) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:545) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at java.lang.Thread.run(Thread.java:832) [?:?]
🤔

unreal quartz
lethal field
#

fix

@Override
    public void onEnable() {
        getCommand("debugcommand").setExecutor(new DebugCommand());
    }

dont work

latent vale
young knoll
#

Make sure debugcommand is in your plugin.yml

unreal quartz
lethal field
#

main: dp.debugproject.DebugProject
name: DebugProject
version: 1.0
commands:
debugcommand:
description: DebugCommand

#

this?

#

wait

latent vale
unreal quartz
#

no I mean your jar

latent vale
#

like this?

empty oyster
#

public final class DebugProject extends JavaPlugin {

unreal quartz
#

you can unzip jars

#

check where it is there

empty oyster
#

remove the final

latent vale
#

how to unzip?

empty oyster
#

and try again

unreal quartz
#

like any other zip

lethal field
#

😢 I don't know. What the hell is going on?

latent vale
unreal quartz
#

you don't need winwar

empty oyster
#

@lethal field remove the final in your debugproject, to this : public class DebugProject extends JavaPlugin {

#

then try out

wide dune
#

is there any way to create an event for when someone reels in a fishing rod on 1.8.8?

unreal quartz
#

PlayerFishEvent

wide dune
#

is that when they reel in?

#

or reel out

lethal field
empty oyster
#

sure try out

latent vale
lethal field
#

[21:03:42 ERROR]: Error occurred while enabling DebugProject v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "dp.debugproject.DebugProject.getCommand(String)" is null
at dp.debugproject.DebugProject.onEnable(DebugProject.java:10) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:403) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:381) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:330) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:422) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:383) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:338) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:545) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at java.lang.Thread.run(Thread.java:832) [?:?]

wide dune
#

I'm not getting reel in on 1.8.8

lethal field
latent vale
empty oyster
#

getCommand("debugcommand").setExecutor((CommandExecutor) new DebugCommand());

#

then try this

lethal field
#

okay

#

thank you

unreal quartz
#

I don't know what to tell you if you can't unzip a file...

lethal field
#
package dp.debugproject;

import org.bukkit.command.CommandExecutor;
import org.bukkit.plugin.java.JavaPlugin;

public class DebugProject extends JavaPlugin {

    @Override
    public void onEnable() {
        getCommand("debugcommand").setExecutor((CommandExecutor) new DebugCommand());
    }

    @Override
    public void onDisable() {

    }
}

I got the same error.

latent vale
unreal quartz
#

open with file explorer or download 7zip or something

empty oyster
#

@lethal field

name: DebugProject
version: 1.0

main: dp.debugproject.DebugProject

commands:
   debugcommand:
#

idk try this?

lethal field
#

I got the same error😢😢😢

empty oyster
ivory sleet
#

Mad sus

latent vale
unreal quartz
#

there is no plugin.yml, and your sources aren't even there

latent vale
#

well thats fked up

#

Hmm then how to export properly

unreal quartz
#

i don't use eclipse

#

you'll have to get someone here who does to help

ivory sleet
#

zeprix you ever tried gradle?

quaint mantle
#

export what?

latent vale
#

file

quaint mantle
#

yeah thats how you make a JAR File from ur code

latent vale
#

as jar or runnable or javadoc?

eternal oxide
#

jar

unreal quartz
#

i think the place to select your sources is on the next page

latent vale
quaint mantle
#

I always spam enter after clicking jar file

eternal oxide
#

untick project and classpath

unreal quartz
#

you don't need .classpath, .project, you should find the src folder on the left

quaint mantle
#

oof ive been doing it wrong

eternal oxide
#

the left is correct

latent vale
#

like that?

quaint mantle
#

good that I switched over to IJ like half a year ago

unreal quartz
quaint mantle
#

yeah but selected too much

quaint mantle
#

nah right top @latent vale

latent vale
eternal oxide
#

untick project and classpath on the right

unreal quartz
quaint mantle
#

ugly?

latent vale
eternal oxide
#

once you have unticked .project and .classpath on the right, click finish

latent vale
#

idc if u use intelj

quaint mantle
#

lol

#

why u keep tagging him

daring sierra
#

idea ultimate is pretty good ide

lethal field
#

Should I have mentioned that I am using "inteleji"?

unreal quartz
lethal field
eternal oxide
eternal oxide
lethal field
#

Is that okay?
commands:
debugcommand:
description: DebugCMD
usage: debugcommand

eternal oxide
#

perfect

ivory sleet
quaint mantle
#

hmmm

eternal oxide
#

with no child node it shoudl return null as not valid

lethal field
eternal oxide
#

it will check as valid Yaml but Spigot will return a null when read as a command

ivory sleet
#

That’s the thing, it doesn’t use the normal file config system probably allowing it to parse that without any child nodes

eternal oxide
sleek pond
eternal oxide
#

ok I'm going to test this. Its always returned null for me with no childs and it was md_5's response to it too

quaint mantle
#

i wanted 2 make more arrows but yea

sleek pond
#

your point being?

eternal oxide
#

one sec Anon

#

running a test

fringe folio
#

in the executor

lethal field
#

Give me the code, please.

quaint mantle
sleek pond
#

there should be a spoonfeed emoji

#

jk

quaint mantle
#

how can I add comments to my config files?

fringe folio
quaint mantle
#

why "this"

#

lol

lethal field
#

error

#

'setExecutor(org.bukkit.command.CommandExecutor)' in 'org.bukkit.command.PluginCommand' cannot be applied to '(dp.debugproject.DebugCommand, dp.debugproject.DebugProject)'

sleek pond
fringe folio
#

is this your main class?

sleek pond
#

but it only supports headers

lethal field
sleek pond
#

although wait

#

thats how you register an event

quaint mantle
#

yup

fringe folio
#

¯_(ツ)_/¯

#

I think at least

cerulean imp
#

Hello, I have a quick question.
I'm currently working on plugin that changes your leather armor color every x seconds / ticks. Currently everything works perfectly fine until I set the time to be below 1 second.
When I do that the following happens (we have two players, p1 and p2 and colorChangeTime = 0.5s):

p1 can see that the armor of p2 changes every 0.5 seconds, however p1 can see that his own armor change every second
p1 can see that the armor of p1 changes every 0.5 seconds, however p2 can see that his own armor change every second

Also it's worth noting that when for example p1 can see his own color change every second (instead of every 0.5s), certain colors may get skipped, as if the server wants to change them, but the client doesn't update the colors as fast.
Here is the part of the code that handles changing of the color. It executes on all players at once, so there should be no reason that player's character would be changing slower.

  Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> {
    for (Player player : Bukkit.getOnlinePlayers()) {
       int newIndex = colorOrder.indexOf(playerArmor.get(player)) + 1;
       if (newIndex == colorOrder.size()) newIndex = 0;

       GiveArmor(player, colorOrder.get(newIndex));
     }
}, 0L, (long) (20L * colorChangeTime));

Currently the only thing that would make sense to me is that the refresh rate for your own character is set somewhere in the client, that's why other players update normally and your own character doesn't. However I wanted to confirm my theory here.

Thank you for any help in advance 😄

alpine urchin
#

nope it doesnt

#

@fringe folio

fringe folio
#

ok

#

ohhh registerEvents does

sleek pond
eternal oxide
#

@quaint mantle @ivory sleet I'm wrong it seems. A single command works correctly without child nodes.

cerulean imp
# sleek pond well how do you cahnge the armour color

It's in the GiveArmor function. It essentially just creates the itemstack and assigns it the given color.
But as I said, it works completely fine until you set time below one second. And even when it's below one second you can see that everyone else changes color when they should, except for your own player, which always changes at lowest rate of one second.

However here is the code for changing armor color:

private void GiveArmor(Player player, String color) {
    playerArmor.put(player, color);
    for (int i=36; i<39; i++) {
        ItemStack item = new ItemStack(Material.valueOf(armor[i-36]));
        LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
        meta.setColor(Color.fromRGB(LPVP_Colors.getValue(color)));
        item.setItemMeta(meta);
        item.addEnchantment(Enchantment.DURABILITY, 3);
        item.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, armorProtectionLevel);
        player.getInventory().setItem(i, item);
    }
}
lethal field
# fringe folio setExecutor should take a Plugin argument

I don't know anything. 😭
Give me the code.

package dp.debugproject;

import org.bukkit.Bukkit;
import org.bukkit.command.CommandExecutor;
import org.bukkit.event.Listener;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public class DebugProject extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        getCommand("debugcommand").setExecutor(new DebugCommand());
        Bukkit.getServer().getPluginManager().registerEvents(this, this);
    }

    @Override
    public void onDisable() {

    }
}
edgy geyser
#

Hi, can someone explain me why the color of the team prefix is not set to the player name?

crystal cliff
#

You can also use JetBrains Academy

#

It's a nice course

lethal field
#

oh

fringe folio
fringe folio
edgy geyser
fringe folio
#

you can create a nickname system then loop through all players and setting their nickname to the color + the name

obtuse basin
#

Any Ideas why this still outputs uncolored text? sender.sendMessage("World created sucessfully!" + ChatColor.GREEN)

fringe folio
#

ChatColor is before the text

edgy geyser
fading lake
#

You could always do a really weird thing and cancel the message event, and resend a custom message woth the prefix and display name, then you could do textcomponent bs with it too

edgy geyser
#

i dont get it

#

messages are not my problem, its only the name above the player and in the playerlist

#

ok i'm just stupid, could have simply set a color for the team with setColor. thx anyway

quaint mantle
#

hey how do i disable collide in spigot 1.12.2? my code:

if (p.getScoreboard() != null) {
            Scoreboard sb = p.getScoreboard();

            if (sb.getEntryTeam(p.getName()) != null)
                sb.getEntryTeam(p.getName()).setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);

        }
woven coral
#

https://sourceb.in/ytYSBI3BTt - so I have this huge piece of code, and if I click either one of the slots it sends "test" twice
same with the no perm msg

quaint mantle
#

Only way is to use teams flags

#

yeah but it doesnt work

#

Yeah because mc is shit

#

It never worked properly

#

oh

lost matrix
quaint mantle
#

what is an event for player damaging a cow for ex.

#

1.12.2

crystal cliff
#

EntityDamagedByEntityEvent iirc

#

and then you just get the specific entity

quaint mantle
#

okay ty

green prism
#

Guys, how can i get all player in a selection/region?

#

WG can't do this

sage swift
#

worldedit has a discord and an api help channel

#

but they're also hella pretentious

#

for example, wizjany's answer to your question there is next to useless:

WG doesn't track that, you'll either need to track it yourself or check when you need it
you were most likely asking about getting the edges to then be able to calculate if the location is between them, and just need to figure out through their overcomplicated api how to get the corners of a region

olive badger
#

Hello,
i search an good command framework for easier create command.

I have see ACF and i want know if it is advanced and stable enough for production usage. If is NOT want i can use ?

sharp bough
#

hi, i once say a while ago String... i think i was, so you could move multiple strings using "test,"test1" for lore, for example but i cant remember what it is

#

how its called

#

the ...

#

or ...String something like that

#

nvm i found it it was String... lore

timber crescent
#

This is null anyone know why? this.getCommand("alerts").setExecutor(new Alerts());

humble stirrup
#

you havent put the command in your plugin yml @timber crescent

quaint mantle
#

Hello Everyone, I just started my own server and I need help with building a plugin. I have 0 experiences with building plugins, could anybody help me developing 1? I would really appreciate it!! DM me

heavy mason
#

From there just look for tutorials on yt and resources on spigot

quaint mantle
#

But It's a pretty big plugin

eternal oxide
#

?services

queen dragonBOT
torn jewel
#

for some reason these values show as the same

#

yet java thinks they are different

lost matrix
eternal oxide
#

that are probably floats or doubles and you are displaying ints

torn jewel
#

public static TownReturn isClaimed(ClaimData data){
TownReturn townReturn = new TownReturn();
if (claims.containsKey(data)){
townReturn.name = claims.get(data).town;
townReturn.intown = true;

    }else{
        for (Map.Entry<ClaimData, Claim> I :claims.entrySet()){

            Bukkit.getLogger().info(String.valueOf(I.getKey().X)+","+String.valueOf(I.getKey().Z));
            Bukkit.getLogger().info(String.valueOf(data.X)+","+String.valueOf(data.Z));
        }
        townReturn.intown = false;
    }
    return townReturn;
}
lost matrix
#

Pls use code blocks

torn jewel
#

ok

lost matrix
#
 Some code
torn jewel
#

public static TownReturn isClaimed(ClaimData data){
        TownReturn townReturn = new TownReturn();
        if (claims.containsKey(data)){
            townReturn.name = claims.get(data).town;
            townReturn.intown = true;

        }else{
            for (Map.Entry<ClaimData, Claim> I :claims.entrySet()){

                Bukkit.getLogger().info(String.valueOf(I.getKey().X)+","+String.valueOf(I.getKey().Z));
                Bukkit.getLogger().info(String.valueOf(data.X)+","+String.valueOf(data.Z));
            }
            townReturn.intown = false;
        }
        return townReturn;
    }
lost matrix
torn jewel
#

wdym

#
package thyclaims.thyclaims.obj;

public class ClaimData {
    public int X;
    public int Z;
}
#

that is the class

#

i am still new to java

flat parcel
#

hello i just come to ask you how i could make a plugin with special texture mobs please ^^

torn jewel
#

as far as ik

#

Or use player models with custom skins

lost matrix
#

If you use hash based collections like HashMaps and HashSets then the key will be stored using their hash code which is just an integer.

lost matrix
lost matrix
torn jewel
#

not rlly

#

just those

flat parcel
#

do you have a tutorial to do it?

torn jewel
#

if i add new stuff it will be in the claim class

#

not claim data

woeful crescent
#

I am trying to make a page system for a leveling GUI. The system is set up so that whatever level a player is set to is the level they are currently working on. There are 29 levels per page. I want to make it so, let's say the player's level value is 10. Their page is set to 1. If they are level 29, their page is still 1 because they are working on level 29. How do I code this? I am trying Math.floorDiv(lv, 29);, but as you can probably expect, if a player's level value is 29 it will send them to page 2 which shouldn't happen. How do I fix this?

sage swift
#

lv-1

lost matrix
#

Ok so its more of a ClaimCoordinate than actual ClaimData. @torn jewel
This would be a proper implementation of that data class:

public class ClaimCoordinate {

  private final int x;
  private final int z;

  public ClaimCoordinate(final int x, final int z) {
    this.x = x;
    this.z = z;
  }

  public int getX() {
    return this.x;
  }

  public int getZ() {
    return this.z;
  }

  @Override
  public int hashCode() {
    return Objects.hash(this.x, this.z);
  }

  @Override
  public boolean equals(final Object other) {
    if (!(other instanceof ClaimCoordinate)) {
      return false;
    }
    final ClaimCoordinate otherCoord = (ClaimCoordinate) other;
    return this.x == otherCoord.x && this.z == otherCoord.z;
  }

}
woeful crescent
lost matrix
woeful crescent
#

so... 30 instead of 29?

lost matrix
#

Yes

woeful crescent
#

ohhhhhh

#

wait

#

if a player is level 59, it wouldn't take them to page 3

lost matrix
woeful crescent
#

1, but that's easy because I can just add 1 to it

#

0 is the default value passed through the message if you don't want a custom page number

lost matrix
#

So then just

  public int getPageFor(int level) {
    return Math.floorDiv(level - 1, 29) + 1;
  }
woeful crescent
#

ok

#

oh rip

#

My mistake was where i thought the level might somehow be zero

#

that's why I was avoiding that

#

ty!

sharp bough
#

why doesnt this work?

#

what did i do wrong?

young knoll
#

What about it doesn’t work

frail steeple
#

Does anyone know if I can make a server with a world without any interactions(your stuck in one place, cant move, no chunks)? Because i'm planning on making a queue server for if my main server is full(where people will wait till some-one leaves the main server). So I want the queue server to use the least resources possible(otherwise it defeat the purpose of a queue server and I would be better off making the player cap higher)

left swift
#

How can I lock the note blocks so that no matter what block they stand on, they keep their instrument

sharp bough
#

if i change the ingredient to recipe.setIngredient('%', Material.EMERALD_BLOCK);

#

then it works

#

but idk why the custom emeral block doesnt work

young knoll
#

Use RecipeChoice.ExactChoice

solemn shoal
#

theres also pistonqueue for spigot n waterfall etc if you wanna do it that way

deft helm
#

Okay I have a quick question.

How does BungeeCord use BungeeCord for custom payload packets?? From my understanding it's not a valid channel name. Someone with knowledge about this please explain, thanks! (ping me)

gusty notch
#

why when i try to run this code it will not remove the dropped item, but instead duplicate it and give the player the STAINED_GLASS_PANE afterwards?

@EventHandler
    public void onUseOfSyringe(PlayerDropItemEvent e) {
        Player player = e.getPlayer();
        if (player.isSneaking()) {
            e.setCancelled(true);
            player.setItemInHand(null);
            player.setItemInHand(new ItemStack(Material.STAINED_GLASS_PANE));
  }
}

https://gyazo.com/b354cb39bebe7b6bfd7824abae6f5e86

solemn shoal
#

set the amount

#

i guess

gusty notch
#

wdym

sharp bough
#

cancel the event first

#

so it doesnt drop

#

then set the item null

gusty notch
#

alr

#

i'll try

sharp bough
#

that will make the item desapear

#

player.setItemInHand(new ItemStack(Material.STAINED_GLASS_PANE));

gusty notch
#

didn't work

#

still duplicates

sharp bough
#

and this will set the item back to stained glass pane

#

if you are trying to cancel the drop event

#

then just use e.setCancel(true)

#

that will prevent the drop

gusty notch
#

e.setCancel(true) is not a valid expression

#

but no i don't want to just cancel the drop

young knoll
#

setCancelled

gusty notch
#

yeah

#

but i want it to replace the item in my hand with a stained glass pane

sharp bough
#

e.setCancelled(true);

gusty notch
#

but when i try to do it, the item that should be removed just gets duplicated

gusty notch