#help-development

1 messages · Page 1910 of 1

crisp arch
#

i just googled "how to edit nbt with spigot" lol

vocal cloud
crisp arch
#

^ i did

vocal cloud
#

And then you figured out how to do it?

crisp arch
#

sort of

#

its basically the spigot representation of nbt i guess

quaint mantle
#

Forget about messing with nms and nbt like about nightmare

olive valve
#

this is probably a dumbo question but i havent been able to figure it out. Random rand = new Random(); int number = rand.nextInt(100 - 1) + 1; if(number == 5) { System.out.println("5"); }the chance is 5 but it runs 95% of the time. i am i doing something wrong?

quaint mantle
crisp arch
#

now i have to google what a persistence api is

vocal cloud
#

Finally

quaint mantle
#

it is not a termin, it just means "api to store persistent data"

crisp arch
#

so is it saved in ram? or like somewhere on the harddrive

#

oh wait this is like a really fancy hashmap

vocal cloud
#

It's persistent it's stored in the file

quaint mantle
#

It is saved on drive, but cached as well, because performance

crisp arch
#

so i can ditch my sqlite database?

eternal night
#

sql definitely has advantages over PDC

#

very different use cases

#

stuff like queries and offline access are pretty much impossible with PDC

crisp arch
#

im just using it to store the hologram's information, and then each armor stand that displays text

eternal night
#

storing large complex data is also not as easy as you might want it to be

quaint mantle
crisp arch
#

idk i already have the sqlite system all working and fine so id rather not

quaint mantle
#

So server admins can edit holograms in the config

#

But, depends on the plugin

crisp arch
#

oh that is kind of true

eternal night
#

^^ yea pdc is really for plugin internal flags and data

vocal cloud
#

Storing the holograms location somewhere is better than using PDC because otherwise you'll never be able to figure out where they are

olive valve
#

this is probably a dumbo question but i havent been able to figure it out. Random rand = new Random(); int number = rand.nextInt(100 - 1) + 1; if(number == 5) { System.out.println("5"); }the chance is 5 but it runs 95% of the time. i am i doing something wrong?

crisp arch
#

ok anyways how is this related to nbt?

#

does minecraft use pdc to store the nbt data?

vocal cloud
#

PDC is NBT. It's just spigot giving plugin devs a little playground to avoid messing up anything on the item

crisp arch
#

ok

buoyant viper
#

?pdc

vocal cloud
crisp arch
#

wow

#

all of that

#

and you couldve just ?pdc

buoyant viper
#

some people want to watch the world burn

crisp arch
#

my brain was like leaking out of my ears i didnt understand a single thing that was going on

vocal cloud
#

I mean googling it brings up the same result and teaches you how to google your questions

crisp arch
#

is this dude

#

just spamming

#

mans asked that question like 5 times already

buoyant viper
vocal cloud
#

Third time you've asked. Answer is we don't know

olive valve
#

nobody answered for 3 times so what am i supposed to do?

buoyant viper
#

wait for someone to answer

olive valve
#

i did

buoyant viper
#

then wait

olive valve
#

i did

crisp arch
#

your in the wrong server

olive valve
#

ok

crisp arch
#

this is spigot-api not java

vocal cloud
azure osprey
#

I still can't figure out wtf they meant by "server version" I've been trying since I last said something

#

is it an imported package?

crisp arch
azure osprey
#

oh it's 1.18.1

crisp arch
#

oh wow

#

will you look at that

#

org.bukkit.Server.getBukkitVersion()

#

:OOOO

azure osprey
#

I'm starting to not like you

vocal cloud
#

Don't throw rocks from glass houses

buoyant viper
#

i throw rocks all the time

crisp arch
#

^

buoyant viper
#

whats life without risk

muted otter
#

how do i check which hand a player has selected in their client settings?

azure osprey
#

anyway what's my server version have to do with anything?

hasty prawn
vocal cloud
crisp arch
hasty prawn
vocal cloud
#

1.8 code could definitely work with a 1.16 server

muted otter
#

..,.\

vocal cloud
hasty prawn
muted otter
#

🤨

vocal cloud
buoyant viper
vocal cloud
crisp arch
#

aw i want a pink name

#

one sec let me spend 5 dollars

vocal cloud
#

5 dollars? Nitro give for free

crisp arch
#

smh fine ill spend more

azure osprey
#

huh, all this just started because I wanted to know how soccer could find the answer to the relationship between bow power and arrow speed, a 1:3 ratio

#

he said "IntellIJ
open random mc-project
write bow and use autocomplete to find the nms class "BowItem"
read the name "releaseUsing" and read "getPowerForTime"

then click the value.name and all other uses will show"

#

and it didn't work

spiral light
#

because you only have spigot api

azure osprey
#

yes

#

what's wrong with spiggot? do you use eclipse or something

crisp arch
#

ok i just got nitro

spiral light
#

if you use maven you can just add the non api instead of the api (which also includes the api)

crisp arch
#

LMAO

sterile token
crisp arch
#

PINK NAME

#

@vocal cloud yooo

#

you cant bully me now

sterile token
#

Sometime it only say running CraftBukkit/Spigot

crisp arch
#

we have the same role

azure osprey
#

ok I'll get maven

vocal cloud
#

🤡

crisp arch
#

yeah thats what i thought

#

try bullly me now c:

vocal cloud
#

I don't need nitro to prove you wrong

crisp arch
#

smh

quaint mantle
#

You can buy a bucket of icecream for 10$

crisp arch
#

say that again please?

quaint mantle
#

You can buy a bucket of icecream for 10$
You can buy a bucket of icecream for 10$
You can buy a bucket of icecream for 10$

sterile token
spiral light
vocal cloud
#

What kind of swill can you get for $5

spiral light
#

the best ratio of drunk and efficient

vocal cloud
#

Buy everclear if you care about efficiency

spiral light
#

well.... no xD

