#help-development

1 messages · Page 2248 of 1

eternal night
#

beyond the banTime config option, this is not configurable

eternal oxide
#

was the bstats in teh jar actually relocated to teh correct pattern?

tender shard
#

Can you pls tell me how to craft hearts @still tusk ?

still tusk
#

how do I set a ban time

eternal night
#

idk, I think you gotta ask mfnalex on how to craft hearts

tender shard
still tusk
#

Please tell me

quaint mantle
#

?ban

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?ban <user> [days] [reason]
Ban a user from this server and optionally delete days of messages.

days is the amount of days of messages to cleanup on ban.

Examples:

  • ?ban 428675506947227648 7 Continued to spam after told to stop.
    This will ban the user with ID 428675506947227648 and it will delete 7 days worth of messages.
  • ?ban @Twentysix 7 Continued to spam after told to stop.
    This will ban Twentysix and it will delete 7 days worth of messages.

A user ID should be provided if the user is not a member of this server.
If days is not a number, it's treated as the first word of the reason.
Minimum 0 days, maximum 7. If not specified, the defaultdays setting will be used instead.

quaint mantle
#

^ syntax

tender shard
urban mauve
#

but i'd shaded updater and check it on both .jars

eternal oxide
#

so you manually included teh bstats class in your project?

urban mauve
#

yep

eternal night
eternal oxide
#

well that explains why its there

urban mauve
#

okay im going to try it again

eternal oxide
#

remove it from yoru shade patterns

still tusk
urban mauve
#

and maybe all will okay

urban mauve
eternal oxide
#

your

urban mauve
#

ah okay

eternal oxide
#

no point in having it try to shade bstats if you manually added it

urban mauve
#

oh okay

eternal oxide
#

it may also be why its not shading the rest

urban mauve
#

okay i will remove bstats shading option

#

maybe all will work

eternal night
still tusk
golden turret
#

yes

#

you are aking about a random plugin in a development channel

eternal night
#

plugins/<pluginName>/config.yml

still tusk
#

And copy and paste the template in there?

eternal night
#

the file should already contain stuff

still tusk
#

it is

eternal night
#

then look for banTime

still tusk
#

it says 0

eternal night
#

Yes

#

which means perm ban

still tusk
#

Ik so what do I replace the zero with if I want to ban them for a day

eternal night
#

the time in minutes

still tusk
#

so 1440

eternal night
#

presumably

#

the code is an absolute mess, so I am more or less guessing

still tusk
#

@eternal night

eternal night
still tusk
#

so I changed the bantime to 1 so I can test if it unbans my alt but it didnt work

eternal night
#

did you restart the server

still tusk
#

I have to restart

#

thanks

tardy delta
#

@still tusk Date date = Date.from(Instant.now().plus(Duration.ofDays(5)));

#

for expires

eternal night
#

they are not interested in coding

tardy delta
#

🥲

#

imma make a ban plugin too

tender shard
#

call it Ben

tardy delta
#

hmmm 🤔

tender shard
#

Benjamin

#

if one shuffles imajin's letters and adds ben to it, it becomes benjamiin

tardy delta
#

i want to do smth else cuz im kinda stuck lol

tender shard
#

stepsister vibes intensify

tardy delta
tender shard
#

the Ben hammer

tardy delta
#

well ye i could use "the ban hammer has spoken" as default reason

#

ben the ban hammer

still tusk
#

@eternal night

tender shard
#

@still tusk

still tusk
#

what

tardy delta
#

@still tusk

tender shard
#

what

still tusk
#

sup

tender shard
#

i dont need numbers above 100 because no one will write them out anyway

tardy delta
#

😳

royal vale
tender shard
#

unfriend your friend

tardy delta
#

i agree with the first

mighty pier
royal vale
# mighty pier

⚠️ IT HAS LIGHT MODE CUZ I JUST RESET MY PC ⚠️

mighty pier
#

excuses

tardy delta
#

pls

hidden kestrel
#

How do I go about pregenerating a world??

eternal night
#

Look at plugins like Chunky

