#help-development

1 messages · Page 814 of 1

slender elbow
#

what even is the problem lol

river oracle
#

I'm put of btd6 monkey momwy 😭

umbral ridge
#

can you make a gui slot with an item not display anything on hover

#

or there has to be something, eg. empty space

young knoll
umbral ridge
#

what is it

#

I need to do it with a plugin

river oracle
#

You'll need a resource pack

#

With shaders

umbral ridge
#

ok nvm xD

river oracle
#

That hover info is client sided

umbral ridge
#

yeah

river oracle
#

Resource packs can be applied with plugin though idk the big deal

young knoll
#

and 1.20.3 allows stacking them

#

woo

river oracle
#

Woooo

umbral ridge
#

easiest way to set an item on gui edges?

#

for loop sounds 😣

young knoll
#

Probably a for loop

#

With a bit of math

umbral ridge
#

are you good at math

#

🤓

young knoll
#

Well, you always want to set the first 9 and the last 9

#

And then you only want to set slots where slot % 9 = 0 or slot % 9 = 8

umbral ridge
#

thanks

#

:D

tranquil dome
#

Is it possible to show a map to a player without the map being in their inventory?

quaint mantle
#

No

river oracle
young knoll
#

eh?

tranquil dome
young knoll
#

no

twilit roost
#

InventoryMoveItemEvent doesn't seem to fire when I transfer items between inventories

eternal oxide
#

pretty sure thats not for players moving items

molten hearth
#

I am once again asking if any epic pro knows how to intercept/change a block's breaking sound (when hit, not when broken)

twilit roost
eternal oxide
#

if its for Players it will generally say Players

young knoll
eternal oxide
#

Entity refers to everything else

young knoll
#

Moving items is just click/drag events

twilit roost
#

ooh
thanks

slim elbow
#

Hello, I am using hikari to handle connections to mysql db, I am running 4 servers and all of them connect to the db and work really well with it but once I try to launch 5th server, it starts throwing such error https://i.postimg.cc/pdGkQLh2/2023-12-01-174332.png

HikariPool-2 - Starting... [16:39:10] [Server thread/ERROR]: HikariPool-2 - Exception during pool initialization. com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections" at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_392]...

grand flint
#

Literally tells you the issue

shadow night
#

Indeed

slim elbow
#

I do not really understand what is supposed to be max amount of connections in this case

grand flint
#

Probably? Maybe hikari needs a plan, I don't use hikari

#

Try and see

eternal oxide
#

You are probably not returning connections to the pool after use

eternal oxide
#

not closing connections

grand flint
slim elbow
#

Like this?

eternal oxide
#

yes

umbral ridge
#

dont tell me you cant get a list of permissions for an offline player

#

bullshit

eternal oxide
#

no

umbral ridge
#

that sucks

#

it should be possible

eternal oxide
#

many factors affect what permissions a Player has, such as world, area, even time of day

#

if they are offline they are not in any world

umbral ridge
#

thats kind of fucked up XD

river oracle
#

feel free to PR more offline player API

#

PRs are always welcome <3

eternal oxide
#

if you directly query the permission plugin you can get the perms for the player in a specific world

#

or query Vault

umbral ridge
#

hmm

zenith gate
#

How can I create a LivingEntity from a class?

eternal oxide
#

there are many things which are LivingEntities

zenith gate
#

Yeah that's what I am trying to do, I have a function that will create and spawn my mobs based of a class of values. I can pass the entity I want. I don't just want LivingEntities, so I am using the Entity class and any sub classes of that.

I just need what the entity is, so I can create it. so if a creeper is passed I'll spawn a creeper with the values, at the location provided.

eternal oxide
#

World#spawn

zenith gate
#

that'll work thank you.

umbral ridge
eternal oxide
#

yes

umbral ridge
#

ok very nice NICE

#

is this the correct way to add vault dependency in pom.xml

rotund ravine
#

You probably also need to excluse bukkit

#

And add the repo

umbral ridge
#

yeah i forgot now works

umbral ridge
#

it builds but i dont see net.milkbowl package

eternal oxide
#

you add vault to the server

#

its its own plugin

#

add it as a depend in plugin.yml

rotund ravine
#

Does it still have the stupid old ass bukkit api dependency?

eternal oxide
#

its a service provider

#

Look on the github page and it shows an example of how to implement it

umbral ridge
eternal oxide
#

scroll down to implementing Vault

#

you only need the permissions part

#

not chat or eco

umbral ridge
#

Yeah I'd do all of that already if It would find vault

#

no milkbowl

#

nvm forgot to click

native bramble
#

with which metods i can avoid using Block get.relative method?

rotund ravine
#

Why?

native bramble
#

im using blockpopulator

#

and guys said that i dont need to use Chunk methods

#

only use LimitedRegion methods

#

and another guy said, that i also shouldnt use Block methods

#

but i need to check is it air near the block

#

i im trying about hour to find smthing

#

but cant

#

i find how to getMaterial of block

#

avoid using Block methods

#

ohh im stupid

umbral ridge
#

So with net.milkbowl.vault.permission how can I retrieve players list of permissions

#

I dont see a function for it

native bramble
#

i find a way

#

sry

dry hazel
#

you can do getType with your coords on the RegionAccessor yea

native bramble
#

no

#

i know how to get type

#

i need to get near blocks

dry hazel
#

you want to do something like a getRelative with a block face?

native bramble
#

yeah

eternal oxide
#

don;t

dry hazel
#

blockface has coordinate offset getters on it iirc, you can use that to shift your coords

eternal oxide
#

use LimitedRegion and you can check with getType using the x/y/z

native bramble
rotund ravine
eternal oxide
#

just make SURE it's isInRegion

native bramble
eternal oxide
#

if you are messing with x,y,z you could move outside your region

native bramble
#

so if block is in region i can use Block.getRelative?

eternal oxide
#

no

native bramble
#

ohh

#

i understand

eternal oxide
#

getType

native bramble
#

i also need to check if it in region

eternal oxide
#

check if IsAir

umbral ridge
#

