#help-development

1 messages · Page 187 of 1

trim creek
#

khmm khmm no need for it? xd

#

it literally forced me to do so

grim ice
trim creek
#

btw it is now fixed :D

grim ice
fluid river
#

if your code works for some situation that doesn't mean its good or have no bugs

#

it might be violating several rules

#

be slow

trim creek
#

Just set JavaPlugin to Loader - this is my main class -, and now it works :D
Thanks :D

fluid river
#

not efficient

grim ice
fluid river
#

and weird(hard to read and to refactor)

earnest lark
#

thanks

fluid river
#

String.split(" ");

grim ice
#

or that

fluid river
#

would return array of all words

grim ice
#

but seriously, learn how to use google for coding

#

will save you a lot of trouble

fluid river
#

Open JavaDocs on second monitor

#

or on half of the screen

grim ice
#

a second monitor is honestly just skill issue

fluid river
#

and never close it

fluid river
grim ice
#

just alt tab

fluid river
#

no second screen available

grim ice
#

a second monitor is just a waste of money

#

except if ur a streamer or something

eternal night
#

👀

fluid river
#

well i can take my PC monitor

#

But that would be hard to take the wire from pc and plug it to laptop

chrome beacon
#

I'd love a second monitor

grim ice
#

or for some type of developer that has extremely tight dead lines

grim ice
fluid river
grim ice
#

get a hardware upgrade or save up for college

fluid river
#

website on one screen

#

code on another

grim ice
#

or save up for other useful things

grim ice
fluid river
#

well my friend usually does that

chrome beacon
#

College is free here :)

grim ice
fluid river
#

where do you live lol

grim ice
#

Algeria

chrome beacon
#

Sweden

fluid river
#

Алжир

grim ice
#

Oh thats algeria in russian

fluid river
#

yeah

#

And Швеция

grim ice
#

shuvetsiya

fluid river
#

Well for us it's free only if you passed exams on really high marks

#

Shve ciya

grim ice
#

oh

fluid river
#

where c = ts, not k

grim ice
#

im getting better at russian tho

#

a few days ago i didnt know how to pronounce most letters

#

now i know the whole alphabet

fluid river
#

Б

grim ice
#

what lol

fluid river
#

b

#

basically

grim ice
#

yeah

fluid river
#

б b

grim ice
#

thats obvious

fluid river
#

Ahaha i know what you can't pronounce

grim ice
#

except its weirdly written

fluid river
#

Ъ Ь

grim ice
#

a hard sign

#

and a soft sign

fluid river
#

and Р probably

#

s

grim ice
#

has no pronounciation

fluid river
#

hehe smart

grim ice
#

its ya

fluid river
#

srry i suddenly written on english

grim ice
#

thats ss in german afaik

fluid river
#

Р

#

Я

grim ice
grim ice
fluid river
#

wanna try pronouncing Russian R in vc

grim ice
#

eh

#

background noises tbh

fluid river
#

i bet you cant

#

no worries

#

i'm in headphones

grim ice
#

aight

#

did i do it right

fluid river
#

i meant

#

Р

#

not ya

grim ice
#

oh

fluid river
#

say rust 🙂

grim ice
#

rust?

fluid river
#

but with strong russian r

grim ice
#

god

#

its kinda hard

#

hm

#

well its good enough

fluid river
#

that's like r in rrrrrampage

untold jewel
#

Hello I have a ClassNotFoundException error but the class clearly exsists

#

exists*

untold jewel
#

static function in src folder

grim ice
#

bro

#

i got it right

#

its very similar to french R lol

fluid river
#

you can try Ребёнок

#

run it in translator and try to repeat

#

did you reload your plugin with plugWoman again @untold jewel

untold jewel
#

plugWoman?

fluid river
#

oh that's not you

#

maybe

#

similar pfp

untold jewel
#

did u see my issue?

fluid river
#

yeah

#

does this class exist in jar file

#

when you compile your stuff

untold jewel
#

yeayea

fluid river
#

hmm

#

does it have errors on enable

untold jewel
#

nope

fluid river
#

hmm

#

hmmmmm

#

idk cya

torn badge
#

How are you building your plugin?

oblique wigeon
#

I'm making custom knockback in the context of custom enchants, but I'm running into an issue. At the moment, I'm using Entity#setVelocity, but this is bad for a few reasons, the main reason being that it affects npcs and non-survival players as well. How can I check if an entity is damagable? I've tried using Entity#isInvulnerable, but to no avail. What should I do from here?

#

also i'm getting IllegalArgumentException: x not finite despite nothing being infinite or divided by 0- why is this? is there some internal division thats happening that is causing this?

fluid river
#

npcs by Citizens?

#
Entity target = even.getEntity();
if (target instanceof NPC/* requires Citiznes API imported */ || (target instanceof Player player && player.getGameMode() == GameMode.CREATIVE)) return;```
#

basically done

#

oh true

oblique wigeon
#

do you know anything about the x not finite?

fluid river
#

which line throws this error

oblique wigeon
fluid river
#

entire stack trace please

#

this seems fine tho

oblique wigeon
#
17:10:21 ERROR]: Could not pass event EntityDamageByEntityEvent to SuperItems v1.1.2-ALPHA
java.lang.IllegalArgumentException: x not finite
        at org.bukkit.util.NumberConversions.checkFinite(NumberConversions.java:118) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.util.Vector.checkFinite(Vector.java:814) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.entity.CraftEntity.setVelocity(CraftEntity.java:452) ~[paper-1.19.jar:git-Paper-65]
        at me.zenox.superitems.enchant.EnchantRegistry.shootSkull(EnchantRegistry.java:94) ~[superitems-1.1.2-ALPHA.jar:?]
        at me.zenox.superitems.enchant.EnchantRegistry.darksoulExecutable(EnchantRegistry.java:81) ~[superitems-1.1.2-ALPHA.jar:?]
        at me.zenox.superitems.enchant.ComplexEnchantment.useEnchant(ComplexEnchantment.java:97) ~[superitems-1.1.2-ALPHA.jar:?]
        at me.zenox.superitems.events.PlayerUseItemEvent.useEvent(PlayerUseItemEvent.java:36) ~[superitems-1.1.2-ALPHA.jar:?]
        at me.zenox.superitems.events.PlayerUseItemEvent.lambda$new$0(PlayerUseItemEvent.java:24) ~[superitems-1.1.2-ALPHA.jar:?]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:669) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callEvent(CraftEventFactory.java:248) ~[paper-1.19.jar:git-Paper-65]
        at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:986) ~[paper-1.19.jar:git-Paper-65]
        at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:963) ~[paper-1.19.jar:git-Paper-65]
        at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.handleLivingEntityDamageEvent(CraftEventFactory.java:1186) ~[paper-1.19.jar:git-Paper-65]```