keen spindle
#
item.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 10);```
 im using this
but idk why it wouldnt work
its not adding the sharpness enchantment to the sword 
i checked the docs and stuff, and found out that DAMAGE_ALL is for sharpness
tardy delta
#

why not just adding enchantment to the itemmeta?

eternal night
#

are you setting the item meta of the item afterwards

#

might override your changes ^

keen spindle
#

oh

#

so i should just set the meta before

keen spindle
misty current
#

is there an easy way to get the playerdata folder?

keen spindle
#

that

#

wouldnt let you set an enchantment

#

above its normal vanilla lvl

#

i wanna set it like sharpness 50

#

or something

eternal night
#

it does

keen spindle
#

i tried

#

it and doesnt do anything :x

eternal night
#

the boolean passed is literally there to ignore level restrictions

tardy delta
#

ignorelevel restriction

keen spindle
#

i put that as false

#

and doesnt work tho..

eternal night
#

Well don't ?

#

what

tardy delta
#

set that as true lmao

eternal night
#

"hey should I ignore level restrictions ? NO" -> why does it not ignore level restrictions

tardy delta
#

people are idiots 🥺 🥺 😭

misty current
#

is there a method to get the playerdata folder?

keen spindle
#

or atleast 10

eternal night
#

what are you talking about

#

pass true instead of false

keen spindle
#

and then?

eternal night
#

false makes no sense if you actively want to ignore level restrictions

keen spindle
#

wait

#

lemme get something right

#

does false mean

urban mauve
#

any ideas?

keen spindle
#

ignore level or not ignore

tardy delta
#

check the docs lol

eternal oxide
#

false means limit

eternal night
#

"ignoreLevelRestrictions: false"

#

what does that sound like to you

eternal oxide
#

true = ignore limits

keen spindle
#

i get it now

eternal night
#

5Head nice xD

keen spindle
#

ok ima try now

#

🙂

urban mauve
keen spindle
#

btw is it like required for me to

#

change the plugin file (in the paper server)

#

each time i update it

tardy delta
#

the plugin jar yes

keen spindle
#

also im using maven

#

and when im like building the package

#

if there was a previous one in the target folder

tardy delta
#

it overrides it

keen spindle
#

it makes a new one called shader, i want it to make like a new one

#

is the shader like, the old one

#

or the new one

tardy delta
#

new

#

it overrides the old jar file as i said

keen spindle
#

oh ok

#

ty btw, it works good now

#

also, i got a question is it possible to edit the enchantment name

blazing flare
#

What would be the appropriate way to get the workstation itemstack of a villager profession, and vice versa?

keen spindle
#

it shows like

urban mauve
keen spindle
#

i cant send images lol rip

tardy delta
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

tardy delta
#

hide the enchant using meta.addItemFlags and edit the lore yourself to display smth custom

#

that will hide all enchants anyway

keen spindle
#

aight

keen spindle
#

?

tardy delta
#

no unless you edit to lore to display those others too i guess

#

it might look different idk too long ago

keen spindle
#

oh xd

#

aight ill figure something out

#

ty btw

urban mauve
#

whats wrong?

chrome beacon
#

Something failed to save

eternal oxide
#

first off, thats purpur NMS not Spigot

urban mauve
#

okay, i need to replace it to spigot, but why its appeared

river oracle
#

I mean you can use what you want but don't expect support here

eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

urban mauve
#

oh k tq

eternal oxide
#

Forks behave differently. We could be chasing our tails for hours trying to diagnose an issue that only happens on a specific fork.

vital trout
#

Is it possible to get the DamageModifier from a strength potion effect ?

misty current
#

how can you get the playerdata folder File

pastel relic
#

Isn't powder snow a material?

#

I mean it is a bucket and it doesn't exist as a block

#

but im making a block blacklisting and i dont want players to get teleported in powder snow

hybrid spoke
#

aha @hasty wasp

eternal oxide
misty current
#

thanks

hasty wasp
#

I am trying to change the skin of a player, any ideas what I am doing wrong? (version 1.17.1)

                    final CraftPlayer craftPlayer = (CraftPlayer) player;

                    final GameProfile gameProfile = craftPlayer.getProfile();
                    final PropertyMap properties = gameProfile.getProperties();

                    final String name = profileCall.getValue().getProperty().getName();
                    final String value = profileCall.getValue().getProperty().getValue();

                    properties.removeAll(name);
                    properties.put(name, new Property(name, value));

                    Bukkit.getOnlinePlayers().forEach(it -> it.hidePlayer(this.plugin, player));

                    Bukkit.getOnlinePlayers().forEach(it -> it.showPlayer(this.plugin, player));

                    final String message = this.plugin.getConfig().getString("messages.skin_changed");
                    player.sendMessage(Objects.requireNonNull(message));
hybrid spoke
hasty wasp
hybrid spoke
#

you also have to kill him and reset his info (inventory f.e.) to update him

hasty wasp
tardy delta
#

how would i call a cache that has a method #queryForRemoval which will remove the entry after x time?

eternal night
#

Use a chaching library 👀

eternal oxide
#

push any entity for removal to a queue

#

just needs teh entity and time

#

I may not be understanding your question

hybrid spoke
#

i think he means the name of the class

tardy delta
#

ye

hybrid spoke
#

we would need more context

#

otherwise you could just name it Cache with the given info

eternal oxide
#

DelayedRemovalCache?

tardy delta
#

hmm maybe

#

i was looking at guavas CacheBuilder but that doesnt support removing after some specific time

eternal oxide
#

WaitALittleBitBeforeRemovingCacheClass

hybrid spoke
#

make it a GC alike

#

so you have to beg the cache to remove it

#

maybe he will

#

maybe he will leak

#

and give him feelings

tardy delta
#

aaah yes

#

sensitive dude

#

🥺

glossy venture
#

SensitiveDudeCache

tardy delta
#

thats kinda the spirit

hybrid spoke
#

SensitiveMoodyCache

tardy delta
#

sad boi

#

would i handle the delayed removal using bukkitrunnables?

urban mauve
sinful rapids
#
            if(player.hasPermission("asciavdf.give"));{
                ItemStack ascia = new ItemStack(Material.IRON_AXE);
                ItemMeta ascianame = ascia.getItemMeta();
                ascianame.setDisplayName("§cAscia VDF");
                ascia.setItemMeta(ascianame);
                ascia.addEnchantment(Enchantment.DURABILITY, 1);
                player.getInventory().addItem(ascia);
                player.sendMessage("§7[§cVDF CORE§7] §7Ascia givvata con successo!");
            } else {
                player.sendMessage("&7[&cVDF CORE&7] &7Non hai abbastanza permessi!");
            }

gives me else in red, why?

tardy delta
#

does this looks like a good impl?

wild reef
#

Hey guys quick question. I want to get the name of a player based on the uuid. I don't want to fetch from mojang api because of the latency and it's limitation. I know that I would need to implement something myself. Question:
did someone implement a plugin for that already which I can just depend on and use it inside mine?

earnest forum
#

its & not §

eternal oxide
tardy delta
#

someone has to show me that web lookup part cuz i digged thro the whole code and couldnt find any of that stuff

tardy delta
#

use ChatColor.translateAlternateColors('&', your message)

subtle folio
#

you shouldn’t use that

#

enum exists for a reason

#

only use that for like a config.yml

earnest forum
sinful rapids
#

But it's not a message problem, else is red, why

earnest forum
#

enum is long

subtle folio
#

that needs colors to get parsed

arctic swift
#

does jobs reborn works in 1.19?

earnest forum
subtle folio
earnest forum
#

get rid of the ;

sinful rapids
#

not work else this

earnest forum
#

get rid of the ;

#

in the if bro

subtle folio
#

?learnjava

undone axleBOT
earnest forum
sinful rapids
#

ok

#

thanks

wild reef
subtle folio
eternal oxide
subtle folio
#

then check if the player is online, then getPlayer()

tardy delta
#

lemme search thro the impl for the web lookup lol

eternal oxide
#

If they have been on your server the name will be not null in the returned OfflinePlayer

wild reef
subtle folio
#

only use api if you need to get offline player based off or name

hybrid spoke
#

only one making a query is the getOfflinePlayer(String)

eternal oxide
tardy delta
#

?stash

undone axleBOT
tardy delta
#

is this the impl?

eternal oxide
#

yes

hybrid spoke
buoyant viper
#

?learnjava

undone axleBOT
buoyant viper
#

?jd-s

undone axleBOT
urban mauve
#

guys, how to not shade some dependencies?

#

i need to use exclusion?

hybrid spoke
#

you can also mark them as provided

#

otherwise exclusion

eternal oxide
#

<scope>provided</scope>

urban mauve
#

oh thanks!

#

i did exclusion need to check it rn

#

works perfectly thanks

eternal oxide
#

don;t use exclusions unless you want to only exclude specific packages in a module

tardy delta
#

is craftbukkit thr spigot impl?

urban mauve
sage merlin
#

for some reason this is not running which tells me that the entire PlayerInteractEvent is not running im not getting the debug message

eternal oxide
#

you add provided to any dependencies you don;t want shaded

urban mauve
#

ye thanks!

sage merlin
#

i am left clicking and im not getting a error

opal juniper
#

to abstract any nms interactions from the user

#

well, api

tardy delta
#

im looking for the DedicatedServer.java file but i can only find a patch file

opal juniper
#

Well yeah, cause you cant just host nms code

buoyant viper
#

its in like

#

work/decompiled something

sage merlin
buoyant viper
#

after u run BuildTools.jar

#

@tardy delta

hybrid spoke
undone axleBOT
tardy delta
#

ah ok

hybrid spoke
#

since the action has to be RIGHT_CLICK_AIR

#

you are in the RIGHT_CLICK_AIR if

opal juniper
sage merlin
#

no no i mean the left click

#

its not running

hybrid spoke
#

yeah, right. but it will always be false

#

since you are nesting the ifs

buoyant viper
#

theres something u can do i think to like get the FULLY patched source but i forget which applyPatches u need to run @tardy delta

#

its in the readme of either CraftBukkit or Spigot

hybrid spoke
#

what you want to do is either jump out of the upper if or else it

sage merlin
#

OH i didn't notince that

#

that wasn't on purpose

tardy delta
#

got the decompiled stuff

buoyant viper
#

yeah its just vanilla code tho so

#

no patches applied

somber sequoia
#

does anyone have any idea how to use VanishNoPacket in a plugin? I'm having trouble using it in mine and I can't import any of its classes

golden turret
#

what are you using

#

maven or gradle?

somber sequoia
#

maven

golden turret
#

show us your pom.xml

sinful rapids
#

How do I add if the player is wearing boots named "hello" text them?

golden turret
#

i actually did not understand anything

sinful rapids
#

how

buoyant viper
#

under making changes to minecraft

golden turret
#

?jd-s

undone axleBOT
sinful rapids
#

ok

golden turret
#

or

somber sequoia
# golden turret show us your pom.xml
<dependency>
  <groupId>org.kitteh</groupId>
  <artifactId>vanish</artifactId>
  <version>1.0</version>
  <scope>system</scope>
  <systemPath>${project.basedir}/libs/VanishNoPacket.jar</systemPath>
</dependency>
#

this is what i did

golden turret
tardy delta
#

uhh i want to find the DedicatedServer#getProfileCache method

tardy delta
#

i guess obfuscated cuz i cant find it in MinecraftServer anyways

somber sequoia
#

i forgot to refresh the maven thing

golden turret
somber sequoia
#

ok i will use that then, I was using a local jar before

buoyant viper
tardy delta
#

uh idk if the fact that im in net.minecraft.server.v1_16_R3 makes a difference

buoyant viper
#

hm

tardy delta
#

well this is what does the web request i guess

golden turret
#

@buoyant viper what are you trying to do

buoyant viper
#

trying to locate something for fourteen

tardy delta
#

i was just tryin to find the place where the web lookup for Bukkit.getOfflinePlayer happened lol

#

if im correctly interpreting this

buoyant viper
#

yeah

#

CraftServer.console -> DedicatedServer -> MinecraftServer

ivory sleet
golden turret
#

imagine clearing the cache 🤡

tardy delta
#

ye what i was looking at

golden turret
#

how can i use remapped in gradle

stoic vigil
#

how to get the block type out of an blockbreak event?

golden turret
#

you have getBlock method

tardy delta
#

isnt there a Block#getType?

golden turret
#

and the Block class have a getType method

stoic vigil
#

ah okee, yee already had .getBlock but getType was what i searched! thy ❤️

golden turret
#

next time see the docs

#

?jd-s

undone axleBOT
solid cargo
#

?paste

undone axleBOT
solid cargo
tardy delta
#

access denied it says

golden turret
#

access denied

agile anvil
#

chmod your files

tardy delta
#

lol

golden turret
#

chmod

eternal oxide
#

don;t use plugman

solid cargo
#

i dont use plugman

tardy delta
#

chmod +x

solid cargo
#

also restart fixed it

eternal oxide
#

then do a restart not a reload

solid cargo
golden turret
#

i never had problems with plugman or reload

eternal oxide
#

and plugins\MCBCL-1.0-SNAPSHOT (3).jar How many do you have in there?

golden turret
#

i always use reload and i never got problems with it

eternal oxide
#

until you do

solid cargo
tardy delta
#

where is plugwoman? did she die or smth

golden turret
#

hahaha jokes

eternal oxide
#

never existed as we don;t know what a woman is

golden turret
#

;

tardy delta
#

hmm facts

solid cargo
#

See? This is how i sometimes work

#

I like to work like that dont judge me

eternal oxide
#

lots of judging

golden turret
#

mac

solid cargo
#

M1 is kinda beastly tho

golden turret
#

WAIT

#

MAC AND WINDOWS?????

solid cargo
#

ye

#

those are 2 diff computers

#

one is my pc with the gpu, i play games there, work when im home...

#

mac when im not home

upper vale
#

Anyone know what is the velocity of gravity for entities

golden turret
#

velocity: moving

solid cargo
#

it increases all the time i think

golden turret
#

gravity: falling

solid cargo
#

acceleration

golden turret
#

you can do cool things with velocity

upper vale
#

oh

#

thats lovely

#

thanks

delicate fractal
#

hello, is there a way to ban words in the chat, like some people are saying racist things and i dont want those words in the chat

golden turret
#

well

solid cargo
#

player.setVelocity(new Vector(0, 50, 0));

golden turret
solid cargo
agile anvil
delicate fractal
#

good

golden turret
#

a lot

delicate fractal
#

does essentials have something against it?

agile anvil
golden turret
heavy marsh
#

Anyone know if predicates work with custom nbt values? For example if I add "open":1 as an nbt to this item, will the model change?

{
    "predicate": {
        "custom_model_data": 539101
    },
    "model": "item/backpack_leather"
},
{
    "predicate": {
        "open": 1,
        "custom_model_data": 539101
    },
    "model": "item/backpack_leather_open"
}
dull goblet
#

Hey what's a 1.19 alternative for actionbarapi which is on 1.16

severe turret
#

how would i run maven project with multiple modules to compile into one jar

severe turret
#

like mvn clean package shade:shade

#

?

delicate fractal
heavy marsh
golden turret
#
Minecraft Wiki

Predicates are data pack files, invoked with various means to check conditions within the world. They return a pass or fail result to the invoker, who will act differently based on this result.
This page describes how predicates are defined and invoked. Also described here is the JSON structure of a predicate condition, the primary JSON structur...

#

maybe jt is possible

#

idk, i did not read so much

tardy delta
#

?tryandsee lol

undone axleBOT
heavy marsh
# golden turret idk, i did not read so much

seems the only predicate values are: angle, blocking, broken, cast, cooldown, damage, damaged, lefthanded, pull, pulling, charged, firework, throwing, time, custom_model_data, level, filled, tooting

#

non of which let you query nbt

weak wasp
#

Spigot API broke a plugin = (

#

it so happens to be a discord bot...

#

calling
``getServer().getScheduler().cancelTasks(this);

#

throws errors now, was fine who knows how long

tardy delta
#

what errors

weak wasp
#

NoSuchMethodError

tardy delta
#

?paste it

undone axleBOT
tardy delta
#

i guess youre using a mismatched api and server version

weak wasp
#

It compiled fine...

tardy delta
#

doesnt mean anything

weak wasp
#

just so long as you don't turn it off mid use it's fine

eternal oxide
#

your this is not a Task

#

not a cancelable task

weak wasp
#

it cancels all tasks for this, which is the plugin

eternal oxide
#

then you are not passing it an instance of your plugin

#

its can't find a method for the value you are passing

#

read the error and it will tell you

weak wasp
#

I am, but this is not new code... All of a sudden spigots new API is doing something differently that I can't figure out

eternal oxide
#

Paste the full stacktrace

weak wasp
#

[DiscordChatMerge] Disabling DiscordChatMerge v1.0.1
[09:58:58] [Server thread/ERROR]: Error occurred while disabling DiscordChatMerge v1.0.1 (Is it up to date?)
java.lang.NoSuchMethodError: 'void org.bukkit.scheduler.BukkitScheduler.cancelAllTasks()'
at discordChatMerge.Main.onDisable(Main.java:51) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:367) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:500) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:492) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.clearPlugins(SimplePluginManager.java:543) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.reload(CraftServer.java:883) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at org.bukkit.Bukkit.reload(Bukkit.java:801) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchCommand(CraftServer.java:821) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]

eternal oxide
#

Thee API has not changed for that

#

?paste

undone axleBOT
eternal oxide
#

not spam

weak wasp
#

sorry bout the spam...

eternal oxide
#

Main.java:51

weak wasp
#

51 is line 4 on that

eternal oxide
#

yeah, you can't use the scheduler in onDisable. it will cancel all tasks on its own

weak wasp
#

it needs to in the stop command

tardy delta
#

oh it worked for me

eternal oxide
glossy venture
weak wasp
#

type is JavaPlugin

#

it's honestly fine

eternal oxide
#

it is an odd error though

weak wasp
#

been released since 2020 now in 1.19 something

eternal oxide
#

I know you can;t use teh scheduler in onDisable but it gives you an actually helpful message

weak wasp
#

like 0 code cahnges since 2020 on it, now it's busted

eternal oxide
#

not a NoSuchMethodError

#

?stash

undone axleBOT
weak wasp
#

java.lang.NoSuchMethodError: 'void org.bukkit.scheduler.BukkitScheduler.cancelAllTasks()'

tardy delta
ivory sleet
#

looks scary

tardy delta
#

no u

ivory sleet
#

:c

tardy delta
#

im sowwy

#

i guess ill make a CachedRepository abstract class which already holds the cache inside

#

as probably all my stuff needs the DelayedRemovalCache::remove thing

ivory sleet
#

the issue I see is the remove part

tardy delta
#

kinda yes

ivory sleet
#

other than that, Ig it looks fine

eternal oxide
#

There is no reference to org.bukkit.scheduler.BukkitScheduler.cancelAllTasks() anywhere in the scheduler code of Spigot. Its not being thrown by the cancelTasks(plugin) call

tardy delta
rigid loom
#

Cross-world non-player entity teleportation

ivory sleet
#

lets say someone within the span of that duration invokes remove again, or well adds a value for said key again

weak wasp
#

yeah just getting rid of that line fixed it up... Thanks guys

#

spigot seems to handle the rest

tardy delta
#

my responsibility to not do that :/

ivory sleet
tardy delta
#

adding the values which should be removed to a queue is a little bit overhead i'd say

ivory sleet
#

thats a queue? thonk

tardy delta
#

idk lol i just mean a collection

weak wasp
#

so you are batch removing them? Not just as they come in?

tardy delta
#

when i call ::remove, im just querying a task to remove them after a given delay

#

maybe a bit overhead to make a new task each time

ivory sleet
#

na

errant snow
tardy delta
#

i guess ill just have to be consistent to not do weird stuff 🤔

ivory sleet
#

mye

#

well I hate whenever u have to involve scheduling

#

it is always prone to insidious bugs

#

and then ofc Ig you could test around that

hybrid spoke
#

when he said remove after x time i thought of a selfclearing cache

#

but why do you want to delay the remove

ivory sleet
#

^

tardy delta
#

for users that logout and relogin right after that

hybrid spoke
#

isnt the span of 1 sec a bit too low for that

tardy delta
#

wdym

hybrid spoke
#

also with the current code isnt it removed anyways

#

ah nvm i didnt saw the x.toSeconds

#

also this isnt really an "ask to remove", its more like a "i say remove but your ping is 1000"

#

wasnt your idea first to query the removal?

tardy delta
#

well ye isnt it queried then?

#

it removes it after some time

hybrid spoke
#

yeah, but you want it to stay if they log on back nor?

tardy delta
#

hmm ye that will put it back in and after the delay it will be removed anyways

hybrid spoke
#

right now its kinda useless, since you are just delaying the removal. its bug prone

tardy delta
#

havent thought about that lol

#

maybe keep track of the tasks that will remove it

#

and remove that task if they log back in

hybrid spoke
#

you could give your query a timestamp of like 5 mins in the future

#

once the timestamp isnt in the future anymore you can remove it

#

if the user log in back, you remove the query

#

so you dont have a timer for each

tardy delta
#

uhh

#

smth like this?

hybrid spoke
#

looks about right but for what the generics

tardy delta
#

im not competely understanding what you mean anyways

#

with the date

hybrid spoke
#

you give your query a timestamp which represents when the query should be executed

#

so that for example when player X leaves his data lasts for 5 minutes. but if he connects back in time the data stays

stoic vigil
#

how to catch an event, if an itemframe breakes? i thought it's EntityDeath, but thats just for living entitys...

tardy delta
#

but with that timestamp, i would still need the scheduler no?

hybrid spoke
hybrid spoke
tardy delta
#

so just scheduler::runTaskTimer which peridically checks for the time of the queries and depending on that, removes it or not?

hybrid spoke
#

sounds about right

tardy delta
#

or i could just use a runnable cuz that generics seems to not work with the record

hybrid spoke
#

check if the args length is 0 and do your stuff

tardy delta
#

cuz a record is a static typed class i guess

undone axleBOT
tardy delta
#

wait im stupid

#

@hybrid spoke like this?

#

actually isBefore should be isAfter

#

wait no

#

so it will schedule a task which will check every 5 minutes if i can entries which should've been already removed

long elm
#

hello i need help with my code i become this error but i don't have a idea why i become this error (my english is not the yellow from the egg..)
code:

package de.maurice.mcp.teamspeak;


import com.github.theholywaffle.teamspeak3.TS3Api;
import com.github.theholywaffle.teamspeak3.TS3Config;
import com.github.theholywaffle.teamspeak3.TS3Query;


public class init {

    public static void main (String[] args) {
        final TS3Config config = new TS3Config();
        config.setHost("82.165.107.47");
        config.setEnableCommunicationsLogging(true);
        
        final TS3Query query = new TS3Query(config);
        query.connect();

        final TS3Api api = query.getApi();
        api.login("MCBOT", "xxxx");
        api.selectVirtualServerById(2);
        api.setNickname("MCP :: SERVERBOT");
        api.sendChannelMessage("bot");

    };
    
};

error:

Exception in thread "main" com.github.theholywaffle.teamspeak3.api.exception.TS3CommandFailedException: A "sendtextmessage" command returned with a server error.
>> insufficient client permissions (ID 2568), failed permission with ID 219
weak wasp
#

seems like after you log in, your bot does not have permission to "sendtextmessage"

long elm
weak wasp
#

hmm

#

I used that before for voice chat actually pretty cool

#

someone else wrote JNI wrappers for the SDK though, so it was very little work. Last I checked TS3 SDK was in C only

long elm
#

okay so it was a cache error i have reload vscode an so its work 😄

severe turret
#

trying to compile 1.19 branch of fastlogin

#

anyone knows how do i fix this

#

duplicate entry: META-INF/services/fastlogin.slf4j.spi.SLF4JServiceProvider

quiet ice
#

Context?

#

Additional lines in the compile log would be nice, as well as how you compiled it

ocean lion
severe turret
quiet ice
severe turret
#

and i used clean install shade:shade

ocean lion
#

Well for starters

quiet ice
#

I assume that you just cloned a repo, what is the repo URL?

ocean lion
#
public static void setItem() {
        FileManager.getCustomConfig().set("item.gadgetsmenu", gadgetsMenu);
    }

Is this the right way to set loading items in onEnable after creatingcustomconfig?

ocean lion
#

How would I make the itemstack since all the data is supposed to be making iteself with customConfig.set

quiet ice
#

It does look cursed

severe turret
#

that exact branch

quiet ice
#

Would need to look more closely to see if that is indeed the proper way of doing it

severe turret
#

ugh

#

i hate maven

river oracle
#

Maven is fireee

quiet ice
#

These devs seem to not know that that is not how to use SLF4J

river oracle
#

I don't even use SLF4J lol

#

I just use the plugin logger I'm a basic hguman

severe turret
#

yeah

#

it would be also nice

#

if he shared how to compile his project

#

also

#

i had to restart invalidate the cache clone rebuild

#

like 50x times

#

for the dependencies to wokr

#

maven is fun haha

river oracle
#

Intellij is bad the amount of times you have to invalidate cache

severe turret
#

nah

#

i love intellij

river oracle
#

Bruh had to do it 5 times using rust last night and didn't evne work ended up switching back to vsc for rust

severe turret
#

i just hate maven

quiet ice
#

SLF4J is really nice

#

Best thing out there, but come on - at least you should know that it isn't meant to be shaded in your plugin

#

However chances are that this will not work

#

It might, but I recommend to use the one that is maintained by mfnalex

severe turret
#

I will just ask the dev I guess

#

I don't have any more brain power to deal with this

#

xd

vernal abyss
#

I am trying to get a Sign instance from the block the player is at, and I was told to do it with the block state.

BlockState blockState = player.getEyeLocation().getBlock().getState();
Sign sign = (Sign) blockState;

But I am getting this error:
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.CraftBlockState cannot be cast to class org.bukkit.block.Sign (org.bukkit.craftbukkit.v1_19_R1.block.CraftBlockState and org.bukkit.block.Sign are in unnamed module of loader java.net.URLClassLoader @759ebb3d)
What should I do?

eternal night
#

Your block is just not a sign

quaint mantle
#

Maybe

#
if(block instanceof Sign)??```
#