#

it has to be something where you dont die after 10ml

vocal cloud
#

Or some baijiu

spiral light
#

like Stroh80

vocal cloud
#

Stuff goes up to 140 i think

modern plank
#

is there an event for when blocks get broken?

spiral light
#

BlockBreakEvent

azure osprey
#

@spiral light okie I have maven, do I add a dependency in the pom file? is that how I get the same thing you got?

spiral light
azure osprey
#

yay

golden turret
#

not actual development but

#

is there a way to do something like that

spiral light
#

no

golden turret
quaint mantle
#

what

spiral light
golden turret
quaint mantle
#

well ok

quiet ice
#

to some degree it makes sense to ask here

spiral light
#

you want to use an custom item you created by extending a nms item to be define the texture ?

#

but just to 3°

quaint mantle
#

That is impossible

spiral light
#

i think that too

tardy delta
spiral light
#

the client dont know custom items you create

golden turret
tardy delta
#

so the custom items?

golden turret
#

and i want that a bow that have the custommodeldata of 1

#

have the texture of a fishing rod

tardy delta
#

ItemMeta#setCustomModelData

golden turret
#

yes but

quaint mantle
#

that should be possible

golden turret
#

i want that in the texture pack

#

.json

tardy delta
#

it is already in

golden turret
#

no

tardy delta
#

wait lemme take a look at my pack

somber hull
#

How would you check if a block is broken?

tardy delta
#

i have things like this

somber hull
#

Ohhh

#

Wait, then it wouldnt be broken

#

Cause only a player can break a block?

#

So is there an event for if a block changes to air or smthng?

buoyant viper
#

i think there is a BlockChangeEvent

tardy delta
#

and then i have another which refers to the file

#

@golden turret

golden turret
#

ik how that works

#

but i would like to set the vanilla bow as my parent

somber hull
golden turret
#

so i would need only to change the overrides

spiral light
tardy delta
#

is that path referring to a json?

golden turret
#

yes

#

to the vanilal one

tardy delta
#

i think it needs to be in your models folder

somber hull
tardy delta
#

so the client looks there i guess

somber hull
tardy delta
#

so set a vanilla fishing rod file in your models folder (i think other packs do it the same way) and change your path obviously

spiral light
somber hull
spiral light
#

O.o

azure osprey
#

I made a bow that shoots a very tight grouping of 12 arrows, when I shoot at an entity and it hits, only one arrow will hit and the other 11 bounce backwards like they hit an enderman

#

does anyone know the explanation for this strange behavior?

tardy delta
#

@golden turret create a new fishing rod json file and set it in your resourcepack / models / somewhere and refer to that file instead of the vanilla fishing rod one, i think this will work

spiral light
azure osprey
#

why does it happen?

spiral light
#

whenever you get dmg by something you have a specific time of no dmg

azure osprey
#

very interesting, thank you for explaining

spiral light
#

you can set the nodamage-ticks to 0 after 1 hits if you want

#

entity # setNoDamageTicks(0) should work (maybe ?) you can also try to take a look at ProjectileHitEvent or EntityDamageEvent (maybe its just canceled)

stark marlin
#

If I cancel the creaturespawnevent if the entity type is instance of WanderingTrader, will that prevent wandering traders completely, or will it still allow the llamas to spawn?

hasty prawn
#

Pretty sure they only spawn if the trader does

vestal dome
#

pstt, look at the sources

#

cof cof

stark marlin
#

Thanks

vestal dome
#

I want to ask a question here, I want to do multiple BungeeCord setup, but I am currently stuck, trying to figure out how to do it so when you connect to the main Ip it sends me to the BungeeCord, and finally to the spigot server..

spiral light
#

ports ?

vestal dome
#

wdym?

spiral light
#

i think connecting to bungeserver needs another port then the actuall server

vestal dome
#

if you think, then make sure you are saying truth

#

I only care about the facts.

spiral light
#

then read the docs and dont ask for help here ^^

vocal cloud
#

Sheeesh so rude

vestal dome
#

ok I apologize.

spiral light
#

i am absolutly sure you did not read them before asking here or at least you were google them xD

#

i am also sure that you will need different ports but i am not sure if you configured everything else right

vestal dome
#

Why would I care about another port?

#

as far as I am concerned, that is not the problem here.

lost matrix
vestal dome
#

I am developing this

#

I want a solution to a problem i have.,

#

which is if I redirect the player to a bungeecord, the bungee doesn't have his IP and has my load balancer one.

lost matrix
#

Ok so you want to have multiple BungeeCord instances with each instance linking to all minecraft servers?

vestal dome
#

yes.

lost matrix
# vestal dome yes.

Then you should use something like nginx reverse proxy setup with a round-robin configuration

vestal dome
#

I didn't get it..

lost matrix
#

One moment

vestal dome
#

alr

lost matrix
spiral light
#

did you draw that ?

lost matrix
lost matrix
spiral light
#

😈

vestal dome
spiral light
#

do you learn rly learn this if you need to ask something that difficulty ? xD

quasi flint
#

And pointless

vestal dome
#

yes

#

too bored

lost matrix
quasi flint
#

Because in no world you have 3 bungees

#

Maybe if something goes wrong 2

#

But 3 😂

vestal dome
quasi flint
#

"only"

lost matrix
#

There are a lot of different approaches to load balancing. Round robin is a primitive but often effective approach.

vestal dome
#

well I might as well ask, is there a way to do this in Java itself?

#

or maybe I'm dumb.

quasi flint
#

If you want to write your own proxy

#

That balances the load

#

On the different servers

vestal dome
#

can't be that hard.

lost matrix
quasi flint
#

Would be a fun summer break project, if you want to have smth pointless and hard

quasi flint
#

Because I would have an own programm, in front of all those bungees

#

Like a super bungee if I understand correctly

vestal dome
#

I would go for only 1 bungee, but I want a way to prevent "bot attacks"

