#help-development

1 messages · Page 415 of 1

smoky oak
#

but the modern ones are just trash

echo basalt
#

I wouldn't bring lan cables to school

smoky oak
#

and all missing at least one key

young knoll
#

I was expecting an external program

echo basalt
#

ethernet ports are all linked to the switch

#

and the switch has a MAC whitelist

#

we have 1 switch per classroom

smoky oak
#

u think my school has competency

#

lol

echo basalt
#

mine's like a technical school

#

we have competent network teachers that know their shit

#

my network teacher's a bit insane

smoky oak
#

like its the same shit in uni, i can just plug a cable in and boom

#

gigabit internet

#

no login required

echo basalt
#

lmao I wish schools had gigabit internet

#

I think my school's petitioning to have a private network line

#

for the IT students

#

so we have our own line that isn't clogged with typical school BS

smoky oak
#

lol

#

oh that brings back memories

#

our server rooms were almost freely accessible

echo basalt
#

but idk if that's going anywhere

smoky oak
#

only one flimsy lock in the way

echo basalt
#

our "server rooms" aren't really server rooms

smoky oak
#

if i wouldve snapped i couldve pulled the plug on the damn email server

#

like very much literally

echo basalt
#

we have the "computer lab" that I helped remake when I was an intern

#

with like a few servers running

#

that I had to shut down when I re-made all the electrical sockets

smoky oak
smoky oak
#

he looked old enough to have worked already in the 1950s

echo basalt
#

yea we have a crazy network teacher that's in charge of all the robotics club

#

he was my network teacher during 10th grade

#

mf dragged me on my way home one day

#

"So, you like ethereum?" and started licking himself all over

#

it was during peak nftworlds season and I was making a shit ton of cash with the shittiest commissions

smoky oak
#

crypto has one (1) good thing about itself

echo basalt
#

It's cool tech

smoky oak
#

well one real-world good thing

#

it doesnt take half your damn paycheck to get the money into your bank account

#

why the fuck does it take like $60 to wire money from america to europe?????

ivory sleet
#

Lol true

desert frigate
#
for (int x = (int) boundingBox.getMinX(); x <= boundingBox.getMaxX(); x++) {
            for (int y = (int) boundingBox.getMinY(); y <= boundingBox.getMaxY(); y++) {
                for (int z = (int) boundingBox.getMinZ(); z <= boundingBox.getMaxZ(); z++) {
                    Block block = world.getBlockAt(x, y, z);
                    if (boundingBox.contains(x, y, z)) {
                        blocks.add(block);
                    }
                }
            }
        }```

i may be doing something wrong but this returns a empty list
desert frigate
desert frigate
#

because getBlockAt takes a int

#

and getMinX is a double

wet breach
#

There should be a method to get the int of it

desert frigate
#

yes but that shouldent be the issue right?

wet breach
#

Anyways. No matter what exactly you trying to do?

desert frigate
#

get the blocks inside a bounding box

#

my full code:

 private List<Block> getBlocksFromBoundingBox(BoundingBox box, World world) {
        List<Block> blocks = new ArrayList<>();
        for (int x = (int) box.getMinX(); x <= box.getMaxX(); x++) {
            for (int y = (int) box.getMinY(); y <= box.getMaxY(); y++) {
                for (int z = (int) box.getMinZ(); z <= box.getMaxZ(); z++) {
                    Block block = world.getBlockAt(x, y, z);
                        blocks.add(block);
                }
            }
        }
        return blocks;
    }```
wet breach
#

Ah. Well if by the time i get home from work in the morning you havent solved it. I will give you the solution

#

Dont really feel like typing out code on my phone

#

Its actually easy to do what you are wanting

#

I get off work 6am cst and usually home by 7am cst

light parcel
#

Does a player die when their health is < 0 or <= 0?

wet breach
#

So either ping me then to remind me or create a thread lol

wet breach
light parcel
#

Thanks

wet breach
#

In fact i will give 2 solutions

#

The easy one and the slightly more complex but still easy and bit more optimal solution because i feel nice

#

Or 3 we will see. The third one is harder but super optimal

quartz basalt
willow widget
#

Anyone knows how to make my own GUI like this for test servers?

#

I mean what do I have to use as project in an IDE or what do I do?

wet breach
#

This is actually the standard gui provided by java

#

Not sure if linux is provided one. But you get this gui if you double click the jar to run it on windows

#

You can get it from the command line but sometimes you have to provide the gui param for it

#

Server jar

#

Even mc client has it too but it tends to hide it away as a configurable option

#

As far as coding your own there is various ways

#

You can use jfx, awt, or jframes

#

Think the one that comes up is just awt and jframes as that is still in the jdk unlike jfx which is its own separate jar and install

#

Its technically called the java console just fyi

#

I5

#

More stable especially with drivers

royal hawk
#

Hello I have problem where I can get packets ids for 1.19.4? It is need for bungee :0

wet breach
#

The left. Cpu is better

#

Dont get fooled about the boost speeds that both amd and intel advertise

remote swallow
#

is ram soldered on new laptops or is that just older ones

willow widget
#

yeah I want to use it lol

#

I just want to "fork" it to make my own version and make it look cuter

wet breach
willow widget
#

I'd get Aspire 7 Intel, it looks way better than Aspire 7 Intel

wet breach
#

It isnt hard to customize it last i remembered

willow widget
#

nevermind, i'd rather stick to just my console lol

#

ty anyways c:

wet breach
#

Can look around the jconsole stuff or what not. Might be some other packages too just have to look

#

You can provide plugins for the console as well which is what that link is

desert frigate
#

unless u mean pm

real fable
#