#

there's more, but i've cut it off just to avoid discord's message character cap

oblique wigeon
fluid river
#

print your initial.toVector()

#

and result of subtraction

#

normalize and multiply probably have nothing to do with this error

oblique wigeon
#

alright

trim creek
fluid river
#

don't use Eclipse convert

trim creek
#

too late I used it

#

.-.

fluid river
#

🙂

#

idk then

#

never used convert

eternal oxide
#

Eclipse convert is fine. plugin.yml goes in resources

fluid river
#

probably should be in src

trim creek
#

it is currently in the src folder

#

should I make a main and a resources folder?

#

(as like how maven works)

fluid river
#

i guess you'd better create new maven project and just copypaste files

trim creek
#

...........

fluid river
#

ymls to src/main/resources and classes to src/main/java

#

not gonna take long

#

try creating resources folder in src and put your ymls there

trim creek
#

however some of them are discontinued xd

#

Is archetype important?

fluid river
#

no, skip it

#

might have

#

why you don't just use Citizens tho

#

it's like the entire NPC system with giant api

echo basalt
#

Remapped is ServerLevel

fluid river
#

i love guys saying they want own implementation but use LuckPerms and WorldEdit

#

🙂

eternal night
#

I mean

echo basalt
#

some implementations are good

#

some are bad

eternal night
#

if there is one system to replace, it would be NPCs

echo basalt
#

luckperms does its job perfectly

#

citizens on the other hand...

eternal night
#

world edit is not exposed to users either

#

so like

#

no need to rewrite that

echo basalt
#

and worldedit is only used on demand

fluid river
echo basalt
#

while npcs are constantly there

fluid river
#

ye

echo basalt
#

yeah

fluid river
#

I like had no troubles with it's API

#

Or it's functionality

#

it was kinda popular

#

all of the time

#

why not? 🙂

native nexus
#

look at the updated javadocs

fluid river
#

spigot-api uses .teleport only

#

you know

#

no setLocation in the entire api

#

ez

trim creek
#

New error is always progress

fluid river
#

why don't you just google mojang mappings

glad prawn
#

Ask everything 😎

#

XylightTheThird

static ingot
#

Is there any consistency in how much time/ticks passed between AsyncPlayerPreLoginEvent and PlayerJoinEvent?

eternal oxide
#

no

static ingot
#

Okay, I'm sure I'll be better off just listening to both events rather than using arbitrary task delays then

untold jewel
#

How did you get that format?

#

on the prefix

#

