#help-development

1 messages · Page 991 of 1

granite owl
#

so, in the end my approach is correct?

#

get data from source x

#

bring it to byte array

#

parse from byte array?

tardy delta
#

i dont see any decryption in there

granite owl
#

????

tardy delta
#

btw File has ::extension or smth

#

you seem to be writing extra verbose code

granite owl
#

ill change that

#

no need to delimit by extension then

tardy delta
#

id accept a Path as argument

blazing ocean
#

yo can somebody help me with jitpack

granite owl
tardy delta
#

just use substring with lastindexof

granite owl
#

getname is the closest

#

delimiting by directories

valid burrow
#

are you trying to get the file extension?

granite owl
valid burrow
#

substrig it with .

tardy delta
#
int i = filename.lastIndexOf('.')
if i == -1 return false
String ext = filename.substring(i)
storm crystal
#

if I have

  deaths: 5
  kills: 6```
in yml file, how do I read each of tabs in a list
#

so that I have a list of ["deaths", "kills"]

tardy delta
#

config.getSection("player").getKeys(false) or smth

granite owl
#
String extension = file.getName().substring(file.getName().lastIndexOf('.'));
```prob this?
valid burrow
#

should work

tardy delta
#

will throw when no extension

valid burrow
#

true

tardy delta
#

could use Math.max(0, ...) and then its empty

valid burrow
#

either way you will need a null check or try catch somewhere

#

might as well put it here

granite owl
#
String[] pathDelimited = path.split("\\.");
if (pathDelimited.length <= 0) return false;

String extension = pathDelimited[pathDelimited.length - 1];
if (extension.equals(String.valueOf(this.settings.fileExtension)) != true) return false;
```at this point this isnt even more work anymore
tardy delta
#

just dont

#

or are you trying to get extension of stuff like doc.md.old

granite owl
#

but this is gonna be a problem anyways

#

because no extension should be valid

#

if the extension is a string of length 0 in the settings

tardy delta
#

then simply call firstIndexOf and substr it

#

wondering what we are even discussing about at this point

granite owl
#

me too xD

storm crystal
#

is this how I'd get stuff from yml config file

tardy delta
#

yes

#
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

glass mauve
tardy delta
#

spigot docs about config are awful

storm crystal
glass mauve
glass mauve
#

what do you not understand?

storm crystal
#

everything?

#

whats your problem?

glass mauve
#

your program is bad and you should fix it

valid burrow
#

Oh god not again

glass mauve
#

in your return you have playerStatsCache.get(id) which is unnecessary

storm crystal
glass mauve
#

because the value returned by the get call returns the same instance as dataAccessObject

#

because you put it into that a line before

granite owl
#

but then theres still a problem with hidden files

#
.manifest
#

that hold no extension

storm crystal
#

what about it

glass mauve
#

you make an unnecessary call to your cache instead of returning dataAccessObject directly

storm crystal
#

happy?

glass mauve
#

yes

#

what you might missing now is the cache look up in the beginning of the method

storm crystal
#

?

#

can you be

#

more

#

concrete

glass mauve
#

it is concrete enough for any java developer to understand

#

it cant be more concrete without spoonfeeding code

#

literally

storm crystal
#

if you cant explain it in simple words then you dont understand it either

glass mauve
#

nah it is in simple words, you just cant understand these simple words

storm crystal
#

not really, you cant explain it in simple words

glass mauve
#

so explain to me your usage of the cache in your code

glass mauve
storm crystal
#

also totally ignoring the fact that this sentence is incorrect

glass mauve
#

why is it wrong?

eternal night
#

As of right now, your method does not read from the cache, it only writes to it.
As such you need to first check if the cache contains the requested value and then yield it before doing the "more expensive" lookup.

storm crystal
#

its not grammatically correct

glass mauve
storm crystal
#

you expect me to understand something written in half assed English, lol

#

quality help it is

worldly ingot
#

:p At the very least you should listen to lynx, he's correct

glass mauve
#

imagine being such a clown

worldly ingot
#

At least in the snippets you given, you're only writing to the cache which does you nothing if you never read from it

storm crystal
glass mauve
storm crystal
worldly ingot
#

Okay, don't need to continue lol

storm crystal
#

it works tho

#

so whats the problem

eternal night
#

As of right now, your method does not read from the cache, it only writes to it.
As such you need to first check if the cache contains the requested value and then yield it before doing the "more expensive" lookup.

worldly ingot
#

You are caching, you are not reading from the cache

storm crystal
#

its literally supposed to read shit from .yml file into the cache

eternal night
#

As of right now, your method does not read from the cache, it only writes to it.
As such you need to first check if the cache contains the requested value and then yield it before doing the "more expensive" lookup.

worldly ingot
#

Yes, and you are not reading from your cache

glass mauve
worldly ingot
#

It's going into the cache, it's never coming out of the cache :p

#

You never invoke a Map#get() anywhere

#

Yes, you had one before in your return statement, but you were doing it at the end which didn't make a difference

storm crystal
#

yml file -> cache

#

I dont know how easier I am supposed to explain it

#

it works

storm crystal
#

whats your problem with that

#

what the fuck do you even mean by reading cache

#

its not supposed to read it

worldly ingot
#

Why not?

storm crystal
#

why do I need to read something I wont be using

glass mauve
#

why do you have a cache then?

worldly ingot
#

That's the whole point of a cache lol

glass mauve
#

lmao

storm crystal
#

I literally have separate methods for that

#

???????????????????????????????

worldly ingot
#

Okay, good. So why are you not pulling from it? PandaThink

#

Or are you doing it elsewhere?

storm crystal
#

because im pulling from a FILE

glass mauve
#

well it would make more sense to check if there is something in the cache before reading in the retrieveFromDatabase method

storm crystal
#

not CACHE

#

come on

tardy delta
storm crystal
#

I expected you to know any better

glass mauve
#

you usually have a cache to prevent repeating expensive lookups, for example expensive I/O operations

eternal night
#

Having this be a different method means every caller to retrieveFromDatatabase has to first check if the value is potentially in the cache and then invoke a different method.

granite owl
# tardy delta ```java int i = filename.lastIndexOf("."); if (i < 1) return false; // no extens...