then how can I check if offline player has a permission homes.limit.<number>, number can be anything from 1 to 28. should I just create a for loop and do "homes.limit.<i>"? XD and in each loop check if they have it

eternal oxide
#

you have access to BlockData

#

and States

native bramble
#

yes

valid burrow
#

am i misisng something? what is wrong with this sql syntax MySQL server version for the right syntax to use near 'WHERE id = '1138378079409033246'' at line 1

umbral ridge
#

Also, since the player is offline, there is no other function that does the same as this one (picture) and I'm wondering if it will still return true if player has a permission I'm looking for but it's not explicitly set to a world but is allowed everywhere.

valid burrow
#

i had the same problem

#

the way i used

#

is imported luckperms api

#

and

#

checked it with that

valid burrow
#

its a bit complicated but works

#

let me find it rq

eternal oxide
#

If it's allowed in all worlds then it returns true

umbral ridge
#

Yeah but I don't want to use it I mean I want to make it support different permissions plugin

eternal oxide
#

Don't implement a specific permission plugin API

#

Native bukkit perms or vault

#

Vault if you want Offline

valid burrow
#

id just implement all popular permissons plugins

eternal oxide
#

and wildcards

umbral ridge
#

how would you solve it

eternal oxide
#

explain your problem

#

I've not seen one

valid burrow
#

getting offline players permissons

eternal oxide
#

I already told him how to get offline permissions

umbral ridge
umbral ridge
eternal oxide
#

you don;t get ALL permissions

#

you test what you need

umbral ridge
#

well what if my permission is dynamic

#

homes.limit.<ANY NUMBER>

eternal oxide
#

then use a wildcard

#

homes.limit.* would return true for any

umbral ridge
#

but then I also need to get the number

valid burrow
#

general question

eternal oxide
#

does vault have a getInt?

valid burrow
#

why dont u use a database for this?

umbral ridge
#

so my idea was to go from 1 to 28 which is basically the max number, with a for loop and in each loop check playerHas and the permission would be homes.limit.<i>

#

I mean that would work but it would look really dumb

valid burrow
#

a for loop doesnt look dumb

eternal oxide
#

what do you need to specific number for?

valid burrow
#

i still say u just use a database xd

umbral ridge
#

So I have a homes GUI that displays player homes, and on top middle there's this item that shows you how many homes you've already created and the max homes you can create. and so when I'm making an inventory in the code, I add a lore to this item, which says something like "You have {homes}/{homesMax}" or if you type /homes <player> it's a bit different, it'll show "{player} has {homes}/{homesMax}".

valid burrow
#

dont use permissons for stuff like this?????

rotund ravine
#

It makes sense vosss

eternal oxide
#

then as they are offline and you can;t use effective permisions you' would first check if they have a wildcard (so some value) then loop to find it

valid burrow
rotund ravine
#

Yes

#

It’s fairly common practice actually

umbral ridge
eternal oxide
#

it's just 28 contains for a string

#

or equals even

umbral ridge
rotund ravine
#

He snswered that

#

Though you should just pass mainworld

umbral ridge
#

Oo I see great

eternal oxide
#

or null

rotund ravine
#

Null works

native bramble
#

why is region.blockState().setType(ORE_MATERIAL); might not work?

#

i have 0 errors

#

and code after this stroke working

eternal oxide
#

because a BlockState needs to be updated

#

not sure if thats safe in a populator though

#

try it

native bramble
#

i iwll try

#

thank u

#

never worked with blockstate

#

not working

#
region.blockState().setType(ORE_MATERIAL);
region.blockState().update();
eternal oxide
#

nope, each time you call blockState you get a new state

native bramble
#

oh

#

so i need to initialize a variable?

eternal oxide
#

yep

native bramble
#

ty

eternal oxide
#

get state

#

change state

#

update state

molten hearth
#

the code i used for the sounds is ```java
SoundGroup soundGroup = customBlock.getMaterial().createBlockData().getSoundGroup();
Sound hitSound = soundGroup.getHitSound();

block.getWorld().playSound(block.getLocation(), hitSound, soundGroup.getVolume(), soundGroup.getPitch());```

native bramble
#
BlockState regionBlockState = blockState();
regionBlockState.setType(material);
regionBlockState.update();```
not working
eternal oxide
#

no clue then

undone axleBOT
glad prawn
#

OfflinePlayer dude

umbral ridge
minor junco
umbral ridge
#

if you've got a better solution by using permissions, please post it here and I'll take a look thanks

lofty badge
#

guys, can i show my current project in gui (wpf + c#) here?

minor junco
umbral ridge
#

with permissions

minor junco
umbral ridge
#

I don't want to use unlimited numbers of homes, 28 is the maximum

#

Storing homes in a separate file would be the dumbest idea I have ever heard, permissions are there to be checked, I'm using Vault for it

minor junco
umbral ridge
#

It is a one-paged GUI with a list of homes

#

I store homes (location, name) in a per-player config

minor junco
umbral ridge
#

Storing a maximum amount of homes can differ per player also, I dont see a point in handling all of that when I can just read the players permissions

minor junco
#

Also if you start the iteration with 28 and subtract you can break the forloop early without having to iterate over each possible combination even tho the result won't change

#

Resulting in a more efficient loop

umbral ridge
minor junco
#

Imagine a player has 20 max homes, now you iterate 28 times even tho 20 is the maximum

#

You get what I mean

umbral ridge
#

That I agree, I can make a function that returns when it finds a permission

#

or if it doesn't, it exists the for loop and returns 28 instead

#

but I don't think there's going to be much difference

#

at least noticable to human

minor junco
#

No it's not but it's just simple things that make your code more efficient, just trying to help

umbral ridge
#

I appreciate your help thanks

minor junco
# umbral ridge I appreciate your help thanks

similiar to this (ofc refactor it to your needs):

int maxHomes = 28;
for (; maxHomes >= 0; --maxHomes)
  if(/* has Permission */) break;
if (maxHomes == 0) maxHomes = 28; // default
rough drift
lofty badge
#

guys, maybe who coding on wpf (c#):
how i can make custom checkbox?

umbral ridge
#

?whereami

devout kite
#

Hey i can not find the mistake.
Error:```java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "de.zyrox.Main.getCommand(String)" is null