oh :(

#

sorry but thats less cool I was reaaaaaaally hoping there was a way to make this

#

XD

coral pilot
#

does someone know how to add tabcompletion to this?

oblique wigeon
fluid river
#

is that Citizens NPC?

sterile token
#

Bukkit#getOfflinePlayer() has been removed from api?

eternal oxide
#

no, it requires an arg

sterile token
#

weird

#

Its seems not to work

#

I mean im calling it via lambda and its mark as red

eternal oxide
#

do you mean getOfflinePlayers() ?

sterile token
#

Is not the same

#

And i find what is happening

eternal oxide
#

there has never been a getOflinePlayer()

sterile token
#

yes

#

You are wrong

eternal oxide
#

No I'm not

sterile token
#

Check the docs bruh

eternal oxide
#

argue all you like but you will realize you are wrong after a while

sterile token
#

🤌

eternal oxide
#

there is getOfflinePlayer(String) and (UUID) there has never been a ()

hasty prawn
#

How would a no arg getOfflinePlayer even work 😛

eternal oxide
#

You are using a getOfflinePlayer(UUID)

sterile token
#

I just was asking if was removed because i forgot to put a first map to get the uuid from the user

oblique wigeon
quaint mantle
eternal oxide
#

omg, No there is not

quaint mantle
#

I've used it multiple times

fluid river
quaint mantle
#

Or im trippin

eternal oxide
#

look again and read it properly

fluid river
#

how can you get offline player withouth nicnkame

#

or uuid

#

bruh

sterile token
#

I mean he is make to lost time

#

🤣

eternal oxide
#

Its nto teh same shit. Its completely different

fluid river
#

same as me i guess

eternal oxide
#

a method has a specific signature. no args is not the same as a String arg or UUID arg.

sterile token
#

Cya

quaint mantle
eternal oxide
#

Which is precisely why we are saying there is no getOfflinePlayer().

#

and never has been

#

loop the List and check for a contains

sterile token
#

List#contains()

eternal oxide
#

only correct, if that is the full line. He asked to find the word so you can assume its a partial entry

sterile token
fluid river
#

nah

eternal oxide
#

contains is fine but he needs to do it on each line not the actual List

sterile token
#

wait string has a contains() ?

#

🤦‍♂️

eternal oxide
#

yes

quaint mantle
#

Yeah

sterile token
#

i just realize

next stratus
fluid river
#
list.forEach(s -> if (s.contains("string")) {
    // do your code
    return;
});```
sterile token
#

Not using shity fors

fluid river
#

tho sometimes fors are better

sterile token
#

they sucks my balls

fluid river
#

no

#

forEach loops only work with final variables if they are declared outside of forEach

sterile token
#

i mean i as asked to recode a plugin which has for int to loop thru list, etc

#

And i have to decline it because it was too much haha

fluid river
#

yeah

#

but for (a : b) is better sometimes

sterile token
#

No no

#

the for int

fluid river
#

cuz of no final limit

sterile token
#

Dont you know?

fluid river
#

i know

sterile token
#

for (int , , a++)

fluid river
#

for int i = 0; i< 99; i++

sterile token
#

yes

#

they use that shit for looping

#

either for () or list#foeach

quaint mantle
#

Doesn't spigot have a commandbuilder? Without adding the command to the plugin.yml? Can't find it for some reason

vocal cloud
#

Afaik you have to inject your commands with reflection like the rest of us

quaint mantle
#

😔

sterile token
# quaint mantle 😔
   CommandMap getCommandMap() throws Exception {
        Field field = this.plugin.getServer().getClass().getDeclaredField("commandMap");
        field.setAccessible(true);
        return (CommandMap) field.get(this.plugin.getServer());
    }```
#

And then go ahead

quaint mantle
#

Ohhh commandmap

#

Thats why i couldn't find it 🥲

sterile token
#

I mean that is the way via reflections

#

I dont know any other

fluid river
#

why not just register command in plugin.yml

#

JREE FRAVA LESSONS

#

??

upper vale
#

depends on the context but probably by streaming filtering

fluid river
#

var newLore = itemMeta.getLore().stream().filter(s -> !s.contains("-")).toList();

#

itemMeta.setLore(newLore);

#

basic java

#

?learnjava

undone axleBOT
fluid river
#

or take FREE JAVA LESSONS from me

fluid river
#

That's for Java > 8

#

if you are on java 8

#

instead of var do

#

List<String>

#

and instead of toList() do collect(Collector::toList) or smth similar

#

don't remember

#

it works now

#

wdym

#

i filter strings here

#

yeah

upper vale
#

technically its not "removing", its just making sure each string does not contain -

fluid river
#

then i just collect filtered stream to list

balmy valve
#

is there anyway I could move an entity exactly 1 block with a velocity? that way the movement is smooth but still exact

fluid river
#

well you can move it +- 1 block

balmy valve
#

?

fluid river
#

well just use setVelocity(entity.getLocation().getDirection().normalize()); i guess

#

velocity gonna be 1 in the direction

balmy valve
#

But that doesn't mean the entity will move 1 block in that direction I thought?

fluid river
#

it will move forward

#

with velocity 1

balmy valve
#

yeah that wouldnt move it 1 block

#

Thats different then moving an entity 1 block is ze problem

fluid river
#

well use Vector#multiply unless you get something similar to 1 block when applying resulting velocity to entity

balmy valve
#

the velocity is equal to meters per tick, but the question is what is the deceleration of velocity

fluid river
#

google it?)

#

i guess there are some mafs in minecraft which you can find

balmy valve
#

google is just providing me with boats

fluid river
#

😭

obsidian roost
#

anyone off the top of their heads know what a dragon head would cast as? It doesnt cast to Skull

fluid river
#

i guess

#

tho you can just place var and then check what variable type is

obsidian roost
#

oh i meant the block itself called dragon head.

fluid river
#

oh

obsidian roost
#

Trying to see what direction its facing

fluid river
#

Block?

upper vale
#

isnt that Directional

obsidian roost
#

Im trying to get a blockface direction from it

fluid river
#

why don't u just get it's block

#

and get it's direction

obsidian roost
#

Im not sure how to get the direction of a block

#

skull has methods like .getRotation

fluid river
#

can you place dragon head to any direction?

#

or just forward/back/left/right

obsidian roost
#

it can be any direction

fluid river
#

hmm

#

isn't it entity tho

#

not a block

#

when you place

obsidian roost
#

its a placeable block, skulls like that are not entities

fluid river
#

armorstand is a placeable block too

#

but it's entity

obsidian roost
#

well yeah but skulls are not entities

fluid river
#

maybe dragonhead is an entity same as armorstand

#

try getting it as EnderDragonPart and then get it's direction

#

what error do you have when casting it to skull tho

obsidian roost
#

just typed /kill @ e on my server with both a dragon head and armor stand placed, very scuffed but I did confirm dragon heads are not entities

fluid river
#

hmm

fluid river
#

maybe we can get it from stack trace

obsidian roost
#

java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftSkull cannot be cast to class org.bukkit.block.Skull ---- is the exact error

fluid river
#

that's CraftSkull then

#

maybe you need nms to work with dragon head

obsidian roost
#

yeah i was hoping not

#

i guess it will work

#

thanks

fluid river
#

cya

hasty prawn
#

The DRAGON_HEAD Material has a Rotatable data class, so you should be able to do

Rotatable rotatable = (Rotatable) block.getBlockData();
System.out.println(rotatable.getRotation());
obsidian roost
#

oh cool, that works too, thanks

worldly ingot
#

Only reason Skull has its own type is because it's both Rotatable and FaceAttachable

#

Actually I lied. They're also Rotatable lol. I thought player heads could be placed on walls too?

#

Ah there's a PLAYER_HEAD and a PLAYER_WALL_HEAD, Rotatable and Directional respectively

fresh timber
#

I have an event handler, PlayerInteractEvent, and I have an if statement in there, it checks if the player's item in their main hand is equal to material.compass. I have some test messages up because it did not work that tell me what happened in-game. The first test message tells me the item in my hand is ItemStack{COMPASS x1}. The if statement checks if the item in the hand is a compass and the if statement returns false for some reason. Can anyone tell me why and how to fix this?

@EventHandler
public void onRightClick(PlayerInteractEvent event) {
    Player player = event.getPlayer();
    player.sendMessage("§8TESTING PURPOSES - " + event.getPlayer().getInventory().getItemInMainHand());
    if (event.getPlayer().getInventory().getItemInMainHand().equals(Material.COMPASS)) {
        player.performCommand("gameselector");
        player.sendMessage("§8WORKS");
        event.setCancelled(true);
    }
}
drowsy helm
#