i came up with this ```java
String extension = "";
switch(file.getName().lastIndexOf('.'))
{
case -1:
{
break;
}
case 0:
{
if (file.getName().charAt(0) == '.') break;

            extension = file.getName().substring(file.getName().lastIndexOf('.'));

            break;
        }
        default:
        {
            extension = file.getName().substring(file.getName().lastIndexOf('.'));

            break;
        }
    }

    if (extension.equals(String.valueOf(this.settings.fileExtension)) != true) return false;
#

xD

tardy delta
#

what the fuck

storm crystal
#

on server enable:
get .yml config into cache

on action:
do something with cache, get something from cache

on server disable:
get cache into .yml config

#

whats so hard to understand in that?

eternal night
#

If the only goal of "retrieveFromDatabase" is to just add it to the cache, little point in returning it

#

but yea, looks like it works then ™️

granite owl
#

in both combinations

tardy delta
#

then swap the boolean

#

cmon man

storm crystal
#

happy?

terse nexus
#

can someone help me with my plugin

tardy delta
#

?ask

undone axleBOT
#

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

glass mauve
# storm crystal happy?

well it works, but I would structure this whole reading/writing differently in the first place

storm crystal
#

Im not going to refactor entire project because "you would do it the other way"

glass mauve
#

never said that 🤷‍♂️

glass mauve
#

just telling you its technically not the best code

glass mauve
tardy delta
#

why doesnt a retrieval operation return anything

terse nexus
#

so i have been making a plugin for a minecraft smp of mine but im running into some problems

  1. the plugin assigns random lives whenever a player joins for the first time but it is assigning lives everytime they rejoin and on server restart
    2.i made a playerdata.yml file to save data but it doesnt seem to save
    3.i made it so that depending on the amount of lives u got ur name color changes but it isnt working on the server
tardy delta
#

it doesnt seem to save
ur saving the file or just writing to it?

#

also define not working and what youve tried

storm crystal
#

works well enough

glass mauve
storm crystal
#

for some reason I dont even have to check if player has those, it just creates itself

granite owl
#

i just realized lastindex is index in string not counts of found instances

storm crystal
#

as usual

glass mauve
tardy delta
#

world is hard

storm crystal
tardy delta
#

dealing with senior devs will only be harder

storm crystal
#

how helpful

storm crystal
glass mauve
tardy delta
#

how fun

storm crystal
#

very helpful again

#

"just do it from scratch again, id do it better"

glass mauve
#

check the other messages before that

#

I was relating to them

hazy parrot
#

Gl getting help with that attitude

storm crystal
glass mauve
#

ok lmao

storm crystal
#

how do I save itemstacks into yml file

terse nexus
tardy delta
#

and whats not working

terse nexus
#

even though its only supposed to do it once and thats when joining for first time

#

so i have been making a plugin for a minecraft smp of mine but im running into some problems

static marten
#

for some reason, even though i have
implementation 'org.java-websocket:Java-WebSocket:1.5.6'
in my build.grade, when i run my plugin it give

[21:19:05 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'Minecraft_wsChat-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: org/java_websocket/client/WebSocketClient

Caused by: java.lang.NoClassDefFoundError: org/java_websocket/client/WebSocketClient

Caused by: java.lang.ClassNotFoundException: org.java_websocket.client.WebSocketClient
#

im using papermc 1.20.4

eternal night
#

are you properly running the shadow task? and using the -all jar.

static marten
eternal night
#

Well you seem to be using gradle.

#

If you want to shade a depdencny into your final jar, you need to use the shadow plugin for that

#

it isn't inbuilt into gradle

static marten
#

alr i'll try that ty

storm crystal
eternal night
#

what?

#

bood?

#

oh BukitObjectOutputStream?

#

no, not when using the YamlConfiguration directly

wraith dragon
#

Hey guys im working on a plugin that clears blocks inside a certain area. Though it only clears "non-builder" blocks, and the way I check that is by using CustomBlockData, an API made by alex, and it all worked great until I went to scale it up (500x500). I then searched for more solutions and I stumbled upon 7smile7's workload distributed which definitely helped, but the root cause of all the lag I was having was the checking of keys of the blocks to determine whether they are a builder block or not. How do you guys suggest I do this? Instead of making a new object everytime and checking the key inside, should I listen for chunk load event and get the blocks from there and add it to a list along with other events like block break and block place, and just grab the object from there? Because then I would have to check if the block is inside the area which could possibly add some lag aswell. Would like to hear your guys' opinion on this, thanks a ton.

eternal night
#

iterating through 500x500 blocks and checking is never going to be fast enough to do it in one tick

brittle geyser
#

How to do multi versional plugin, i need to get material from server minecraft version 1.16 with 1.8 version plugin

rotund ravine
slender elbow
#

Can't keep up!

storm crystal
#

can I store entire inventory in yml file

eternal night
#

You can store a List<ItemStack>

#

not the entire inventory, but its contents

onyx fjord
#

i have a problem with the patrick choe mojang spigot remapper plugin
artifact builds and remaps fine but if its used as shaded project dependency it uses the non-remapped artifact

eternal night
#

idk if it properly exposes a configurationf for you to depend on

wraith dragon
eternal night
#

Huh?

#

No you want to do what smile laid out

#

spread this work over multiple ticks

wraith dragon
#

Alright

onyx fjord
#

i dont see it exposing a configuration in it's src

eternal night
#

Yea then you probably have to create one yourself

onyx fjord
#

it can take a task however

onyx fjord
eternal night
#

configurations.register

#

and then you just add outgoing.artefact(tasks.reobf) or whatever

#

I hope the task properly defines its outputs

polar forge
#

Hi guys

#

I got a question, I know it’s very basic Java knowledge thing but

#

How do I recall a variable later on in another if statement

#

My variable was set in a field

#

Im so dumb

#

Thanks anyways!

#

Another question

#

Im technically saving the position of the player, by using getBlockX Y and Z

onyx fjord
polar forge
#

Im now trying to make that if I do /setfree player it would teleport that player to the saved position, which can be found in Custom.yml file. But I saved them by coords X Y Z

blazing ocean
#

please send your code, not a screenshot of the ide 🙏

#

?paste

undone axleBOT
polar forge
#

I mean sure

#

If it’s handy for u

blazing ocean
#

i mean

#

you can't see the entire code, low quality

polar forge
#

Ok

blazing ocean
#

and you would also need to do getLocation i think

polar forge
#

Im not using getLocation

blazing ocean
#

yea

polar forge
#

I’m using getBlockX Y Z

blazing ocean
#
target.teleport(config.getString(".X"));
#

you are trying to teleport the player to a string

polar forge
#

Im trying to teleport him to those coords of X Y Z that are saved under the username of the target

trail coral
#

whats the logic behind a gun system?

blazing ocean
#

yeah then at least create a location object before that

#

with world, x, y, z

polar forge
blazing ocean
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

eternal oxide
storm crystal
#

is there a way to make this structure look better?

trail coral
#

hey elgar youll probably know this

polar forge
storm crystal
#

like, not as redundant?

trail coral
#

whats the logic behind a gun system?

trail coral
eternal oxide
#

The code you had yesterday was fine and would have worked

#

You literally only needed one more line but my internet died yesterday

polar forge
# trail coral what are you trying to do

Trying to save the position of a player in my yml file if I send /investigate player command and when I set him free /setfree player he would return to the saved position

polar forge
trail coral
#

or those dont work with players

eternal oxide
#

config.set("path."player.getUniqueId().toString(), player.getLocation());

trail coral
#

yeah they do

#

why do you need a config file

eternal oxide
#

he has trouble with variables. He's not anywhere near using PDC

trail coral
#

oh damn

eternal oxide
#

and if he doesn;t understand something he just ignores it

trail coral
#

anyways do you know how i would start building a gun system? elgar

polar forge
#

No I just ask

trail coral
#

like whats the logic

polar forge
#

But Elgarl, what’s the solution for this now for this code

eternal oxide
#

Not sure what you mean

#

logic?

trail coral
#

I only need 1 "gun" its like a shovel that shoots projectiles that build ice walls and shit but

#

oh yeah also

#

have you seen the door animation on hypixel?

eternal oxide
#

nope

#

weapons that shoot are quite easy

trail coral
#

its like with falling blocks I think its a 3x3 "door" with blocks that falls into the ground

eternal oxide
#

its just player interact event and launch projectile

#

tag teh projectile, then on hit, do whatever you want

trail coral
#

so i need a weapon. whenever the ammo hits a person a small ice "mountain" araises like 2 blocks tall, freezes for 2 seconds and then falls into the ground again

#

and i kinda know how thats done with like falling blocks and stuff right?

#

like the ice wall comes up from the ground

eternal oxide
#

you can do it with falling blocks but it would be simpler with Block Entity

trail coral
#

whats that?

eternal oxide
#

No collision, Translation and does not need to align to other blocks, so can spawn/reside exactly where you want it

#

with FallingBlocks you have collision issues

trail coral
#

hmm

#

are you available for help today? cause i'll probably be back haha

polar forge
eternal oxide
#

you have to store a Location, or at least World name, x,y,z as your player may come from another world

icy turret
#

Can someone help me

tardy delta
#

?ask

undone axleBOT
#

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

icy turret
#

Help Me pleas

#

Why is my server still asking

eternal oxide
#

random site, not clicking

icy turret
#

mclogs

#

google it up

#

Its so u can see the Logs

eternal oxide
#

?paste

undone axleBOT
eternal oxide
tardy delta
#

pastes.dev should be the paste site here tbh, its wonderful

eternal oxide
#

it shoudl

valid burrow
nova quail
#

Hello! I have made a SQLite database for a plugin where stores info about player's selection in a GUI. All works great when one player chooses something, but when the second player chooses another effect in the GUI, the server starts lagging for a few seconds and then sends an error in the console. I've never worked with databases before. Can someone help, please? My database code and error: https://paste.md-5.net/topiramoxu.php

hasty hamlet
#

Who can make a plugin that will track the accuracy of hitting the target, and will write to the player in the chat. Additionally, when the player approaches the target to issue a bow and arrows?

tardy delta
#

why are you caching a statement

#

and why using synchronized, doubt your code is multithreaded

nova quail
#

i tried

valid burrow
eternal oxide
#

I bet he's firing from Asyncchat or something

valid burrow
#

chatgpt sucks at jaava

nova quail
tardy delta
#

dOnT uSe ChAtGpT fOr CoDe

#

it has no idea what its saying

valid burrow
valid burrow
#

then stop using it xd

#

ai can be useful

#

but only if u know how to code propperly

#

its like giving someone stupid a task and you are a production manager

#

maybe it will work

#

but you have to review it

tardy delta
#

1 stop caching your statement, and use Connection::prepareStatement instead, that will cache it internally

#

and i guess you also have to close the statement then

nova quail
tardy delta
#

been a while since i did databases in java

nova quail
#

but sometimes i use it just to recheck

valid burrow
#

pain

tardy delta
#

should use kotlin

#

and an orm mapper

valid burrow
#

#nokotlin

storm crystal
#

how do you read itemstack material type from a string?

tardy delta
#

because you dont know how good it is

#

Material.matchMaterial

nova quail
valid burrow
tardy delta
#

for how long

valid burrow
valid burrow
tardy delta
#

valueOf? idk matchMaterial does some extra magic or smth, check source

tardy delta
valid burrow
#

there has just never been a situation where i thought: „wow this wouldve been so much worse in vanilla java“

tardy delta
#

its the verbosity of java for me

#

as with so much other languages, but thats another story

valid burrow
#

i actually dislike the trend of making langs less verbose

tardy delta
#

why

valid burrow
#

idk just feels wrong for me

#

i also hate the fact that language like python are using indentation for example

#

some may find it easier

#

to me it just feels wrong

tardy delta
#

does it require exactly 4 spaces or a tab?

tardy delta
#

fuckery

valid burrow
#

python has no { / }

#

most of the time

#

goofy

static marten
tardy delta
#

i do like its simplcitly in scripts but thats about it

#

?services

undone axleBOT
tardy delta
#

:/

hasty hamlet
#

Sorry

valid burrow
#

dm me pookie wookie

hasty hamlet
#

Paste

valid burrow
#

ill help u

tardy delta
#

ask ai \🤓

#

wondering what nonsense it will come up with

valid burrow
storm crystal
#
if (healthLeft > 0.66* entity.getHealth()) entity.setCustomName(ChatColor.DARK_RED + enemy.getName() + ChatColor.GREEN + " " + healthLeft + ChatColor.DARK_GRAY + "/" + ChatColor.GREEN + enemy.getMaxHealth());
        if (healthLeft > 0.33*entity.getHealth() && healthLeft <= 0.66*entity.getHealth()) entity.setCustomName(ChatColor.DARK_RED + enemy.getName() + ChatColor.YELLOW + " " + healthLeft + ChatColor.DARK_GRAY + "/" + ChatColor.YELLOW + enemy.getMaxHealth());
        if (healthLeft <= 0.33*entity.getHealth()) entity.setCustomName(ChatColor.DARK_RED + enemy.getName() + ChatColor.RED + " " + healthLeft + ChatColor.DARK_GRAY + "/" + ChatColor.RED + enemy.getMaxHealth());
        if (healthLeft <= 0) entity.setCustomName(ChatColor.DARK_RED + enemy.getName() + ChatColor.DARK_RED + " 0" + ChatColor.DARK_GRAY + "/" + ChatColor.DARK_RED + enemy.getMaxHealth());```
I remember that there was a way to make this code less redundant, so that only ChatColor are changed, but I dont remember what structure was used in that
tardy delta
#

saw someone using a treemap with roman literals

storm crystal
#

it was something like

#

uh

#

you set up a variable

#

with a conditional if

valid burrow
#

🐀🐀

#

tree maps are funky

orchid iron
#

Hi, how can i remove the default item lore on tools, armor, potions and so on?

kind hatch
#

ItemFlag#HIDE_ATTRIBUTES

orchid iron
#

ty

carmine mica
#

you have to actually add back the default attributes tho

kind hatch
#

Potions are weird because they use ItemFlag#HIDE_ENCHANTS

#

?ask

undone axleBOT
#

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

sly flint
#

my plugin name is MIXELSMC

tardy delta
#

thought you were stuck or something

sly flint
#

NO

tardy delta
#

idk we all know what happens when youre stuck

sly flint
#

i cant upload a pic

#

why

tardy delta
#

?verify to do that

#

?verify

sly flint
#

k

tardy delta
#

!verify cmon

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

tardy delta
#

smh

storm crystal
#

why it doesnt work?

#

I thought im using correct syntax

tardy delta
#

valu is int

storm crystal
#

ooh

#

wait

#

I get it lol

sly flint
nova quail
#