```OnEnable:
        getCommand("homecrate").setExecutor(new CreateCommand());
CreateCommand Class:
public class CreateCommand implements CommandExecutor {

    @Override
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
        Player player = (Player) commandSender;
        if(player.hasPermission("Homes.create")){
            Block block = player.getTargetBlock(null,5);
            Location location = block.getLocation();
            player.sendMessage(block.getType() + " " + location.getY());
        }else player.sendMessage(Main.prefix + " Du hast keine Rechte hierfür!");




        return false;
    }

could you pls help me with that?

#

foud it had a typo

hushed spindle
#

i have concluded World#locateNearestStructure() is terrible

#

yes it locates a structure, but it completely ignores the radius parameter

#

does anyone have a different method to check if a structure is present within a given radius

native bramble
worldly ingot
#

Note that that radius is in chunks, not blocks

hushed spindle
#

yes im using chunks

#

i gave 8 chunks in this case and it still found an ancient city 450 blocks away

#

i also specified to not include unexplored structures and this it seems to be ignoring also

#

seems that two of the method's parameters are at least conditionally ignored

#

i did it again (2 chunks) and it found a jungle temple well over 1000 blocks away

quaint mantle
#

how can I translate exceptions with a database

#

I read online, and the article said "IOException" is too low level

#

is that even true

hushed spindle
#

why

river oracle
quaint mantle
#

so

#

if I have something like this

#

are these acceptable exceptions

quaint mantle
# quaint mantle

I might remove throws NoSuchElementException and just include them in docs

dry hazel
#

that doesn't even do anything iirc, since NSE is an unchecked exception

quaint mantle
#

ya that's why I suggested that for myself

worldly ingot
#

You have to think of it more this way - do you want to force callers to handle a checked exception? If so, mark it as throws

#

I would also remove it from get() because it seems a little unnecessary

glossy venture
#

ez database library lets go this might be the first project that has actually gone to plan

glossy venture
#

oh true

lost matrix
#

But still a cool project from what ive seen

glossy venture
#

oops accidentally pushed this

glossy venture
lost matrix
glossy venture
#

also it caches shit locally so its not just query abstraction ig

lost matrix
#

Do you cache using caffeine?

glossy venture
#

no idea what that is

#

oh ic

lost matrix
#

A caching library

glossy venture
#

no but i could abstract the caching as well

#

and make that an option

lost matrix
#

Abstract everything. Start with Atomos. The smallest possible component.

glossy venture
#

ight got it let me just abstract java.lang.String

ancient plank
#

owo

#

Things that make my database experience easier my beloved

glossy venture
#

@lost matrix pls give me a better name for this method

#

ig doubleBacked is redundant with MappedList

#

but still sounds weird

glossy venture
#

im reinventing the wheel for like the 6 millionth time it probably looks like 7 billion other libraries

grim hound
#

how are the

#

PlayerInventory#getContents

#

numerated

#

like the hotbar indexes

lost matrix
grim hound
glossy venture
#

i assume

#

right

grim hound
young knoll
#

I believe hotbar is 0-8

grim hound
#

method

#

as well?

glossy venture
#

fuck

#

caffeine is java 11+ only

eternal night
#

The future is now old man

glossy venture
#

doesnt really matter bc i cant see this being very fast

umbral ridge
#

so when I teleport the player this pops up

#

and chunks are loaded since it's like 10 blocks away, I don't really understand why it comes to this

I'm using player.teleport()

floral kindle
#

Is it possible to use base64 in object[]?

eternal night
#

like three view creations and then your normal iter

hazy parrot
#

but having array of object already seems odd

glossy venture
floral kindle
#

I'm making an application to open csv files that are in base64!

eternal night
#

up to impl detail I presume

floral kindle
eternal night
#

not that iterator is gonna be the wildest thing out there anyway if you are searching for performance

glossy venture
#

very true

#

but id say ArrayList.iterator() is probably comparable to for (int i = 0; i < l; i++) ... if you removed all the other shit in the iterator

#

which i might do

#

rn

#

custom iterator

eternal night
#

save yourself the hastle and just fastutil ?

#

isn#t that exposed in the API anyway ?

#

eeeh might be paper

glossy venture
#

this isnt for spigot specifically but i could make a fastutil cache impl

eternal night
#

I mean, their ArrayList iterators are literally just index counting up

#

which I guess is what you were after

glossy venture
#

this is unsafe as shit but idk

#

ill make it thread safe later

eternal night
#

famous last words

worldly ingot
#

Why aren't you just returning list.iterator()?

glossy venture
#

no idea

#

ima use a concurrent linked queue tho bc it needs to be thread safe and locking the whole object is probably not the best idea

#

iterator is probbaly slow ash tho but whatever

minor junco
glossy venture
#

oh true i need to start at -1 and do ++i

minor junco
#

use i < size

#

Instead of size - 1

glossy venture
#

but i removed that code already

glossy venture
#

ig that works if you leave the other code

#

like postfix ++

minor junco
#

yh

slender elbow
eternal night
#

🪄 implementation detail 🪄

slender elbow
#

i love relying on implementation details !!!!!!!!!!!!!!!!

eternal night
#

Thank god you don't design APIs monkaphew

slender elbow
#

i don't design apis

#

i only expose implementations

glossy venture
#

same

#

i love exposing collections in my code

#

just like 7smile7

lost matrix
lost matrix
slender elbow
dry hazel
#

no

glossy venture
#

i like having a white name

slender elbow
#

hmm

glossy venture
minor junco
#

Sounds the same

slender elbow
#

yeah i think im fucked either way

remote swallow
slender elbow
remote swallow
#

md

minor junco
#

Say a lighter tone is what I prefer

remote swallow
#

send md 100 dollary doos

#

what in the fuckin shit

clear raptor
#

Does anyone knows if there is a way to use native Minecraft LootTable system? I have a few dozens of loot_tables from resourcepack and I want to use them to generate loot on Spigot server. Afaik I cannot access those internal methods of net.minecraft to parse my JSON and then execute the loot table to create loot?

#

Or can I?

clear raptor
#

Thats not what I am lookin for. Thats only for native loot tables or loot tables written in code. I am aiming to use existing JSON loot tables from resourcepack I have.

#

I was making them few years back and those loot tables are huge. I do not want to rewrite all of them in different format 😄

chrome beacon
#

Just load them with a datapack first

clear raptor
#

ohhhh... I totally forgot about datapacks on server 😄

molten hearth
molten hearth
remote swallow
#

burger

molten hearth
#

By holding down the destroy button while the player is within range of the target block and while selecting the block, the player's hand begins swinging, making a repetitive "thump" sound as the player hits the block, and cracks appear on it while being broken.

#

does anyone know the actual delay between sound plays

#

or does the client wait until the sound has finished playing

molten hearth
#

nuh uh

glossy venture
#

ok i just realized the fucking counter in the lore is broken bc editing lore sucks but ignore that

quaint mantle
#

is it even beneficial to abstract data classes

#

like if I had an Animal class with fields like name, age, breed

hazy parrot
#

if you would later have multiple animals which share those fields, sure

ivory sleet
#

Altho I’d never go for that design

quaint mantle
#

I mean like

#

into interfaces

ivory sleet
#

Yea that shits hella lit

quaint mantle
#

u fr?

ivory sleet
#

Myeah

#

Interfaces are so good

#

I mean its NOT NECESSARY ofc

#

But I find it lit

hazy parrot
#

IAnimal brain_expand

quaint mantle
#

AnimalImpl

molten hearth
#

what is the best way to check if a block would be in a player if placed there

#

i was thinking uhh

#
blockBoundingBox.overlaps(playerBoundingBox)```
#

but nuh uh

minor junco
#

i mean yes

molten hearth
#

well apparently not because thats returning false where it should be true

#

oh wait

#

i think im using the wrong block rofl

minor junco
#

yes

molten hearth
#

yeah idk it seems like it aint working lol

#

i have uh

#
Block[76, 79, 17]
Player[76, 80, 17]```
#

and when using java BoundingBox blockBoundingBox = currentBlock.getBoundingBox(); BoundingBox playerBoundingBox = event.getPlayer().getBoundingBox(); if(blockBoundingBox.overlaps(playerBoundingBox)) { return; }

#

its returning false

minor junco
#

what is currentBlock

molten hearth
#

the block with the position i just sent

#

or you mean the material or smth

#

because the material is air

minor junco
#

whats the bounding box of the block

#

must be offsetted 0 0 0 1 1 1

#

cause then ofc it will return false

slender elbow
molten hearth
minor junco
#

79->80 does not overlap with 80->81.799

#

yeah because air has no bounding box

molten hearth
#

amazing

minor junco
#

i mean quite obvious huh

molten hearth
#

i mean a block of air should have a block bounding box imo but thats just me

#

well how else should i check if a player is occupying the space then if there's no bounding box for air

minor junco
#

?xy

undone axleBOT
minor junco
#

thats an xy problem

#

what do you want to achieve initially

molten hearth
#

checking if a player is occupying a space

#

lol

minor junco
#

i mean this answer will always be yes

molten hearth
#

im manually setting a block at a point in the world where id rather if there isnt a player

minor junco
#

a player always has a bounding box since a player is always occupying space

minor junco
molten hearth
#

but you just told me air has no bounding box

#

im not gonna set the block if there's a player there 😭

#

bc then the player gets pushed down and has a funni animation

minor junco
#

so at some point you place a block randomly in the world

#

and that block is air?

molten hearth
#

im not placing it randomly

young knoll
#

BoundingBox.of(Block)

molten hearth
young knoll
#

Makes a full block sized bounding box

molten hearth
#

tldr im trying to prevent this

minor junco
#

you could try that

molten hearth
#

thanks lol

minor junco
#

it applies a block boundingbox to a block you give

#

so offset of 1 1 1

molten hearth
#

and if the block is air does it still work or shoot itself

minor junco
#

should work

#

i think it returns the location + offset of 1 1 1 on the max values

molten hearth
#

thankz

minor junco
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

visual laurel
minor junco
#

yh

native bramble
#

how can i add to some block which will generate in world custom texture?

odd adder
native bramble
#

i will try to use rp + display entity

livid jay
native bramble
#

i need to create textures for custom ore

#

i know about block states but want to try display first

torn shuttle
#

just what I needed to make working on this resource pack math more interesting, a migraine

upper hazel
#

Does anyone have any ideas on how to make the location search more customizable using this algorithm so that, for example, the range does not include coordinates from 500 to -500 (the center is 0)
https://paste.md-5.net/anagafikew.cpp

#

adapt to this #minimum and maximum coordinates (not less than 0!)
xMin: 500
xMax: 2000
zMin: 500
zMax: 2000

hushed spindle
#

i found a typo

#

the world is ending

hushed spindle
#

what are you searching?

upper hazel
#

location

hushed spindle
#

but anything specific with location

#

because searching each block in such a large area is a lot

upper hazel
#

although a circle is possible

upper hazel
hushed spindle
#

oh so you want to make like an rtp thing

#

random coord within a ring

upper hazel
#

yes rtp

#

optimize it more accurately

#

make a more uniform randomizer

torn badge
#

So you want a square with a circle removed from it?

upper hazel
#

what?

torn badge
#

I don't understand what you mean by optimizing

alpine urchin
#

no typo

upper hazel
#

if this is displayed on a plane, then I want to make a donut with a customizable hole inside

#

or a square donut

hushed spindle
#

i would just pick a random coord within a circle(or square) 2x the radius as your ring width, subtract 500 from the x and z so it centers the circle, and if the x is positive add 500 and if negative subtract 500. same with z

#

im not a math guy but im pretty sure that would select a rough circular area without the center 500 radius

upper hazel
#

The problem with this algorithm is that the radius of the “donut” cannot be adjusted; it has a certain constant

torn badge
#

Just generate a random radius within your range

#

Then take a random point from that circle

hushed spindle
#

what

torn badge
#

?

hushed spindle
#

actually no my solution wont create a donut it'll create 4 segments

torn badge
#

You just need a random radius from your range, then you generate a random number from 0-1 and calculate a point on the circle with that random radius

hushed spindle
#

why a random radius

#

how would this make a donut shape

#

getting a random point on a circle isnt the issue

torn badge
hushed spindle
#

yes thats what he wants

torn badge
#

Yeah so he needs a random radius from within that range

hushed spindle
#

oh i see what you mean

torn badge
#

Which would give you 1 of the infinite circles in that donut

hushed spindle
#

my bad yeah that would work

shadow night
#

if I have the PlayerItemConsumeEvent, how would I know if the player has eaten food and how would I know what his new and old hunger and saturation levels are? Is there some other event that extends it and contains that data?

upper hazel
candid galleon
#

should be able to check what item was used from there

shadow night
#

is the event fired right before the finishing the food or right after?

#

this is a thing

candid galleon
#

there's also FoodLevelChangeEvent which you could listen to

#

right before finishing the food

#

If the ItemStack is modified the server will use the effects of the new item and not remove the original one from the player's inventory.

hushed spindle
#

i just check their food level at and 1 tick after the event

#

allows me to make custom foods out of consumable items that dont give food points like potions or milk

candid galleon
#

i'd probably go PDC + ItemConsume event

#

but guess that works

hushed spindle
#

does anyone know what the LongSet in ChunkAccess#getAllReferences() means?

#

in the context of structures it returns a Map<Structure, LongSet> but what does the longset mean

candid galleon
#

might just be a set of longs?

hushed spindle
#

..yes

#

but what do those longs mean

#

are they like the time of discovery or what

candid galleon
#

presumably the X, Y, and Z?

#

i'd just debug it out and try and find out

hushed spindle
#

i mean they're just numbers lol

#

kinda hard to just look at some numbers and derive some arbitrary meaning

tall holly
#

hi everyone, how to sort the tablist using teams in 1.8.8?

outer wind
#

trying to create an armour stand using World.createEntity

this.display = (ArmorStand) world.createEntity(location, EntityType.ARMOR_STAND.getEntityClass());
this.display.setInvisible(true);
this.display.setInvulnerable(true);
this.display.setAI(false);
this.display.setArms(false);
this.display.getEquipment().setHelmet(displayItem);
this.display.setRotation(0, 0);
this.display.setHeadPose(new EulerAngle(0, 0, 0));
world.addEntity(this.display);

but I get
java.lang.NoSuchMethodError: 'org.bukkit.entity.Entity org.bukkit.World.createEntity(org.bukkit.Location, java.lang.Class)' when trying to run this code

quaint mantle
#

That method does not exist in a jar

outer wind
#

oh :/

quaint mantle
#

Check your deps

outer wind
#

I thought it was a part of spigot's API

outer wind
# quaint mantle Check your deps
<dependencies>
    <dependency>
      <groupId>org.spigotmc</groupId>
      <artifactId>spigot-api</artifactId>
      <version>1.20.2-R0.1-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
quaint mantle
#

Like your jar in server folder

outer wind
#

why the heck did they remove it...

eternal night
#

createEntity has yet to be pulled into paper

#

it is a rather terribly new API

#

not that whatever you are using it for requires it either

#

just use spawn with the consumer overload

outer wind
eternal night
#

spigot has those methods too

outer wind
#

the main reason I was trying to use createEntity is because otherwise it is visible for a few seconds before becoming invisible...

eternal night
#

yea use the spawn overload

outer wind
outer wind
#

idk how I missed that :/

eternal night
#
world.spawn(location, ArmorStand.class, a -> {
  // This is run before the entity is added to the world
});
icy beacon
#

Is it possible to allow trailing comma in Gson? I couldn't find a surefire yes/no answer and the setLenient() in GsonBuilder is ambigious

robust helm
#

is it possible to change the max hunger bar amount?

#

so that the max saturation is for example 22 instead of 20

twin venture
#

nothing happens

#

it won't send me to lobby

#

am i messing something?

#

nvm , found the fix

hushed spindle
#

1.20.2 is 1_20_R3 right?

hushed spindle
quaint mantle
#

Or use spigot api

glossy venture
#

blocking the main thread on disable is probably a good idea right

quaint mantle
#

Yeah

hushed spindle
#

there's no setfoodlevelscale or setsaturationscale or what have you

#

you can only set the food and saturation values, and food is a bit inconvenient because its in integers and not floats

#

so you'd need to track those levels yourself if you want to do it custom, and use the food and saturation as value indicators

umbral ridge
#

can vault permission calls be ran asynchronously

#

because when i run it with a scheduler i dont get the expected result

rotund ravine
#

Depends on the implem from the permissions plugin

umbral ridge
#

if I use LuckPerms?

#

so here's the thing. I'm checking if offline player has a permission and apparently it loads some time

rotund ravine
#

I would just use luckperms api if ur relying on it

umbral ridge
#

So luckperms gave me an error saying this

rotund ravine
#

Then it wants u to do em async 👌🏻

umbral ridge
#

I did but then I also need to update the lore with the value

#

so I just move the entire for loop in a scheduler?

rotund ravine
#

Run it async then do a sync task to set the lore and stuff

#

Btw

umbral ridge
rotund ravine
#

A seperate scheduler for setting the item back etc.

umbral ridge
#

sooo I guess just runTask?

rotund ravine
#

Sure

umbral ridge
#

Ok but now it doesn't update the lore at all

#

it doesn't even touch it

rotund ravine
#

Spexx…

umbral ridge
#

i don't know my way around with schedulers

rotund ravine
#

?paste ur method

undone axleBOT
rotund ravine
#

So

#

Move the async call to the top

#

Under inside the async call

#

Spawn a new task

#

And pass all the crap from the method in

#

Well’ish

#

Nvm don’t do that

#

But move the runTask thing inside the async call

#

Remember, you need to get the permission async. Then spawn a new task

hushed spindle
#

does anyone happen to know what the LongSet in ChunkAccess#getAllReferences() represents? i figured it was probably locations, but converting those longs to locations produces wildly inaccurate locations

rotund ravine
umbral ridge
#

Ok, I'll try it

hushed spindle
#

in this context im trying to find structure references in a chunk which produces a Map<Structure, LongSet> but im not sure how to work with that longset

umbral ridge
#

I'm bad with schedulers

#

Is it a lot of code changing? Can you change it? XD

rotund ravine
#

Not atm am on phone

#

Remember the async won’t run right as you ask it to so the variable you get from there won’t be gotten before after x period

#

When it’s gotten you should then create ur inventory

umbral ridge
#

Ohh I see

rotund ravine
#

So you switch to an async context to get it and then spawn a new task to switch to a sync context to edit the inventory etc. based on what was received

umbral ridge
#

I guess I have to use CompletableFuture

#

because then I can do thenRun() after the async has completed

rotund ravine
#

Suure

alpine otter
#

why am i getting java.lang.IncompatibleClassChangeError for jetty in spigot even if the version is the same?

rotund ravine
#

?stack

umbral ridge
#

just at the end? out of completablefeature scope

rotund ravine
#

Ideally you wouldn’t return inventory

#

Return a completable future or smth else

#

No, but if it works it works

fervent thicket
#

Hey here

ocean hollow
#

can anyone recommend a sound similar to a cannon shot?

shadow night
#

tnt explosion?

#

maybe

ocean hollow
#

and besides the TNT explosion? The gun just fires first, and then the shell makes the sound of a TNT explosion

shadow night
#

sec, lemme find a mc jar so I can go through all sounds

native bramble
#
public static void addRecipeToServer(){
        ShapelessRecipe shapelessRecipe = new ShapelessRecipe(NamespacedKey.minecraft(
                "new_netherite_ingot"), new ItemStack(Material.NETHERITE_INGOT));
        shapelessRecipe.addIngredient(4, Material.STRING);
        Cekc.instance().getServer().addRecipe(shapelessRecipe);
    }

this is not working, no errors in console

shadow night
wraith dagger
#

?mappings

undone axleBOT
fickle helm
#

Are the snapshot Obfuscation maps available anywhere, specifically for the latest version 1.20.3 release candidate 1?
It used to be that each snapshot would get a page on https://minecraft.fandom.com/wiki/Minecraft_Wiki
but it seems ever since 1.20.3 they only publish release versions now

river oracle
#

You're supposed to use the actual official wiki

fickle helm
#

was not aware of that

river oracle
#
dry hazel
river oracle
#

This is the only official wiki now please disregard the Fandom one it'll continue to become more out dated and wrong

fickle helm
#

Apparently. Thanks

wraith dagger
#

is there any net.minecraft.server mojang-remapped wiki for 1.20.1?

river oracle
#

Do you need help setting it up?

#

If so

#

?mappings

undone axleBOT
fickle helm
#

Every single version yes

river oracle
#

?nms

wraith dagger
#

i want to know like what exactly what is this class doing

#

like spigotAPI javadocs

#

or somethings about that

dry hazel
#

no such thing

#

some mappings have javadoc comments, but definitely not anything that'll be a game-changer

chrome beacon
#

When working with nms you're mostly on your own

rotund ravine
#

Why would Mojang be nice and give us javadocs

hushed spindle
#

so i got a bunch of structures and their bounding boxes now, and i want to figure out which structure is the closest to a location in terms of bounding box. would it be a fine approach to expand those bounding boxes to touch the comparison location to figure out the distance, or is there a better approach?

#

doing so would require me looping through all the bounding boxes in a structure which might be overkill

twin venture
#

hi , i need help with redis iam trying to achive is :
the Map selector should , show all arenas of solo in that gui
but , if 2 servers have the same arena name , it should add 1 itemstack and say :
amount of servers [number of the same arenas with the same name].

#

i got this but , it does not work

#

if anyone know how , please mention me , iam gonna go study now .. :p

valid burrow
#

any of yall have experience with spawning modified entities with nms

ivory sleet
#

Ask away

crimson scarab
#

hey what is the undeprecated way to set armourstand armour / holding

valid burrow
# ivory sleet Ask away

well thats kinda it im trying to spawn a custom entity using nms but i nor get an error neither does it work

#

like at atll

#

?paste

undone axleBOT
valid burrow
rough drift
#

what's not working

valid burrow
#

everything

#

as i said

#

i dont get an error

#

but the entity doesnt spawn either

native bramble
#

What could cause ItemDisplay to work differently in different dimensions?

valid burrow
# valid burrow everything

also i havent really found a way to spawn an entity and also get it as an object in nms which i also need

native bramble
#

i have two classes for my display entities

#

but i built code that only relates to place itemdisplay

native ruin
#

how does dynmap hanlde so many blocks?

umbral ridge
native ruin
#

wouldn't that require huge amounts of storage though?

eternal oxide
#

its also only rendering a single plane

#

highest block

valid burrow
umbral ridge
#

this.setPosRaw(loc.getX(), loc.getY(), loc.getY());

#

X Y Z not X Y Y

#

I think

wet breach
native ruin
#

checking each xy coord and storing the top block if there are air blocks below that it also stores those below that air block (for the 3d stuff)(with a minimum y level to prevent cave), this for every new chunk that gets loaded, any blockupdates like placing breaking etc, will store them aswell.

would the concept be something like this? or am i missing something huge that could speed up/ make it more memory efficient

eternal oxide
#

it only needs to remember 16x16 blocks per chunk

native ruin
#

if you're working only in 2d yes

eternal oxide
#

and that only updates on a schedule IF a block has changed

#

yes

native ruin
valid burrow
#

armor stand does not extend entity??????

hazy parrot
#

It does

native ruin
#

maybe a cast fixes the problem?

ashen quest
#

It should

eternal oxide
#

could you be passing NMS entities to bukkit methods?

valid burrow
#

does that not work?

eternal oxide
#

no

valid burrow
#

well yh makes sense

#

any way i can fix it?

wet breach
#

there is usually methods to transform them

kind hatch
#

You might be able to convert to a bukkit entity

eternal oxide
#

yep like getBukkitEntity()

valid burrow
#

are there no attributes in craft entites

#

this alll is making me cry soon

#

why are there so many types of entities

remote swallow
#

attribute are probably living entity

#

oh wait attributes are for items

#

player attributes are different in nms probably

valid burrow
#

well how

remote swallow
#

i havent used nms attribute stuff so no idea

gleaming yarrow
#

can you set a custom collision box

#

to an entity

valid burrow
#

any way i can get a normal entity from a craft entity

eternal oxide
#

cast it

river oracle
eternal oxide
#

depends normal?

valid burrow
#

bukkit entity ig

eternal oxide
#

do you mean NMS or Bukkit?

river oracle
eternal oxide
#

if Bukkit you just cast

river oracle
#

just use the CraftEntity

valid burrow
#

i have a bukkit entity that i got from nms

river oracle
valid burrow
#

no the re is

eternal oxide
#

yep no reason but it was his question

valid burrow
#

i cant use atributes on bukkit entites

river oracle
valid burrow
eternal oxide
#

cast to a Bukkit interface just reduces the methods available to you in the object

remote swallow
#

entitys dont have attributes in bukkit

eternal oxide
#

Entity is not attributable

remote swallow
#

only items

valid burrow
#

oh wait im restarted

#

i need a living entity

#

can i also just cast that

eternal oxide
#

yes, if it IS a LE

valid burrow
#

yh i just spawned it

valid burrow
#

im gonna become shizo

#

for some reason my entity isnt null

#

but

#

it also isnt there

#

how does that work

true shuttle
#

How can I control a ridden entity with wasd?

#

Any good tutorials out there I’m missing?

#

Or can someone just steer me in the right direction

echo basalt
#

basically

#

client sends a vehicle steer packet

#

you listen to it and apply your own physics

#

was something like

#

float ahead = readFloat(0)
float side = readFloat(1)

#

ahead 1 = front
ahead -1 = back
side 1 = left
side -1 = right

#

might be inverted

#

mess around and find out

valid burrow
#

?paste

undone axleBOT
valid burrow
#

why cant i give a zombie a potion effect

#

Cannot resolve method 'addPotioanEffect' in 'Zombie'

scenic onyx
#
public HashMap<BedWarsTeam, List<BWPlayer>> createTeam(int playersPerTeam) {
        // Assicurati che ci siano abbastanza giocatori per formare almeno un team
        if (players.size() < playersPerTeam) {
            System.out.println("Non ci sono abbastanza giocatori per formare un team.");
            return null; // o gestisci in modo diverso la situazione di errore
        }


        // Mescola la lista dei giocatori per distribuirli casualmente nei team
        Collections.shuffle(players);

        // Calcola il numero totale di team
        int totalTeams = players.size() / playersPerTeam;

        // Crea e popola la mappa dei team
        HashMap<BedWarsTeam, List<BWPlayer>> teamsMap = new HashMap<>();
        for (int i = 0; i < totalTeams; i++) {
            BedWarsTeam team = BedWarsTeam.values()[i % BedWarsTeam.values().length];
            List<BWPlayer> teamPlayers = players.subList(i * playersPerTeam, (i + 1) * playersPerTeam);
            teamsMap.put(team, new ArrayList<>(teamPlayers));
        }

        return teamsMap;
    }

it is correct?

echo basalt
#

You could rework it so the math isn't as complicated

#

Also you should aim to return Map instead of HashMap in case you decide to switch the impl later

scenic onyx
echo basalt
#

One's the interface / contract and the other is an implementation of that

scenic onyx
echo basalt
#

It allows you to switch the impl without redoing the whole codebase

proud badge
#

is it possible to get the death cause aswell or no?

eternal oxide
#

no

#

only in the event

proud badge
#

rip

valid burrow
#

how can i make entites permanently invis for all players

#

mobs to be specific

eternal oxide
#

delete them 🙂

valid burrow
#

wow

#

well no they need to exist

slender elbow
#

setVisibleByDefault

proud badge
#

is there a spigot guide/page on TextComponents? (such as run command on chat click text, hover, etc) I don't 100% trust chatgpt

eternal oxide
#

add the invis mobs to a team and hide them

valid burrow
#

will that make their nametags invisible

eternal oxide
#

yeah that may only be name tags

slender elbow
#

it won't send any of the entity data to the player

#

as if it didn't exist

valid burrow
#

oh oki

#

ill just add a small armorstand on top

remote swallow
naive loom
#

Does anyone know if there are reasons why a item wouldn't be able to be enchanted in the enchantment table? Is there a exact thing a material needs to be enchantable? Same with the anvil.

upper hazel
valid burrow
naive loom
echo basalt
#

random.nextdouble(min, max)

#

might be specific to ThreadLocalRandom

lavish shell
#

I would like to implement a plugin that would prevent the use of the /repair command from repairing it with an anvil, as well as using repair. but Idk how to do it, tell me some events or libraries

valid burrow
#

just dont give the people the permisson lol

upper hazel
valid burrow
#

why 2

upper hazel
#

becuse y not need find

valid burrow
#

but i want y

upper hazel
#

y need for find solid block

valid burrow
#

i need a reason to live

#

y do i live

proud badge
#

btw is it possible to make it so only a portion of the message is hoverable/clickable? Not the entire message

proud badge
#

Ok I'll figure it out

#

I just wanted to know yes or no

wet breach
#

or maybe you could do it with two components one clickable the other not

eternal oxide
#

use teh component builder

upper hazel
upper hazel
#

i was just use random...

lavish shell
proud badge
#

hmmmmm???

icy beacon
#

Wrong import

lavish shell
proud badge
#

i didnt import anything yet, let me do it

icy beacon
#

You gotta import the net.md_5 one

proud badge
#

ok thanks

#

ok everything here is depracted

#

I hope it doesn't cause issues

valid burrow
#

make a list with allowed item

#

if the item is not in the list dont repair it

proud badge
#

what method do I use to fix it

remote swallow
#

player.spigot.sendMessage()

proud badge
#

yes thats what I did

#

or is this not the same?

remote swallow
#

no

proud badge
remote swallow
#

yeah

proud badge
#

ok what about now?

remote swallow
#

wrap it all in components

#

and use component builder

proud badge
#

ok I used the builder I'm still confused on what im doing wrong

remote swallow
#

everything must be a component

#

you cant have ChatColor.color + string it must be a component

eternal night
#

Just use mini message or something to create it ?

proud badge
#

ah so it has to be (tpComp+fixComp+intComp)

eternal night
#

GIven the amount of deprecation there, you are using paper-api right kekwhyper

proud badge
#

no clue

#

i think

#

ok I removed the strings

#

can I not have multiple components in one message?

eternal night
#

you can't join them via the + operator

proud badge
#

rip

eternal night
#

you gotta join them with in a parent component

proud badge
#

and how may I do that?

eternal night
#

dunno 😅

eternal night
#

Maybe something on the component builder again ?

river oracle
#

sorry I only know Minedown

eternal night
#

sorry, did you just link a fucking emoji

river oracle
#

yeah

#

problem?

eternal night
river oracle
#

I just beat the system

eternal oxide
#

ComponentBuilder.joiner

river oracle
#

save all emotes as gifs

eternal night
#

ah there we go

#

yea

orchid gazelle
#

does anybody have some idea on how I may make players(builders) define complex sections of blocks in the world?

proud badge
#

thanks

orchid gazelle
#

"this house consists of the square of blocks between xyz + the square of blocks between xyz + the square of blocks between ...."

proud badge
#

Yo it works thanks

true shuttle
echo basalt
#

all mobs

shell robin
#

config/new.yml:

join-reward:
  item: IRON_ORE
  amount: "1"
  display-name: "Join Reward"
  lore:
    - "Line 1"
    - "Line 2"```