You are comparing an itemstack to material

low temple
chrome beacon
#

Use == when comparing enum values

crimson terrace
#

damn I just found the maxHealth setting in the spigot.yml, why is that like a secret? never heard of it

quaint mantle
#

Elo

brave goblet
#

What is the best way to make sure that when calculating the total percentage of doing 2 stats that if one I have eg 500% done it only limits it to 100%?

if(actualAmount > requiredAmount){
   actualAmount = requiredAmount;
}

Would this work

desert loom
#

you could use Math.min

brave goblet
#

cause the result would only return 1 number

hazy parrot
#

What do you want to do exactly?

desert loom
hazy parrot
wet breach
#

if you wanted to make sure it doesn't go over 100, then divide the number by 100, if it is 1 or greater then its above 100%

brave goblet
#

simple maths :')

brave goblet
wet breach
#

as long as the number is float, it should get you the right percentage

#

or even a double

brave goblet
#

ye i am using doubles

#

ty for the help I appreciate it ^^

fickle mist
#

Hi all! I have a question how to make it so that if an item from an ItemStack was right-clicked, for example a chest, then the opening of the chest was canceled

torn shuttle
quaint mantle
#

Is there a way to disable damage in the EntityDamageEvent ?

torn shuttle
#

cancel the event

quaint mantle
torn shuttle
#

set the damage to 0

quaint mantle
torn shuttle
#

no you don't

quaint mantle
#

If you want I can show you

torn shuttle
#

I would rather say something nice about @echo basalt than get on voice chat with you

#

and I would rather start ww3 than say something nice about him

quaint mantle
#

hää?

echo basalt
#

magma

#

I saw a guy that looked just like you at the gym

#

he was thinner than oil

quaint mantle
#

??

torn shuttle
#

how the hell did he look like me then

echo basalt
#

same face, beard

torn shuttle
#

if he did not return your look with intense disdain and hatred then he looks nothing like me

#

as it turns out game dev is a lot of work, who'd've thunk it

#

the thing that kills me the most is the art style, I am not artist and I just can't get myself to commit to anything

quaint mantle
#

i dont understand you guys

torn shuttle
#

and I don't understand how setting the damage of an event gets you an infinite loop

quaint mantle
#

get a bow and arrow

torn shuttle
#

alright I went back in time and did that 5 years ago

quaint mantle
#

shoot yourself

#

Yeah nice the arrow will "stand" on you

#

it will not disappear

torn shuttle
#

yeah no shit

#

that's what you told it to do

#

a) not an infinite loop

#

b) your fault for not removing the projectile on the damage cancel event

quaint mantle
#

but more than 1 time

#

And i only want it 1 time

quaint mantle
torn shuttle
#

try that sentence again

quaint mantle
#

you are just rude and dont understand anything bb

torn shuttle
#

@tender shard oh no I've accidentally impersonated you

quaint mantle
#

no wonder this server is dead

#

xDDD

molten hearth
#

Bro can't figure out how to cancel a single event 💀

torn shuttle
#

he ain't getting away that easy

#

meanwhile, in a different discord...

#

discord is the worst at snitching on people

molten hearth
#

😂

wet breach
#

it appears I am missing

torn shuttle
#

I hope you go on a journey to find yourself then

wet breach
torn shuttle
#

he left the server bud

#

hence me hunting him down

wet breach
#

they haven't

torn shuttle
#

is he back?

wet breach
#

if they weren't here I wouldn't be able to ping them

torn shuttle
#

seems like they're not here to me

wet breach
#

@vital notch

#

see

torn shuttle
#

uh I can't do it

#

I think discord is just pulling a discord on you

echo basalt
torn shuttle
#

also he's only on paper on my mutual servers

wet breach
#

they just left just now 🙂

#

seems I got my message in just the nick of time 😉

torn shuttle
#

no they were gone for a while, I am certain of it

wet breach
#

they weren't

#

otherwise I wouldn't be able to ping, now I can't ping 🙂

torn shuttle
#

I couldn't ping mfnalex earlier

#

I think discord is just broken

echo basalt
#

nah he's on

torn shuttle
#

I know, it was just not working

echo basalt
#

magma

#

I'm extending forward a formal invitation

torn shuttle
#

did you finally find a cliff?

echo basalt
#

for us to meet at the rap battle event next year

echo basalt
#

we'll do a couple battles

torn shuttle
#

that is not the kind of battle I was thinking of

echo basalt
#

have some mom's spaghetti

torn shuttle
#

also I am leaving this place next year

echo basalt
#

because your palms will be sweaty

#

running away from the war because you know you will lose

torn shuttle
#

I heard that loseritis is infectious and I noticed you were on this continent

#

so I'm out

echo basalt
#

🤓 axually loseritis is very infectious and I'm scared to catch it

torn shuttle
#

bud... I have bad news

#

it's terminal

#

putting you down would be a small mercy

#

shame I can't make it to the rap battle

echo basalt
#

that is the real terminal disease

torn shuttle
#

yeah sounds like you're really infectious

#

you know what they say, never meet your gods

torn shuttle
#

frostalf is determined to use every gif today

wet breach
#

it is just going along with the background theme

echo basalt
#

frostalf is determined to kill all the mobile data

torn shuttle
#

you're on mobile?

wet breach
#

should be glad these aren't even super HD gifs

crimson terrace
torn shuttle
#

if you're on mobile I have a manifesto that I really, really want you to read

#

it's about 5pb large

crimson terrace
#

is it lorem ipsum?

wet breach
#

you haven't lived long enough to have a 5pb manifesto

crimson terrace
#

I first read pb as "pebble" and I will not go back to petabyte

echo basalt
#

watch me upload a zip bomb and disguise it as logs

torn shuttle
#