lost matrix
#

But then you are better off learning Docker and Kubernetes for container orchestration, scaling and load balancing.

quasi flint
vestal dome
lost matrix
red sedge
#

How can I set the attack speed of an item?

tardy delta
#

do i need a preparedstatement if i dont use like ::setString and such?

lost matrix
quasi flint
tardy delta
#

or is it just optimized?

vestal dome
#

bru

lost matrix
red sedge
#

i need to set it

#

like on swords

quasi flint
#

Maybe look at 1.8 PvP plugins

#

Like oldcombatmechanics

red sedge
#

they just remove the attack speed

#

not useful tbh

quasi flint
lost matrix
# red sedge i need to set it

2 Ways.

  1. Remove the default modifiers and replace them with yours
  2. Add a modifier that decreases the attackspeed based on the default speed (-100% would remove it all together)
lost matrix
vestal dome
#

well it's incoming connections to join the server..

lost matrix
#

Most of them have that included

vestal dome
#

it is not a ddos attack

red sedge
#

the modifiers on swords dont seem to be in the nbt

lost matrix
vestal dome
#

what if I reject a person's actual client?

red sedge
#

wait if its not on the nbt

#

it would get overriden by the attribute

lost matrix
lost matrix
light parcel
#

Are there any dependency mirrors for the spigot API? The network I work on blocks spigotmc.org

lost matrix
light parcel
#

Any idea how I can work around this?

lost matrix
light parcel
spiral light
#

at my work i cant use discord ... but "sadly" they also provide guest wlan .... with (maybe?) no blacklisted domains 😄

lost matrix
#

Is the domain blacklisted or is your remote repo setup in a save way?

azure osprey
#

what kind of job blacklists discord? do jobs do that?

light parcel
azure osprey
#

I'm 17 I work a 17 year old job

torn shuttle
#

hm just had a random question, if I later create a premium plugin but also put the premium plugin as say a patreon reward, am I not allowed to say that you can get it via patreon on the spigot page?

azure osprey
#

not adult job really

spiral light
azure osprey
#

oh

light parcel
#

Yeah cyber security is a major concern

lost matrix
light parcel
#

Mm this might be too hard, I can't download VPN software either and I don't want to "try too hard" to circumvent their restrictions if you know what I mean (security breach = unemployed)

#

Was hoping there was just another spigot repo I could link

azure osprey
#

I have a weird problem, intellij only works on a more recent version of Java, like Java 16, but another app where I'm learning java needs java 8

spiral light
#

you could just switch to an local storage or not ?

vocal cloud
light parcel
#

Put spigot on a USB and put it in? Yeah that'd work, although is that maven/pom friendly? I've never just downloaded and dropped a jar into a project

lost matrix
torn shuttle
azure osprey
#

my spiggot server doesn't though

spiral light
torn shuttle
#

my question is if it's allowed or if it falls under promoting an alternative marketplace

azure osprey
#

my spiggot server needs like java 15 or higher I think

lost matrix
lost matrix
azure osprey
#

TMCbeans is the one who needs a more previous version of java

vocal cloud
light parcel
#

Sweet, thanks guys :)

torn shuttle
vocal cloud
torn shuttle
#

I'm not asking if I can somehow make it so they can only get it on patreon, I'm asking if I make a premium plugin and I also have the download up on patreon if it's allowed to say that it is also available on there

onyx fjord
#

people prefer paying once

#

than per month

#

i guess you are free to add licenses manually tho

#

from patreon

torn shuttle
#

guys I unironically have a decently successful patreon already, stop trying to dissuade me from something that I am already doing alright in

onyx fjord
#

amogus?

#

i'd just make an exclusive plugin addon

#

or smth

vocal cloud
#

Also allowed?

onyx fjord
vocal cloud
#

Why not? What did i miss on that front

onyx fjord
#

exclusive = patreon only

#

no other way to get

#

posting on spigot would make it not exclusive

ivory sleet
#

So much help development here

vocal cloud
#

Yeah imo you'd lose out on too much potential revenue to bother with Patreon

vocal cloud
torn shuttle
vocal cloud
#

You go to a dev chat to talk about rules you're not going to get what you want

torn shuttle
#

I can't go to dev chat to ask if I can post my dev stuff on spigot?

ivory sleet
#

Magma afaik you’re not allowed to

#

Like some other devs have done it before

#

And well, it just didn’t end their way

light parcel
ivory sleet
#

But can’t find em

vocal cloud
#

Life is pain

ivory sleet
#

Yup

torn shuttle
#

or is it a different rule

ivory sleet
#

I believe so yeah

onyx fjord
#

u cant call mr choco dum

#

its toxic

ivory sleet
#

If you use some ‘primeary’ build tool yes

#

But eventually you get something more keen and then you don’t need to depend on the shaded one

vocal cloud
#

Gotta do the good old maven local jar

#

I swear officer it's a repository

ivory sleet
#

🥲

onyx fjord
#

my .m2 is 4 gigs

#

😢

ivory sleet
#

Yikes

light parcel
ivory sleet
#

Ah

#

One way would be to depend on the one which gets built into m2 repo by build tools as someone mentioned above

willow oar
#

is there a thing like TimeUnit.SECONDS.sleep(seconds); but for spigot?

hasty prawn
#

?scheduling

undone axleBOT
willow oar
#

ty

light parcel
quaint mantle
crude estuary
#

i Already knew that but it's Handy for new People

ivory sleet
#

Yup

#

Very pog

sterile token
#

Build Tools will install the Spigot, Spigot-Api maven dependencias to local repo.

#

Of course you should told the build tools which versión do you want to install

light parcel
#

Ohh actual spigot build tools, I thought he meant any build tool of which Maven is one

sterile token
#

Wait

#

I didnt understand you

chrome beacon
#

?bt

undone axleBOT
sterile token
#

There you have

light parcel
#