When I use <Player> scaled health, the health bar of the player isn't updated instantly. I mean there's a big delay before the health is set to it's amount, so we can see the bar regenerate and then all the hearts are set.
Is this normal ? If no how can I solve that ?
(I'm using spigot 1.18.2)

piece of code:

<Player>.setHealthScaled(true);
<Player>.setHealthScale(10);
<Player>.setHealth(10);

PS: Please ping me for any replies

real fable
storm stump
#

Can anyone help me understand why my PacketPlayOutRelEntityMove code makes the entity look jerky

#

It looks weird as if there were 3 zombies on screen at some points

#

The legs move very oddly

#

return new PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook(entity.getId(), (short)(4096*(x-oldX)), (short)(4096*(y-oldY)), (short)(4096*(z-oldZ)), l0, l1, true);

#

Jumping actually looks smooth

#

Walking and otherwise looks super jerky

#

I'm on 1.12.2

wet breach
#

I work night/graveyard shift

desert frigate
#

oh alrighty

buoyant viper
#

java stdlib guis?

#

u gotta enable it with some jvm prop for Mc now iirc, otherwise u get a headless exception

tender shard
#

macbook pro m2

vocal cloud
wet breach
tawny remnant
#

is there a way to get the Item in PlayerFishEvent or the velocity of the Item? Im trying to pull a creature that spawns when you fish towards the player any ideas?

wet breach
#

What item? The fishing line?

tawny remnant
wet breach
#

Alex gave you the method for it

tawny remnant
tender shard
#
  1. Get the player's location, turn it into a vector called "vecPlayer".
  2. Get the fishing hook's location, turn it into a vector called "vecGuardian".
  3. You need a third vector, called "vecGuardianToPlayer" so that "vecGuardian + vecGuardianToPlayer = vecPlayer". That means vecGuardianToPlayer is "vecPlayer - vecGuardian".
  4. Spawn the guardian at the fishing hooks location. Using the spawn(Location, Class<Entity>, Consumer<Entity>) method, and set the velocity of the guardian to vecGuardianToPlayer inside that ( https://blog.jeff-media.com/use-consumers-when-spawning-custom-entities/ )
#

I forgot step 3a: Adjust the vecGuardianToPlayer vector by normalizing it, then multiply it to set the "speed" of the movement. E.g. normalize() it, then multiply it by 2. If it's too fast, multiply it with a smaller number. If it's too slow, multiply with a higher number.

#

right now, you just set the guardian's velocity to the velocity of the fished item, which is probably 0

wet breach
#

You dont even need to do all this

#

If all you are wanting is to put a different entity on the hook. Just getHook().setHookedEntity(Entity)

tender shard
#

oh I thought they wanted to spawn an additional entity

tawny remnant
#

yes

wet breach
#

Oh they want another entity

#

Not replacing the hooked one

tender shard
#

you might also have to set both entities to not collide with each other

tawny remnant
#

you can collide with a drop?

wet breach
#

Wells its not a drop until its realed in

#

Anyways back to work for me

tender shard
#

Is there a reliable way to get a list of all installed java versions, regardless of OS?

hazy parrot
#

Not sure as it have to be built into binary to be regardless of os

#

But each binary is independed and doesn't know of other one afaik

eternal oxide
#

is the guardian flying or not moving at all?

tawny remnant
#

not moving

eternal oxide
#

not even a twitch?

quaint mantle
#

How can I scale up (increase in size) a block display?

#

I've been testing this but for some reason it's not working lol

tawny remnant
eternal oxide
#

something in his AI is stopping him moving then

tawny remnant
#

should i try replacing the entity?

eternal oxide
#

try spawnign something that doesn't have a ranged attack

#

Zombie for example

tawny remnant
#

alexes code isnt working

#

its not spawning at all now

vernal oasis
#

What's the best way to save info to a file?
I want to save playerName, Int to a file, do I just use a txt file or csv file?

hazy parrot
#

?pdc

hazy parrot
#

Also never save info that should be parsed to txt lol

eternal oxide
#

saving using names is not a good idea. As it's obviously going to be used between sessions, players can change name

vernal oasis
#

It will just be playername and an int

#

or should I do uuid , and int

eternal oxide
#

uuid

native gale
#

Please, can anyone help me to figure out how world generators work? What I want to achieve is to have the default generation, but replace every grass block with green glass block.

eternal oxide
#

no

#

you have to iterate over servers.values() toi check the name

#
servers.values().forEach(info -> {
    if (info.getName().equals("hub")...```
small current
#

Why when i cancel projectilehotevent nothing happens

#

Something should change

flint coyote
#

No @EventHandler or forgot to register the event?

small current
#

I checked them all

eternal oxide
#

you shoudl get no damage event if you cancel the hit

small current
#

Potions get splashed

#

Firecharges set ground on fire

#

Nothing happens

#

I have debug

#

It prints that it should be cancelled

wispy wyvern
#

how do i add comments to my yml custom file?

eternal oxide
#

did you cancel the splash event or only the hit event?

small current
#

Is firecharge splash?

eternal oxide
#

splash event extends hit event

small current
#

There are two events for splash

#

I should have the same class 4 times?

wispy wyvern
#

like config.getConfig().set("value", "num") and then this would have # This is the num for the value

#

how can i create the fields with comments explaining what each field does?

eternal oxide
#

you get a section and setComment

small current
terse ore
#

how does bukkit generator work (config nukkit.yml)?

eternal oxide
#

try listening on a splash event and see if it prevents a splash potion

terse ore
#

any resource from where I can start

wispy wyvern
#

this is what i'm doing atm, what can i do here to add comments?

ConfigUtil config = new ConfigUtil(this, "machines.yml");
config.getConfig().set("machines.gold_machine.radius", 5);
config.getConfig().set("machines.gold_machine.radius_type", "CUBOID");
config.getConfig().set("machines.gold_machine.rate", 20);
config.save();
#

or is there an easier way

eternal oxide
#
config.getConfig().getConfigurationSection("machines.gold_machine").setComments...```
wispy wyvern
#

after each one?

#

got it, thank you

eternal oxide
#

after each on you setInlineComments

#

or you do it on teh section header

wispy wyvern
#

ok

#

so i'd need this to make a comment?

config.getConfig().set("machines.gold_machine.radius", 5);
config.getConfig().getConfigurationSection("machines.gold_machine.radius").setInlineComments("Some comment?");
eternal oxide
#

don;t forget to save

#

try it and see

wispy wyvern
#

okok, thank you

kind hatch
#

Check if it's empty, not if it's null.

#

Yea

eternal oxide
#

you can use isString(path)

#

or isSet for all

terse ore
#

how could I check for custom portals?

eternal oxide
#

yes, but in a config you shoudl use isSet to check for a values presence

wispy wyvern
#
if (config.getConfig().get("Config.message") == "" || config.getConfig().get("Config.message") == null){
    Bukkit.getLogger().info("Theres is no 'message' field in the file 'Config' section");
}
#

that worked for me

#

maybe you dont need the null part but

eternal oxide
#
if (!config.getConfig().isSet("Config.message")){
    Bukkit.getLogger().info("Theres is no 'message' field in the file 'Config' section");
}```
wispy wyvern
#

that also works

kind hatch
eternal oxide
#

a path isn;t always a section

kind hatch
#

When's it not?

eternal oxide
#

when it's just a value

#

ie a key is not always a section, only if it has a MemorySection and not a value

kind hatch
#

Can you give an example?

wispy wyvern
eternal oxide
#

config is a section, message is a section, num is not a section

kind hatch
#

What's it classified as then? Cause I thought it was still a section.

eternal oxide
#

it's a key/value pair

#

its when you use isSet

wispy wyvern
eternal oxide
#

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

flint coyote
#

Because you are trying to cast a CraftBlock to a Supplier. That's all I can tell you based on the given information

eternal oxide
#

MachineHandler.java:61

wet breach
#

They are also using paper not sure if that matters

wispy wyvern
#
public void onMachinePlace(BlockPlaceEvent event)
{
  Block block = event.getBlock();
  Bukkit.getLogger().info(block);
}

when i tried this, it suggested i use Bukkit.getLogger().info((Supplier<String>) block); instead

wet breach
#

So dont do that. Just because the ide suggests something doesnt mean it is always correct

#

But you need to change block to a string otherwise its going to print the object pointer

flint coyote
#

Because that's a log statement and it requires a string, not any other object.
If you just wanna print the toString() Method of the Block you can do both,
Bukkit.getLogger().info(block.toString());
and
Bukkit.getLogger().info("" + block);

wispy wyvern
#

String.valueOf(block) i forgot about this

#

does that work also?

wet breach
hazy parrot
#

If ide suggest it means that info method have supplier as one of overloads, I wonder why is that the case lol

hazy parrot
#

Oh

flint coyote
wispy wyvern
#

i didn't choose paper, i started the project and choose Bukkit > Spigot

wet breach
#

Objects can always be printed

#

It just doesnt print their contents instead just prints their memory pointer

kind hatch
kind hatch
#

Otherwise yea.

wispy wyvern
#

wtf

wet breach
flint coyote
wet breach
#

But we dont need to get into technicals

kind hatch
wet breach
#

This isnt a normal object

flint coyote
#

it's an instance of a class, how is it not a normal object?

wispy wyvern
#

what did i do xD

#

i just used ide's suggestion and now its a discussion

kind hatch
wet breach
#

Hence why you cant assign this a value

flint coyote
#

So I'm supposed to print a class instead of a class instance?

wispy wyvern
#
public void onMachinePlace(BlockPlaceEvent event)
{
    Block block = event.getBlock();
    Location loc = block.getLocation();
    ConfigUtil config = new ConfigUtil("machines.yml");
    int radius = (int) config.getConfig().get("machines.gold_machine", "radius");
    String rType = (String) config.getConfig().get("machines.gold_machine", "radius_type");
    List<Block> blocks = getBlocksInRadius(loc, radius, RadiusType.valueOf(rType));
    Bukkit.getLogger().info(blocks);
}
hazy parrot
#

You can print object, not reference to object trough "this" keyword

wet breach
#

This is a reference. Its not an object itself. In fact when you compile this isnt even there no more as it gets inlined as a synthetic

wispy wyvern
#

String.valueOf() and .toString() didn't work.

wet breach
#

Either print the material or its location

kind hatch
tall dragon
wet breach
#

Or that

tall dragon
#

pretty sure blockdata can be stringified pretty easily

wet breach
#

Always forget there is blockdata

flint coyote
wispy wyvern
wet breach
kind hatch
wet breach
#

As i said, when printing objects in most cases you will get the memory pointer or address of said object instead

wispy wyvern
#

i want all of the stuff

flint coyote
#

Ohh. Yeah I knew that. I thought you wanted to tell me that I can print an object without specifying it as a string using Bukkits Logger (which is possible by System.out.println)

wispy wyvern
#

i forgot String.valueOf(s)

tall dragon
wet breach
#

Do you just ignore what everyone said?

#

Like there was this entire discussion and with valuable information to learn and gleam from

tall dragon
eager pier
#

Hellow !

#

I struggle a bit with the player.discoverRecipe method may I ask you ?

kind hatch
#

?ask

undone axleBOT
#

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

wet breach
#

Anyways with that i am going to drive home now

flint coyote
#

Drive safely :)

eternal oxide
#

drive fast and recklessly, like everyone else

eager pier
#

When I'm using discoverRecipe in a PlayerJoinEvent it works well but when used in command method it doesn't work

#

it is the same method with same args but not same result did anyone know any bugs or different behaviors ?

eternal oxide
#

?paste your command

undone axleBOT
flint coyote
#

The plugin certainly does not care whether your code is executed in a command, listener or on enable. So no, the same code should lead to the same result.

eager pier
#

I agree ^^ that's why I'm stuck 🙂

flint coyote
#

Well there's 2 options that come to my mind (without having your code)

  1. You have overlooked a difference
  2. You forgot to recompile and update the plugin
kind hatch
#

Or you forgot to wipe the player's discovered recipe before letting them discover it again.

eager pier
#
public static void discoverCrafts(Player player) {
        for (ACraft craft : recipes) {
            if (craft.isMandatory() || Config.getCrafts()) {
                player.discoverRecipe(craft.getKey());
            }
        }
}```
#

to wipe it ?

flint coyote
#

Player#undiscoverRecipe

eager pier
#

the player doesn't know it before I make him discover it , No ?

flint coyote
#

If you tested the event and the command with the same player they do after you ran your event test

quaint mantle
#

is there an event for player entering a minecraft?

eager pier
#

Ah ok, but I cannot see the recipe in the crafting table book so I'm assuming that player has not discovered it yet

eternal oxide
#

recipes are stored in the player dat, so relogging will not clear a known recipe

flint coyote
quaint mantle
#

what?

#

minecart, yep.

flint coyote
quaint mantle
#

i dont even have autocorrect i just did the autocorrect myself probably.

#

by which i mean auto incorrect.

eager pier
eternal oxide
#

a recipe can be known but not shown if you have not discovered one of it's components

quaint mantle
#
       if (event.getAction() == Action.PHYSICAL) {
            Material material = event.getMaterial();
            Chunk chunk = event.getClickedBlock().getChunk());
        }```
#

is this valid?

#

is event.getClickedBlock(); valid here?

eternal oxide
#

what event?

flint coyote
#

InteractEvent

quaint mantle
#

PlayerInteractEvent.

flint coyote
#

I'd say yes but why don't you hop on a local server and test it?

quaint mantle
#

ok.

eternal oxide
#

nullable

flint coyote
#

would be bad wording for a pressure plate that was stepped on. Might not work then

#

I'd still test it tho

wispy wyvern
#

bruh what, this returns null
String rate = String.valueOf(config.getConfig().get("machines.gold_machine.rate"));

flint coyote
#

"rate" sounds like a numeric value

wispy wyvern
#

yes

#

omg

#

am i a noob?

kind hatch
#

Likely a case of.

machines:
  gold_machine:
    rate: 1 # This section doesn't exist.
eternal oxide
#

do not use String.valueOf

wispy wyvern
#

if i dont it's red

eternal oxide
#

because its not a string

kind hatch
#

Use the built in methods. FileConfiguration#getInt()

flint coyote
#

Why do you try to save an int as a string anyway?

wispy wyvern
river oracle
#

Cuz they don't know java :O

flint coyote
#

this code will run perfectly fine when rate is an int

eternal oxide
#

rate does not need to be a String

kind hatch
eternal oxide
#

concatenation will stringify it

wispy wyvern
#

i dont use the brain sometimes

#

the thing is i knew this

#

but somehow i am being extremely dumb

tribal karma
#

can anyone tell me whats the problem?

#

it keeps crashing

eternal oxide
#

wrong channel

flint coyote
#

It's funny how paper is like
DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH
and then is like
Server thread dump (Look for plugins here before reporting to Paper!):

wet breach
#

spigot has the same thing

flint coyote
#

I know why it is implemented like that but it's still confusing since it basically tells you two different things

wet breach
#

basically they want you to check to make sure it isn't a plugin at fault because commonly its a plugin doing something it isn't supposed to

#

occasionally you might have stumbled on a bug though

flint coyote
#

My first thought was that the second part is always printed on a thread dump and the first part is only printed if they are sure it's based on a plugin issue

wet breach
#

first part is always printed unless it was a legit crash

#

rare to have a legit crash and commonly such things are the result of mojang code more so then spigot

#

but basically its just the watchdog or panic as it is also known

#

happens when the server thread hasn't responded for a period of time

#

can be caused because you decided to paste too many blocks at once 😉

flint coyote
#

Or forgetting to break a loop 😛

wet breach
#

sure but I was just pointing out an easy way to make it happen that isn't the result of any code

flint coyote
#

I see, yeah makes sense

smoky oak
#

regex + was 'at least one' correct?

flint coyote
#

I don't get the question

trim lake
#

Would be passible to make visibility of others player name toggle able with command?

#

Ex. If I typed /names I will se player names

flint coyote
#

You can hide names with scoreboard teams so yes you can achieve that with a command

trim lake
#

So probably not needed to make plugin for that 🤔 thanks

flint coyote
#

I'm not an expert with the vanilla scoreboard command but it might work without a plugin, yes

trim lake
#

I would like make command for admins, so they can see names when ever they want. But player wont see names

#

So Im not sure, If can be toggle able to only specific player can see the names

flint coyote
#

you can probably check for permissions or op status in a command block. Not sure - I'm more on the development side

eternal oxide
#

then admins and anyoen you want to see names you move out of that team

trim lake
#

Yea, thanks. So its simlpy. If someone type command /names I will add him to team where he can see names.

#

Simples than I thought.

eternal oxide
#

yes

trim lake
#

It is depricated but I guess, thats fine

eternal oxide
#

its just been replaced is all

trim lake
#

perfect, thanks

quaint mantle
#

OfflinePlayer playerToBeAdded = Bukkit.getOfflinePlayer(playerTobeAddedName);

#

i have a problem, is there a way to check if the playerToBeAdded player has ever joined the server before?

kind hatch
#

Player#hasPlayedBefore()

quaint mantle
#

ok.

trim lake
#

Is there way to display text above player? Probably best solution is invisible armor stand?

quaint mantle
#

another question, it seems to be making an mojang api call though to get the player, is there a way to just check without making a mojang api call?

quaint mantle
#

i dont have the uuid.

chrome beacon
#

Then no you can't

flint coyote
#

What are you trying to achieve @quaint mantle?
Do you need the data for offline players or is it fine to check once they join?

quaint mantle
#

i am using the username to check against uuid.

chrome beacon
#

You need to api call to get the uuid from the username

quaint mantle
quaint mantle
#

i could just check for usernames there.

#

save some network io.

terse ore
#

@tender shard I saw you made a post for making custom portals do you think you could help me with something similar?

quaint mantle
#

make code a bit more efficient.

#

maybe.

chrome beacon
#

What is the goal?

#

What are you trying to make

quaint mantle
#

well, its just a membership system that is it.

#

/members add Grian is the command that is it.

chrome beacon
#

and you want to add offline players?

quaint mantle
#

yep.

#

but i only wanna add them if they have joined the server before.

#

i mean i achieved that, i was wondering if there is a more efficient way than making a mojang api call.

#

eh, does not matter anyway.

#

nvm.

eternal oxide
#

the only way to NOT make a web call is to manually search getOfflinePlayers()

quaint mantle
#

that may be what i was looking for, appreciate the help.

#

oh wait, nvm, i cant even use that, cuz players could change usernames.

#

it would become unsynchronised, nvm.

#

i guess api call it is.

eternal oxide
#

yes, but you are only providing a name

echo basalt
#

make it async

quaint mantle
#

no, i mean unsynchronised with the official mojang database.

#

nvm all that.

echo basalt
#

Just make an async api call

quaint mantle
#

it is already async.

echo basalt
#

CompletableFuture.supplyAsync(() -> Bukkit.getOfflinePlayer(name)).thenAccept(player -> {
...
}); y'know

#

at a company I worked for, we had our own UUID cache with multiple layers of fetching

#

it'd fetch from an in-memory cache, then a proxy-wide cache, and some third-party caches etc, might be useful for you

#

You don't always need to be synced with mojang

#

Sometimes speed is better

#

Well, not for a command but eh

sterile token
echo basalt
#

uh not really

sterile token
#

Hmn righ

echo basalt
#

if you sync it back to the main thread, you're gonna make it wait for the data to be available

#

what I have is a MainThreadExecutor that I use with CompletableFutures to yeet it back to main

sterile token
#

I mean execute the task Async but get the result sync

echo basalt
#

that's just gonna be waiting sync for the async task to complete

#

doesn't achieve much

sterile token
#

Yes that

#

I don't like to use the thenAccept()

#

It's males You write more code

echo basalt
#

you just gotta abstract it really well

#

🤔 project's at 770kb rn

#

I wonder when it'll reach 1mb

flint coyote
#

with or without any libs? 🤔

visual laurel
#
15.03 12:51:09 [Server] ERROR Could not pass event PlayerInteractEvent to ReplenishEnchantment v1.4-RELEASE
15.03 12:51:09 [Server] INFO java.lang.IllegalArgumentException: Cannot get data for not block WHEAT_SEEDS```

Getting this error on 1.19.3 spigot plugin when using the playerInteractEvent

```java
    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        Block block = event.getClickedBlock();

        if (event.getAction() == Action.RIGHT_CLICK_BLOCK && block.getType() == Material.WHEAT && player.getInventory().getItemInMainHand().getType() == Material.DIAMOND_HOE) {
            block.setType(Material.WHEAT_SEEDS);
            ItemStack wheatItem = new ItemStack(Material.WHEAT);
            player.getWorld().dropItemNaturally(block.getLocation(), wheatItem);
        }
    }
weak meteor
#

what

#

the

#

actual

#

fuck

#

'registerEvents(org.bukkit.event.Listener, org.bukkit.plugin.Plugin)' in 'org.bukkit.plugin.PluginManager' cannot be applied to '(cirosanchezb.dtanvilrpg.events.MainMenuInventoryClickEvent)'

eternal oxide
chrome beacon
quaint mantle
#

is there an event for land being tilled for crops?

visual laurel
eternal oxide
visual laurel
#

yeah i was looking in there and didnt see wheat thats why i asked

chrome beacon
#

Set wheat and not wheat seeds

#

and then change the age with the method ElgarL sent

vital sandal
#

any good way to encode/protect my plugin ?

eternal oxide
#

no

vital sandal
#

or at least remove the pom.xml from .jar

eternal oxide
#

don;t include source

vital sandal
#

how :l?

smoky oak
#

is ItemStack::getItemMeta::getPersistentDataContainer reference or do i need to put the modified ItemMeta back into the ItemStack after editing?

eternal oxide
#

meta is always a clone

smoky oak
#

so put it back

#

got it thanks

#

what about ItemMeta::getPersisetntDataContainer? Is that reference then?

eternal oxide
#

Not sure, but be safe

worn tundra
#

It just gets modified

#

Same as the lore or any other attribute would

#

When you change that, just make sure to apply the itemmeta

smoky oak
#

ok

visual laurel
#

java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftCrops cannot be cast to class org.bukkit.entity.Ageable (org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftCrops and org.bukkit.entity.Ageable are in unnamed module of loader java.net.URLClassLoader @200a570f)

#

thats the error

#
@EventHandler
    public void onPlayerInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        Block block = event.getClickedBlock();

        if (event.getAction() == Action.RIGHT_CLICK_BLOCK && block.getType() == Material.WHEAT && player.getInventory().getItemInMainHand().getType() == Material.DIAMOND_HOE) {
            Ageable wheatBlock = (Ageable) block.getBlockData();

            if (wheatBlock.getAge() > 5){
                block.setType(Material.WHEAT);
                ItemStack wheatItem = new ItemStack(Material.WHEAT);
                player.getWorld().dropItemNaturally(block.getLocation(), wheatItem);
            }
        }
    }```
#

thats the code

#

What am i doing wrong here?

worldly ingot
#

Wrong Ageable interface

#

There are two

lost matrix
#

You should not rely on implicit relations like if material is Wheat then i can safely cast to Ageable
Always do an instanceof check. Also you are using Ageable for entities like Choco said. (Cows, Pigs etc)

worldly ingot
#

+1

smoky oak
#

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.meta.ItemMeta.getPersistentDataContainer()" because the return value of "org.bukkit.inventory.ItemStack.getItemMeta()" is null
however

ItemMeta meta = stack.getItemMeta();
meta.getPersistentDataContainer().set(
    new NamespacedKey(Echo.getInstance(), "AppliedShard"),
    PersistentDataType.STRING,
    "APPLY_SAFE");
stack.setItemMeta(meta);

am i missing something about itemMeta here?

#

theres no meta.setPDC method

chrome beacon
#

You don't need to set the pdc

#

What you're doing is fine

smoky oak
#

wheres my pdc then

#

the code runs without error and the visual clue that it ran is there

chrome beacon
#

The error you sent says the item doesn't have item meta

#

Which means it's probably air

smoky oak
#

im clicking with the item that has the visual clue that the code above ran

#

also

#

as i said

#

there is no error otherwise

#

again where is my pdc

chrome beacon
#

wdym?

#

It's stored in the nbt tag if you want to see it in game

smoky oak
#

uh do u know the command to check that?

chrome beacon
#

/data get entity @s SelectedItem.tag

#

Going of memory might be slightly wrong

smoky oak
#

yea the nbt is there

#

so why the hell does it say the itemMeta is null

chrome beacon
#

Are you using the interact event?

smoky oak
#

click event

#
ItemStack clickedWith = event.getCursor();
if(clickedWith == null ) return;
String s = clickedWith.getItemMeta().getPersistentDataContainer().getOrDefault(
    new NamespacedKey(Echo.getInstance(),"AppliedShard"),
    PersistentDataType.STRING,
    "DO_NOT_APPLY");
#

and yes that is LITERALLY all my code

#

so why does an item that definitively HAS metadata return NULL ?!

chrome beacon
#

clickedWith == null || clickedWith.getType().isAir()

#

Try that

smoky oak
#

dafuq?

chrome beacon
#

?

#

In your if statement

smoky oak
#

i mean

#

i did that but

#

why does it not err out now

#

i mean

#

when i had two items and clicked on one with the other

#

it threw the error

#

?????????

#

does the click event get thrown multiple times maybe?

#

hm it doesnt

eternal oxide
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
eternal oxide
#

or are you inventory click?

smoky oak
#

inventory click

#

i have a completely different issue now

#

so apparantly this doesnt apply frostwalker to boots

for(Enchantment e : list.keySet()){
    Bukkit.broadcastMessage(e.toString());
    clickedOn.addEnchantment(e,list.get(e));
#

i am so goddamn done

#

doesnt throw an exception

#

it just doesnt apply the enchantment

eternal oxide
#

are you also messing with the meta?

smoky oak
#

of what?

eternal oxide
#

the item you are trying to enchant

smoky oak
#

no

#

thats just a pair of boots pulled out of thin air

#

all im doing with that one is doing a null and air check beforehand

eternal oxide
#

you don;t touch its meta nor pdc?

smoky oak
#

nope

round finch
#

if you're trying to set enchantment just use meta from the Item you have

smoky oak
#
//null check above
//check if should apply
Map<Enchantment, Integer> list = clickedWith.getEnchantments();
for(Enchantment e : list.keySet()){
    Bukkit.broadcastMessage(e.toString());
    clickedOn.addEnchantment(e,list.get(e));}
#

also why should i use meta if ItemStack has setEnchantment methods?

wispy wyvern
#

how can i make this code allow me to place only 1 block of gold and remove all others i try to place within the given radius?

@EventHandler
    public void onMachinePlace(BlockPlaceEvent event)
    {
        Block block = event.getBlock();
        Location loc = block.getLocation();
        ConfigUtil config = new ConfigUtil(RankupMachines.getInstance(), "machines.yml");
        int radius = (int) config.getConfig().get("machines.gold_machine.radius");
        String rType = (String) config.getConfig().get("machines.gold_machine.radius_type");
        List<Block> blocks = getBlocksInRadius(loc, radius, RadiusType.valueOf(rType));
        for (Block b : blocks) {
            if (b.getType() == Material.GOLD_BLOCK) {
                event.setCancelled(true);
                break;
            }
        }
    }
#

it works, but it also deletes the block im currently trying to place

#

so there's never a single gold block

smoky oak
buoyant viper
#

or lwjgl might be doing something

smoky oak
#

im so goddammed done
this is the code that creates that message

for(Enchantment e : list.keySet()){
    Bukkit.broadcastMessage(e.toString()+" "+list.get(e));
    clickedOn.addEnchantment(e,list.get(e));

where the hell is the enchantment gone
There's no exception in the console

quaint mantle
#

is there an event for sheep being sheared?

smoky oak
#

i am trying, keyword trying, to apply an enchantment to an item

#

idfk whats going on here but its not applying the enchantment

round finch
#

i need help with figuring out multi java threading
any recommended sources?

idk how to manage them properly

quaint mantle
#

you are getting the enchantment from the keySet then you are doing list.get(e);, what are you even doing?

quaint mantle
smoky oak
#

im grabbing the set of enchantments from one item, which is a Map<Enchantment, Integer> and TRYING to apply it to an item with that loop

#

it prints the damn enchantment

#

so where is it

wispy wyvern
# smoky oak get rid of the block ur placed from the blocks list

how would i do that? this is my getBlocksInRadius

private static List<Block> getBlocksInRadiusSquare(final Location center, final int radius, final Predicate<Block> predicate) {
        final List<Block> blocks = new ArrayList<>();
        for (int x = center.getBlockX() - radius; x <= center.getBlockX() + radius; x++) {
            for (int y = center.getBlockY() - radius; y <= center.getBlockY() + radius; y++) {
                for (int z = center.getBlockZ() - radius; z <= center.getBlockZ() + radius; z++) {
                    final Block block = Objects.requireNonNull(center.getWorld()).getBlockAt(x, y, z);
                    if (predicate.test(block)) {
                        blocks.add(block);
                    }
                }
            }
        }
        return blocks;
    }
round finch
#

java Threads fr

eternal oxide
#

try an addUnsafeEnchantment

smoky oak
terse ore
smoky oak
terse ore
#

I am confused on how to do them

buoyant viper
#

?jd-s

undone axleBOT
smoky oak
#

@eternal oxide Nope. No message, no enchant

eternal oxide
#

do you have the correct API version set in your plugin.yml?

wispy wyvern
smoky oak
#

im running 1.19 on all of em

eternal oxide
#

and you have that in your plugin.yml?

smoky oak
#

ye

wispy wyvern
#

@smoky oak i love you!

#

i've been here all day, trying to use my shit brain to make it myself

#

you took 3 seconds :/

fluid river
#

i woke up

buoyant viper
#

go back to sleep

smoky oak
#

BWAHAHA
the captchas are using Stablediffusion images now

#

LOL

round finch
#

i need help with figuring out multi java threading

smoky oak
fluid river
#

?

smoky oak
#

tldr

#

i apply enchantment

#

enchantment not applied

fluid river
#

umm

#

aren't enchantments part of meta

#

hi morice

eternal oxide
#

yes, but you can use the addEnchant on the ItemStack if you are not altering the meta

#

its just a wrapper

#

thats possible

#

but thats what addUnsafe is for

wispy wyvern
#

im creating something similar to a spawner, and it will stack entities, so like if i place 10 spawners, they'll merge into the closest spawner and show 10x Rabbit on top for example.
how could i store this data for each player's spawners?

smoky oak
#

WHAT THE ABSOLUTE F***
so im printing to console what im using. this works

Bukkit.broadcastMessage("'"+strings[0].toLowerCase(Locale.ENGLISH)+"'");
Enchantment enchantment = Enchantment.getByKey(NamespacedKey.minecraft(strings[0].toLowerCase(Locale.ENGLISH)));
ItemStack stack = player.getInventory().getItemInMainHand();
stack.addUnsafeEnchantment(enchantment,1);

this doesnt

Bukkit.broadcastMessage("'"+eString+"'");
Enchantment ench = Enchantment.getByKey(NamespacedKey.minecraft(eString.toLowerCase(Locale.ENGLISH)));
clickedOn.addEnchantment(ench,1);

BOTH prints THE EXACT SAME TEXT to the console

undone axleBOT
wispy wyvern
#

that was just an example, i'm using a custom block at the moment

#

the effect is the same, it produces money and if you place more machines they'll stack

undone axleBOT
wispy wyvern
#

can i store a quantity in pdc?

smoky oak
#

pdc can store everything

wispy wyvern
#

oh yea that not nbt, nvm

smoky oak
#

its just not recommended

hollow grotto
#

Hello! I have this problem in Spigot (Minecraft Plugin), where some of my command aliases works, some doesn't but my code seems fine, and when I use the main command it works, there also seems no problem in plugin.yml, any idea about this matter?

buoyant viper
#

just sounds like not all aliases are in plugin.yml to me

hollow grotto
#

When sending codes here, should it be in what format?

undone axleBOT
hollow grotto
buoyant viper
#

woah idk what my eyes are doing but that red text is like 3D to me

crystal palm
#

hiya. using bungeecord - i want to add a column named after each server for storing a big int on proxy startup to an sqlite database. what would be the correct method?

"ALTER TABLE db ADD ? BIGINT(100)"

I tried this but I don't think it'll work.

hollow grotto
#

so the uppercase matter is the only issue?

buoyant viper
#

blender 3d ? AbsoluteHalal

hollow grotto
#

alright, I tried it on the itemRename, and changed it to itemrename and it worked...

fluid river
#

gender 2d

quaint mantle
#

hi, for PlayerInteractAtEntityEvent, how do i get the item player right-clicked with?

buoyant viper
#

gender 3d

fluid river
#

no

#

gender 2d

round finch
crystal palm
#

huh? will that actually create a new column?

buoyant viper
#

gender 4d

fluid river
#

gender 115d

quaint mantle
#

hi, for PlayerInteractAtEntityEvent, how do i get the item player right-clicked with?

crystal palm
#

huh alright, though i dont really see a ? placeholder in there. running a for loop

fluid river
#

event.getPlayer().getInventory().getItemInMainHand() ez

round finch
#

lender 45f

fluid river
#

isn't current for inv

buoyant viper
#

?jd-s

undone axleBOT
quaint mantle
#

so, if the item was shears and player sheared sheep and the shear may have been in offhand, would it return the offhand item or mainhand?

quaint mantle
fluid river
#

read last method name

#

pls

buoyant viper
#

u can get which hand they interacted with

quaint mantle
#

okay.

crystal palm
#

yeahh uhh i dont think it works.

#

pretty sure its ALTER <table> ADD <column> <datatype>

round finch
#

mah eyes welp mysql

quaint mantle
#

uh.

#

how do i get the item?

#

and material of the item, more specifically cuz i need to check if it is a pair of shears or not.

#
Player player = event.getPlayer();
EquipmentSlot hand = event.getHand();

Material material;
if (hand == EquipmentSlot.HAND) {
    material = player.getMainHand();
}```
crystal palm
#

hmm alright!

weak meteor
quaint mantle
#
Player player = event.getPlayer();
        
        Material material;
        if (event.getHand() == EquipmentSlot.HAND) {
            material = player.getInventory().getItemInMainHand().getType();
        } else {
            material = player.getInventory().getItemInOffHand().getType();
        }```
fluid river
#

jree fava lessons

quaint mantle
#

is this correct?

#

ok.

buoyant viper
#

yes

#

so u need to see which hand it was called for

#

and if they're holding two shears? oh well

fluid river
#
Material material = event.getHand() == EquipmentSlot.HAND? player.getInventory().getItemInMainHand().getType() : player.getInventory().getItemInOffHand().getType();```
ez
quaint mantle
fluid river
#

))

quaint mantle
#

i dont nest if statements unless i am the only one working on the project.

#

i find nested if statements kind of easy to read.

#

it does not seem to work.

fluid river
#

?

quaint mantle
#

i guess trial and error it is.

fluid river
#

tho

#

item is nullable

#
var item = event.getHand() == EquipmentSlot.HAND? player.getInventory().getItemInMainHand() : player.getInventory().getItemInOffHand();
if (item == null) return;```
#

yes i do

#

var good

#

full typename disgusting

quaint mantle
#

i use statically typed languages for the fully typed typenames.

fluid river
#

and?

quaint mantle
#

and, that is it probably.

fluid river
#

what prevents people from using var in java

#

var is statically typed too tho

quaint mantle
#

yeah that probably was kind of menacing though lol.

quaint mantle
fluid river
#

you can't declare variable with var if you don't init it on the same line with =

quaint mantle
#

i dont use python.

#

ok.

fluid river
#
var map = new HashMap<UUID, Object>(120); // java19+```
#

you don't type HashMap<> two times

#

just using var

#

<>

#

still 2 chars less

#

ez

hasty wasp
#

Any Ideas why my Itemstack material is AIR when I am holding a sword and sneaking at the same time? (player.getActiveItem())

fluid river
#

?jd-s

undone axleBOT
fluid river
#

is that even spigot

#

oh

#

sheeit

#

guys can you send 1.5.2 spigot

#

so i can code for 1.5.2

hasty wasp
#

1.19.2

fluid river
#

i'm unsure

#

don't see it on javadocs

#

maybe paper

#

or 1.9.2

#

if it even exists

quaint mantle
#
    public void onPlayerInteractAtEntityEvent (PlayerInteractAtEntityEvent event) {
        event.setCancelled(true);
    }```
#

sheep still gets sheared.

#

how do i cancel sheep shear?

fluid river
#

@EventHandler

quaint mantle
#

it has the event handler.

fluid river
#

PlayerShearEntityEvent

quaint mantle
#

oh.

#

okay.

fluid river
#

idk what he was doin'

#

just clicking on entities with shears in both hands

#

hey morice

#

do you have some free time

#

and a local server

#

empty

quaint mantle
#

this could have probably been so much faster only if that event would have been known to me sooner.

#

what are you doing there? I am curious now lol.

fluid river
quaint mantle
#

both of you.

fluid river
#

umm

#

you can join if you want

tender shard
#

anyway, what's your question

quaint mantle
signal kettle
#

I tried to make ShapedRecipe that using oraxen Items as input and as well output, with vanilla Items it work but with oraxen not. Any ideas?

public class CraftingRecipes {
    public static void init() {CreateAsh_Block();}

    private static void CreateAsh_Block() {
        ItemStack ash_block = OraxenItems.getItemById("ash_block").build();
        ItemStack ash_item = OraxenItems.getItemById("ash_item").build();

        ShapedRecipe ash_block_recipe = new ShapedRecipe(NamespacedKey.minecraft("ash_block"), ash_block);
        ///A - ash_item
        ash_block_recipe.shape("AA ", "AA ");
        ash_block_recipe.setIngredient('A', ash_item);
        Bukkit.getServer().addRecipe(ash_block_recipe);
    }
}
tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

olive sparrow
#

Hey guys. Just started messing with placing blocks and this happened https://ibb.co/kSG0g5y . Could you please point me in a direction of fixing this ? (the glass wont connect to the cobble)

tender shard
#

you mean that the glasspane didn't update?

olive sparrow
tender shard
#

show the line where you're doing setType

#

try to use setType(someMaterial, true)

olive sparrow
#

IntelliJ froze up on me again T_T Im going to try that

tender shard
#

are you using the minecraft dev plugin? because that plugin is the reason for 100% of my intellij crashes lol

olive sparrow
#

Yeah.

chrome beacon
#

You might need to allocate more ram if the material enum freezes IJ

buoyant viper
#

need a super computer to open that class

olive sparrow
tender shard
#

yeah that can also help. but the IJ minecraft dev plugin also causes crashes with 10GB assigned

#

Help -> Change memory settings (or sth like that)

olive sparrow
signal kettle
# tender shard ?notworking

when I use vanilla items in ItemStacks then everything work like should, I put the ingredient where they belongs and I get output item that I set, but when I set it with Oraxen ItemStacks then after puting ingredients (Oraxen ItemStack ash_item) to crafting like they should be I get nothing as output.
No errors in console, plugin enabled like should. Also ItemStacks for Oraxen are build in proper way.

tender shard
olive sparrow
tender shard
small current
#

Why when i cancel ProjectileHitEvent, the firecharge fire still works

tender shard
#

maybe oraxen uses a random PDC tag to make this one item unstackable or sth

small current
tender shard
#

i dont know what fire charges do. do they explode?

#

if yes, cancel EntityExplodeEvent

hasty prawn
#

They're weird, they can explode but they don't always explode

quaint mantle
#

How can I make a item display as big as a block?

hasty prawn
#

Like one shot from a dispenser doesn't explode, just sets fire (i think) but one from a Ghast does explode.

tender shard
quaint mantle
#

The new entities 1.19.4 added

tender shard
#

oh I haven't seen them yet

quaint mantle
#

Block display, item display, text display

chrome beacon
quaint mantle
#

Yep

regal geyser
#

how can i make variable like this in kotlin? tried

val plugin = ConfigPlugin.plugin(ConfigPlugin.class)

but the .plugin is red

tender shard
chrome beacon
quaint mantle
#

I'm using the spigot api for them, so

chrome beacon
quaint mantle
#

I had to build spigot 1.19.4 because I think it's not up on the site

tender shard
quaint mantle
#

google

chrome beacon
#

You always need to build Spigot

quaint mantle
#

What

chrome beacon
#

You've had to use build tools since 1.8

quaint mantle
#

I only build Spigot when I need NMS

quaint mantle
chrome beacon
#

Don't tell me you've been using unofficial uploads from 3rd party sites 💀

quaint mantle
#

No

hasty prawn
#

oh

quaint mantle
#

I use Purpur or Pufferfish mainly because of the performance

#

That's why I never had to build Spigot I think

hexed falcon
#

This code seems fine but when it runs on a server the console reports Java.lang.nullpointerexception:null. but the code works so idk why error

tender shard
#

show the stacktrace

#

?paste

undone axleBOT
tender shard
#

it's probably the getDisplayName() which is already highlighted by IJ

#

getDisplayName() will cause NPE if the item you have in your hand doesn't have item meta (e.g. if you don't have any item in the hand)

hexed falcon
#

so should i add an else where if the item isn't in hand it does nothing?

quaint mantle
#

so uhh how do i make procedurally generated structures in an empty world

tender shard
cobalt thorn
#
Cauldron cauldron = (Cauldron) item.getLocation().getBlock().getState().getData();
                            BlockState cauldronState = item.getLocation().getBlock().getState();
                            cauldronState.getData().setData((byte) (cauldron.getData() + 1));
                            cauldronState.update();

i don't know why but im trying updating the water and doesn't work, any clue? im using 1.19.3

tender shard
#

Thats 1.8 code

cobalt thorn
tender shard
#

Use Levelled

#
        Levelled levelled = (Levelled) block.getBlockData();
        levelled.setLevel(levelled.getMaximumLevel());
        block.setBlockData(levelled);
#

that fills the cauldron completely

hexed falcon
tender shard
#

?learnjava

undone axleBOT
tender shard
#

hasItemMeta() returns true/false, whether the item has itemmeta

#

if hasItemMeta() returns false, it means getItemMeta() will be null, which means you cannot call getDisplayName() on it

cobalt thorn
tender shard
cobalt thorn
tender shard
#

anyone else got this bug? after /reload, it always says I have chat disabled, although I don't

#

rejoining fixes it

smoky oak
#

never seen that

#

on a different topic does anyone know why cancelling inventoryClickEvent clones the item clicked on into the cursor?

#

ive been trying for like 20 minutes to get rid of that

bitter steeple
#

There is still not way to setCustomName with TextComponent or to set to a JSON format?

#

😞

terse ore
rotund ravine
#

I just blamed the guy asking for help

young knoll
#

Sometimes it isn't the users fault

#

But only sometimes

rotund ravine
#

It was Alex’ fault for using reload

rotund ravine
smoky oak
#

clone

#

leave rejoin still there

rotund ravine
#

Then ur probably doing something wrong

smoky oak
chrome beacon
#

Are you on 1.19.4?

smoky oak
#

.3

#

y

chrome beacon
#

Bugs are usually quite common after a new release

smoky oak
#

idk whats happening

#

its just cloning the item

#

even if i do replace it

rotund ravine
#

Try to replicate it on 1.19.3

smoky oak
#

im on 1.19.3

#

not 4

chrome beacon
#

Are you in creative?

smoky oak
#

ye

#

why

#

im not cloning it

chrome beacon
#

If the item is on the cursor it means the client controls it

#

So it can duplicate

#

Try recreating your issue in survival mode

smoky oak
#

...works flawlessly in survival

#

i hate the event api

river oracle
#

Creative mode is just weird

#

Not event api fault Moreso how mojang has it setup backend

lost matrix
#

There is a separate event called InventoryCreativeEvent
But creative mode is often scuffed because a lot of things are client
authoritative there

rotund ravine
#

Yeah

#

Creative = pooo

cold field
#

I was wondering, why merging with paper isn't a thing?

smoky oak
#

cuz paper is built separately

young knoll
#

Because the paper team and MD have different visions

indigo sage
#

and different goals

buoyant viper
#

cos spigot is best duke

cold field
#

Mh, it must be smth groundbreaking bc the charts shows that vanilla spigot is becoming less and less popular.

hazy parrot
terse ore
#

@tender shard

smoky oak
#

why is everything here somehow related to alex

terse ore
#

I use search bar for looking at code from people

#

alex appears

#

I search in spigot resources

#

alex appears

#

he's an omniscient narrator in spigot

#

welp I still have my question

#

how could I make a custom portal?

#

there is PortalType.CUSTOM but no more info

young knoll
#

It looks like portaltype is only used in a deprecated event

terse ore
#

bruh

#

any suggestions on how to make a portal?

terse ore
#

I am thinking of using multiverse portals if not

young knoll
#

Well, you can use the PlayerPortalEvent to detect when they use a portal

terse ore
#

I want to make a portal with a custom border

young knoll
#

And then save the locations of your custom portals to compare in the event

terse ore
#

instead of obsidian use reinforced deepslate

young knoll
#

You probably just want to use the interact event then

#

When they interact with reinforced deepslate using a flint and steel, look for a valid portal shape and then spawn portal blocks

terse ore
#

that's my issue

#

I've been trying all morning to detect the portal shape but didn't get it

young knoll
#

Have a look at what Mojang does perhaps

terse ore
#

how can I check it?

young knoll
#

Decompile the remapped jar from buildtools and dig around

terse ore
#

oki

round finch
#

i wanna learn all about threads

subtle folio
#

What’s the best framework for making websites in my plugin?

maiden thicket
#

check how mojang creates Wither and iron golem structures in NMS

#

u'll probably see how portals are created there

gritty brook
quaint mantle
#

Why do item displays go black when there's a solid block under them

young knoll
#

Because they calculate lighting based on location

remote swallow
#

a part of them is clipping the block so aliasing

tawny remnant
#

alexes fault btw

quaint mantle
#

why is the hitbox below the item display

tawny remnant
#

move it down

quaint mantle
#

how

chrome beacon
#

That's the eye height. I don't see a hitbox in that screenshot

tawny remnant
remote swallow
#

you seem to be missing pink name

young knoll
#

They don't actually have a hitbox

chrome beacon
remote swallow
#

very sad

quaint mantle
tawny remnant
#

show code

young knoll
#

Of course it does

remote swallow
#

danko, thats not a hitbox

young knoll
#

Eye height is relative to the entity position

remote swallow
#

are item displays austrailian

tawny remnant
quaint mantle
young knoll
#

Should be able to

tender shard
tawny remnant
tender shard
#

The velocity also works fine. No idea why you're delaying it by 5 ticks, you can instantly set the velocity in the Consumer<Guardian>. Also a velocity with length 5 is quiiite fast as you can see in this video @tawny remnant

tender shard
#

read it

tawny remnant
#

why cant it be higher

#

is it setMaxHealth?

young knoll
#

getAttribute(Attribute.maxhealththingy).setBaseValue

tender shard
#

btw you are supposed to set the velocity in the consumer, as already said

public class GuardianTest implements NMSTest {
    @Override
    public void run(TestRunner runner, Player player) throws Throwable {
        Location loc = player.getTargetBlockExact(30).getLocation().add(0, 1,0 );
        runner.getWorld().setDifficulty(Difficulty.HARD);
        Guardian mob = player.getWorld().spawn(loc, Guardian.class, (g) -> {
            g.setCustomName("§b§lConfused Guardian");
            g.setCustomNameVisible(true);
            //g.setHealth(10);
            g.setTarget(player);

            Vector playerVec = player.getLocation().toVector();
            Vector entityVec = g.getLocation().toVector();
            Vector guardianToPlayerVec = playerVec.subtract(entityVec).normalize().multiply(2);

            g.setVelocity(guardianToPlayerVec);
        });
    }

quaint mantle
#

got it working!

#

Custom blocks in minecraft with custom model data

young knoll
#

Not bad

#

Sadly still too laggy for large scale

#

But less laggy than stands

quaint mantle
#

Laggy as in the client or the server?

tawny remnant
#

did you do it through NMS?

quaint mantle
#

No

young knoll
#

Client

#

I mean they will have a small impact server side because while they don't tick they still are in the entity lists

halcyon hemlock
#

What do u guys think

#

Procedural dungeon generation

tardy delta
#

can you also do procedural tree generation in mc?

still ocean
#

can someone make "BossBar Damage Indicator"

young knoll
#

?services

undone axleBOT
cobalt thorn
#
if(event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.CAULDRON) {
            if(event.getItem().getType().toString().contains("_LEAVES")) {
                event.getItem().setAmount(event.getItem().getAmount() - 1);
                Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
                    @Override
                    public void run() {
                        Levelled cauldron = (Levelled) event.getClickedBlock().getBlockData();
                        cauldron.setLevel(cauldron.getLevel() + 1);
                        event.getClickedBlock().setBlockData(cauldron);
                    }
                }, 20 * plugin.getConfig().getInt("WaterLevel.time"));
            }
        }

Its giving me this error:
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R2.block.data.CraftBlockData cannot be cast to class org.bukkit.block.data.Levelled (org.bukkit.craftbukkit.v1_19_R2.block.data.CraftBlockData and org.bukkit.block.data.Levelled are in unnamed module of loader java.net.URLClassLoader @46ee7fe8)

someone knows a fix?

young knoll
#

Cauldron is not levelled

#

WATER_CAULDRON is

cobalt thorn
young knoll
#

Turn it into a water cauldon first

cobalt thorn
young knoll
#

mhm

cobalt thorn
#

and then exectute the code as normal

young knoll
#

Yep

cobalt thorn
#

thanks

young knoll
#

The water and powdered snow cauldrons are levelled, empty and lava ones are not

tender shard
#

I wonder what's the reason to have different cauldrons for empty and water

young knoll
#

Because there is also lava and powder snow cauldrons

tender shard
#

it would be easier to just have CAULDRON with a level of 0 for an empty cauldron, and then a separate one for LAVA and SNOW

young knoll
#

And they don't all act the same

#

¯_(ツ)_/¯

twilit roost
#

can I Thread#sleep in CompletableFuture?

weak meteor
#

getServer().getPluginManager().registerEvents(new MainMenuInventoryClickEvent(this, config), this);

Class: ```java
public class MainMenuInventoryClickEvent implements Listener {
public MainMenuInventoryClickEvent(Plugin plugin, Configuration config) {
this.plugin = plugin;
this.config = config;
}
public void getInventory(Inventory inventory){
mainMenuInventory = inventory;
}

public void onMainMenuClick(InventoryClickEvent e){
    e.getWhoClicked().sendMessage("asdsadas");
    if (e.getClickedInventory() == mainMenuInventory){
       e.setCancelled(true);
        if (e.getCurrentItem() != null){
            switch (e.getCurrentItem().getType()){
                case DIAMOND_SWORD:
                    EnchanterMenu enchanterMenu = new EnchanterMenu(plugin, config, (Player) e.getWhoClicked());
                    enchanterMenu.openEnchanter();
                    break;
                case WOODEN_SWORD:

                    break;
                case BRICK:
                    break;
                case WRITABLE_BOOK:
                    break;
                case EXPERIENCE_BOTTLE:
                    break;
                case PLAYER_HEAD:
                    break;
            }
        }
    }
}``` Bros not sending me the asdadsad message from the event idk why
quaint mantle
#

How can I play a hand swing animation on the client?

tender shard
tender shard
tender shard
young knoll
#

Do note that isn't just the animation

#

They will wack stuff

quaint mantle
weak meteor
tender shard
tender shard
young knoll
#

Really?

quaint mantle
#

Seems like it

young knoll
#

I swear I did it before and ended up wacking stuff

#

Huh

#

Welp my bad

quaint mantle
#

How can I check which hand the item is in in player interact event?

tender shard
quaint mantle
#

aight thanks

#

So there is a delay when placing blocks one after another right?

#

I'm trying to replicate that

#

Because I need a way to place my custom blocks since they are just items with custom model data

tawny remnant
#

How do i make a config file that sets a true/false of a boolean?

warm mica
tawny remnant
#

would you be able to provide me with a link to a guide for a config file?

chrome beacon
#

?configs

undone axleBOT
small timber
#
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException```