#help-development

1 messages Β· Page 2128 of 1

quaint mantle
#

the code that throws that error didn't change

#

the version was the same

#

I just switched to maven

chrome beacon
#

The legacy warning shouldn't have anything to do with your error

#

Nor does it have anything to do with maven

quaint mantle
#

hm ok

chrome beacon
#

If you used the same plugin.yml the warning would have been there

quaint mantle
#

I might have accidentally removed the api-version part

#

is that part required?

chrome beacon
#

Not required but it is recommended

quaint mantle
#

The legacy support error went away when specifying the api-version. Thanks!

golden kelp
#

whats the difference xd

earnest forum
#

skript is a language

#

its a javaplugin

#

its a simple way to create plugins

dusk flicker
#

ew skript

sterile token
#

Skript its a simple interpreter for building plugins. They are generally coded in a .sk file

earnest forum
#

basically its a plugin u put in

#

and its got a folder where u put files ending with .sk where you put your code

#

and it'll convert it to java

sterile token
#

Basically what I told

earnest forum
#

but easier to understand

sterile token
#

Ah sllrigh

#

Yada

#

I can ask something?

dusk flicker
#

It won't convert to java, its just interpreted

sterile token
#

Any here has knowledge and good practices about networking with redis. Specially hset, hget, pub-sub

candid galleon
#

?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!

harsh totem
#

I have this command which it registered in the main but when I try to input a player name that doesn't exist I don't get the error that I set it to. please help

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (command.getName().equalsIgnoreCase("getdragonwand")){
            if (!(sender instanceof Player)){
                System.out.println("Β§cYou must be player to execute this command!");
            }
        if (args.length == 0){
            Player player = (Player) sender;
            player.getInventory().addItem(ItemManager.dragonWand);
            player.sendMessage(ChatColor.LIGHT_PURPLE + "You now posses the power of the dragon!");
            }  else {
            Player player2 = Bukkit.getPlayerExact(args[0]);
            if (player2 != null){
                player2.getInventory().addItem(ItemManager.dragonWand);
                player2.sendMessage(ChatColor.LIGHT_PURPLE + "You now posses the power of the dragon!");
            }  else {
                player2.sendMessage(ChatColor.RED + "(!) Invalid player");
                player2.sendMessage(ChatColor.RED + "(!) getdragonwand <player>");
            }
        }
        }


        return true;
    }
}```
fervent gate
#

How can I check when the player unequips an armor piece?

harsh totem
fervent gate
#

There isn't an event for that specifically, would inventoryclick work? This only works when equipping

harsh totem
#

there is an event for equipping armor so just check if the opposite happens

fervent gate
eternal oxide
fervent gate
fringe hemlock
#

Use inventory click event and check if the inventory is a PlayerInventory, then you can check if they clicked a armor slot and if the armor slot had a item already in it

eternal oxide
fringe hemlock
#

What is the error

harsh totem
fringe hemlock
#

Ah! I think I see it, you are sending player2 the invalid player message instead of player!

chrome beacon
harsh totem
#

ohhh

#

ok

harsh totem
#

im not dumb

harsh totem
#

yes i understood

chrome beacon
mellow edge
#

why is this code not working? ```java
Block block = bedLoc.getBlock();
block.setType(Material.BED_BLOCK);
Bed bed = (Bed) block.getState().getData();
bed.setHeadOfBed(true);
bed.setFacingDirection(face);
block.getState().update();

silent vigil
#

hey so i need some help. im using spigot 1.8 as a library so that i can make a plugin. all the stuff works (as in all the spigot classes like inventories, and players and everything else) but when i try to compile it says it can find object bukkit

mellow edge
#

it places the bottom part of the bed

golden kelp
#

what is something that is complex for spigot devs & can be added into my spigot util api

golden kelp
silent vigil
mellow edge
#

do I need a second location for the bed and then place it?

golden kelp
#

oh u are

golden kelp
silent vigil
#

ohh ok tysm

silent vigil
golden kelp
#

You didnt add as dependency, just the repo

silent vigil
#

i did

chrome beacon
#

Does it work then?

silent vigil
#

its sending sec

chrome beacon
#

Why an image ;/

golden kelp
chrome beacon
#

You did it right the first time. Also now the mongo dependency is missing

silent vigil
#

ohh ok

#

tysm for the help

vocal cloud
#

Ah i see the issue. You're using 1.8 dogekek

midnight shore
#

⚠️ ERROR: No build artifacts found
Expected artifacts in: $HOME/.m2/repository/org/example/UtilAPI/1.0-SNAPSHOT

I keep getting this error when i try to use jitpack for my github repository . I have a release.. could anyone help me?

#

still getting this error

waxen plinth
#

Show us your maven or gradle buildscript

midnight shore
#

where can i find it?

waxen plinth
#

.-.

#

So you don't have one

#

That would be why

midnight shore
#

idk if i have it

#

i don't even know whats that

#

lol

waxen plinth
#

Then you definitely don't have one

midnight shore
#

i'm new to maven and github stuff

#

can you help me?

waxen plinth
#

No

#

I don't feel like going through it all

#

Look up tutorials on gradle or maven

#

Take your pick

midnight shore
#

i just want to know how can i use my project on another one using maven and jitpack

#

no need to go through it all

waxen plinth
#

No see I do

midnight shore
#

i don't see any tutorials on this

waxen plinth
#

Because I would need to show you how to make a buildscript

midnight shore
#

i've searched like 9 times

waxen plinth
#

And how to make it jitpack compatible

#

What did you search

midnight shore
#

"jitpack publishing using github"

waxen plinth
#

Like just search "gradle tutorial" or "gradle getting started"

coarse finch
#

if i kick a player with a reason "kicked for: \rreason", will it show as a newline? if it wont how do i make it?