Yeah I know what spigot BuildTools is

sterile token
#

Allrgiht

#

For programming spigot plugins you only have on remote repos the Spigot-Api

worldly ingot
#

Hmmm the MySQL connector driver is installed by default on Spigot, yeah? Because it's not very happy with me atm lol

#

Grrrrr java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/veinminer

lost matrix
#

Because Postgresql is a thing

lost matrix
worldly ingot
#

I'm saving player data. e.g. which categories they have disabled, which pattern they're using, which mode they have selected, etc.

#

I store with JSON currently, I'm just adding support for a few different options, including SQL

#

Just can't test at the moment because it won't let me connect to my localhost server! lmao

sullen marlin
#

Did you Class.forName it

worldly ingot
#

Is that a requirement for MySQL? o.O

lost matrix
sullen marlin
#

I believe technically not with recent versions, but that’s traditionally how you load jdbc drivers

worldly ingot
#

Will give it a shot then I suppose

sterile token
#

Oh nice github Shutdown my package maven repo. Where I had deployed the Spigot-Jar and Spigot-Api

#

Its amazing btww

worldly ingot
#

I mean yeah ideally you don't host that anywhere

#

There's a reason why Spigot doesn't lol

sterile token
#

And my account was Warned by github

worldly ingot
#

ngl, genuinely surprised they did that though. That's the first I've heard of them doing that, meanwhile I know of a few repositories that literally have NMS in source

hasty prawn
#

I once accidentally committed a Discord bot token to Github and within about 30 seconds Discord yelled at me Sadge

sterile token
#

Its amazing why i cannot host a private maven package for spigot

#

I have explained and send probs that its only used byke

#

But they didnt like

chrome beacon
#

||codemc||

worldly ingot
sterile token
silver shuttle
#

How do I alphabetically sort an array of Plugin type?

#

It still needs to be the Plugin object in the end

sullen marlin
#

Create a comparator that compares their name

silver shuttle
#

So there's no method like Arrays.sort... sad, but thank you md_5

chrome beacon
#

There is but you need to tell it what to compare

#

Arrays#sort

silver shuttle
#

oh damn youre right

#

Arrays.sort(plugins, Comparator.comparing(Plugin::getName));
So this?

chrome beacon
#

Probably

silver shuttle
#

oh yeah, works like a charm

#

thanks and goodnight ^^

alpine barn
#

How do I trigger a custom sound when a player bumps into a specific block type?

#

So that all players can hear it

#

Well, all players that are close enough

quaint mantle
#

Hellow.
How fix it?
ERROR]: Tried to load unrecognized recipe: crystal:commoncobblestone removed now.

sullen marlin
#

ignore it, you had a plugin called Crystal that you removed

quaint mantle
#

ow ty

crimson marsh
#

Anyone know how I could fix this issue Caused by: java.lang.NoSuchMethodError: com.google.gson.JsonParser.parseString(Ljava/lang/String;)Lcom/google/gson/JsonElement;

lost matrix
crimson marsh
#

Alright thank you

buoyant viper
#

?dmca

undone axleBOT
alpine barn
#

Awesome, I left the toxic, dmca riddled DayZ modding universe for Minecraft, and it's the same here? Maybe I should stop messing with computers altogether and become a beet farmer in north east pennsylvania

crimson marsh
mint mesa
#

if I were to use PlayerInteractEvent, how would I get the name of the player I just clicked on?

jade grove
mint mesa
#

I want to make a freeze block basically

crimson marsh
jade grove
onyx fjord
#

Oops wait no

mint mesa
#

that gets the user who used the block

#

:p

#

well you dont damage players

#

its for a practice server

onyx fjord
jade grove
#

im pretty sure he wants to do it if the player right clicks on a certain player

mint mesa
#

no so

onyx fjord
#

Ah

mint mesa
#

basically I will have a block of ice

#

in my hand

onyx fjord
#

The player you clicked

mint mesa
#

when I right click on the player

#

it should stop that player from moving

jade grove
mint mesa
#

yes

#

I said that

jade grove
#

cringe

mint mesa
jade grove
#

but sure

#

alright

mint mesa
onyx fjord
#

You could just freeze the closest player?

jade grove
#

no

mint mesa
#

hmm that could fail

onyx fjord
#

Or ray trace

#

Isn't there like player interact at entity event?

lavish hemlock
#

If not, a ray trace would work

onyx fjord
mint mesa
#

I am currently trying EntityDamageByBlockEvent

onyx fjord
#

Just check if the entity type is player and continue

lavish hemlock
#

Like

#

Falling sand/gravel

#

Or magma

onyx fjord
#

Yeah

onyx fjord
#

Lava I believe

#

Also a block

#

😳