Try that it might work.

green prism
#

Gotta some problems... The server says in Italic/LightGray "[Server: Showing new title for Player]", "[Server: Showing new subtitle for Player]" when trying to send a title. Can you help me?
Version: 1.16.5

humble tulip
#

Check if the block data is a sign

#

Or state can't remember

#

See what Sign.class extends

eternal night
#

Block state

wary harness
#

Any one can help with packet or item name

#

I would like to use item name message as second action bar

#

Is that to crazy idea

tardy delta
#

why isnt this working?

class SomeClass<T> {
  record Stuff(T t) {}
}```
#

the generic parameter in the record doesnt work

#

only seems to work when converting it to a non static class

left swift
#

How can I create fake players on tablist? I mean i know that should I send ClientboundPlayerInfoPacket, but when I send it on player join it doesn't work. <- Player can't join to the server.. Without any errors in console

[16:39:51 INFO]: ★ TheTuso joined the game
[16:39:51 INFO]: TheTuso[address] logged in with entity id 154 at ([world]24.829597197271955, 65.0, 1.865502375417641)
[16:39:51 INFO]: TheTuso lost connection: Disconnected
[16:39:51 INFO]: ★ TheTuso left the game```
tardy delta
#

records are static classes?

humble tulip
humble tulip
tardy delta
#