midnight shore
#

i'm using maven

waxen plinth
#

Then search for that

coarse finch
#

ok thanks

midnight shore
#

actually

#

\n

mellow edge
#

I gave up, can anyone show me the FUC*** way of placiung bed with both parts PLEASE

#

on 1.8.8 that 100% WORKS!

#

I SPENT THREE HOURS OR MORE ON IT

waxen plinth
#

1.8

#

skull

#

Update via BlockStates without physics updates

mellow edge
#

nothing works lol I gave up is there any working code

waxen plinth
mellow edge
#

y4es

#

yes

waxen plinth
#

Show the code

mellow edge
#

I tried getting the block data

#

ok

#
    Block block = bedLoc.getBlock();
        block.setType(Material.BED_BLOCK);
        Bed bed = (Bed) block.getState().getData();
        bed.setHeadOfBed(true);
        bed.setFacingDirection(face);
        block.getState().setData(bed);
        block.getState().update();
eternal night
#

states are snapshots

#

you will haave to store the state instance

pulsar pier
#

Quick question: What's the BukkitRunnable used for?

waxen plinth
waxen plinth
rotund pond
waxen plinth
mellow edge
#

how do I update it without physics and why do I need to update it without physics

waxen plinth
#

Because if you update with physics it breaks it immediately since there is no foot of the bed

eternal oxide
#
BlockState state = loc.getBlock().getState();
//do stuff
state.update(false);```
mellow edge
#

k

pulsar pier
#

So what does it do and why do you use it? πŸ™‚

waxen plinth
#
Block b;
b.setType(Material.BED_BLOCK, false);
Bed bed = (Bed) b.getState();
bed.setHeadOfBed(true);
bed.setFacingDirection(face);
bed.update(true, false);```
waxen plinth
ivory sleet
mellow edge
#

do you mean b.getState().update or what

waxen plinth
#

No

#

I don't

ivory sleet
#

code scheduling Ig, altho as said most likely you'll find yourself that the BukkitScheduler methods do the trick well

rotund pond
mellow edge
#

well because Bed class does not have an update method

#

at least not in 1.8.8

waxen plinth
#

I forget what's BlockState and what's MaterialData

eternal oxide
waxen plinth
#

Bed must be MaterialData

visual tide
#

shoudlnt that be BlockData

#

instead of MaterialData

pulsar pier
ivory sleet
#

Idk

#

if you wanna run some code every second

waxen plinth
#
Block b;
b.setType(Material.BED_BLOCK, false);
Bed bed = (Bed) b.getState().getData();
bed.setHeadOfBed(true);
bed.setFacingDirection(face);
BlockState state = b.getState();
state.setData(bed);
state.update(true, false);```
ivory sleet
#

or perhaps wanna coordinate a task to run on the server thread from a thread in lets say the common fork join pool

waxen plinth
#

This would be so much easier in 1.13+

mellow edge
#

yes

waxen plinth
#

People really gotta stop using 1.8

mellow edge
#

but I can't use it

#

(1.13+)

mellow edge
#

your code didn't work, but ig you meant state.setData and state.update instead of b

coarse finch
#

how cna i get the player from a sender

midnight shore
#

how can i get the client version of a player?

#

like 1.17.1 or 1.17

mellow edge
#

I can test it now

waxen plinth
#

Yes, I did

#

I'm on mobile

#

Coding on mobile 😩

mellow edge
#

respect!

pulsar pier
#

Thanks! @ivory sleet

mellow edge
#

IT WORKED I LOVE YOU THANK YOU VERY MUCH ASND THAT YOU AGAIN VERY MUSCH @waxen plinth IT WORKS JUST WORKS I MEAN LOOK AT MY FUCKI*** BED

dusk flicker
#

lol

ivory sleet
#

pog

dusk flicker
#

thats a cool sky texture

mellow edge
#

*shaders

dusk flicker
#

ah makes sense

mellow edge
#

BSL_v8.1.01.zip

#

they are cool

waxen plinth
#

Out of context this is the funniest thing

#

FUCKI***

midnight shore
waxen plinth
#

The hell does that mean

#

Client version

mellow edge
#

but you don't know that I spent THREE HOURS of my life for that

waxen plinth
#

What are you trying to do

dusk flicker
#

therea way to do it just I cant remember lol

#

Let me pull up one of my projects

midnight shore
#

like if i join the server from 1.17 and then from 1.18 how can i get the version i was joining from?

dusk flicker
#

I know theres a way to do it as I do it for hex colors; just need to find the code lol

waxen plinth
#

Viaversion API I would imagine

dusk flicker
#

How I've done it is getting the protocolversion of the client, but I'm also using Paper, and its coming from their NetworkClient interface

waxen plinth
#

I thought by "client version of the player" you meant a version of the player object that belongs to the client somehow

#

People's dumb questions in here have messed me up

dusk flicker
#

lol yeah

#

I don't think there is a way to do it in base spigot, in Paper there is but tbh id rather use an api like viaver

midnight shore
#

is there a way to see total amount of lines of an intellij idea project?

ivory sleet
#

there's this statistics plugin

small current
waxen plinth
#

Or

#

cloc

#

cloc is better because it counts empty lines, comments, and code in separate categories

golden kelp
#

how do i check if a material is legacy (i get a random one). Shall I just do #toString()#contains("LEGACY")?

waxen plinth
#

Isn't there just an isLegacy method

#

?jd

zealous osprey
#

isnt there something like Material#isLegacy() ?

golden kelp
#

no

waxen plinth
#

lol

golden kelp
#

Yea

#

see I said, i checked it first

waxen plinth
#

Why do you need to check

zealous osprey
waxen plinth
#

If you specify an api-version you should never need to check

golden kelp
waxen plinth
#

.-.

golden kelp
#

ok ty, didnt know that

quaint mantle
#

I need some help please
I want to make a space helm (which I have done)
but now I want to implement a command /spacehelm <player>
which gives that specific player the space helm
with the name of the player given to
like -
from - loladminname
to - playername
how can I do it?
https://hypixel-skyblock.fandom.com/wiki/Dctr's_Space_Helmet

Hypixel SkyBlock Wiki

Dctr's Space Helmet is a ​​​​​​​​Special item that is sold or given out by 12[ADMIN] Dctr. The backstory behind this item is currently unknown, but this is a reference to him having an astronaut...

#

here is an example

sterile token
#

Allright

#

Im suppoused you have created an itemStack?

#

@quaint mantle

quaint mantle
#

ya

#

@sterile token get ponged

#

can we go dms?

sterile token
#

Mr

#

yes if you want

quaint mantle
#

accept frien req

#

πŸ˜”

golden kelp
#

how do i make a baby villager jump at a player

#

like animating that they are bumping the player

#

kicking him in ithe balls is what i want

#

if you look at baby villagers, they gang up and kick you in the balls

manic crown
#

Hey, how do I test, if an entity is an Item Iron_ingot?

slim kernel
golden kelp
#

Sure

#

I am actually gonna make a vid about it xd

#

got a ton of ideas

slim kernel
#

nice one πŸ™‚

manic crown
#

thank you for that, but how can i ignore all other items?

tender shard
golden kelp
#

How do i check when a SPECIFIC CHICKEN moves. Just want to check when it moves and make the player move like it

tender shard
#

then check if old location .equals new location

golden kelp
#

oh

tender shard
#

if no, there's your movement

golden kelp
#

and teleporting the player to that location will work?

#

will it be smooth though

tender shard
#

it will work but it probably won't be very "smooth"

golden kelp
#

why

fleet pier
#

not working if i only do write if i flush and close it works but i cant rewrite again

manic crown
#

Thank youπŸ‘

slim kernel
#

What is the best way to "scan" like a 20x20x20 block area then save somehow and then at some point place all the blocks at a specific location again?

waxen plinth
#

Keep a 3d array of BlockData?

tender shard
#

yeah or a multi-dimension array as Redempt said, but a Map<Location,BlockState> is probably easier

waxen plinth
#

Why would you do a map

tender shard
#

because it's easier to use

slim kernel
waxen plinth
#

That's pointless lol

#

For multiple reasons

tender shard
hushed spindle
#

a map seems weird i would agree

waxen plinth
#

First of all, each BlockState already is associated with a location

tender shard
#

why? you are "mapping" a blockstate to it's location

hushed spindle
#

its easy yes

tender shard
waxen plinth
#

Secondly, this system wouldn't allow you to build it elsewhere

tender shard
#

then just use a Set

slim kernel
tender shard
#

Set<BlockState>

waxen plinth
#

Which is what I think they want

#

BlockStates can't be "moved"

#

A 3d array of BlockData is the best way to do this since it lets you easily build again relative to another location

tender shard
#

well in that case I'd use a Map<Location,BlockData>

waxen plinth
#

That's also not useful

tender shard
#

then you can easily save it in a file because BlockData can be turned into a string

waxen plinth
#

Unless each Location is a relative one

#

But either way that's overcomplicated

tender shard
slim kernel
tender shard
waxen plinth
#

If you need to save it then your best bet is to use my library

tender shard
#

maybe just explain what you are actually trying to do @slim kernel

waxen plinth
#

It can save a multi-block structure as a string and then easily rebuild it anywhere

#

With rotation/mirroring if needed

#

And it will even rotate the block data within the structure for you

slim kernel
manic delta
#

how can i get one player skull with custom texture?

#

i was trying and searching and i just got it for old versions

slim kernel
#

I would scan it once and then just place whenever I need it

tender shard
#

but tbh I'd use schematic files

hushed spindle
#

i'd just use heads database, its easier. otherwise you need to use base64 encoded skins and use those on skulls with nms i believe

manic delta
#

damn i got ignored

tender shard
#

CompletableFutures

hushed spindle
#

callbacks @quaint mantle

tender shard
manic delta
#

yep

tender shard
#

noone "ignored" you

hushed spindle
#

and i did answer you anyway

tender shard
#

you can't just interrupt existing conversations and expect people to answer to you within 10 seconds

tender shard
hushed spindle
#

anyway now im gonna interrupt this conversation with my own question

manic delta
#

itemstack

hushed spindle
#

i got this sql query that spits out a syntax error and i cant tell why, i just want to add columns to tables if they dont exist

#

sql validators are also useless

eternal oxide
#

showing the error may help

hushed spindle
#

yeah its not helpful

tender shard
#

I'm already looking for code to send you

#

you're looking for a custom head itemstack with a base64 texture, right?

manic delta
#

okay

manic delta
#

i want to get the texture from one web

tender shard
manic delta
#

let me see

rich inlet
#

Is it possible to set the velocity of a LivingEntity when it has no AI (LivingEntity#setAI(false))? It doesn't move in my case, also, when I set the AI to true, then apply velocity and after that set AI to false again, it doesn't move either.

tender shard
#

"no ai" = "not moving", from what I know

#

why do you need "no ai" though?

hushed spindle
#

yeah i thought no ai by definition meant no moving

tender shard
#

that'll always look laggy

crisp steeple
rich inlet
tender shard
#

that's the "best" solution

rich inlet
#

So I have to use the Mojang Mappings for this?

coarse finch
#

why is it sendin this, i have this nowhere in my code

rich inlet
coarse finch
#

yes it is but why is it sending it

tender shard
#

because you return false

coarse finch
rich inlet
manic delta
undone axleBOT
coarse finch
crisp steeple
#

did you register the command?

coarse finch
#

ye

#

s

chrome beacon
crisp steeple
#

try changing the name to something as a test

coarse finch
#

oh wait no i didnt

crisp steeple
#

it might be something with overriding vanilla commands

#

ok

rich inlet
coarse finch
#

ok now how do i choose whether the server uses the default ban or the custom ban?

#

?

chrome beacon
eternal oxide
rich inlet
#

Instead of saying this, why don't you tell us what you find confusing in this command. That would help @coarse finch more to improve :)

tender shard
#

see the pom.xml of the "core" module I linked

coarse finch
crisp steeple
#

minecraft:ban

slow thunder
#

how do i make an item have certain uses, so like after i right clicked it 3 times it disappears

coarse finch
crisp steeple
#

idk if you even can unregister a command

coarse finch
#

could i use commandmap?

crisp steeple
#

maybe but it might cause issues

slow thunder
coarse finch
#

if i can just make it where i dont need anything for it in the plugin.yml it will work

midnight shore
slow thunder
#

?pdc

midnight shore
#

Exactly

crisp steeple
# slow thunder im sorry but can u give me an example?

In this episode, I show you how to use Spigot's Persistent Data API to store primitives and Strings in items, blocks, and players. #Spigot #Minecraft

⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentatio...

β–Ά Play video
slow thunder
#

thanks both of u

crisp steeple
#

np

rich inlet
#

?paste

undone axleBOT
rich inlet
manic delta
#

πŸ’€

edgy sigil
#

Is there a way to live update a server resource pack?

kindred valley
#

someone please help me setup maven

#

it always gives errors

#

i dont know how to add dependencies i have api

tepid ore
#

Send the pom

#

?paste

undone axleBOT
kindred valley
tepid ore
#

have you imported it?

kindred valley
delicate lynx
#

you're missing dependencies

kindred valley
tepid ore
kindred valley
tepid ore
#

Ig you don't have maven for it

tepid ore
#

So add it to the build path

opal juniper
#

oh nvm bit late

delicate lynx
#

do not add it to the build path

tepid ore
#

They have no Maven for it tho?

rich inlet
#

Wanted to use mojang mapped NMS, why can't I use it even if I added everything to my pom.xml?

rich inlet
rich inlet
kindred valley
sterile grotto
rich inlet
sterile grotto
kindred valley
tepid ore
#

Your api

sterile grotto
#

some old name can't be used anymore

kindred valley
tepid ore
#

It's stupid to add to stuff to the build path, but idk how to do it if you don't have maven for it

#

Idk, I'm on eclipse

tepid ore
#

What is row 43

kindred valley
#

alex

tender shard
#

me?

kindred valley
#

do you use maven

tender shard
#

obviously, I just sent a blog post about how to use mojang mappings with maven that I wrote, lol

rich inlet
kindred valley
#

im getting error

tepid ore
#

They have spigot working with maven, but not their own API.

#

Which they have not imported

#

And have no maven import for

#

And since I'm on eclipse idk how to help them

#

java.lang.NullPointerException: Cannot invoke "org.bukkit.scoreboard.Scoreboard.getObjective(String)" because "skyflag.skyflagminigames.SkyflagMinigames.scoreboard" is null

kindred valley
tender shard
tender shard
slow thunder
#
        data.set(new NamespacedKey(SlimeChunkDetector.getPlugin(), "uses"), PersistentDataType.INTEGER);```