olive crescent
#
               p.sendMessage("Sem dinheiro");
               return;
           }else{
               Main.getInstance().economy.withdrawPlayer(p.getName(), 5000.0);
               p.sendMessage("Você reparou seu item");
            }``` I'm using the SPIGOT 1.18 version. Why is not this working? Returns that Economy.GetBalance (P) is null.
light parcel
#

Does build tools include plugin-annotations? If not, where can I get that jar?

mint mesa
lavish hemlock
mint mesa
#

oh god my brain

onyx fjord
#

I can't rly code from my brain but I'll navigate you

light parcel
onyx fjord
#

Entity clicked = e.getClickedEntity()

lavish hemlock
#

I mean you can download it from the Maven manually if you want...? It's not generally advisable to link to files over Maven though.

onyx fjord
#

@mint mesa check the doc

light parcel
onyx fjord
#

Or wait till tomorrow so I can help you

wary harness
#

got this error

onyx fjord
light parcel
#

It's not unfortunately :(

lavish hemlock
#

yeah

#

?bt

undone axleBOT
wary harness
lavish hemlock
#

java -jar BuildTools.jar --rev <your version> --remapped iirc

onyx fjord
#

Spigot can't post mojangs code

wary harness
#

well I know that

#

I useded build tools

lavish hemlock
#

they also can't post their mappings either

onyx fjord
#

So it's not in repo

lavish hemlock
#

which I've never understood :)

onyx fjord
wary harness
#

yes

buoyant viper
#

why post mojangs mappings when mojang posts mojangs mappings

onyx fjord
#

Is maven local in your repo list

wary harness
onyx fjord
#

Send your pom

#

?paste

undone axleBOT
wary harness
#

I useded this

#

in build tools

#

"C:\Program Files\AdoptOpenJDK\jdk-16.0.2\bin\java.exe" -jar BuildTools.jar --rev 1.16.5 --compile-if-changed --remapped

lavish hemlock
#

he could also be declaring the dependency wrong

wary harness
#

it worked with 1.17.1

onyx fjord
#

Post your pom on paste

wary harness
#

I changed now to 1.16.5

onyx fjord
#

Wait

#

I think it changed in 1.17

#

Didn't it

lavish hemlock
#

Sending the file doesn't embed the whole thing

onyx fjord
lavish hemlock
#

Oh

buoyant viper
#

mobile moment

onyx fjord
#

Mobile haha

lavish hemlock
#

lol bitchass mobile user X D

wary harness
buoyant viper
#

u can still view the text on phone i just forget how

#

i think u just open it in external browser

wary harness
#

So any one can tell what is wrong

buoyant viper
#

besides the ungodly amount of spacing, no not rly

onyx fjord
#

Do you have to declare maven local or its automatic?

lavish hemlock
onyx fjord
#

It isn't in gradle dude

#

u have to do mavenLocal()

buoyant viper
#

i would hope that maven searches maven local

lavish hemlock
#

Maven Central also isn't automatic in Gradle

buoyant viper
#

unless u need to like <scope> it

lavish hemlock
#

The only automatic repo is the Gradle Plugin Portal lol

onyx fjord
#

@wary harness try system scope

#

And system path

#

To the jar

buoyant viper
#

god

#

why

wary harness
onyx fjord
#

So am i

#

<scope>system</system>
<systemPath>pathtojar</systemPath>

#

In dependency

buoyant viper
onyx fjord
#

Yeah

sterile token
#

Really strange

onyx fjord
sterile token
#

I never called the main class instance like that

ivory sleet
#

Yeah it’s bukkits singleton design

sterile token
#

Oh ok

ivory sleet
#

A bit odd but it does the job shrug

sterile token
#

Ah yeah

onyx fjord
#

Normally

sterile token
ivory sleet
#

Don’t use that fancy word on me

#

But you right

#

Passing it through a constructor

#

(:

sterile token
#

Why you dont like it?

#

He

lavish hemlock
#

He

sterile token
#

I refer this:

MainClass instance

onEnable instance = this

MainClass getInstance

#

I do it like that

ivory sleet
#

Oh

#

I mean that works Ig

azure osprey
#

Hi conclure!

onyx fjord
#

Does java have its own Emmet?

ivory sleet
#

Greetings

sterile token
onyx fjord
#

Boilerplate generator

sterile token
#

Idk

onyx fjord
#

For example

sterile token
#

What that means

onyx fjord
#

div>p*5

wary harness
onyx fjord
#

This makes div in html and 5 paragraphs in it

ivory sleet
#

Don’t think so kacper

onyx fjord
#

Sadd

ivory sleet
#

Ye

onyx fjord
#

Html is too powerful

wary harness
#

and not sure why

onyx fjord
#

Not sure either

ivory sleet
onyx fjord
#

Look you only can use 2 languages in your life

#

Which one do you choose

ivory sleet
#

What r the options?

onyx fjord
#

Everything

ivory sleet
#

Java and Rust

wary harness
#

@ivory sleet could you help my remaped jar is not created

onyx fjord
#

I'd leave C and JavaScript

ivory sleet
#

I don’t know much about maven sadly

#

Ye

wary harness
#

"C:\Program Files\AdoptOpenJDK\jdk-8.0.302.8-hotspot\bin\java.exe" -jar BuildTools.jar --rev 1.16.5 --remapped

onyx fjord
#

Not maven

wary harness
#

this is what I run for build tools

#

I tried 2 times

ivory sleet
#

1.16.5 does not existed remapped

#

1.17+

wary harness
onyx fjord
#

Google how to use nms 1.16 I guess

wary harness
cold tartan
#

is there a way to make an onPlayerLand event, other than checking PlayerMoveEvent a bunch?

waxen plinth
#

Don't think so

tender shard
#

I'd just run a scheduled timer 😄

tender shard
azure osprey
#

what about using the isonground variable? check if they are on the ground right after they are in the air

#

have an if statement that triggeres everytime they're in the air that then checks for when they're back on the ground

cold tartan
#

i was wondering if there is a more efficient way

azure osprey
#

oh

cold tartan
#

ty tho

cold tartan
azure osprey
#

oh

vocal cloud
#

Man it's like looking through a crack to understand whats going on with that lmfao

prime reef
#

Does anyone have any knowledge of how getNearbyEntities works internally?

#

Does it it filter by chunk? Or is it just shorthand for a distance check?

waxen plinth
azure osprey
vocal cloud
cold tartan
#

is there any way to check what block the player is currently standing on with respect to how a player can be shifting over the edge of a block?

azure osprey
#

could you just use getBlock(player.getLocationX, player.getLocationY -1, player.getLocationZ)?

#

wait nvm I forgot about the shifting thing where you can be above another block

#

maybe do an if statement where if the block below the player is air it won't work?

cold tartan
#

im just trying to figure out a work around for the depreciation of Player.isOnGround()

azure osprey
#

maybe check if the y location of the player remains exactly the same after .001 seconds?

#

like player.getYLocation minus player.getYLocation after .001 seconds to check if they're on the ground

prime reef
subtle folio
hasty prawn
#

You can't remove while iterating over it like that

#

combatLog.remove(p);

subtle folio
#

yeah?

sterile token
#

Oh

#

So Where he would remove the player!

subtle folio
#

my question ^

sterile token
#

Ahh nvm

subtle folio
#

I dont see any other place/way I would remove them..?

hasty prawn
#

Either use Iterator, or make a temporary list and remove them after you're done with the loop.

sterile token
#

Iterator?

hasty prawn
#

Si

sterile token
#

I never figured how they works

subtle folio
#

oh so make a temp little list add them to that, then when the loop is done remove them from the list and blah blah and delete the list?

sterile token
#

You dont need to delete the list

hasty prawn
sterile token
#

Its commonly used its uuid over the complete Player Object

subtle folio
#

well, its much easier, you suggest I save their uuid or ign and get that?

hasty prawn
#

UUID

sterile token
#

Uuid

#

Never name

hasty prawn
#

Pretty much never store IGNs

sterile token
#

Name can change

subtle folio
#

well for temp stuff like combatLog

#

i dont think it would rlly matter

hasty prawn
#

It wouldn't, but just for good practice purposes save their UUID

sterile token
#

Yeah

subtle folio
#

alr

sterile token
#

I had some problems with tmp and saving James

subtle folio
#

imm go with the list approach, ty all very much

sterile token
#

Like

#

I had some problems before

sterile token
#

If you need more help just ask it here

hasty prawn
#

You're gonna have to be a little more specific, you're trying to update a value in the config?

undone axleBOT
sterile token
buoyant viper
#

do not car still should paste big text

hasty prawn
#

So you're trying to get something from the config?

subtle folio
buoyant viper
#

i respect ur change but if it was already solved.. sadge

sterile token
#

So you want people change the location from yaml

subtle folio
golden turret
#

how could i detect if the player is pulling a bow?

buoyant viper
#

getItemInUse() is bow maybe

buoyant viper
next stratus
#

Am I just stupid or is it hard to add support to a 1.18 plugin for 1.8 - 1.18?

hasty prawn
#

Depends what you're doing

next stratus
#

I mean, it's for a sort of mine plugin so I gotta sort out schematic and material stuff

#

I can't understand why people are stuck with such old versions when the newer ones are fine, but it'll get me a larger audience if I can get it to work on the older versions

granite burrow
#

how can I get the enchantment and level from Set<Enchantment>?

next stratus
hasty prawn
#

Yeah I know, tell your audience that lol

next stratus
#

I wish I could add the support myself but I'm not smart enough to do so

hasty prawn
#

For people to drop 1.8 someone is gonna have to make a fabric mod that makes PvP look and feel exactly like 1.8

#

Which is pretty hard to do

next stratus
#

Fabric? I don't trust that tbh

granite burrow
#

Ive used fabric for like 3 years

hasty prawn
#

Whats wrong with Fabric

next stratus
#

I don't even trust that lunar client

hasty prawn
#

I trust Fabric over Lunar

granite burrow
#

same

next stratus
#

I swear somethings gonna come out bad big time regarding lunar client

#

Like it was made to pull people in and it'll have something in the background

hasty prawn
#

Should've seen what Badlion did

#

It was practically a virus lol

granite burrow
#

fabric is basically forge no?

hasty prawn
#

Same concept, completely different softwares

granite burrow
#

well yeah but in functionality, its just fabric is more visual no?

hasty prawn
#

Don't think so? Fabric is a full mod loader afaik

granite burrow
#

ah

next stratus
#

But yeah, i wish I knew how to support older versions but hey I'll learn one day

hasty prawn
#

No better time than the present

granite burrow
#

^^

next stratus
#

I mean I think me getting myself into a mess has made it harder

granite burrow
# next stratus For loop?

also to this it doesnt show it correctly, i get this rn [Enchantment[minecraft:sharpness, DAMAGE_ALL]] But im not sure how to dynamically get each of the minecraft: effect

hasty prawn
#

Call getKey()

granite burrow
#

Set<Enchantment> doesn't have getKey from what I can see

hasty prawn
#

You need to iterate over it

#
for(Enchantment enchantment : enchantments) {
  NamespacedKey key = enchantment.getKey();
}
#

You could also stream but idk what you're trying to do

granite burrow
#

im just trying to get all the enchants on an item

granite burrow
#

Thank you it now tells me minecraft:enchant, and I can just remove minecraft: with .replace

hasty prawn
#

Could also call getKey again on the NamespaedKey 😄

granite burrow
#

wow...

#

I need to look more into enchantments

ancient jackal
#

I'm trying to make a plugin with two dependencies and one of them doesn't have a maven repository

#

am not happy to say it did not work

#

"build success" but really did not succeed. it's not a dependency and just threw two files around

vocal cloud
#

You didn't add it as a dep or? I'm confused did you add it to the pom?

muted otter
vital sandal
#

AttributeModifier damage = new AttributeModifier(UUID.randomUUID(),
"generic.attackDamage",
70.0,
AttributeModifier.Operation.ADD_NUMBER,
EquipmentSlot.HAND);
item.getItemMeta().addAttributeModifier(damage);

#

Cannot resolve constructor 'AttributeModifier(java.util.UUID, java.lang.String, double, org.bukkit.attribute.AttributeModifier.Operation, org.bukkit.inventory.EquipmentSlot)'

#

Cannot resolve method 'addAttributeModifier' in 'ItemMeta'

#

anyone know why ...

ancient jackal
vocal cloud
#

What command did you use to import it?

ancient jackal
#

I used the install-file command as shown in the link I provided but it's still unavailable

vocal cloud
#

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

ancient jackal
#

install:install-file

#

yes

#

mvn install:install-file -Dfile=C:\Users\name\IdeaProjects\Rankup3\build\libs\Rankup-3.13.2.jar -DgroupId=okx-code -DartifactId=Rankup3 -Dversion=3 -Dpackaging=okx-code.Rankup3

hasty prawn
vital sandal
vocal cloud
ancient jackal
vocal cloud
#

Um well

vital sandal
#

if version is a problem how can i use it without change to higher version?

vocal cloud
#

-Dpackaging=okx-code.Rankup3 this is wrong?

hasty prawn
#

You can't, that constructor doesn't exist in 1.12.2

ancient jackal
#

how?

hasty prawn
#

You can use those.

vocal cloud
vital sandal
#

hmmm so how about add attribute ?

ancient jackal
#

oh

vital sandal
#

addAttributeModifier seem not in 1.12.2 too

ancient jackal
#

I set it to jar

#

so it now it looks like mvn install:install-file -Dfile=C:\Users\name\IdeaProjects\Rankup3\build\libs\Rankup-3.13.2.jar -DgroupId=okx-code -DartifactId=Rankup3 -Dversion=3 -Dpackaging=jar

#

ran it, "build success," nothing in the external libraries dropdown or in the maven dependencies in the maven menu

#

just tried a clean dependency install and still nothing

#

mvn clean install -U

vocal cloud
#

So go to your dependencies

vocal cloud
ancient jackal
#
    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.palmergames.bukkit.towny</groupId>
            <artifactId>towny</artifactId>
            <version>0.97.5.15</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>```