```java
    private YamlConfiguration config;
    @Override
    public void onEnable() {
        // ...
        getServer().getPluginManager().registerEvents(this, this);
        config = YamlConfiguration.loadConfiguration(new File("config/new.yml"));
        // ...
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
    public void giveReward(Player player) {
        ItemStack reward = new ItemStack(Material.getMaterial(config.getString("join-reward.item")), config.getInt("join-reward.amount"));
        ItemMeta meta = reward.getItemMeta();
        meta.setDisplayName(config.getString("join-reward.display-name"));
        meta.setLore(config.getStringList("join-reward.lore"));
        reward.setItemMeta(meta);
        player.getInventory().addItem(reward);
        // ...
    }
    @EventHandler
    public void onJoin(PlayerJoinEvent e){
        giveReward(e.getPlayer());
    }
}

Error: Material cannot be null
Why new.yml is doesn't load?

echo basalt
#

Yeah so

#

the file isn't created

shell robin
#

i created new.yml file in resources

kind hatch
#

Cause that file wasn't ever written to disk. If you include that file in your plugin, use #saveResource() to write it to disk.

shell robin
vague swallow
#

Hey everyone, I'm currently trying to set the Velocity of an armor stand but it's not moving for whatever reason, does anyone have an idea why?

remote swallow
#

no way its darthmango

vague swallow
#

armorStand.setVelocity(velocity);
player.setVelocity(velocity);

On the player it's working but not on the armostand

rotund ravine
#

?

vague swallow
quiet ice
#

You're the whereami person

vague swallow
rotund ravine
#

How are you spawning the armorstand

quiet ice
#

Idk - maybe you need to set the AI? But that'd be a mojang moment

vague swallow
vague swallow
rotund ravine
#

Anything else?

vague swallow
#

Some changes on the armorStand

rotund ravine
#

Which are?

vague swallow
#

armorStand.setVisible(false);
armorStand.setGravity(false);
armorStand.setMarker(true);
armorStand.setArms(false);
armorStand.setBasePlate(false);
armorStand.setSmall(true);

rotund ravine
#

Geavity?

vague swallow
#

Yeah I didn't want it to fall down

rotund ravine
#

Does it work with gravity

grand flint
#

its the paper user guy

rotund ravine
#

Maybe we should send him there

quiet ice
#

Hey, we already mentioned that

grand flint
#

hey i was late actually

quiet ice
#

Do we really need to bully that person to death?

grand flint
#

ye

#

?whereami

vague swallow
rotund ravine
#

Did you try?

vague swallow
quiet ice
#

The only change I could expect could cause issues is the marker thing as they might not tick, but I am not 100% sure

vague swallow
vague mason
#

PlayerLoginEvent

getHostname() -> does client send this data or the server gets it?

#

Basically can be edited by client?

#

Or the server gets it so it can be trusted?

rotund ravine
#

Yes

vague mason
#

Yes client or yes server?

rotund ravine
#

Server

kind hatch
grim hound
#

Nice

#

what was PacketPlayInKeepAlive replaced with?

kind hatch
#

Probably ClientboundKeepAlivePacket & ServerboundKeepAlivePacket

#

?mappings

undone axleBOT
grim hound
#

how to search in this stuff

mellow edge
#

I am not sure whether this is the right way to make custom damage amount:


 @EventHandler
    public void entityDamageEvent(EntityDamageByEntityEvent e) {
        if(e.getDamager().getType() == EntityType.FIREBALL) {
            e.setDamage(random.nextBoolean() ? 2 : (random.nextBoolean() ? 3 : 1));
        }
        System.out.println(e.getDamager().getType() + " aSDASDOASHDKJAHSDKUZsgdfKJGHYsbdfgJIYBDVKHJHYSDBZGUKFBsku");
    }
rotund ravine
#

Sure

kind hatch
grim hound
rotund ravine
mellow edge
#

ok thanks and chances are correctly set up

grim hound
#

shows up

kind hatch
# grim hound

Searching for packets across versions is not something that I'm aware exists on that site, but one approach I use is to select the version that the packet name does exist on and it will bring me to the mojangmapped name.

What version does that packet exist in?

native ruin
#
[21:15:26] [Server thread/INFO]: Is Directory: false```

I call a function in the main class that is supposed to read the files from a folder, but when logging the results it tells me it isn't
kind hatch
#

Yea, @grim hound, spigot is moving towards the mojang mapped names.

grim hound
#

did they change the package as well

worthy yarrow
#

If I use Player interact event can I implement logic to check if the interaction was equipment of armor? I'm trying to make a custom armor plugin...

young knoll
#

Yes