How to save database in plugins folder? Cause it saves in server's folder

orchid iron
kind hatch
orchid iron
#

yh on 1.20

kind hatch
#

Paper moment?

slender elbow
#

true

orchid iron
#

yes xd

tardy delta
peak depot
#
if(sender instanceof Player){
            Player p = (Player)sender;
            if(args.length == 0){
                Location loc = p.getLocation();
                loc = loc.add(0.0, 5.0, 0.0);
                byte chiffre = 0;
                loc.getBlock().getWorld().spawnFallingBlock(loc, Material.CHEST, chiffre);
            }
        }```since the spawnFallingBlock method is deprecated what is the properway to do it?
clear elm
#
int minZ = -10000;
            int maxZ = 10000;
            Random rand = new Random();
            int randomZ = rand.nextInt((maxZ - minZ) + 1) + minZ;


            int minX = -10000;
            int maxX = 10000;
            Random random = new Random();
            int randomX = random.nextInt((maxX - minX) + 1) + minX;```
why do i get the same value in both randoms
lilac dagger
#

it usually comes with examples of how you can do it now

storm crystal
#

is it a proper way to see if data object is empty?

#

like, does not exist?

tardy delta
#

what is empty?

lilac dagger
#

it is a good way to do it

#

you can have a hasCache method in your weapon manager

#

but if you need the weapon dao just leave it as it is

tardy delta
#

that would lead to two map lookups in the worst case

storm crystal
#

so the cache is a hashmap

tardy delta
#

could return an Optional if you really wanted

storm crystal
#

<String, DataObject>

lilac dagger
#

optional is not my favorite

quaint mantle
lilac dagger
#

it's a null wrapper

quaint mantle
#