they say an image is worth a thousand words so I filmed my manifesto in 8k 120fps and then converted it into raw text so illusion can read it

echo basalt
#

weird way to flex the capacity of your porn storage server but ok

torn shuttle
#

that's only 8tb I mean, what?

#

unrelated, I really like my synology NAS

wet breach
molten hearth
#

Ima be real I don't think they do

wet breach
#

ah right the hieroglyphs are fake

molten hearth
#

That's drawings get it right 😏

torn shuttle
#

words last forever unless the medium they're on rots away or people forget how to speak the language

molten hearth
#

Idk I can write something and nobody will care and it will fade away in history

#

While technically still existing

echo basalt
#

🤔

tepid flower
#

how to get note/instrument of noteblock in BlockBreakEvent?

torn shuttle
molten hearth
#

Relatable

echo basalt
#

weren't you the one asking me for nms help

torn shuttle
#

me?

wet breach
tepid flower
#

i'll give it a try.

tepid flower
errant narwhal
#

Hey is there any api or anyway make a repices unlocked on player screen with different title , icon?

#

i want to use it for my quest plugin

#

but i can't find any api for that

drowsy helm
#

Are you asking how to do a toast

#

Or make a custom recipe?

errant narwhal
#

like send a popup this messager with different title and description

drowsy helm
#

You have to use. Packets

#

No built in api on spigot for it

#

I think theres a few libs for it though

wet breach
#

probably could just make use of advancements for custom toast messages

drowsy helm
#

do advancements have the item icon?

remote swallow
#

they have a icon iirc

drowsy helm
#

oh im bugging then

wet breach
#

@errant narwhal some ideas to try out above

echo basalt
torn shuttle
#

I think I'm starting to be influenced by illusion

#

I was wondering where the package for my usb power plug was, checked amazon, amazon says they delivered

#

check the tracking number, tracking says it was delivered a month ago

#

I look under the desk, the power plug is there

errant narwhal
errant narwhal
wet breach
#

nope

#

this is where you just need to learn more about Java

#

or understand how to read and use API's

jolly gust
#

int x = 0;
for (; x <= config.getInt("menu.items_amount"); x++) {
if (slot == config.getInt("menu." + String.valueOf(x) + ".slot")) {
break;
}
}
player.sendMessage(String.valueOf(x));

1 should be sent to the player, but 0 is sent, why and how to fix it?

remote swallow
#

++x

jolly gust
remote swallow
#

you have x++ you need ++x

jolly gust
vocal cloud
#

Yup

#

Huge difference between the two

remote swallow
#

Yes

#

iirc ++x adds one then sends it x++ sends x then adds 1

jolly gust
#

I tried it, but it also outputs 0, not 1

vocal cloud
#

Get and increment vs increment and get

jolly gust
#

int x = 0;
for (; x <= config.getInt("menu.items_amount"); ++x) {
if (slot == config.getInt("menu." + String.valueOf(x) + ".slot")) {
break;
}
}
player.sendMessage(String.valueOf(x));

vocal cloud
#

Can always just start x at 1?

jolly gust
vocal cloud
#

Idk what you're doing so I can't say

wet breach
#

since x is assigned outside of the loop, the operation doesn't work the same because x isn't being overriden value wise

#

if you have x being outside of the loop the more appropriate way would be to do x=x++

#

it is the only thing I can think of unless you are not implementing it properly

remote swallow
#