vocal cloud
#

So add it there and see if it worked

ancient jackal
#

okay it's listed as a dependency now, thank you

#

now I just need to figure out how to use a listener with it...

vocal cloud
#

👍

agile sinew
#

Trying to get rid of the block so I did
block.setType(Material.AIR)
Isn't this how you do it?

young knoll
#

Yes

#

Or you can break it if you want drops

agile sinew
#

how to break it

young knoll
#

breakNaturally

agile sinew
#

breakNaturally is boolean

young knoll
#

It returns a Boolean

agile sinew
#

I want if wheat grow, it breakNaturally

#
@EventHandler
    public void onBlockGrow(BlockGrowEvent e) {
        Block block = e.getBlock();
        if (!(e.getBlock().getBlockData() instanceof Ageable)) return;
        Ageable ageable = (Ageable) e.getNewState().getBlockData();
        if (ageable.getAge() == ageable.getMaximumAge()) return;
        block.breakNaturally();
    }

so I did this but it wasnt broken just drop item

forest path
#

I've never used BlockGrowEvent, but have you tried cancelling the event? Or use a higher EventPriority?

young knoll
#

You may have to wait a tick

summer scroll
#

How can I make armor stand looking into specific location?

hardy swan
#

Vector

young knoll
#

You should be able to calculate the vector between the two and then use setDirection