kindred valley
slow thunder
tepid ore
#

Can manager.getNewScoreboard() be null?

rich inlet
# tender shard np!

Still I can't use e.g. EntityZombie in my project. IntelliJ also doesnt propose to import something. I believe I did every step right and everything was added to my local maven repository. Any idea why it still won't work?

tepid ore
sterile grotto
slow thunder
tepid ore
#

So no errors?

rich inlet
undone axleBOT
slow thunder
tepid ore
#

oki

tardy delta
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

tardy delta
#

to send pictures

tepid ore
kindred valley
slow thunder
#

oh ok

tepid ore
tender shard
tepid ore
#

Are you using the files somewhere else?

sterile grotto
rich inlet
tender shard
rich inlet
sterile grotto
tender shard
#

if it still doesn't work, ping me pls

slow thunder
#

!verify UrSOMeanLOL

undone axleBOT
#

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

slow thunder
#

@tepid ore

quaint mantle
#

how do i check if an itemstack is a splash potion

kindred valley
tepid ore
undone axleBOT
tender shard
eternal oxide
#

instanceof

tepid ore
#

instanceof?

eternal oxide
#

use getType as above

fleet pier
tender shard
#

?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!

tepid ore
#

That is what this channel is yes

fleet pier
tepid ore
#

They are one-time uses

tender shard
# fleet pier ur funny

I am funny? You are the one who asked "can any1 help" without providing further information

tender shard
#

if you just ask "can any1 help" then noone can help

sterile grotto
fleet pier
tender shard
#

what's GameServer line 56?

fleet pier
kindred valley
tender shard
undone axleBOT
tepid ore
#

it cant be empty

slow thunder
#

fuck im dumb

#

ty

tepid ore
#

:>

slow thunder
#

sm

tepid ore
#

Np :))

tender shard
tender shard
#

what the heck are you trying to do there anyway?

#

the whole code looks a bit weird tbh

fleet pier
fleet pier
tepid ore
#

Wat

fleet pier
#

that servers are running in a process

chrome beacon
#

? If you want to run commands just use the api

sterile grotto
fleet pier
tender shard
fleet pier
sterile grotto
rich inlet
#

@tender shard @sterile grotto Oh nooo, it was "Zombie" instead of "EntityZombie" all along, Im stupid :D Thank you two very very much :D Now at least that works ;) See you when I get the next error xD

fleet pier
rich inlet
#

I am so glad this discord exists, I wouldnt have found the answer on the internet