or just change the for statement to for (int x = 0; x <= config.getInt("menu.items_amount"); ++x) {

vocal cloud
#

Imo just setting x to 1 is less work

glad prawn
#

Is there any method to be able to spawn custom mobs with a specific amount?. Or do I have to use a loop?

wet breach
crimson terrace
glad prawn
crimson terrace
#

would be the first time I hear about one

wet breach
crimson terrace
#

when I try to use ConfigurationSerialization for ItemStack none of the data from the ItemMeta actually goes with it. do I have to save that data myself?

#

actually, dont answer that just yet

eternal oxide
#

meta is saved from what I remember, but only in yaml

#

I do remember meta being lost when using json

crimson terrace
#

I was just not setting the meta to the item

#

my bad

#

Im using yml

#

even the pdc gets serialized

fast sedge
#

anyone can help me?

#

i am unable to access .spigot()

#

it give error

#

if i also type p.spigot()

#

@ancient plank

remote swallow
#

How do you expect us to help without any code or errors

eternal night
#

presumably some dependency is pulling in bukkit ? provide your dependency tree

ancient plank
#

don't ping staff for development or server help

fluid river
#

ItemStacks are FULLY serializable

#

with NBTs PDCs meta and stuff

#

@ancient plank can you help me with my topic

fluid river
#

set 6 hours slow mode on it

remote swallow
#

who says

remote swallow
#

i say i can

#

so

#

getfucked

fluid river
#

alr

#

set slow mode on my topic

#

6 hours

#

getfucked

timid jetty
#

Hola, does walk speed/fly speed effect how quickly you move in water

#

Also what's the default walk speed

fluid river
#

google

#

should be 0.2f

#

finally

timid jetty
#

Ty

untold jewel
#

I have a PlayerInteractAtEntity event which I use to make a Villager serve as a join npc for a minigame. However it opens a the trading window which I do not want to happen? How would I prevent this?

fluid river
#

event.setCancelled(true)

#

or just cancel all VillagerTradeEvent or how is it called

untold jewel
#

Okay thansk

#

thansk

#

thanks!!!

echo basalt
fringe hemlock
#

How do you get the bungeecord API jar?

echo basalt
#

I don't think there's an API jar in specific, bungee isn't an abstraction layer

fringe hemlock
#

I remember having one in the past, just not sure where to get it

echo basalt
#

should be in the spigot nexus repo

fringe hemlock
#

Thanks!

worldly ingot
#

Bungee does have an API module

fluid river
#

maven?

worldly ingot
#

Done via Maven, yes.

<dependency>
  <groupId>net.md-5</groupId>
  <artifactId>bungeecord-api</artifactId>
  <version>1.19-R0.1-SNAPSHOT</version>
</dependency>```
fresh timber
serene sigil
#

hi, i have a string that is a player uuid. how do i get a player by that uuid (which is a string)

eternal oxide
#

UUID.fromString

serene sigil
raw prairie
#

how might I set a radius for the user? and paste schematics within that radius?

opal juniper
wind blaze
#

how do i set new scoreboard as main scoreboard? or does that happen automatically?

wind blaze
#

im dumb its just stscreboard LOL

chrome beacon
#

Be careful so you don't break other plugins

wind blaze
#

oh you sent it too

fresh timber
#

I have a server network, and I'm gonna use an ender pearl for the game selector menu in the player's inventory. I have canceled the event when someone uses an ender pearl in a PlayerInteractEvent. When I use the ender pearl, however, It puts the little white overlay on the item slot in the hotbar. Is there any way to remove this?

#

the screen shot is kinda bad, sry, it goes so fast its hard to get a good one

crimson terrace
fresh timber
#

hm, how do I do that?

crimson terrace
#

maybe the Attack speed attribute is responsible for that?

#

not sure tho

fresh timber
#

ok

fluid river
raw prairie
#

How might I set a radius for the player?

fresh timber
crimson terrace
fluid river
#

he is 360 by default

raw prairie
fluid river
#

bro what

#

you want to place schematics around the player?

fluid river
#

and what is the problem

eternal oxide
#

He's creating rooms/maze using schematics but his server can;t handle pasting them too fast. We've told him to use worldgen/chunk loading instead but he won;lt

raw prairie
fluid river
#

just place schemtaic and that's all?

raw prairie
#

IT doesn't work

fluid river
#

one behind one forward

#

one left one right

#

idk

raw prairie
#

yep

#

thats about it

fluid river
#

depends on how big schematic is

eternal oxide
#

Of course it works. You want every new chunk spawned to be a room. How do you think normal chunks are spawned?

raw prairie
eternal oxide
#

If your server can handle generating normal chunks then generating a 16x16x16 as worldgen is tiny

crimson terrace
#

unless you make it very very inefficient, yes

fluid river
#

there is no need for radius to fix your problem

raw prairie
fluid river
#

you can use my Void generator guide

#

and isntead of air just place blocks where needed

crimson terrace
fluid river
#

for each chunk in generator

eternal oxide
#

it's literally 1 16th of the server load to generate rooms rather than full chunks

eternal oxide
#

The way you are tryign to do it is adding more work for the server to do instead of making it simpler.

#

you are making the server generate a chunk, overwrite the chunk with your room

#

instead you shoudl be replacing teh world gen with placing yrou room

#

oh and on top of the extra work load you are using WorldEdit to paste yoru schematics

raw prairie
#

Unless theres a better solution

eternal oxide
#

use worldgen and you will actually increase the performace of yoru server

eternal oxide
#

good plan

fluid river
#

instead of my surface method do your own realization which pastes blocks

#

if you also want some biome

#
wc.biomeProvider(new NetherProvider()); // Here is biome provider we need to create```
raw prairie
tardy delta
#

Collections.singletonList :(

raw prairie
#

@fluid river

fluid river
#

?

raw prairie
#

with noise?

fluid river
#

you need surface

#

not noise

nimble lichen
#

I'm trying to convert my project to maven but I am having trouble with nms. Maven in intellij cannot find "org.spigotmcspigot1.16.5-R0.1-SNAPSHOT". I have run the buildtools with the mappings flag and supposedly this would put the mappings into my local maven repository.

raw prairie
#

instead of your surface thing

fluid river
#

remove my loop

#

in the method

raw prairie
#

did that

fluid river
#

well now you can work around x and z of chunk

#

which are given as parameters

raw prairie
#

so

fluid river
#

and any random y you want

raw prairie
# fluid river and any random y you want

so try (EditSession editSession = WorldEdit.getInstance().newEditSession(world)) { Operation operation = new ClipboardHolder(clipboard) .createPaste(editSession) .to(BlockVector3.at(loc.getChunk().getX() * 16 + , 40, loc.getChunk().getZ() * 15 + 8)) .build(); Operations.complete(operation); }

fluid river
#

instead of loc.getChunk() you now have chunkdata

raw prairie
eternal oxide
#

Don't use worldedit inside a worldgen. It will attempt to use getChunk which is not safe

fluid river
#

true tho

#

you can just place blocks

#

without schematic

raw prairie
eternal oxide
#

I think Bukkits Schematics are fine to use in worldgen

raw prairie
fluid river
#

data.setBlock(x, y, z, Material.STONE);

raw prairie
fluid river
#

depends

#

you can have several schematics

#

and place random one using random int

raw prairie
fluid river
#

bukkit

raw prairie
#

k

fluid river
#

i basically stored X,Y,Z,Material in a string

#

and all of the strings in string list

raw prairie
fluid river
#

and the string list in a schematic.yml file 🙂

raw prairie
#

I cant find it

fluid river
#

and then manually built locations from strings and placed blocks

raw prairie
raw prairie
#

Its kinda confusing

eternal oxide
#

as you have all yrou rooms as schmatics you may be better off reading those, but not using worldedit

raw prairie
eternal oxide
#

no

#

The way I'd do it is convert all your current schematics to structures and use teh Bukkit API to paste them in yoru worldgen

eternal oxide
#

The StructureManager is how you create/load/save Structures

raw prairie
eternal oxide
eternal oxide
#

converting would be easy

#

you can already place them with worldedit.

raw prairie
eternal oxide
#

so place with worldedit, then use StructureManager to create a Structure, fill (copies the block data) and StructureManager to save it

raw prairie
#

Im still extremely confused

eternal oxide
#

look at teh two javadocs I pasted

raw prairie
#

So place it one time

serene sigil
#

what event triggers if u do /reload?

raw prairie
#

so

createStructure()

tardy delta
eternal oxide
#

yes, Bukkit.getStructureManager().createStructure() gives you a blank Structure Object

tardy delta
#

you know the server is reloading by seeing if worlds.size() > 0 in JavaPlugin::onLoad

eternal oxide
#

Then use the returned structure to fill

serene sigil
raw prairie
serene sigil
#

like to reload the plugin

tardy delta
#

maybe in paper

serene sigil
# tardy delta none

cuz always if i reload my list gets reset and it gives all players free 100 levels 😳

tardy delta
#

my plugin breaks too on reloading

#

just put Runtime.getRuntime().halt() /j

#

people will do everything to reload their server

#

same thing like using 1.8

eternal oxide
#
Structure newStructure = Bukkit.getStructureManager().createStructure();
newStructure.fill(loc1, loc2, false);
NamespacedKey key = new NamespacedKey(...);
Bukkit.getStructureManager().registerStructure(key, newStructure);
Bukkit.getStructureManager().saveStructure(key);```
raw prairie
glossy venture
#

just make those coordinates and a world into a location object

eternal oxide
#

There are two fill methods

#

one takes two Locations, the other takes an origin Location and a vector length

#

you would probably use the second

serene sigil
eternal oxide
#

fill(loc1, new BlockVector(x,y,z), false)

quaint mantle
#

hi, I have a question ... I have a hub with spigot and obviously a bungee connected ... I am learning to do pl bungeecord and therefore, I was told that for a pl for example for the hub I have to do it entirely in bungee, but can I put the bungee pls in the plugins folder of the hub in spigot? otherwise what's the point, I can't put it in the bungee otherwise it affects all modes

#

I have to do them in bungee for connections to modes

#

with compass

raw prairie
tardy delta
#
if (Bukkit.getBukkitVersion().split("-")[0].split("\\.").equals("8")) {
  System.out.println("ew 1.8 im outta here");
  Runtime.getRuntime().halt();
}```
raw prairie
alpine urchin
#

that violates GPL

#

@tardy delta

raw prairie
#

@eternal oxide

tardy delta
#

dunno what gpl is so dont yell at me

#

🤡

serene sigil
#

wait what does that do?

raw prairie
#

@eternal oxide is this right?

tardy delta
#

dont try it on a server you want to keep playing on ig

raw prairie
#

trying to generate rooms

tardy delta
#

TimeUnit.HOURS.sleep(1)

#

and then sysout smth like hold on

undone axleBOT
raw prairie
#

Trying to generate the backrooms..

#

having trouble with the chunkgenreator

#

class

eternal oxide
# raw prairie

no the generate surface method is for generating the world. The code I gave you is how you copy your schematics to Structure types

#

What you want to do is use the void generator.

#

then after the void is generated, place your structure

#

That removes all generation code so its super fast

#

and 1 tick later pastes in the Structure

quaint mantle
#

hi, I have a question ... I have a hub with spigot and obviously a bungee connected ... I am learning to do pl bungeecord and therefore, I was told that for a pl for example for the hub I have to do it entirely in bungee, but can I put the bungee pls in the plugins folder of the hub in spigot? otherwise what's the point, I can't put it in the bungee otherwise it affects all modes
I have to do them in bungee for connections to modes
with compass

raw prairie
#

so where might I put ``` Structure newStructure = Bukkit.getStructureManager().createStructure();

        NamespacedKey key = new NamespacedKey(loc1, new BlockVector(60,40,60), false);
        Bukkit.getStructureManager().registerStructure(key, newStructure);
        Bukkit.getStructureManager().saveStructure(key);  ```
#

@eternal oxide

eternal oxide
#

you use that to convert yrou current schmatics to Structures

#

and thats not how you create a NamespacedKey

raw prairie
#

;-;

eternal oxide
#

public Structure generateStructure(Location loc, String name) {
  NamespacedKey key = new NamespacedKey(plugin, name.toLowerCase());
  Structure newStructure =   Bukkit.getStructureManager().createStructure();
  newStructure.fill(loc, new BlockVector(16,16,16), false);
  Bukkit.getStructureManager().registerStructure(key, newStructure);
  Bukkit.getStructureManager().saveStructure(key);
  return newStructure;
}```
raw prairie
eternal oxide
#

thats just a util method to create and save a Structure

#

of size 16 at teh provided loc

raw prairie
tardy delta
#

varchar max brr

raw prairie
opal juniper
eternal oxide
raw prairie
#

for player loc

eternal oxide
#

that method is just a step for converting yoru schematics to Structures

tardy delta
eternal oxide
#

ie, paste in your current schematic (at loc) call that method to copy it/save to a Structure file

raw prairie
#

so I have to do it in game

#

someoh

#

at 16, 16, 16?

#

is that corect/

eternal oxide
#

at whatever location you want

raw prairie
#

k

#

ill do it at 16, 16, 16

eternal oxide
#

you just need to convert all yoru current schematics to Structures

#

be sure to remember the names you give each Structure

tardy delta
#

new english word?

#

inventing smtg new every day

opal juniper
raw prairie
crimson terrace
eternal oxide
#

if it's 1 block short you can't have got the loc or the vector quite right

#

paste at 0,0,0

#

simplest

raw prairie
remote swallow
#

its got an offset on the schem im guessing

eternal oxide
#

looks like

#

you offset when you copied the schematic

#

so paste at -1 in whatever direction its off

remote swallow
#

-1 0 -4 i would guess looking at that

eternal oxide
#

but be sure to save the Structure at 0,0,0

remote swallow
#

i was correct lmao

#

stand at -1, 0 -4 then paste the schem

#

should paste exactly at 0, 0

raw prairie
raw prairie
#

FOV go brr

remote swallow
#

that looked like 4

#

-1 0 -3

eternal oxide
#

once you get it correct, load each of your schematics one by one, and save as Structures, giving each its own name

alpine urchin
#

quake pro

nimble oxide
#

Why isn't this working?

package com.marqus.cubicscoreboard;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.*;

public final class CubicScoreboard extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(this, this);

    }

    @EventHandler
    public void onJoin(PlayerJoinEvent e) {

        Player player = e.getPlayer();

        createBoard(player);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
public void createBoard(Player player) {
    ScoreboardManager manager = Bukkit.getScoreboardManager();

    Scoreboard board = manager.getNewScoreboard();

    Objective obj = board.registerNewObjective("FangeBoard", "dummy");
    obj.setDisplaySlot(DisplaySlot.SIDEBAR);
    obj.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&a&lCUBIMC &8-  &f&lPRISON"));


    Score name1 = obj.getScore(ChatColor.translateAlternateColorCodes('&', "&7Dit navn &8»"));
    name1.setScore(3);

    Score space = obj.getScore("");
    space.setScore(2);


    Score name = obj.getScore(ChatColor.translateAlternateColorCodes('&', "&a" +  player.getName()));
    name.setScore(1);


    player.setScoreboard(board);


    }
}



I am using 1.8 I know I should update to a higher version, but I am keeping 1.8

crimson terrace
#

Ok there, ima just ask because all other people here are probably tired of it. What is not working

nimble oxide
crimson terrace
#

how do you know its not working?

nimble oxide
#

No errors, but the sidebar is not just showing up.

crimson terrace
#

are you reloading the server?

nimble oxide
#

Yes

#

Restarting it

crimson terrace
#

maybe put it on a delayed task

raw prairie
#

@eternal oxide

#

its at 0 0 0 exactly

nimble oxide
crimson terrace
#

when a player just joined they may not receive the Scoreboard correctly

#

The bukkit scheduler

nimble oxide
#

Ehhh

crimson terrace
#

?schedule

#

?scheduler

#

what was the command?

eternal oxide
remote swallow
#

?scheduling

undone axleBOT
crimson terrace
#

ah

raw prairie
crimson terrace
raw prairie
#

is that fine?

eternal oxide
#

no

#

you need the full schematic showing

raw prairie
#

but this is a multi y level schematic

eternal oxide
#

so if it's 16 tall paste it at 0,16,0

#

each schematic is 16 tall yes?

#

I'm assuming you have a seperate schematic per room type

eternal oxide
#

Well I have no idea how yoru schematic is setup

#

What do you mean by it's a multi level?

#

if it's just 16 tall then paste it at 0,16,0

raw prairie
#

Ok I did that

#

What now

eternal oxide
#

ok, now call that method I gave you using the correct values

eternal oxide
#

if it's 7 tall then change teh size in the BlockVector too

eternal oxide
#

yep, pass a Location of 0,7,0 and a Vector of 16,7,16

nimble oxide
crimson terrace
#

Try the Bukkit.getScheduler.scheduleSyncDelayedTask method

raw prairie
# eternal oxide yep, pass a Location of 0,7,0 and a Vector of 16,7,16

public Structure generateStructure(Location loc, String name) {
Location loc = (0,0,0)
  NamespacedKey key = new NamespacedKey(this, name.toLowerCase());
  Structure newStructure =   Bukkit.getStructureManager().createStructure();
  newStructure.fill(loc, new BlockVector(16,7,16), false);
  Bukkit.getStructureManager().registerStructure(key, newStructure);
  Bukkit.getStructureManager().saveStructure(key);
  return newStructure;
}```
nimble oxide
#

so this:

#

BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLater(plugin, () -> {
Bukkit.broadcastMessage("Mooooo!");
}, 20L * 30L /*<-- the delay */);

eternal oxide
#

runTaskLater if you don;t want deprecated

raw prairie
#

Pseudo code rn on my phone

crimson terrace
eternal oxide
crimson terrace
eternal oxide
#

actually using a negative vector is probably a good idea

eternal oxide
#

as it will cause the Structure to be placed from bottom up, meaning no chance of things like sand falling

#

so saving the structure using loc (0,0,0) and vector (16,-7,16)

#

and whatever name you want

#

all lower case

#

the resulting Structure file will be saved into your world folder

eternal oxide
#

Then you can write your code

#

the simplest is to use teh void generator you were given earier

raw prairie
eternal oxide
#

?

#

The simplest implementation...

#

use the void generator (without any modifications)...

#

add a ChunkLoadEvent listener

crimson terrace
eternal oxide
#

in that is isNewChunk() use the StructureManager to get yoru Structure and place at teh chunk coords

eternal oxide
#

what do you mean>?

#

are you trying to save the structure or what?

eternal oxide
#

I gave you the full method to save it

nimble oxide
raw prairie
# eternal oxide I gave you the full method to save it

public Structure generateStructure(Location loc, String name) {
Location loc = (0,0,0) //this part gets an error
  NamespacedKey key = new NamespacedKey(this, name.toLowerCase());
  Structure newStructure =   Bukkit.getStructureManager().createStructure();
  newStructure.fill(loc, new BlockVector(16,7,16), false);
  Bukkit.getStructureManager().registerStructure(key, newStructure);
  Bukkit.getStructureManager().saveStructure(key);
  return newStructure;
}```
eternal oxide
#

you pass the Location to the method

#

you don;t set it in the method, and thats not valid anyway

#

also if using 0,0,0 don;t forget to change the vector to -7

crimson terrace
raw prairie
# eternal oxide you pass the Location to the method

  public Structure generateStructure(String name) {
        NamespacedKey key = new NamespacedKey(this, name);
        Location loc = (0, 0, 0);
        Structure newStructure =   Bukkit.getStructureManager().createStructure();
        newStructure.fill(loc, new BlockVector(16,-7,16), false);
        Bukkit.getStructureManager().registerStructure(key, newStructure);
        Bukkit.getStructureManager().saveStructure(key);
        return newStructure;
    }```
#

still an error at

#

Location loc = (0, 0, 0);

nimble oxide
eternal oxide
#

thats not how you create a Location

raw prairie
eternal oxide
#

new Location (worldName, 0,0,0)

crimson terrace