hardy swan
#
Vector dir = loc.toVector().subtract(armorStandLoc.toVector());
armorStandLoc.setDirection(dir);
#

i think

summer scroll
#

Can I somehow get the yaw?

#

I mean I'm trying to do this client-sided

#

So with craftbukkit method

hardy swan
summer scroll
#

Oh, it's a method from Location, my bad.

#

Thanks! Will try this out

quaint mantle
#

Is there anyway to change a value and server.properties, and then applying it live? Specifically resource-pack. I found a way to save the URL to the file but not change the live string of it.

#

This is how i'm saving it currently

((CraftServer) Bukkit.getServer()).getServer().x.getProperties().X.setProperty("resource-pack", packURL);
past void
#

So I am making a spigot plugin where im adding a custom item, I made the item but I still need a custom model or texture that cannot be obtained by a normal player(so that they cant cheat). I need this because I am making a crown that gives special abilities and I am using my base item as a netherite helmet. I want a custom texture so people can deffrienciate between to players with enchanted netherite helmets. (sorry for bad spelling)v

vocal cloud
#

If you set a variable in the PDC you won't have to worry about players being able to cheat

young knoll
#

You can set a custom texture with customModelData

past void
#

ik

young knoll
#

But that only works for the item, not the model when worn

past void
#

yes, is there a way to get around that?

young knoll
#

Optifine

summer scroll
#

Optifine

young knoll
#

Or a ton of messing with core shaders

past void
#

ok thank you!

worn tundra
#

So you can make "hats" that are shown. Done using a model you can create in Blockbench

#

(Which is 100% vanilla)

young knoll
#

True

#

I forgot items have a specific model for the head slot

past void
#

so I can make a crown

#

but instead of using a netherite_helmet I can use a pumpkin or somethign?

worn tundra
#

Nope

#

You can actually use any item

#

Any material

#

Just change it's model using custommodeldata

past void
#

so i ur saying I can use a seed

worn tundra
#

?

#

Yes

#

Like the seeds item, if you wish

#

That's how custommodeldata works

#

😅

past void
#

ok thanks soooo much

#

ill go do that rnow

worn tundra
past void
#

ok you just endend my 2 hour cycle of watching useless youtube videos 😂

worn tundra
#

Let me know if you need any help

past void
#

so do I have to set up a recourcepack?

summer scroll
#

Can you completely disable viewing spectator hotbar menu?

worn tundra
past void
#

ok thx

worn tundra
#

Alternatively, depending on what you want to do, you may put the player in spectator mode, set the player to spectate an armorstand (and maybe? set the gamemode back to survival)

#

Or if you want the player to just fly around actually spectating - you could just make them invisible and enable survival flight

summer scroll
#

My goal is to make the player viewing entity's view with spectator mode and for the additional feature, the player cannot open the spectator hotbar menu.

worn tundra
#

I'm afraid that might be client side?

#

Not really sure though

vocal cloud
#

Can you use pastebin instead of posting 3000 lines of text

worn tundra
#

Paste your problem in there

#

Please

#

The error

#

Mostly

#

What's at line 51 in your "External" class?

#

this.plugin is null

#

Perhaps you're forgetting to set it

#

Did you read what I said, I'm sorry?

#

For you to use "this.plugin"

#

you must define it somewhere

#

as in "this.plugin = plugin"

#

It's not set, which causes that error

vocal cloud
#

What's wrong with it? We're not here to debug your code for you.

worn tundra
#

You could just also run the code, you know

minor otter
#

I did but I was having a error with it not giving the message I had set to send, the only outstanding error that came through was Unhandled exception occured in onPacketSending(PacketEvent) and I wasn't sure why it occured

vocal cloud
#

Have you tried logging and or debugging via a debugger?

minor otter
#

Yes

#

No issues showed up

#

Just a build success in a few seconds

#

using the intellij debugger

vocal cloud
#

What? Debuggers don't say build success

minor otter
#

I selected the debug option in intellij and that's what was sent through the console

vocal cloud
#

Debugging the build sequence isn't going to give you any info on whats wrong

#

You need to debug an active server thats running your plugin

#

or use a logger to log the different stages of your command/listener/etc

minor otter
#

okay

past void
#

ok so I made a resource pack and in my code, when creating the item i specified the customemodeldeta and wrote .setCustomModelData(123456); then I went to my recource pack and folder and in models i put my model with the item i wanted to replace and specified the custom model data in their as well. I feel like im missing something.

worn tundra
#

What do you feel like you're missing?

#

Does it work?

past void
#

nope

#

joiin my server

worn tundra
#

I can't

past void
#

no not u

worn tundra
#

?

past void
#

im just saying I join my server and it dosnt work

worn tundra
#

Okay, did you follow a guide for the model?

#

It has to first be put in a models folder

past void
#

wait

worn tundra
#

Then you must create a json file that has the material as it's name

past void
#

did that

worn tundra
#

then inside of that you put all of the custom model datas

past void
#

{
"parent": "item/handheld",
"textures": {
"layer0": "item/bowl"
},

"overrides": [
{ "predicate": {"custom_model_data": 123456}, "model": "item/Crown"}

]

}

#

that is what is in my file

#

of the material

worn tundra
#

Everything looks correct

#

Are you sure that's the correct path to the model?

#

It must lead to a path inside assets/minecraft/models

#

And must be a json file

past void
#

yep

#

idk whats wrong

#

wait

#

if its a server plugin

worn tundra
#

?

past void
#

nvm

#

stupid question

worn tundra
#

You could try enabling output log in your launcher

#

To see if there are any errors while loading the pack

past void
#

ok

#

so this is the output

tiny wolf
#

Hey, Im trying to get my local debug server up in intelij, I got the server up and running but how do I get it add the plugin too ?

tidal hollow
#

How can I make the totems give negative effects as you spend them?

hasty prawn
tidal hollow
#

X D

hasty prawn
tardy delta
#

is it a good practice to use dependency injection just for the plugins logger?

tidal hollow
hasty prawn
hasty prawn
hasty prawn
#

But why KEKW

tidal hollow
hasty prawn
#

You'll have to keep track of that yourself, probably using PDC would be the best way.

tiny wolf
#

whats pdc stand for

hasty prawn
#

Persistent Data Container

tiny wolf
#

not if ur on fun fun 1.8

tardy delta
#

is this how to execute multipe queries after each other?

hasty prawn
#

Well that's also not supported so pog

tiny wolf
#

I'd use 1.18 if notch was still at minecraft

little elm
#

Hi. I'm writing a plugin in Kotlin, and for some reason, I am getting a org.bukkit.command.CommandException caused by java.lang.NoClassDefFoundError caused by java.lang.ClassNotFoundException. In my onEnable, where I do this.getcommand.setexecutor, am I doing something wrong?

class Arena : JavaPlugin() {
    companion object {
        var plugin: Arena? = null
            private set
    }

    val arenaPlayerManager = ArenaPlayerManager()

    override fun onEnable() {
        plugin = this

        this.getCommand("arenalistplayerjobs")?.setExecutor(ListPlayerJobsCommand())
    }
}
class ListPlayerJobsCommand() : CommandExecutor {
    override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
        plugin!!.arenaPlayerManager.getPlayerJobsMap().forEach {
            sender.sendMessage(it.key.name + " is a " + it.value.name)
        }
        return true
    }
}
tiny wolf
#

after he left the code went to shit

hasty prawn
tiny wolf
little elm
tiny wolf
#

it went from 1gb sometimes to 5 gb doing nothing

tardy delta
#

or like that transaction you said

quaint mantle
tardy delta
#

these are all table, database creations

quaint mantle
#

You dont have to create a database manually. A user should create it and judt provide you access

tiny wolf
little elm
tardy delta
#

oh

tiny wolf
#

simpler to do something like:

lateinit var jp: JavaPlugin
class Whatever : JavaPlugin(){
override onEnable(){
jp = this
}
}
fun getI():JavaPlugin(){
return jp}```
#

if you put methods outside of the class, they are similar to what we have in java with static methods

ivory sleet
#

Or use a companion object perhaps?

tiny wolf
#

as far as im aware

tiny wolf
little elm
tiny wolf
#

at least in my opinion

ivory sleet
#

?

#

Companion objects are the closest thing to static

tiny wolf
#

kotlin ?

ivory sleet
#

Well if you annotate with JvmStatic ofc but anyhow

tiny wolf
#

LMAO

quaint mantle
#

Smh just dont do singletones

tardy delta
#

and finally what does this do again?
getConfig().options().copyDefaults(true);

ivory sleet
#

The code you showed is probably something you want to avoid.

tiny wolf
tiny wolf
#

anyways Im not a super expert so rely on them

ivory sleet
#

Actually if you really want a singleton in kotlin, companion objects are overkill, simply an object class is enough

tiny wolf
#

also true

tardy delta
#

is there a better way? instead of returning a future with a collection in?

quaint mantle
#

i dont see anything wrong?

#

or you can return a collection of completable futures cuz you know its multithreading