brush alr metioned it :(

storm crystal
#

would this work in Yaml?

eternal oxide
#

no

tranquil glen
#

Required running through java to return a string

#

ChatColor.DARK_RED returns "§4"

#

ChatColor.BOLD.toString() returns "§l"

#

So you'd be able to just do §4§lRed Virtue instead

storm crystal
#

okay

eternal oxide
#

if you want it human readable add your own parser and use keys like %DARK_RED%

tranquil glen
#

Yes

tranquil glen
#

And in the code where you call "name" from the yaml
Just do a .replace("%DARK_RED%", "§4")
kinda thing

eternal oxide
#

String.replace("%DARK_RED%", ChatColor.DARK_RED.toString())

tranquil glen
#

Yeah that

storm crystal
#

that screams unnecessary

icy beacon
#

When just working with chatcolors maybe yes

tranquil glen
#

It's not necessary

eternal oxide
#

I did say if you want it human readable

tranquil glen
#

^

icy beacon
#

It can be useful in other cases where there's maybe hundreds of magic values to remember

eternal oxide
#

I always find it annoying to look up the color codes

icy beacon
#

I've memorized them 😛

eternal oxide
#

write a parser once and you are done for good.

tranquil glen
#

I was obsessed with minecraft when I was younger, so I have them all memorized lol

icy beacon
#

&6 is the best color

tranquil glen
#

I like &b

eternal oxide
#

&f is best 🙂

tranquil glen
#

All of the letter ones are the best

#

Except &6, there isn't a good letter replacement for it

icy beacon
#

Wanna make an announcement? &6
Wanna draw attention? &6
Wanna send a warning? &6 or maybe &e

tranquil glen
#

or

#

&c

#

for warning

icy beacon
#

I'd say it's for smth more severe than a warning

tranquil glen
#

Fair

icy beacon
#

And if you want to be extreme

#

&4

tranquil glen
#

They all have their own purposes

#

Yes

tardy delta
#

there was a time i knew all those color codes out of my head

worthy yarrow
#

&L is the best, cuz then you just get to scream at people

peak depot
#

is there a way to see the chest when you spawn it via World#spawnFallingBlock

lilac dagger
#

Falling blocka are not tile entities

#

Or what chests are

#

You can have a hashmap of falling block and inventory and apply it on transform to block

stiff vine
#

hi, i test to use the #setInterpolationDuration on spigot 1.20.4 but that don't work. When i test on 1.19.4 that work perfectly and when a copy/past to 1.19.4 to 1.20.4 (cuz normaly it would work) no. so idk if i'm wrong or something but idk.

Location loc = new Location(Bukkit.getWorld("world"),0 ,120 ,0);
        BlockDisplay display = (BlockDisplay) (loc.getWorld().spawnEntity(loc, EntityType.BLOCK_DISPLAY));
        display.setBlock(Material.GLASS.createBlockData());
        Vector3f translation = new Vector3f(0,0,0);
        AxisAngle4f axisAngleRotMat = new AxisAngle4f((float) Math.PI, new Vector3f(0,1,0));
        Transformation transformation = new Transformation(
                translation,
                axisAngleRotMat,
                new Vector3f(1,5,1),
                axisAngleRotMat
        );
        display.setTransformation(transformation);
        display.setInterpolationDuration(3);
#

when i say it don't work, i mean that the displayblock instant do the animation without duration

valid burrow
#

?paste for me

undone axleBOT
storm crystal
#

why is my command name printed after using it?

valid burrow
#

return true

storm crystal
#

oh

#

do I return false when it does not work?

worthy yarrow
valid burrow
#

for example when you are trying to say "hey you used this command the wrong way"

worthy yarrow
#

More times than not you can just return true to exit early (when it comes to commands) depends on whether or not you want that msg I suppose

storm crystal
#

how to read elements of yaml string array into java String[]

worthy yarrow
#

Get the path of said element, add it to the array

storm crystal
#

I just used getStringList and made List<String>

#

ig it works too

worthy yarrow
#

Sure, we’ve got the

#

?tas command for a reason :p

#

?tas

undone axleBOT
storm crystal
#

?

#

I literally said that it works

#

whats your deal

worthy yarrow
slender elbow
#

lol

topaz cape
#

can you add exceptions to specialsource plugin

clear elm
#

int Y = world.getHighestBlockYAt(randomX, randomZ);
can some1 help? how can i do that this block cant be bedrock?

worthy yarrow
clear elm
#

prob xD

#

im doing an rtp plugin

worthy yarrow
#

Ith the easiest way would have to do with the generation to begin with

clear elm
#

wdym "generation"

worthy yarrow
#

world generation

storm crystal
clear elm
#

im not generating it im doing an rtp plugin thats spots the highest y value to teleport too

#

and in the nether its the bedrock everytime

peak depot
#

how to make double chest bc just setting 2 next to each other wont work

#

and all of the stuff online uses outdated code

worthy yarrow
#

Highest block refers to the highest block within that x/z area iirc, so given that you're in the nether that will always be the ceiling. When you're in the overworld theres no ceiling so it, again, gets the highest block for that x/z area

#

Which could be any block

clear elm
#

im trying todo in nether in normal it works

worthy yarrow
clear elm
#

okay

worthy yarrow
#

Or add a block clause that doesn't search for bedrock

#

^ ith, I haven't seen all your code

clear elm
#

what

worthy yarrow
#

But if you're using getHighestBlock for nether it will always be the bedrock ceiling

topaz cape
clear elm
#

i tought about smth like highest block und 120 or smth like this

worthy yarrow
#

If you can figure that and get it to work then for sure. I can't think of a more efficient way

clear elm
#

ill try

worthy yarrow
#

It's either something like that, or do the block iteration yourself

clear elm
#

what is iteration 😅

worthy yarrow
#

So like you have a list for example with 5 values

#

an iteration of that list would go through all 5 values and do something

clear elm
#

okay

clear elm
worthy yarrow
#

Uh the first one if you can figure it out. The second means you'll have to go over all the blocks in the x/z area and then determine which is highest Y value. So basically rewriting the gethighestblock method

#

Also the latter would be more performance impacting if I had to guess

clear elm
#

hmm okay

clear elm
peak depot
#

?paste for me

undone axleBOT
peak depot
sullen marlin
#

What are you getting

storm crystal
#

can I use spaces in naming in yaml?

#

like key name: 5

ivory sleet
#

Yes

storm crystal
#

oh

ivory sleet
#

"my key": "my value"

storm crystal
#

are "" mandatory?

ivory sleet
#

but its a bit cursed, not sure if bukkit config api supports it

ivory sleet
slender elbow
pearl forge
#

hi, how could I make it so that if I hit a mob that is in a boat, it gets out of the boat?

sullen marlin
#

Look at damage event and mount / passenger methods

strong ice
#

hi is it possible to cancel the event of someone using an elytra, i need to make a plugin to stop people from using elytras while in combat (combatlogx)

trail coral
#

or theres an nms way aswell if that doesnt work

remote swallow
stiff vine
storm crystal
#

why does it throw an exception

glad prawn
#

ah

#

see what it says

nova notch
storm crystal
#

its not initialized

glad prawn
#

init default value for it

storm crystal
#

you dont even know the context

#

this part throws null

#

despite me having elements in statistics

glad prawn
storm crystal
#

how on Earth is it null

#

thats the key Im putting in, I just printed it

#

how does this throw a null exception

river oracle
#

your string violates the Namespaced Key requirements

#

read the docs

storm crystal
#

it cant have spaces or what

glad prawn
#

lowercase

#

and

river oracle
undone axleBOT
storm crystal
#

why

#

its so stupid

#

why cant it be in upper case or with spaces

river oracle
#

don't ask me go over to discord.gg / minecraft and ask them

#

its not stupid its just sensible naming practices but I highly doubt you would get that ;)