pff what a shit to convert that to a normal class

#

when does java have tuples

humble tulip
#

😂

tardy delta
#

stfu

glass mauve
#

💀

#

tuples are against OOP rules

tardy delta
#

dont care lol

#

gimme tuples

hollow arch
#

why so angry o.o

tardy delta
#

cuz this way of doing it sucks

glass mauve
#

make a specific class if you want to return or hold multiple things

river oracle
glass mauve
#

or make a tuple

#

should be pretty simple

#

but as said its against OOP rules

left swift
#

Code how I create packets and ServerPlayer```java
private @NotNull Collection<ServerPlayer> getFakePlayers(int amount, @NotNull Player receiver) {
ServerLevel serverLevel = ((CraftWorld) receiver.getWorld()).getHandle();
Collection<ServerPlayer> fakePlayers = new ArrayList<>();
for (int i = 0; i < amount; i++) {
fakePlayers.add(this.createCraftPlayer(serverLevel).getHandle());
}
return fakePlayers;
}

public @NotNull CraftPlayer createCraftPlayer(ServerLevel serverLevel) {
    GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "                                "); // 32 spaces
    gameProfile.getProperties().put("textures", this.DEFAULT_SKIN);
    ServerPlayer serverPlayer = new ServerPlayer(this.minecraftServer, serverLevel, gameProfile);
    CraftPlayer craftPlayer = new CraftPlayer((CraftServer) Bukkit.getServer(), serverPlayer);
    craftPlayer.setGameMode(GameMode.SPECTATOR);
    return craftPlayer;
}

public ClientboundPlayerInfoPacket createPacket(Player receiver) {
    return new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, this.getFakePlayers(80, receiver));
}```
tardy delta
#