tender shard
#

erm

tender shard
#

replace getOutputStream with getInputStream ?!

eternal night
#

are you on the java process api ?

tender shard
fleet pier
tender shard
#

an INPUT stream is to RECEIVE input

fleet pier
#

Required type:
OutputStream#

tender shard
eternal night
#

a processes output stream is what you write to for it to end up in the processes stdin

tender shard
#

do you have any idea what the difference between the following things is?
Input/Output
Reader/Writer
@fleet pier ?

eternal night
#

so your java logic gets the output stream that the process has the respective input stream for

tender shard
#

you are trying to send commands to the server by using its output stream

quaint mantle
fleet pier
#

but the scnd time i do that it stopps working

sterile grotto
fleet pier
#

still

tender shard
fleet pier
#

the system i work on is standalone it could execute anything all i want to do is execute commands in that process

#

it doesnt have to be a spigot server yk

sterile grotto
quiet ice
#

You probably have the issue that you need to actually flush the output stream

quaint mantle
#

[18:59:13 ERROR]: Could not load 'plugins/dctr-PRE-RELEASE-0.1.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `space.helm.dctr'
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:84) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:414) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:322) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:393) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:269) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.ClassNotFoundException: space.helm.dctr
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:155) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:114) ~[patched_1.16.5.jar:git-Paper-794]
at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Class.java:398) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:82) ~[patched_1.16.5.jar:git-Paper-794]
... 8 more

#

I keep getting this error

#

anyone can help me?

fleet pier
#

you need to provide a main class in your plugin.yml

quaint mantle
#

ye ik

#

I did

fleet pier
#

LMAO

#

im drunk now

#

totally

quaint mantle
#

what

fleet pier
#

not only the package

quaint mantle
#

name: DctrSpaceHelm
version: '${project.version}'
main: space.helm.dctr
api-version: 1.16

#

see

#

plugin.yml

fleet pier
#

dctr

#

is your main class?

quaint mantle
#

o

#

right

#

wait what if I change the dctr

#

to the class name

#

will that work?

#

name: DctrSpaceHelm
version: '${project.version}'
main: space.helm.SpaceHelmet
api-version: 1.16

fleet pier
quaint mantle
#

like this

#

no

#

ok

fleet pier
#

space.helm.dctr.SpaceHelmet

crimson terrace
#

SpaceHelmet is your main class?

fleet pier
#

you need to provide the packages and the main class at the end]

fleet pier
quaint mantle
#

name: DctrSpaceHelm
version: '${project.version}'
main: space.helm.dctr.SpaceHelmet
api-version: 1.16

#

this correct

quaint mantle
#

or?

#

okay tysm!!

crimson terrace
hushed spindle
#

ill ask again because i had to go get dinner, but i got a syntax error in my sql query

DROP PROCEDURE IF EXISTS addColumnToTable; 
CREATE PROCEDURE addColumnToTable() 
BEGIN 
  IF (NOT EXISTS( 
    SELECT NULL
      FROM INFORMATION_SCHEMA.COLUMNS
      WHERE table_name = 'tableName'
      AND table_schema = DATABASE()
      AND column_name = 'test') )
  THEN 
    (ALTER TABLE BANKS_PROFILES ADD COLUMN test SMALLINT DEFAULT 0;)
  END IF
END; 
CALL addColumnToTable();

and the error #1064 - 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 'ALTER TABLE tableName ADD COLUMN test SMALLINT DEFAULT 0' at line 9

It supposedly tells me where the issue is, but i can't see what the issue is because the syntax at least in my eyes and according to google is fine

eternal oxide
#

pretty sure you should not have a ; after your 0. Your closing ) ends the statement

hushed spindle
#

i already tried removing it, didnt change the error

eternal oxide
#

alter table table_name add new colm name column structure or definition [before colm name | after colm name];

hushed spindle
#

it should be ADD NEW COLUMN ?

eternal oxide
#

seems what google is saying

hushed spindle
#

doesn't look like that was it

#

NEW isnt even a keyword

eternal oxide
#

yeah, I just checked mariaDB and its not

hushed spindle
#

seems to be just about what im doing

slow thunder
#

how do i add 1 to PersistentDataType.INTEGER

eternal night
#

you first get it, add 1, and then set it

hushed spindle
#

yup

slow thunder
#

i want to give people an item with 1 then add 1 everytime they right click an itiem

#

and when it reaches 3

#

the item disappears

#

basically 3 uses

hushed spindle
#

ok then use ItemMeta#getPersistentDataContainer().get() to get the current value, and use ItemMeta#getPersistentDataContainer().set() to set the next value. and delete the item when it reached 3

#

dont forget to set the item meta to the item again or the change wont reflect

slow thunder
#

that worked ty @hushed spindle

quaint mantle
#

is there a way to get player ranks?

#

like player.getRank

#

or smth?

sterile grotto
quaint mantle
#

like

golden kelp
#

Wdym ranks

quaint mantle
#

vip rank

#

etc

#

hm

#

a

sterile grotto
#

third party defined?

quaint mantle
#

like [VIP]

golden kelp
#

They are handled from Luck Perms i think

quaint mantle
#

noo like

golden kelp
#

Mostly

quaint mantle
#

I want to embed it in a code

golden kelp
#

yes but how did u make those ranks

quaint mantle
#

luckperms

golden kelp
#

Say that

#

Use the LP Api

coarse finch
#

i need some help. in the config, the server admin can choose whether to enable or disable a custom ban command. how would i implement that?

#

if its enabled, it uses a ban command i wrote, otherwise, it uses vanilla ban command for /ban

chrome beacon
#

You can just use the minecraft:ban command instead of your plugin command

#

No need to bother with a toggle for each command

coarse finch
#

can i just change which has the /ban, like switching it from me to the server?