storm crystal
#

"somethinglikethis" is clearly more readable than "Something Like This"

#

lol

#

why didnt I think of it earlier

remote swallow
#

woah_you_can_use_under_scores

storm crystal
#

how to see pdc tags in game

remote swallow
#

on items?

storm crystal
#

yes

remote swallow
#

/data get entity @s SelectedItem iirc

storm crystal
#

there was a shortcut on keyboard for it

#

to see extended nbt tags

remote swallow
#

that doesnt exist in vanilla

storm crystal
#

I literally remember someone showing me it on this discord

remote swallow
#

what your thinking of is f3+h which just that it has extra tags

river oracle
#

it just shows if it has any NBT

#

not the specific NBT

#

you need a mod for that

remote swallow
#

did it look like this

storm crystal
#

okay everything works, finally

#

I moved my data structure into yml

sand spire
#

Is there a way to get a boolean if an entity is rendered in for a player, or even better an event that's called when this changes?

I already tried listening to the entity teleport packet ||but it also triggers when you can't see the player||
And I tried getting nearby entities with player.getClientViewDistance as args||but you can see further than this||

storm crystal
#

Works fine without them

ivory sleet
#

ah ok nice nice

undone axleBOT
sand spire
# sullen marlin ?xy

I made code to make entities glow only for one player with packets, but if the entity leaves the players entity rendering distance and comes back it isn't glowing anymore, so I want to listen for this to make it glow again

young knoll
#

You can listen for the add entity packet

sand spire
gilded tangle
#

Does anyone know why everything works but the nametag remains white? Could it be that I forgot something? 😮

eternal oxide
#

Wrong ChatColor import?

gilded tangle
#

It needs a Bukkit ChatColor

wintry elk
#

im trying to make it so when you eat a chorus fruit it spawns a tnt on you AND THEN teleports you but i cant figure out how to spawn it

young knoll
#

Listen to the item consume event and then spawn a primed tnt with the api

wintry elk
#

can you explain how i would do that i still dont understand

young knoll
#

PlayerConsumeItemEvent iirc

#

Check if the consumed item is chorus fruit and then spawn tnt

wintry elk
#

is this on intellij IDEA because i cant find it

remote swallow
#

?events

#

?event-api

undone axleBOT
eternal oxide
#

Its a mix of API and nms

wintry elk
#

i just grabbed the code from chorus fruit on intellij idea

eternal oxide
#

yeah nms

#

Stay away from nms

wintry elk
#

what does nms mean

eternal oxide
#

net.minecraft.server

#

Minecraft internals

wintry elk
remote swallow
#

you dont remake it

eternal oxide
#

you don't

obsidian wolf
#

im a pro scripter so I know this stuff

remote swallow
#

nah u dont

obsidian wolf
#

yo chat

#

wait, can you still use PlayerItemConsumeEvent on paper? Just wondering

slender elbow
#

sure?

obsidian wolf
#

?

remote swallow
#

i mean yeah but heres not the right place to ask

obsidian wolf
#

should you use Spigot or Paper if your trying to make a custom gamemode

remote swallow
#

whatever you feel like

obsidian wolf
#

like a completely custom Gamemode

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.

obsidian wolf
#

are they the same

#

im not asking abt that but are they the same? what’s the difference

eternal night
#

They are competing software Try both and see which one you like more

obsidian wolf
#

I use spigot but I just wanna know the difference

eternal oxide
#

Spigot is the root, all others are derivatives.

obsidian wolf
#

oh, so there basically the same?

eternal night
#

No not really

young knoll
slender elbow
#

i didn't know lynx was bi

eternal night
#

I mean, try paper, try spigot

wintry elk
#

alr well i have 0 clue how to add the playerconsumeitemevent

eternal night
#

Try both APIs

undone axleBOT
eternal night
#

Paper does some changes to the plugin API some people like and some people don't like

#

It's still spigot compatible but yea

young knoll
#

I would definitely learn the api first

obsidian wolf
#

Gotcha

#

but for the server they both function almost the same way right?

#

just some plugins work some don’t

young knoll
#

Since you are currently trying to extend an NMS item

eternal night
#

Well, for s server that is trying to make something completely custom, yea probably

#

(paper obviously a bit faster)

obsidian wolf
#

gotchu

#

but it’s not completely custom and a couple of plugins is it still compatatible

eternal night
#

Vanilla wise, paper disables some exploits by default e.g. tnt duping. People sometimes have issues with that

#

Tho there is a config option

obsidian wolf
#

ah

eternal night
#

But yea, I am biased on this so, don't take my word. Try both and see

young knoll
#

They got enough complaints to add even more config options

#

:p

eternal night
#

Facts XD

obsidian wolf
#

Gotchu

#

have a good day

#

ima eat

young knoll
#

Idk why y’all didn’t do that ages ago but ¯_(ツ)_/¯

eternal night
#

E.g. the one we had for the infinite cure discount stuff

#

Then it gets fixed by Mojang and people are confused why their config option doesn't work

#

But yeah, config options for everything woohoo

slender elbow
young knoll
#

Config option for your config option

remote swallow
blazing flare
#

Would it be fair to say PDC is still preferred over item_name when it comes to handling your plugins custom items? that is unless you're careful with what items other plugins use to avoid conflicting names

young knoll
#

Yes

remote swallow
#

id recommened pdc always

young knoll
#

Never ever use name

#

Or I’ll find you

#

:D

remote swallow
#

what does coll fly on

#

a moose?

blazing flare
#

what if I use name just so I'm not lonely? ;o

wintry elk
undone axleBOT
young knoll
#

Identify it with pdc

#

?pdc

zenith gate
#

Is there any good resources on nms?

sullen marlin
#

?xy

undone axleBOT
drowsy helm
#

nms has a lot of things in it

zenith gate
sullen marlin
#

Why

quaint mantle
pliant topaz
#

Why shouldn't we use nms nowadays? I mean, sometimes when u want to do something you'll need it