tf

worldly ingot
#

Yeah, record types declared inside of a type are implicitly static

#

Did you know you can do this too?

public class Main {

    public static void main(String[] args) {
        record Example(String value) { }

        Example first = new Example("Hello");
        Example second = new Example("world");
    }

}```
tardy delta
#

yes

#

just tested it out an hour ago

worldly ingot
#

You can do it with classes. They're just implicitly static

#

I can't think of a reasonable situation to do it for a class, but doing it for a record sort of makes sense lol

#

I've had to use records only in a single method before

tardy delta
#

oh didnt know records could be generic

glass mauve
#

thats why its so fast to create a Tuple with records and generic

tardy delta
#

so i could do this hehe

waxen plinth
tardy delta
#

god...

waxen plinth
#

Why do you need that

glass mauve
tardy delta
#

technically i could also do it with an iterator over the values

waxen plinth
glass mauve
#

wait let me find this one post from one of Javas creator

waxen plinth
#

Records are called nominal tuples in the JEP that introduced them

tardy delta
#

love it

waxen plinth
#

Why do you need that

tardy delta
#

im iterating over a map with holds queries to execute at a specific time

#

and in my current impl i need access to both the key and the value

waxen plinth
#

Stream over the entry set

tardy delta
#

so Iterator<Map.Entry<K, RemoveQuery<K>>> ugh

waxen plinth
#

Wait

tardy delta
#

streams are slow

waxen plinth
#

Ofzfzltsksrirawkr

#

You know what's slow?

tardy delta
#

👀

waxen plinth
#

Iterating over all of them to check which ones should be executed and removed

#

Use a TreeMap or TreeSet

tardy delta
#

ignore the two for loops, just testing smth

waxen plinth
#

Then you can just directly retrieve all the ones that are due to be executed

tardy delta
#

lemme look what a treemap is

#

isnt that a map which takes a comparator to order the elements?

hollow arch
#

What would be a decent-ish way to generate custom structures? They aren't too large but I am not entirely sure if Spigot/Bukkit has a built in way of doing this. I'd like to not rely on WorldEdit schematics

left swift
#

Is there any way to send ClientboundPlayerInfoPacket with name longer tha 16 chars?

tardy delta
#

nope, use scoreboards

#

actually teams

simple silo
#

What is the best way to run code everytime a new day starts on a world?

tardy delta
#

theres no timechange event, you probably want to use a runnable to check when it becomes day

simple silo
#

alright, thanks

ivory sleet
#

but this often depends on situation and context

glass mauve
ivory sleet
#

sometimes an implementation pattern will be just as explanatory with a tuple... sometimes not

glass mauve
#

I also used Tuples/Pairs

ivory sleet
#

ye

glass mauve
tardy delta
#

why

#

wait nvm

ivory sleet
#

yuh, well my general rule is if the class is gonna be exposed to other modules, or to the world of api consumers

#

then go for a record/class

heady spruce
#

Is it possible to play a sound to a player using packets in bungeecord?

ivory sleet
#

else if its just an impl detail, why not keep it a tuple/pair and let the variable name explain its duty

tardy delta
#

is there a way to sort a treemap by values?

#

comparator only takes keys

ivory sleet
#

ye

#

you can implement a comparator that knows about the map instance

#

and uses Map::get (on the keys)

tardy delta
#

im still working on that cache thing

ivory sleet
tardy delta
#

and maybe its a good thing to sort the entries based on the time when they should be executed

#

what Redempt said

ivory sleet
#

mye why not

tardy delta
#

actually im thinking about what the advantages would be

#

that i could just stop searching when i reach an "invalid" entry

#

and maybe the lookup time for the map? idk

#

wut records can implement stuff

#

thats new for me

ivory sleet
#

ye

#

they cant extend iirc

#

but they can implement

limber marten
#

How can I use NMS with Gradle?

repositories {
    mavenCentral()
    maven {
        name = 'spigotmc-repo'
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
    }
    maven {
        name = 'sonatype'
        url = 'https://oss.sonatype.org/content/groups/public/'
    }
}

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
}
tardy delta
#

nope they cant extend

ivory sleet
#

ye since they extend the java record class

ivory sleet
#

then switch the artifact if the dependency from spigot-api to spigot

limber marten
#

i'll try this ty

tardy delta
#

never implemented comparable lol and Instant doesnt seem to have a compareTo method

#

i guess compare the time between now and the instant

limber marten
tardy delta
#

owh bruh ye youre right

#

i was checking the wrong generic parameter

#

love it cant even use a lambda

rotund pond
#

Hello everyone !
I have bugs with something :/
I'm trying to get the amount of items crafted.
Here is my code: (Spoiler: I've got it from spigotmc.org)

  private ItemStack getCraftedItem(CraftItemEvent event) {
    if (event.isShiftClick()) {
      final ItemStack recipeResult = event.getRecipe().getResult();
      final int resultAmt = recipeResult.getAmount(); // Bread = 1, Cookie = 8, etc.
      int leastIngredient = -1;
      for (ItemStack item : event.getInventory().getMatrix()) {
        if (item != null && !item.getType().equals(Material.AIR)) {
          final int re = item.getAmount() * resultAmt;
          if (leastIngredient == -1 || re < leastIngredient) {
            leastIngredient = item.getAmount() * resultAmt;
          }
        }
      }
      return new ItemStack(recipeResult.getType(), leastIngredient);
    }
    return event.getCurrentItem();
  }

My problem: If I'm trying to craft things like my screenshot, it will crash only 1 mushroom stew, but it will count as 64.
How can I fix it please ?
I'm trying to fix this *** since 2 days 😭 😭

lost matrix
tardy delta
#

the thing is that i want to compare by value, in a treemap

#

so the key should be aware of a map where both the key and the value are in

lost matrix
rotund pond
lost matrix
tardy delta
#

ye mb

#

it shouldnt be the treemap but another map

#

actually i guess its impossible what im doing

#

lemme use my last braincells

lost matrix
lost matrix
rotund pond
tardy delta
#

ah i get it, i need to know the value which is used on the treemap::put and compare that

#

but comparator compares on keys

#

so i thought lets get the value from another map, based on that key

#

but there is no such map

ocean lion
#

How would I set an itemstack in customconfig (data like displayname, lore etc) without making the whole item

tardy delta
#

it implemnts confiuration serialzable

twilit roost
#

How to import custom animations?
And apply them to entities?

lost matrix
# rotund pond Alright, it's still a beautiful way. Thank you ♥

PS: For performance reasons: You just need to look at the crafting matrix and the amount of the result ItemStack.
In fact, only the matrix slot with the lowest amount.
Then you do
recipesTriggered = smallestBefore - smallestAfter
And
itemsCrafted = recipesTriggered * resultSingleAmount

ocean lion
#

if someone here knows anywhere I can read about making custom item.yml file I would appriciate it. Cant find anything

lost matrix
limber marten
tardy delta
#

stackoverflow doesnt seem to help alot, those things only make the efficiecy worse

ocean lion
#

is that a false statement

rotund pond
lost matrix
rotund pond
#

@lost matrix Sorry for the ping, do you accept that I try to DM you when I've finish to fix this ?
Just to be sure I'm not doing weird things

wary harness
#

is there a packet way to modify this message

echo basalt
#

uhh

#

that's the item's name

wary harness
tardy delta
#

anyways i can just leave the collection unsorted but that wont be really good for performance. But ye i dont have much entries so probably doesnt matter

wary harness
#

I would like to use it as second actionbar

earnest forum
#

without changing the item name

#

?

echo basalt
#

you can modify it through some hacky stuff but it's very fuggly

wary harness
echo basalt
#

As in, change the item's name, update inv

#

but I wouldn't recommend it

#

The inventory would flicker a bunch, some issues can occur if the player opens their inv

earnest forum
#

the actual message is probably client sided and u cant do much about it

#

but as said above you could try changing the items name

wary harness
#

dam it

earnest forum
#

for a tick

#

u could research it tho

#

may be possible

lost matrix
# limber marten up :)

I would recommend maven for Spigot and gradle for Paper.
Just because of the special-sources and userdev plugins respectively.

lost matrix
ocean lion
lost matrix
ocean lion
#

but why is it null

lost matrix
heady spruce
tardy delta
#

im currently storing a function that will remove an entry from a map, do i better save it as a Runnable or a Consumer<K>? so with the first one it would be () -> map.remove(key); and second one map::remove

#

both ways work

#

only difference is that the code for the 2nd one is a bit longer (ignore the errors)

ocean lion
lost matrix
river oracle
#

7smile7 I have a question. I need to construct some predefined ItemStacks and I'm curious what you think a good way to do that is. Static is a given, but every way I think of doing it seems so wrong.

heady spruce
ocean lion
#

I'm really confused

tardy delta
lost matrix
heady spruce
#

i know this sounds stupid but what are the differences between a map, hashmap and collection xD

ocean lion
rotund pond
#

What is the inventory Matrix exactly ?
What does it return ?

#

Please

heady spruce
lost matrix
# river oracle they are immutable

Put them in an enum. You dont want to get the ItemStacks but always call .clone() on the template ItemStacks.
Otherwise you will run into problems.

ocean lion
#

this is the main class

rotund pond
lost matrix
# river oracle okay thanks for the help

Example:

@Getter
@RequiredArgsConstructor
public enum CustomItemType {

  FLAME_SWORD(
          ItemBuilder.of(Material.IRON_SWORD)
                  .name("§6Flame Sword")
                  .lore("", "A cool flame", "sword")
                  .enchant(Enchantment.FIRE_ASPECT, 5)
                  .build()
  ),
  FLAME_BOW(
          ItemBuilder.of(Material.BOW)
                  .name("§6Flame Bow")
                  .lore("", "A cool flame", "bow")
                  .enchant(Enchantment.ARROW_FIRE, 5)
                  .build()
  );

  private final ItemStack itemStack;

  public ItemStack get() {
    return itemStack.clone();
  }

}
ornate patio
#

why has this baby horse gone stupid

#

it wants to drink water

#

but also wants to follow parents

river oracle
ornate patio
#

and it can't decide between the two so it keeps turning around over and over again

#
this.goalSelector.addGoal(1, new PanicGoal(this, 1.2D));
this.goalSelector.addGoal(1, new RunAroundLikeCrazyGoal(this, 1.2D));
this.goalSelector.addGoal(2, new HorseBreedGoal(this, 1.0D));
this.goalSelector.addGoal(4, new DrinkWaterGoal(this, 1.0D));
this.goalSelector.addGoal(5, new EatSeedsGoal(this, 1.0D));
this.goalSelector.addGoal(6, new FollowParentGoal(this, 1.0D));
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 0.7D));
this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.addGoal(9, new RandomLookAroundGoal(this));
#

even though DrinkWater has a higher priority compared to FollowParentGoal

ocean lion
#

sight

tardy delta
#

so exposing constructor or not

ocean lion
#

do you know anywhere with item.yml custom config

tardy delta
#

i sent a link somewhere above

ocean lion
#

Yes I looked through it but it does not contain anything about storing items or how to set them.

tardy delta
#

itemstacks?

#

config.set(itemstack)

ocean lion
#

yes but it gives error wait

tardy delta
#

it will be serialized automatically cuz ItemStack implements ConfigurationSerializable

#

hmm

ocean lion
tardy delta
#

did you put it in the resources folder?

#

thats the easiest way, you can also create a new file and write the stuff manually

#

but like the config.yml, a prewritten config with defaults is always the easiest

ocean lion
#

yes

#

i get the item.yml file

#

but nothing in it

#

i want it prewritten with defaults

tardy delta
#

in the resources folder?

ocean lion
#

Yes

tardy delta
#

i forgot what when that error throws

#

show code

ocean lion
#

Lmao

#

it didnt copy the right link

glossy venture
#

theyre all the same url

ocean lion
#

wait

glossy venture
#

lmao

ocean lion
#

ye

glossy venture
#

aight

ocean lion
#

Now

tardy delta
#

you arent saving the file when setting stuff to it anyways

#

but that looks about right

#

to tired to see whats wrong lmao

#

but can we see the file structure of your plugin to see if you put the file in the resources folder

#

like this

ocean lion
#

I cant paste picture here?

tardy delta
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

tardy delta
#

or use some pasting site idc

glossy venture
#

yo, i want to load a jar file dynamically from a plugin and have it be accessible across all other plugins
the only problem is that parenting it to this.getClass().getClassLoader(), this.getClassLoader() (<-- didnt work at all) or JavaPluginLoader.class.getClassLoader() dont work (where this is a JavaPlugin)

i also tried to reflectively invoke URLClassLoader.addUrl(URL), but the setAccessible(true) method throws a IllegalAccessException stating that i cant reflectively access the method
code for this method:

private static Method uclAddUrl;

static {
    
    try {
        uclAddUrl = 
                URLClassLoader.class
                .getDeclaredMethod("addURL", URL.class);
        uclAddUrl.setAccessible(true);
    } catch (Exception e) {
        uclAddUrl = null;
    }
    
}

// ...

/* some function */ {
  uclAddUrl.invoke(/* the JavaPluginLoader class loader */ classLoader, url);
}

so now im wondering if this is even possible, and if so, how would i do it

ocean lion
#

reason its red on ItemManager is that i was trying to make something to save when I set the item

tardy delta
#

uhh i dont really know

#

ah wait

#

maybe just call saveDefaultConfig in your plugins onEnable method

ocean lion
#

dont think so but i will try

tardy delta
ornate patio
#

how do i get the bukkit world from an nms level

vapid cosmos
#

How do I ignore Citizens NPCs?
Caused by: java.lang.ClassCastException: net.citizensnpcs.nms.v1_8_R3.entity.VillagerController$VillagerNPC cannot be cast to org.bukkit.entity.Player

ocean lion
tardy delta
#

and youre loading it with fileConfig = YamlConfiguration.loadConfig(file)?

ocean lion
#
      customConfig = new YamlConfiguration();
        try {
            customConfig.load(customConfigFile);
        } catch (IOException | InvalidConfigurationException exception) {
            exception.printStackTrace();
        }
    }
}

tardy delta
#

dunno why people dont use that static method

ocean lion
#

?

quaint mantle
#
30.06 18:24:47 [Server]  java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
30.06 18:24:47 [Server]  at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
30.06 18:24:47 [Server]  at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
30.06 18:24:47 [Server]  at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
30.06 18:24:47 [Server]  at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1098)
30.06 18:24:47 [Server]  at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1046)
30.06 18:24:47 [Server]  at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1371)
30.06 18:24:47 [Server]  at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1031)
30.06 18:24:47 [Server]  at CallousPvP-1.0-SNAPSHOT.jar//me.uncoding.callouspvp.datamanager.SQLGetter.createTable(SQLGetter.java:25)
30.06 18:24:47 [Server]  at CallousPvP-1.0-SNAPSHOT.jar//me.uncoding.callouspvp.CallousPvP.onEnable(CallousPvP.java:52)
    public void createTable(){
        PreparedStatement ps;
        try{
            ps = plugin.SQL.getConnection().prepareStatement("CREATE TABLE IF NOT EXISTS callouspvp " +
                    "(UUID VARCHAR(100),NAME VARCHAR(100),FFAKILLS INT(100),FFADEATHS INT(100),NETHPOTINV VARCHAR(100),PRIMARY KEY (UUID)");
            ps.executeUpdate();
        } catch (SQLException e){
            e.printStackTrace();
        }
    }

for context i have been trying to make customizable duels layouts that you can save but i'm having problems with the saving so if anyone could help me figure out what this error means then i would appreciate it

tardy delta
#

how can i check if a repeating task is already scheduled? (so task.runTaskTimer has been called) I saw the method BukkitScheduler#isCurrentlyRunning and isQueued but im not sure which ones to use

ocean lion
#

😛

tardy delta
#

what

vocal cloud
quaint mantle
vocal cloud
#

I mean exactly what I said

tardy delta
#

look for sql validator on internet

#

or that ye

#

:D

vocal cloud
#

I love Jetbrains

#

guess it worked kek

quaint mantle
#

testing it right now haha

#

it worked thank you so much

quaint mantle
long elm
#

hello, i has worked with java on a long time ago..
how can i use the api in my sendMsg construct

public class init {

    public static void main (String[] args) {
        final TS3Config config = new TS3Config();
        config.setHost("82.165.107.47");
        config.setEnableCommunicationsLogging(true);
        
        final TS3Query query = new TS3Query(config);
        query.connect();

        final TS3Api api = query.getApi();
        api.login("xx", "xx");
        api.selectVirtualServerById(2);
        api.setNickname("MCP :: SERVERBOT");
        api.sendChannelMessage("bot");

    };

    public void sendMsg(String[] atgs) {
        this.api.sendChannelMessage("CONNECTED")
    }
    
};
simple silo
#

What is the way to put an array of ItemStack in a chest inventory and spread it randomly?

tardy delta
#

finished it

dull goblet
#

Hey I have a question. What defines a plugin? I'm asking this because i'm using PersistenDataStorage and you have to give a plugin instance. But what defines this, would it be possible to start a new project and have the same plugin instance so you can access the storage?

river oracle
#

yea you can use whatever main instance you want as long as its a JavaPlugin

dull goblet
#

Yes but if it's different you can't access the data from the other instance

river oracle
#

you can actually just take another plugins instance by using JavaPlugin#getPlugin(Class<T extends JavaPlugin)

#

though its not advised

#

for storing data use a database or yaml file

#

pdc is best for small snippets

dull goblet
#

Its like storage for keycard doors to store which door is which but my question is how a plugin instance is unique

#

Like if i update my plugin code

#

it's still the same plugin

river oracle
#

a plugin instance is just something that extends JavaPlugin

#

lol

dull goblet
#

yes but if i open a new project and try to access the pdc on a door from that project it won't recognize it

river oracle
#

I'm not sure how it works in the back end but if your changing your main class name and spot every update idk what your even doing

river oracle
#

but you can just use that other plugins instance to retrieve keys

#

ideally if you want to use them for other projects make an API endpoint

dull goblet
#

No it doesn't fine the keys because its another instance

#

Yeah thats the best, i just reference the other plugin now

river oracle
#

set up an API for your plugin right now to access those keys

#

than use maven to import the API

dull goblet
#

I'm just curious what makes the instance unique to learn how it works

river oracle
#

set it as provided for scope

#

and your good to go

river oracle
#

a namespacedkey only needs something that extends JavaPlugin

#

in no way is a plugin instance like a UUID though

#

I seriously don't see the issue here an API end point to access the keys and using that API is really all you need

dull goblet
#

There is no issue i just wanted to learn

#

how it works

river oracle
#

I'm not sure the exact details you'd have to dig in the craft bukkit source

#

?stash

undone axleBOT
dull goblet
#

Okay thanks

quaint mantle
#
    public String getInventory(UUID uuid,String stat){
        Configuration CallousConfig = CallousPvP.getInstance().getConfig();
        try{
            PreparedStatement ps = plugin.SQL.getConnection().prepareStatement("SELECT " + stat + " FROM callouspvp WHERE UUID=?");
            ps.setString(1,uuid.toString());
            ResultSet rs = ps.executeQuery();
            String stats = CallousConfig.getString("Default"+stat+"InventoryContents");
            if (rs.next()){
                stats = rs.getString(stat);
                return stats;
            }
        }catch (SQLException e){
            e.printStackTrace();
        }
        return CallousConfig.getString("Default"+stat+"InventoryContents");
    }

this returns null and i want it to return what's in the config if the player doesn't have anything for the stat. does anyone know how i would fix this?

river oracle
ornate patio
#

is it possible to make a passive mob attack a player with nms

quaint mantle
river oracle
#

make sure if its nested you have dots between the path

simple silo
#
location.getBlock().setType(Material.CHEST);
Chest chest = (Chest) location.getBlock();

how does this produce a ClassCastException? the chest definitely is there

river oracle
simple silo
#

huh?

#

How can I get the chest inventory then?

river oracle
#

give me a second checking forums

chrome beacon
#

Cast the BlockState

river oracle
#

BlockState is the proper cast

#

oh shit you beat me to it

simple silo
#

oh

river oracle
#

you can cast BlockState to Chest

#

make sure you use instanceof to check

simple silo
#
location.getBlock().setType(Material.CHEST);
Chest chest = (Chest) location.getBlock().getState();

like that?

river oracle
#

si

simple silo
simple silo
#

ok, will do it then

river oracle
simple silo
#

thanks

quaint mantle
#
                String invstring = data.getInventory(P.getUniqueId(),"NETHPOTINV");
                System.out.println(invstring);
#

and that prints out null when i try to get the inventory

river oracle
#

send your Config class that contains getInventory etc

quaint mantle
#

okay

quaint mantle
river oracle
#

?paste

undone axleBOT
river oracle
#

send the config too

quaint mantle
#

okay

simple silo
#

How can I rename a chest title? Like you would rename it in anvil

zealous osprey
#

G'day, I have a (hopefully) quick question, for which I couldn't find a straight answer for:
I'm having an issue with Vault, it throws a NullPointer exception whenever I try to use: econ.depositePlayer(p, 0.0d).
And I can not find out why, since both p and econ are not null.

zealous osprey
#

?paste

undone axleBOT
quaint mantle
zealous osprey
chrome beacon
#

Use another economy plugin

zealous osprey
#

eco plugin or something other than vault?

#

Version is 1.12.2 btw

chrome beacon
#

You appear to be using CraftConomy

#

Use something that's not 5 years old

zealous osprey
#

Indeed, as it was the first one I could et a download for

chrome beacon
#

Like Essentials

river oracle
#

teh issue is your economy provider as Olivo said

zealous osprey
#

Thanks <3