kind hatch
#

If you use the namespaced versions yes.

sterile grotto
kind hatch
#

It’s just that your input needs to be the same

coarse finch
kind hatch
#

If your config value is false, have the server execute the ban command using the minecraft:ban namespace.

coarse finch
#

like can i just disable my command entirely if its false

chrome beacon
#

I guess you can use the command map directly but that sounds like a bad idea

kind hatch
#

Well what I suggested would essentially do that, but unregistering commands isn’t easy.

coarse finch
brave sparrow
#

It’s not necessarily a bad idea it’s just a little dirty since the map isn’t exposed

#

You have to hack your way into it

coarse finch
#

oh ok

slow thunder
#

how do i check if PersistentDataContainer equals something?

chrome beacon
#

Get the value and compare it?

eternal night
#

.equals

slow thunder
eternal night
#

I mean, if you want to compare the entire container, .equals is implemented

kindred valley
#

why am i getting this

tardy delta
#

why would you even compare the whole container

slow thunder
eternal night
#

well then get both values and compare ?

#

πŸ€”

slow thunder
# chrome beacon <@966268120224366623> ?

yes that worked when setting the data but i want an if statement so if it has 1 use, then set it to 2 and if iti has 2 uses then set to 3 and if it has 3 uses then clear inv

kind hatch
#

?

#

Tf, just get the value and increment it.

chrome beacon
#

They already have

kind hatch
#

The save it back to the container

chrome beacon
#

But it seems they don't know how to do an if check??

quaint mantle
#

when the server is reloaded the bukkit runnable will start again
or basically loop it in join event
how can I do this?

chrome beacon
#

If you have a runnable that runs on join you can loop online players in your onEnable method and start it again there

slow thunder
#

guys just tell me how do i get that value

#

ill do the rest

chrome beacon
#

That's how you get the value

#

You've already done it once

slow thunder
#

hm

#

ok

#

ill try again ig

coarse finch
chrome beacon
#

You remove your command from the command map

slow thunder
#

will this work?

chrome beacon
#

Yeah

slow thunder
chrome beacon
#

itemInMainHand() doesn't appear to be a method in your class

slow thunder
#

oh shit i deleted it when i was testing earlier

golden kelp
#

Xd

glossy venture
#

how do i remove src/test from my gradle module

#

i dont need it

coarse finch
glossy venture
#

bascially i want to remove the test sourceset

waxen plinth
#

Just remove the folder

glossy venture
#

wont it recreate it

waxen plinth
#

No

glossy venture
#

when reloading

#

oh

#

ok

#

ill try when im done moving the files

#

thanks

quaint mantle
#

hm

#

how 2 use lp api?

#

jk

#

String prefix = user.getCachedData().getMetaData().getPrefix();

#

so I just need to implement this

kindred valley
#

am i doing this queuing right, it throws jar does not contains plugin.yml?

quaint mantle
#

?

chrome beacon
#

I highly recommend using maven instead

#

(or gradle)

kindred valley
coarse finch
#

ok so im pretty cure i cant create 2 of the command class, so how would i get the existing command class that i have in the main class?

coarse finch
#

whatever doing new BanUtils; does

tepid ore
#

Instance

coarse finch
#

ok

tepid ore
#

Save it as a variable before registering it

slow thunder
tepid ore
#

And return the variable when you need it

coarse finch
tepid ore
coarse finch
tepid ore
#

Hold on

coarse finch
#

ok i got it i think

tepid ore
#
public class MyClass {
    private static MyClass instance;

    public MyClass() {
        instance = instance == null ? this : instance;
    }

    public static MyClass getInstance() {
        return instance;
    }
}```
#

Like this

coarse finch
#

ok

#

does that go where i need it?

tepid ore
#

Wat?

coarse finch
#

or the main class

tepid ore
#

Where you need it

coarse finch
#

ok

tepid ore
#

MyClass is the class you want to get

coarse finch
#

i already have an instance of my main class and i think its interfering

tepid ore
#

?paste

undone axleBOT
coarse finch
tepid ore
#

Paste your code

#

That is a constructor btw

#

Which I assume you already have

coarse finch
coarse finch
tepid ore
#

Oh, so the public BanUtils() { instance = instance == null ? this : instance; } has to be in the BanUtils class

coarse finch
#

oh ok

tepid ore
#

Then use BanUtils.getInstance() to get the instance

coarse finch
#

ok

#

ok and if i unregister a command i can just do getServer().getPluginCommand("ban").setExecutor(BanUtils.getInstance()); to register it again?

tepid ore
#

I assume so

#

Never done it before

#

Why would you do that tho?

slow thunder
#

im so confused

coarse finch
slow thunder
#
                    if (plugin.getServer().getLogger().warning(im.getPersistentDataContainer().get("uses", PersistentDataType.INTEGER).toString()).equals("1")){
                        
                    }``` why is this wrong
#

can somone help me

#

ive been stuck in this for 3 hours

tepid ore
#

You have no NamespacedKey, only a string

#

You need to do .get(new NamespacedKey(YourPluginInstance, "uses"), PersistentDataType.String)

tepid ore
tepid ore
#

Do integer then

slow thunder
#

ok let me try

coarse finch
#

java.lang.NoSuchFieldException: knownCommands

Object result = getPrivateField(Bukkit.getServer().getPluginManager(), "commandMap");
SimpleCommandMap commandMap = (SimpleCommandMap) result;
Object map = getPrivateField(commandMap, "knownCommands");
@SuppressWarnings("unchecked")
HashMap<String, Command> knownCommands = (HashMap<String, Command>) map;
knownCommands.remove(cmd.getName());```
chrome beacon
#

Are you on 1.17 or above?

slow thunder
coarse finch
chrome beacon
coarse finch
#
private static Object getPrivateField(Object object, String field)throws SecurityException,
        NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
    Class<?> clazz = object.getClass();
    Field objectField = clazz.getDeclaredField(field);
    objectField.setAccessible(true);
    Object result = objectField.get(object);
    objectField.setAccessible(false);
    return result;
}```
coarse finch
chrome beacon
#

I assume you copied and pasted that from somewhere

#

Anyways open the SimpleCommandMap class and take a look

#

It should be available in your IDE

coarse finch
#

oh i found a thread that is almost exactly what i want

chrome beacon
#

Same thing there make sure the field name hasn't been changed

#

oh and make sure to follow their license

#

in this case it's fine to use and modify but you should keep the license in mind. Don't just copy and paste code blindly

coarse finch
#

yeah

amber stump
#

Is there a bot for Ressource Updates? I post an update and the bot writes an automatically message with the content of the update

golden kelp
#

How will the bot find the content

compact haven
#

He’s talking about CD basically

#

I semi looked into it, there are endpoints to publish a resource, but you need some tokens and they may be protected by cloudflare

dry forum
#

can someone help with this

golden kelp
#

Try creating section
Adding section
Adding value
Saving
And then read

dry forum
#

i already did

#

it didnt work

#

here

coarse finch
crisp steeple
#

send the yml file then

dry forum
#

its just
warns: in the config but i also tried

#

this to create the section but it doesnt work same errors

crisp steeple
#

but that’s not a configuration section

#

there is no configuration section called β€œwarns.” + of.getUniqueIs()

dry forum
#

i check if the config sections exists

#

which is where the error comes from

#

here

crisp steeple
#

right

#

you’re getting a value from warns

#

not a configuration section

#

and then after that you’re trying to get a configuration section

dry forum
#

but why would i be getting an error sayings "warns" doesnt exist? what would it be if its not a config section

crisp steeple
#

warns does exist

#

warns.playerid does not

#

you would have to create that

dry forum
#

oh

#

i see now ty

amber stump
#

@dry forum How about you directly set a value by doing getConfig().set("warns." + player.getUniqueId, "Hello");

crisp steeple
#

np

coarse finch
#

can anyone help me?

golden kelp
#

With

coarse finch
#

oj it didnt reply

crisp steeple
#

you’re sure the field names are correct?

coarse finch
#

no

#

i got it from the bukkit forums

crisp steeple
#

i would check if it is correct then

coarse finch
#

ok, how would i do that?

#

the thing it errors on is in the class SImpleCommandMap not sure if that helps

crisp steeple
#

control click

coarse finch
#

yeah i know that

crisp steeple
#

so is the name of the field you’re trying to access the same as the one you’re using?

coarse finch
#

yes

crisp steeple
#

not sure why you would get a fieldnotfound exception then

coarse finch
#

im not sure either

crisp steeple
#

try doing getDeclaredFields and printing them out as debug

coarse finch
#

ok

#

well thats the line it errors on

tepid ore
# slow thunder

Sry, I'm slow. idk if you've solved it, but it should be .get(new NamespacedKey(YourPlugin, "TagName"), PersistentDataType.WHATEVER_TYPE, YourValue);

slow thunder
tepid ore
#

Nice :>

coarse finch
#

i just noticed my fan vent is asymmetrical 😑

tepid ore
#

Fix it

coarse finch
#

i cant its a laptop

tepid ore
#

Ahh

#

My favourite

kindred valley
#

how can i fix this

coarse finch
mighty pier
#

how do i check if args[0] is an integer?

tepid ore
#

Can you rewrite the message

coarse finch
crisp steeple
mighty pier
crisp steeple
coarse finch
#

basically i get this error java.lang.NoSuchFieldException: knownCommands but the field exists

kindred valley
# crisp steeple

no i dont want to do that because in that case console gives error

tepid ore
coarse finch
crisp steeple
#

a string won’t ever be an instance of an int

coarse finch
#

oh makes sense

coarse finch
#

but read that

cedar hamlet
#

how would I go about making it so if a certain player joins, their gamemode is forced to be in creative?

tepid ore
#

Permission?

cedar hamlet
#

Like

#

Username

coarse finch
#

check thier name and it matches, set them in creative

tepid ore
cedar hamlet
#
        Player player = event.getPlayer();
        if (player.getName() == "ArisTheMage") {
            player.setGameMode(GameMode.CREATIVE);
        }
cedar hamlet
#

This does not work

coarse finch
tardy delta
#

dont compare strings with == use .equals

tepid ore
tardy delta
cedar hamlet
#

ah

tardy delta
#

whats the type of the field and where does it come from

cedar hamlet
#

right

coarse finch
#

well its what was on the forum

coarse finch
tardy delta
#

lol

coarse finch
#

oh it comes from SImpleCommandMap i think

tepid ore
tardy delta
#

isnt it called commandMap?

#

decompile it and see

cedar hamlet
#
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event){
        event.setJoinMessage("Oh look, A person has joined. Very cool.");
        Player player = event.getPlayer();
        if (player.getName().equals("ArisTheMage")) {
            player.setGameMode(GameMode.CREATIVE);
        }
    }
kindred valley
#

?paste

undone axleBOT
cedar hamlet
#

This also does not work