acoustic shuttle
#
    public static void setEntityNBTTag(Entity entity, String key, String value) {
        net.minecraft.world.entity.Entity nmsEntity = ((CraftEntity) entity).getHandle();
        CompoundTag tag = new CompoundTag();
        nmsEntity.save(tag);
        tag.putString(key, value);
        nmsEntity.load(tag);
        Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + tag.getString(key));
        Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + tag.toString());
    }```
No errors, the tags just aren't saving to the entities, what am I doing wrong?
In the messages I send to console I can see that it is being added to tag and the tag does contain the entities full NBT but when I run it again with a new tag to be applied it doesn't show the old tag in the new tag.
blazing ocean
agile anvil
acoustic shuttle
buoyant viper
#

PDCs on players persist across sessions right?

#

like if i apply a PDC, they leave, then come back, or the server is restarted, that pdc tag will still be on them right?

#

oh wait obviously thats how that works its called fucking "persistent" data container

#

sorry i had a briandead moment

twilit coral
#

pdcs are typically for session data, if you're doing something larger use a database

polar forge
#

Hey guys

#

I got a question

#

Why does the console say: the embedded resource “custom.yml” cannot be found in plugins?

#

I wrote the correct code

acoustic shuttle
# polar forge Why does the console say: the embedded resource “custom.yml” cannot be found in ...

For new yml file:

                    File customConfigFile = new File("plugins" + File.separator + "Plugin name or whatever you want" + File.separator + "customConfig.yml");
                    YamlConfiguration customConfig = YamlConfiguration.loadConfiguration(customConfigFile);
        getCommand("investigate").setExecutor(new InvestigateCommand(this));
        getCommand("setinvestigationroom").setExecutor(new InvestigateCommand(this));
        getCommand("setfree").setExecutor(new InvestigateCommand(this));```
^ No need for this just register the command in your plugin.yml and add aliases:
```yaml
commands:
  investigate:
    aliases: setinvestigationroom```
twilit coral
polar forge
twilit coral
polar forge
#

Sure, I’ll do. But out of curiosity, why didn’t it create the file automatically since I coded a if statement that says that if that file doesn’t exist, it should create one?

twilit coral
polar forge
#

Oh ok, thanks for the help

#

So I could easily delete all my try and catch code right?

#

And replace it with what u just wrote

twilit coral
#

like so

polar forge
#

Ok sure thanks

golden basin
#

guys does anyone know how to make a plugin which disables observers detecting things?

tepid turret
#

Hey Its been recommended to me by a few people within here to make a class that handles messages all throughout my plugin. Where would I find a doc or blog breaking the process down for me as I don't know where to start.

twilit coral
golden basin
tepid turret
tepid turret
buoyant viper
golden basin
tardy delta
#

kotlin extension functions for CommandSender::sendMessage(LangKey) are the best

golden basin
#

@EventHandler
public void onBlockRedstone(BlockRedstoneEvent event) {
Block block = event.getBlock();
if (block.getType() == Material.OBSERVER) {
event.setNewCurrent(0);
}
}
}

tepid turret
undone axleBOT
golden basin
tardy delta
#

then add an extension function so i dont have to call asString every time
fun CommandSender.sendMessage(message: LangKey, vararg args: Any) = sendMessage(message.asString(args))

#

but ye kotlin

tepid turret
twilit coral
tardy delta
#

cuz kotlin is nicer than java, gotta admit this code doesnt look fantastic

tepid turret
shadow night
tardy delta
#

cuz its less verbose and has so much utility functions that are never gonna be implemented in java

tepid turret
twilit coral
tardy delta
#

i dont want to make this conversation about kotlin again

tepid turret
shadow night
tepid turret
twilit coral
#

Real but my code is too bad for that to

tepid turret
#

Also side not I'm struggling with getting adventure api onto spigot

#

i've gotten up to audiences but thats it

#

How do i send a minimessage.

twilit coral
#

you gotta import the minimessage serializer

#

from da adventure website

tepid turret
#

ohh shoot how has it taken me this long to find it

tepid turret
#

i took a break from java ok dont kill me

#

and java docs r still annoying

polar forge
#

Heyy guys

#

I got another issue

#

So I’m trying to save the location of the player when I send the command /investigate <player>, it saves the location and stores it in the custom.yml

#

And it tps the player to a location (investigation room)

#

But when I want to set the player free with /setfree <player> it doesn’t send the player back to his previous position

#

It just sends him to a strange location

drowsy helm
#

show your code for setfree

polar forge
#

Here’s the location it saved

twilit coral
#

hmm the problem sounds sus cannot help

polar forge
#

The actual code starts under line 12

drowsy helm
#
Investigate.getCustomConfig().getInt(".X")
twilit coral
#

is it tping them to 0 0 0

#

b/c you're not doing configsection.getint

drowsy helm
#

and also you should be checking perms first of all

#

not last

#

and early returns

polar forge
#

Oh yea you’re right

polar forge
twilit coral
#

same thing

drowsy helm
#

yeah like chochip said, its not querying the section

twilit coral
#

your path should be the config section of player or include player into your path

#

like Legnano.X, or getSection(Player).getint(x)

#

. is relational dot operator if you don't have a preceding key don't use it

polar forge
#

I don’t understand

#

So I should write

twilit coral
#

ok so this line: "if (Investigate.getCustomConfig().getConfigurationSection("player") != null) "

#

is fine aside from hwat buobuo is saying with early returns

#

save the config section from this call

#

because you queried the player's name here

#

so like say getConfigurationSection(player.Legnano);

#

and then using that same section do section.getint(x)

polar forge
#

But it’s not always Legnano that’s the problem

twilit coral
#

so then use

polar forge
#

It could be BozoLoxo or Greaves

#

Any player

twilit coral
#

"player." + player.getname

tardy delta
#

use player uuid btw, players can save their name

twilit coral
tardy delta
#

dont eggplant me will you

polar forge
#

Bc there is also another line that looks the same under It

#

Line 21

twilit coral
twilit coral
# polar forge Line 21

21, you could just remove the for loop by calling config.getConfigurationSection("player." + uuid) or his name however you wanna store it

polar forge
twilit coral
#

Config customConfig = Investigate.getCustomConfig();
ConfigurationSection playerSection = customConfig.getConfigurationSection("player");
if (playerSection == null) {
return false;
}
ConfigurationSection uuid = playerSection.getConfigurationSection(uuid);
if(uuid == null) {
return false;
}
target.teleport(new Location(target.getWorld(), uuid.getInt("X"), uuid.getInt("Y"), uuid.getInt("Z")));
target.sendMessage(ChatColor.GREEN + "You Have Been Returned To Your Previous Location. Follow The Rules!");
Bukkit.broadcastMessage(ChatColor.LIGHT_PURPLE + target.getName() + " has Been Let On Parole")

twilit coral
polar forge
#

You’re writing getConfigurationSection 2 times

#

you’re technically writing:

#

Interrogate.getCustomConfig().getConfigurationSection(“player”).getConfigurationSection(uuid);

tardy delta
#

just do getSection("players." + uuid)

clever lantern
#

can i change the size of the enderchest?

polar forge
#

ConfigurationSection uuid = Investigate.getCustomConfig().getConfigurationSection(“player.” + uuid)

twilit coral
#

The uuid is initialized you initialized the player in the first couple of lines as target

#

It’s not accurate code what I gave you, adapt it and learn from it

polar forge
#

I never initialised uuid that’s why

twilit coral
#

UUID is with the player

#

Player.getuniqueid

polar forge
#

I added

#

UUID player = player.getUniqueId(); in the scoop

#

And replaced (“player.” + uuid) with (“player.” + player)

#

This should work

tardy delta
#

what

polar forge
# tardy delta what

I think he might referred uuid to the actual uuid and not the uuid from ConfigurationSection

tardy delta
#

i have no idea what you guys been doing for so long

polar forge
#

Trying to teleport the target back to the position saved in the custom.yml when I do /setfree <player>

#

With these info

tardy delta
#

and whats the issue

polar forge
#

I couldn’t teleport him back to the position

#

He tped in a random position

tardy delta
#

when someone does the command to store their location, save it, then load it back when doing setfree

#

can you correctly load the location?

polar forge
#

No it saves the location when I interrogate him /investigate <player>

#

And no it still doesn’t work

tardy delta
#
var section = config.getConfigurationSection("player." + player.getUniqueId());
var x = section.getDouble("x");
// [..]
player.teleport(new Location(world, x, y, z));```
#

gimme a sec im in class rn

sand spire
polar forge
polar forge
#

Btw I’m using the uuid

sand spire
tardy delta
#

because a player might change their name, making the data stale

polar forge
#

Yes but it’s not a ban plugin, where the stored data is perma, but it’s rather something temporary

#

During an interrogation

sand spire
#

I see so the player never leaves the server while they're in the file

tardy delta
#

so youre saving the data based on uuid already?

polar forge
#

I don’t think so

#

I still need to do so

tardy delta
#

why dont you do it then

polar forge
sand spire
polar forge
tardy delta
#

equally simple

polar forge
#

Im just now stick with a yml file

tardy delta
#

you shouldnt be checking if the player section exist, check the section "player." + uuid

#

well i see you handle it but why handle the case [player] does not exist

#

and use uuid instead "player." + player);

sand spire
#

You should print the x, y and z to console to see if the problem is before or after that

polar forge
tardy delta
#

bruh

sand spire
#

Also, are you sure you save the x y z in the right order to config

polar forge
#

Here’s an example

#

I now changed that it stores the uuid instead of the player username

tardy delta
#

so after you run your command, the data is saved correctly to the file?

polar forge
#

Yes like that in the picture

tardy delta
#

and loadin g it?

polar forge
#

Wdym?

tardy delta
#

does it work

polar forge
#

Im not sure I get a warning in the console telling me that the track is impossible to find

#

Java.io.IOException

sand spire
polar forge
#

In the main class line 53

#

Or line 34

sand spire
#

well the code you sent isn't your main class

polar forge
#

Line 34 is createCustomConfig();

#

And 53 is inside a try and catch statement

#

try { customConfigFike.createNewFile(); } catch (IOException) e.printStackTrace(); customConfigFile.getParentFile().mkdirs(); saveResource(“custom.yml”, false); }

#

second line after try {

#

That’s line 53

tardy delta
#

if !file.exists() plugin;saveResource("data.yml", false) if you have the file in your resources folder

#

either way check if it exists first

polar forge
#

I asked in this chat and they suggested me to just put the file in the resources

#

So idk if I still need this whole code

#

I already have it in my resources folder

#

Do I still need this whole code?

tardy delta
#

is it empty in the start?

polar forge
#

No it has “player:”

tardy delta
#

just do the thing i posted then

polar forge
#

Should I delete something and replace with what u wrote or what

#

Just add it or replace it

tardy delta
#

you seem to be always calling createNewFile

#

if it exists, dont

polar forge
#

So I’ll delete that code

tardy delta
#

if it not exists, dont call createNewFile but plugin.saveResource(filename, false) to copy it from the resoureces folder into the plugin folder

polar forge
tardy delta
#

yes

polar forge
#

And I’ll replace it what u wrote

#

Correct?

tardy delta
#

yes again

polar forge
#

if (!customConfigFile.exists()) { saveResource(“custom.yml”, false) }

#

Ok cool let’s try now

#

Should I modify something from the setfree command class?

tardy delta
#

idk

tardy delta
#

try it out instead

polar forge
#

It now works

#

Now comes the difficult part to code

tardy delta
#

what part

polar forge
rapid vigil
polar forge
rapid vigil
polar forge
rapid vigil
tardy delta
#

have a set of uuids for the players that are being investigated

rapid vigil
#

or use PDC

#

there's a lot of options you can go with but preferably a set or PDC(if you want it to be persistent)

rapid vigil
polar forge
rapid vigil
polar forge
#

So I’ll do private Set<Player> investigatedPlayer = new HashSet<>();

#

Right?

tardy delta
#

try it out

polar forge
#

I’ll send the code I wrote

polar forge
#

And I wrote investigatedPlayer.add(target); when he’s under investigation

#

And investigatedPlayer.remove(target); when he’s set free

rapid vigil
#

did you register your listener?

polar forge
#

Oh I forgot

#

Ooopsie

polar forge
#

I did implements CommandExecutor, Listener {