coarse finch
# tardy delta isnt it called commandMap?
public static void unRegisterBukkitCommand(PluginCommand cmd) {
    try {
        Object result = getPrivateField(Bukkit.getServer().getPluginManager(), "commandMap");
        SimpleCommandMap commandMap = (SimpleCommandMap) result;
        Object map = getPrivateField(commandMap, "knownCommands");
        @SuppressWarnings("unchecked")
        HashMap<String, Command> knownCommands = (HashMap<String, Command>) map;
        knownCommands.remove(cmd.getName());
        for (String alias : cmd.getAliases()) {
            if (knownCommands.containsKey(alias) && knownCommands.get(alias).toString().contains(Bukkit.getName())) {
                knownCommands.remove(alias);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}```
quaint mantle
cedar hamlet
#

Yes, the join message is changed even

tardy delta
#

whats getPrivatefield doin?

tepid ore
cedar hamlet
#

Yeah It might

tepid ore
#

Try changing the priority

tardy delta
cedar hamlet
#

I have multiverse core

tardy delta
#

wait already asked

cedar hamlet
#

i'm trying to make it so It doesnt boot me into survival every time

tepid ore
#

Change the priority of the event

#

Or remove all other plugins

crisp steeple
#

if you’re doing it only for yourself it might be fine to wait a tick or so

cedar hamlet
#

how do I do that?

#

(Asking to both)

tepid ore
#

@EventPriority(priority = EventPriority.HIGHEST)

tardy delta
#

just remove the plugins jars out of the plugins folder and see

coarse finch
coarse finch
fleet pier
#

how do i stop a thread without the deprecated stop

tardy delta
grim ice
#

What is an output stream?

#

as far as i know an input stream is the input, and the its output stream is?

#

is it the other party input stream?

#

like, what you receieve from the other party input stream?

#

actually

#

isnt it reverse

#

input reads and output sends right

tardy delta
#

and output stream is the output

coarse finch
# tardy delta whats getPrivatefield doin?
private static Object getPrivateField(Object object, String field)throws SecurityException,
        NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
    Class<?> clazz = object.getClass();
    Field objectField = clazz.getDeclaredField(field);
    objectField.setAccessible(true);
    Object result = objectField.get(object);
    objectField.setAccessible(false);
    return result;
}```
gusty gorge
#

I want to use a bit of kotlin in my plugin but get the error Λ‹Λ‹java.lang.NoClassDefFoundError: kotlin/jvm/internal/IntrinsicsΛ‹Λ‹.I don’t want to use maven or gradle because I don’t know how. So how would I fix this?

chrome beacon
#

Use maven or gradle and shade the Kotlin stuff in to your jar

#

It will be harder without them

mighty pier
#

im trying to loop kits my kits like this for (String kit : KitData.get().getKeys(false)) { but it doesnt return anything

#

nvm

gusty gorge
chrome beacon
#

I'd create a new project and move the source files over

gusty gorge
#

Will that work? I have written quite a lot of code.

chrome beacon
#

oh and install the Minecraft Development plugin it will take care of most of the setup

gusty gorge
#

I have but most of the time I work offline so the plug-in won’t recognize the Minecraft version

chrome beacon
gusty gorge
#

Do you have recommendations on whether to use gradle or maven?

chrome beacon
#

I prefer Maven, but sometimes I have to use Gradle

#

It depends on what your goal is

#

I find Maven easier, Gradle is a bit more complex

rich inlet
#

Hey, I am getting a ClassNotFoundException and ClassNotDef Error when trying to create an object of a class that extends Slime from NMS, any idea why?

#

?paste

undone axleBOT
rich inlet
chrome beacon
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

chrome beacon
#

hm not quite what I wanted

#

But you need to remap your jar

rich inlet
#

I already use Mojang mapping

chrome beacon
#

Yeah but you didn't remap

#

Could you show your pom?

rich inlet
chrome beacon
#

hm looks fine exept you have two spigot dependencies

#

Make sure you're using maven to compile your jar

rich inlet
#

It is "package" under "Lifecylce" isnt it

chrome beacon
#

Yeah

rugged cargo
#

ive been using straight up ItemStack for all of my custom items. would i be benificial to create wrappers for them? I realize this is kind of a subjective question, but I just want someone else's opinion.

#

im pretty sure it would be beneficial, because i have 10+ custom items

supple elk
#

Ok so for a class like this, should I use an interface or an abstract class?

crisp steeple
#

abstract class

supple elk
#

actually yeah having said that cause of the registering it should be abstract

#

but if that wasn't there

crisp steeple
#

well you can’t have fields in an interface either

supple elk
#

I could replace the fields with methods like getString() or getIcon()

crisp steeple
#

but you could just make getters

#

yeah

supple elk
#

yeah exactly

#

why use an interface over an abstract class?

#

like when would you actually use one

crisp steeple
#

idk tbh

#

i guess when you only want a contract for something

gusty gorge
mighty pier
#

oh, thank god

coarse finch
rich inlet
sterile token
#

Hi, anyone can send me his github link please. Because i wanna get example for doing a Storage system

chrome beacon
#

Who's "his"

mighty pier
#

this

rich inlet
#

@chrome beacon can I tell Maven somehow to compile the jar directly to my plugins folder in the server directory?

chrome beacon
#

Yes but I don't recommend that

mighty pier
#

ArrayList<ItemStack> items = (ArrayList<ItemStack>) KitData.get().get(kitname + ".items"); i use it like this for (ItemStack item : Kits.getContents(args[0])){ its giving me an error

quaint mantle
quaint mantle
#

trying to save a player's inventory for some reason this loop doesn't save the 35th slot for (int i = 0; i < 35; i++) any idea why? all the other slots get saved

echo basalt
#

Because i is lower than 35

#

Change to <=

rich inlet
echo basalt
#

But yeah seems fairly simple

rich inlet
#

My goal is to have a noAI mob, which gets a velocity when hit by a player

#

So it shouldnt move normally

echo basalt
#

NoAI doesn't tick pathfinders

#

Or gravity itself

#

Theres Mob#setAware

#

Or you can just clear the pathfinder list

rich inlet
#

But it should stop moving completely, until I hit it

echo basalt
#

No gravity no nothing?

rich inlet
#

Well, I want to assign a velocity then, the mob flies a parabola and then it shouldnt move anymore