#help-development

1 messages · Page 2211 of 1

buoyant viper
#

didnt know my site screams 🏳️‍⚧️

dusk flicker
#

83.1% of people run above 1.16

lost matrix
#

1.8.8 people just want to click their left mouse button real fast.
Everything more complex is incomprehensible for them.

ivory sleet
#

Well there’s block hitting

#

But that’s just spam left+right, not much of a difference

eternal night
#

Conclure coming out as a secret 1.8 enjoyer ?!

#

phew

eternal oxide
#

I like 1.8 combat because I panic like fuck and just hit random buttons.

river oracle
#

I am a 1.8 combat enjoyer , but I am also an intellectual who installs a plugin

buoyant viper
#

no, dont even fucking think about swearing

quiet garden
eternal night
#

have you read general

river oracle
#

swearing is fucking prohibited don't you dare

buoyant viper
#

porhiniyted

quiet garden
#

why the fuck would you swear

dusk flicker
#

no you can not fucking swear

ivory sleet
#

||When used in moderation cursing is fine||

lost matrix
dusk flicker
#

fuck fuck fuck fuck fuck fuck fuck fuck fuck fuck fuck fuck fuck fuck fuck fuck

#

I actually typed each of those rather than copying and pasting lmao

river oracle
#

lol

ivory sleet
lost matrix
#

bollocks
(no ban pls)

ivory sleet
quiet garden
dusk flicker
#

string

buoyant viper
#

int

dusk flicker
#

are you running an offline server

lost matrix
quiet garden
#

and even with the same file switching to the pervious maven version fixes it

dusk flicker
#

string are you making an offline server?

lost matrix
dusk flicker
#

yours I assume

#

for the core you are making

lost matrix
#

Use a more object oriented approach pls

buoyant viper
#

TimeUnit class go brrrrrrrr

quiet garden
lost matrix
#
  private Instant endTime;

  public void setTimeToPass(final Duration duration) {
    this.endTime = Instant.now().plus(duration);
  }

  public boolean hasTimePassed() {
    return Instant.now().isAfter(this.endTime);
  }
dusk flicker
#

why do you need to use modulo in that?

dusk flicker
#

this is a thing in java???

#

I literally wrote an entire fucking duration thing that does all of that

ivory sleet
#

Since java 8 🌚

lost matrix
#

Setting a duration is as easy as:

x
setTimeToPass(Duration.ofSeconds(30));
or
setTimeToPass(Duration.ofDays(1));
or
setTimeToPass(Duration.ofMillis(6000));
etc
#

I find that more readable than using raw millis

dusk flicker
#

😵

#

not always

ivory sleet
#

More bug prone to the contrary

waxen plinth
#

No conclure don't you understand

#

Abstraction is poison

#

Homebrew everything

lost matrix
#

I once ran a thought experiment on how far you could abstract something away. And i ended up with
something called Atomos which was like 50 abstraction levels away from my starting point (Car)

dusk flicker
#

lmao

waxen plinth
#

There's no limit to how many abstraction layers you can have

#

The question is how many of them can be useful

ivory sleet
#

More like gold if done correctly and solidly :3

lost matrix
#

Composition > Inheritance

ivory sleet
#

Oh I don’t necessarily mean impl inheritance but ye

#

That one is true

pastel juniper
#

I made a claim system but whenever a player claims land instead of getting the UUID in config file, I get this:

brave sparrow
#

That’s a UUID ish

#

How did you serialize it @pastel juniper

lost matrix
#

Just serialize them as a String and deserialize them using UUID.fromString()

pastel juniper
brave sparrow
#

How did you serialize it

pastel juniper
#

It cannot understand the extra part

brave sparrow
#

7 is correct though

pastel juniper
upper tendon
#

There a way to know who crafted an item in the CraftItemEvent?

upper tendon
#

...how...?

tender shard
#

getWhoClicked

lost matrix
tender shard
upper tendon
#

Oh yeah totally

#

Didn't catch that on the website

#

Thanks

lost matrix
#

Ah thought about the Prepare event

tender shard
#

yeah the prepare event requires getting the viewer

topaz cape
#

any clue how's this done?

ivory sleet
#

Resource pack

topaz cape
#

well how is it sent in chat xd

ivory sleet
#

Using Chinese and other obscure characters

topaz cape
#

huh

ivory sleet
#

Ye

#

The server sends the client gibberish

tender shard
ivory sleet
#

But the client knows what the gibberish means

#

And turns it into a cool looking texture

#

With the help of a resource pack

topaz cape
#

ok i can do the resource pack i just dont know how would i send it to a player

tender shard
topaz cape
#

no i mean like in chat

#

i can give the player the resource pack too

tender shard
#

i dont get the question

topaz cape
#

the textures exist in the resource pack

tender shard
#

in your resource pack you add a font. it looks like the normal font except that ä gets replaced with the spigot logo. now you send a message that contains ä and itll show the spigot logo.

topaz cape
#

just not in the chat

#

oh

#

i see

tender shard
ivory sleet
#

Lol

dire sand
#

How can I rotate a block to be facing a certain direction w/o getBlockData

tender shard
#

why without blockdata?

dire sand
#

Don't seem to have that as a method

tender shard
#

you should rephrase your quesiton to "how can I rotate a block in <version>" then

dire sand
#

Oh sorry

#

How can I rotate a block in 1.11.2

tender shard
#

probably setData(...)

ornate patio
#

when packaging my jar, i have like 5 options

#

which one should i use?

tender shard
tender shard
ornate patio
#

oh alright

tender shard
#

unless that's not the file with the largest size

#

then you should check your pom and see what you have defined as finalName

dire sand
#

Hmmm

#

So I'm attempting to set the direction of vines

#
Block vineBlock = b.getRelative(facing.getOppositeFace());
            vineBlock.setType(Material.VINE, false);
            Vine v = (Vine) vineBlock.getState();
            v.setData();
#

I have the cardinal direction that I would like it to face

#

In the form of BlockFace

ornate patio
#

I'm receiving what should be an extremely simple error to fix but like I have no what's going on...

#
Caused by: java.lang.Error: Unresolved compilation problems:
        The import me.screescree.SuperiorSteed.Utils cannot be resolved
        Utils cannot be resolved
        Utils cannot be resolved

        at me.screescree.SuperiorSteed.SuperiorHorse.HorseEditor.HorseEditor.<init>(HorseEditor.java:14) ~[?:?]
        at me.screescree.SuperiorSteed.Commands.SummonHorse.onCommand(SummonHorse.java:26) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
#

import not resolved

#

even though its right there

#

and my IDE says its fine

#

I literally didnt make any changes that has to do with the file structure

#

i just added a print statement and this happened

tender shard
#

SUperiorSteed != SuperiorHorse

#

Utils is in SuperiorHorse

ornate patio
#

wait what

#

Utils is not in SuperiorHorse

tender shard
#

on your screenshot it is?

#

oh wait

ornate patio
#

its a little hard to tell because of all the indents

tender shard
#

it isnt

#

mb

ornate patio
#

why is this happening i didnt even do anything 😔

tender shard
#

seems like your sources root is messed up

dire sand
#

ok so I found that ```java
Vine v = (Vine) vineBlock.getState();
v.putOnFace(facing.getOppositeFace());

tender shard
#

or why is the horse folder green and commands folder blue?

dire sand
#

but how can I reapply this back to the block itself?

ornate patio
#

i even checked it in WinRar...

tender shard
#

how can you have a jar file if it cant compile?

ornate patio
#

it does compile

#

i load the plugin

#

and then run a command that uses the HorseEditor.java file

#

then it throws an error

#

i'm literally using the same import line in every other file

#

could this be something?

[WARNING] IF-0.10.5.jar, superior-steed-1.0.jar define 1 overlapping resource: 
[WARNING]   - META-INF/MANIFEST.MF
[WARNING] maven-shade-plugin has detected that some class files are   
[WARNING] present in two or more JARs. When this happens, only one    
[WARNING] single version of the class is copied to the uber jar.      
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on        
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
tender shard
#

no

#

you can ignore the warning about META-INF

#

you only need to care about the MANIFEST file if that actually contains something useful

#

for example if you wanna define a main class for a standalone app

ornate patio
#

oh

#

well it doesnt have anything to do with this import thing right

#

dude wtf

tender shard
#

idk never saw this error before

ornate patio
#

i just compiled it and loaded the plugin 50 times and now it works..

#

i didnt even

#

change anything

#

huh

#

im confused

#

i love programming

tender shard
#

just get a proper IDE 😛

ornate patio
#

i will be attacked by everyone for that every day

#

i will stand my ground

tender shard
#

same for me sometimes using light mode

ornate patio
#

why do you sometimes use light mode

#

sometimes you hate your eyes?

tender shard
#

idk I also sometimes eat pizza with tuna and sometimes I rather eat another kind of pizza

ornate patio
#

sometimes i drive my car with the seat facing the other direction

tender shard
#

hm I never tried that. it's probably illegal here

ornate patio
#

sometimes my knees bend backwards too

dusk flicker
#

wait wait wait

#

what ide are you using

#

oh god vscode

#

please use an actual ide

river oracle
#

I use vscode too

#

dusk flicker
#

i will fight

#

did you see my sign

river oracle
#

no

dusk flicker
#

oh I found your base on alex's server and left a sign

river oracle
#

oh

#

I haven't been online

dusk flicker
#

lol

river oracle
#

I've been busy

dusk flicker
#

fair

river oracle
#

thanks for remininding me though I'll hop on right now

dusk flicker
#

welp im going to sleep

solid sigil
#

I live vscode but it's no good for plugins

river oracle
#

👀 your take is bad so I will ignore it

tender shard
river oracle
#

😭

#

I will just code then

tender shard
#

lets do some stupid stuff in mc tomorrow

river oracle
#

I will after summa school class

tender shard
#

oki

ornate patio
#

all other opinions are invalid, vscode above all

river oracle
ornate patio
#

ill make it work

river oracle
#

at that point you might as well use notpad++ tbh

ornate patio
#

why does WHITE_DYE not exist

#

nvm i accidently imported NMS Material

#

is it possible to use a custom chat color on the display name of an item?

quaint mantle
#

have you even tried it- yes

ornate patio
#

i havent really used custom chat colors before

#

but I heard you have to use TextComponent or something, which isn't an argument option for ItemMeta#setDisplayName

quaint mantle
#

ItemMeta#setDisplayName(ChatColor.GREEN + "green.")

#

ItemMeta#setDisplayName(ChatColor.translateAlternateColorCodes("&a&lbold green."))

ornate patio
#

oh i meant

#

like the custom custom ones

#

with hex color codes

#

@quaint mantle

quaint mantle
#

i think they dont work in the inventory

#

i tried it once

ornate patio
#

aw man

quaint mantle
#

you can use hex on the display name

#

it just might not work in the inventory preview

#

you have to try it yourself

ornate patio
#

wdym

#

how does the display name work but inventory not

#

how would you even attempt a custom color

#

this takes a string not a TextComponent or whatever

quaint mantle
#

ChatColor.of(...)

#

bungeecord chatcolor

ornate patio
#

oh okay

dire sand
#

Hello

#

I am looking to spawn a falling block

#

But I just want for ex. a normal block to fall at a given location

#

How can I do that w/o MaterialData?

dire sand
#

Hello, in this example, how are you getting the block to phase through the others?

#

Oh nvm I see, you are removing then readding

#

Is it possible to have the block phase through?

rocky rampart
#

So I have a weird question. Does anyone know why Bukkit added a PluginClassLoader at all? What was the desired goal?

humble tulip
#

To load plugins?

#

It also does something with the dependencies iirc

rocky rampart
#

Well right, but that doesn't strictly require creating a new ClassLoader, you could simply load the jar and use the normal one.

humble tulip
#

U can check what it does yourself

rocky rampart
#

I have eyes, that isn't the problem.

#

I'm trying to figure out what advantage this offers, and the best I can come up with doesn't seem to cover it.

#

What it seems to do is read the bytecode and redefine the classes contained within that plugin's jar, but I don't see why that would be advantageous.

winged anvil
#

am i tweakin or is there not a way to save a maven build to multiple directories

rocky rampart
#

I don't think Maven's really designed to do that sort of stuff, it's pretty much just designed to build things. That's why people use things like Ant / Gradle on top of Maven.

#

You can specify an output directory, but I don't think you can do multiple.

wet breach
#

give me a bit and I can answer the classloader question

unique shuttle
#

Does anyone know if this "Preview chat" is implemented?

#

in spigot

#

or bukkit

night bay
#

No it is not implemented yet

west crag
#
Sound sound = Sound.values()[new Random().nextInt(Sound.values().length)];
EntityType entityType = EntityType.values()[new Random().nextInt(EntityType.values().length)];
            event.getPlayer().playSound(entityType,sound,100,10);
#

is this correct way to produce sound when ever player breaks a block

hazy rock
#

are there any libraries or similar out there that help with creating chest guis? having lots of problems trying to make my own implementation so i figured i might as well use someone elses code lmao

delicate lynx
#

why are you passing entitytype into the sound?

west crag
quiet ice
earnest forum
#

pass in the player

#

for entity

delicate lynx
#

entity and entitytype are not the same

tranquil ferry
# hazy rock are there any libraries or similar out there that help with creating chest guis?...
GitHub

A library for Bukkit plugins to create GUIs with inventories - GitHub - Phoenix616/InventoryGui: A library for Bukkit plugins to create GUIs with inventories

GitHub

Yet another bukkit inventory gui library. Contribute to Jannyboy11/GuiLib development by creating an account on GitHub.

west crag
#

i thought its asking which entity sound you want

delicate lynx
#

there's a list of sounds

earnest forum
#

type in Sound.

#

and scroll through what your IDE suggests

west crag
earnest forum
#

yes

west crag
#

what about this?

delicate lynx
#

are you trying to get a random one

west crag
#

yea

delicate lynx
#

that should be fine

west crag
#

okay..

#

lets me try

harsh totem
#

Is there a way to check if a villager has a bed?

hybrid spoke
#

i dont think they have a hardcoded bed

harsh totem
#

So is there a way to what entity owns a bed?

hybrid spoke
#

only player probably

harsh totem
#

🥲

west crag
#

there are no errors in console

#

and other part of code is working

#

like spawning mobs

native gale
#

What are the best practices to organize commands?

#

Other then a giant if-else tree in the onCommand method

humble tulip
#

Methods for each command?

#

Well subcommand

dark arrow
#

switch?

native gale
#

It quickly turns into unmanagable mess

dark arrow
#

are you good at python coding?

#

?learnjava

undone axleBOT
native gale
#

I think there should be some design pattern for that

dark arrow
#

you can learn basics of java

mighty pier
#

is it possible to give armorstands some type of data that the player cant see? i just want it to be able to remove the armorstand with a command

dark arrow
#

well if you cant give time then how will you learn

#

if you will give atleast 1 hour a day then in 15 to 20 days you will know almost all basics of java and will be ready for spigot coding

quiet ice
#

Java can Run on anything

#

The question is whether the application written in Java can run

dark arrow
#

my old pc has 2gb ram and i was able to run java 8 on it lol

native gale
dark arrow
quiet ice
native gale
quiet ice
dark arrow
#

it was just a guess lol

quiet ice
#

Eclipse Adoptium provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure. Supported platforms include Linux, macOS, Windows, ARM, Solaris, and AIX.

dark arrow
#

i think you should download java 17 and not the latest version

quiet ice
#

Or Azul Zulu, But idk their page

dark arrow
#

i downloaded 18 but its of no use in spigot

quiet ice
#

Another alternative is Jetbrains runtime or DCVEM

dark arrow
#

and you will also need a IDE so i recommend Intelligi idia

quiet ice
#

I would Not Run Stock OpenJDK

quiet ice
dark arrow
quiet ice
#

Whatever, you should learn to use Java+Javac from the CLI first

dark arrow
#

you can use blueJ too😂

quiet ice
#

AI autocompletion?

dark arrow
#

?

quiet ice
#

What blueJ is

#

I have never Heard about it, so I'd assume AI-driven autocompletion

dark arrow
#

Its a very old java software its just like notepad many beginers use it as they dont have to download jdk

dark arrow
#

no one usses it

quiet ice
#

Aha

dark arrow
#

idk why my school asks their students to use it

quiet ice
#

My school uses "Javaeditor"

dark arrow
#

blueJ is notepad with little better interface the only advatange is you can just click on new class and create it lol

quiet ice
#

Doesn't Run on Linux, so I just ignore their requests and use eclipse (but as of now sublime Text is the easier route)

dark arrow
#

for school projects i need to use blueJ since in school lab there is no eclipse

quiet ice
#

I have Eclipse installed on my USB 😼

#

Takes forever to Start Up though

dark arrow
#

I wish i could do the same, blueJ is 10 times slower

quiet ice
#

I mean I do Not really Care, I have used Java for so Long that I can Develop without an IDE

#

from time to time I Troll my teachers and use plain old notepad

dark arrow
#

i am depandent on code recommndation so it becomes faster and if i have done a mistake it takes me a lot of time to figure it out

dark arrow
quiet ice
#

I've been using it for 5 years now

dark arrow
#

noice

#

what's your age?

quiet ice
#

Though I only really started going with it throughoutly 2 years ago when I also switched to eclipse

quiet ice
dark arrow
#

oh

#

i am 14

#

almost same

quiet ice
#

That is kinda a Young age to learn it at svhool

#

Though looking at my classmates, I'd Not recommend learning it through school If you are 18, they struggle incredibly. Though I am kinda to blame there given that I am probably accelerating the pace

dark arrow
#

i am at class 9 in class 8 java was taught at school and in class 9 students had the option to choose between commerce , PE and computer so i choosed computer

#

i dont depend on what school teaches i just search up the internet to learn new things and sometimes do small courses on udemy

quiet ice
#

Initially my mother taught me the basics - I was quick at forgetting them

#

Doing it yourself helps a lot

dark arrow
#

oh

#

yah if i was dependant on what school teaches i would be learnign how to add 2 variables

quiet ice
#

E.g. I would do stuff Like

while (bool == true); {

}

And be wondering why the Loop did Not loop

dark arrow
#

yah

#

i gotta go for brunch

#

it was nice talking to you mate

tender shard
median trench
#

Is it better to use xEntity instanceof Ghast or xEntity.getType() == EntityType.GHAST?

tender shard
#

what is xEntity? is that part of XSeries or did you just happen to call a bukkit entity "xEntity"?

median trench
#

lol

#

pretty obvious, its just an example variable xD

tender shard
#

how is that pretty obvious? could also be that you meant XEntity

#

if you explicitly want to check if it's a ghast and nothing else, use the entity type. if you don't care whether it's a ghast or one of its hypothetical subclasses, uses instanceof

median trench
#

I wrote xEntity twice, like I could write someEntity, anEntity or entity. There's no possible way to mistake that, and considering the question it's even less possible :/

tender shard
#

...

manic ice
#

why cant u just write en or e or entity

median trench
tender shard
#

no

#

a Spider is instanceof Spider and has EntityType.SPIDER.
A CaveSpider for example extends Spider and hence is instanceof Spider and instanceof CaveSpider and has EntityType.CAVE_SPIDER. Enums are public static final constant fields and fields cannot "inherit another field" or similar

median trench
tender shard
#

anyway it was a legitimate question to assume that your question had something to do with XENtity and I don't see why it's so funny to consider that I think this might have been the question. Better ask before giving a wrong answer

median trench
#

But if I have a public class superGhast extends Ghast

#

extending the NMS class

#

it should be from type Ghast no?

tender shard
#

then you don't have any bukkit entity at all unless you explicitly create any

dense falcon
#

how can I get the CPS of a player?

tender shard
#

measure them

median trench
#

I use ghast as an example btw

tender shard
median trench
#

hmm nice to know

tender shard
#

1 sec

#

it works like this. if you extend one of those "spawnable" classes instead of an abstract class, it will return a bukkit entity that's "the same" as the class you extend. so yeah if you do getBukkitEntity on your NMS Entity that extends Ghast, you'd end up with a bukkit Ghast

#

if you directly extend Entity or Monster or things like AbstractMinecart, you'll get an AssertionError

median trench
#

Okay nice

#

thx

tender shard
#

np

iron glade
#

This CME is driving me nuts

#
        at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:649) ~[?:?]```
tender shard
#

do not remove or add stuff while iterating in a for loop

#

either iterate over a copy of the map, or use a temp collection where you store the "to remove" or "to add" things, or use an iterator

iron glade
#

I want to stop all trolls at once, I have

plugin.getTrollManager().getTrolltable().values().forEach(Troll::stopTroll);```

stoptroll does the following:
```java
    public void safeRemoveTroll(UUID uuid) {

        Set<Map.Entry<UUID, Troll>> entrySet = getTrolltable().entrySet();
        Iterator<Map.Entry<UUID, Troll>> it = entrySet.iterator();

        while (it.hasNext()) {

            if(it.next().getKey().equals(uuid)) {

                it.remove();

            }

        }

    }```
tender shard
#

show the full stacktrace pls

iron glade
#

?paste

undone axleBOT
iron glade
tender shard
#

what's GuiManager line 152?

iron glade
#

It calls this method java plugin.getTrollManager().safeRemoveTroll(trolled);

tender shard
#

so you loop over the values of the map and then create an iterator again of the same map and remove stuff from it

#

so you get a concurrentmodification

iron glade
#

now that you say it

#

makes sense

tender shard
#

why do you need the forEach() if safeRemoveTroll iterates over it anyway?

iron glade
#

the stopTroll() clears up stuff left behind by the troll, like blocks, etc.

#

that's why the safeRemoveTroll() is called after that in the stopTroll()

tender shard
#

hm hard to say on how to improve this without the full code

#

all I can say is, do not remove stuff while iterating without iterator 😄

iron glade
#

My basic idea was to get all active trolls (iterate through the HashMap) and stop one by one with an iterator

#

but as you said that would be a loop + an iterator = CME

eternal oxide
#

NO looping with an iterator is fine

#

You can;t remove manually is all, use iterator#remove()

tender shard
#

but they create an iterator inside a for loop

eternal oxide
#

oh

tender shard
#

because both methods are looping lol

eternal oxide
#

yeah, iterator has to be outside

iron glade
#

How would I get all values from the map then and stop them? :(/

#

without looping

eternal oxide
#
Iterator it = Map.getIterator();
while (it.hasNext()) {
    Troll troll = it.next();
    //do shit...
    it.remove();
}```
iron glade
#

Means I'd have to remove the method to remove it from the map from the stopTroll() itself I guess

desert tinsel
#

?paste

undone axleBOT
desert tinsel
short raptor
#

How can I add a ban by UUID? The only types for getBanList are name and IP

eternal oxide
#

use name from teh enum, then addBan(uuid

short raptor
#

Oh It'll work with UUID if I use the name one?

#

Alr

vast raven
#

How to drop an item in front of a player?

tender shard
#

World#spawnItem

vast raven
#

event.getWhoClicked().getWorld().dropItemNaturally(event.getWhoClicked().getEyeLocation(), event.getCursor()).setPickupDelay(40);

tender shard
#

oh yea dropItem

#

not spawnItem

vast raven
#

Since this works, but is not in front.

tender shard
#

get the location of the eye. get the direction they are looking at, normalize that vector, and add it to the eye location

vast raven
tender shard
#

RIP

#

why

#

don't you just put some stuff into separate methods

vast raven
vast raven
tender shard
#
    public static Location getLocationInFrontOfPlayer(Player player) {
        Location eye = player.getEyeLocation();
        Vector facing = eye.getDirection();
        return eye.add(facing.normalize());
    }```
#

don't inline everything

vast raven
tender shard
#

if you need "event.getWhoClicked()" three times in one line, you're doing sth wrong lol

vast raven
tender shard
#

I didn't say that it does. But this is unreadable and useless

tender shard
vast raven
tender shard
#

lmao

#

good luck then

vast raven
vast raven
tender shard
ivory sleet
#

That isn’t a memory leak tho, so you know what it means?

vast raven
ivory sleet
#

Nope

#

A memory leak is when some memory on the heap cannot get cleared by the garbage collector even tho there is no reference to it

keen star
#

Hi

#

can someone help please

ivory sleet
#

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

keen star
#

[WARNING] Unable to create attribute: null
i got this error when try to add attribute in my item

ivory sleet
#

Mind sharing your code?

tender shard
#

using variables != memory leak

vast raven
tender shard
#

memory leak = keeping references to objects you do not need anymore

vast raven
#

And to make that var. global I've just to use "public" before the var to make it not local?

ivory sleet
#

But ghost you have to understand garbage collection runs in waves, most "unused" stuff just stays there in the state of being enqueued for gc for some time before being swept up by the gc

eternal oxide
#

no, you can;t set the scope inside a method

tender shard
ivory sleet
#

Java has a scope hierarchy system

tender shard
#

that's the whole idea of local variables

vast raven
vast raven
#

How to make a var. global?

eternal oxide
#

you make it a field

vast raven
tender shard
#

there is no such term as "global" in java. you probably mean public fields

ivory sleet
vast raven
ivory sleet
#

No need to use nms this unnecessarily

keen star
tender shard
#

wrong reply

eternal oxide
tender shard
#

@vast raven

#

local variables are indeed fine to use lmao

#

you do not have to avoid them

#

you will have a very bad time if you try to "use as few vars as possible"

vast raven
vast raven
keen star
tender shard
#

a short name for "variable" i guess

vast raven
keen star
vast raven
tender shard
#

well it's hard to understand because you misunderstood basic java concepts. you cannot for example "return a variable"

#

you can return objects or primitive values

#

but you cannot return "a variable"

eternal oxide
#

ego is bad. Its the downfall of every bad dev.

tender shard
#

you wanted to "store a local variable"

ivory sleet
#

^ all local variables are stored on the stack anyway

tender shard
#

If I wanna get that var. out that part of code, how can I set the code?
like what is that supposed to mean? "get that var. out of that part of code"? You mean "how can I return the object my var held?"

#

if not, no idea what you are talking about

vast raven
tender shard
#

I'm totally relaxed

vast raven
#

event.getWhoClicked().getWorld().dropItemNaturally(getLocationInFrontOfPlayer((Player) event.getWhoClicked()), event.getCursor()).setPickupDelay(40);

tender shard
vast raven
tender shard
#

I think so too

vast raven
#

By the way "mex." is messages.

west crag
#

everything is working but its not playing random sound

#

and there is no error

#

ping me if anyone knows

subtle folio
west crag
subtle folio
west crag
#

Sound sound = Sound.values()[new Random().nextInt(Sound.values().length)];

#

its getting random sound

subtle folio
#

I see

#

try pitch and volume 1 1

#

it could be too high lmao

west crag
#

xD

tender shard
#

a pitch of 10 is definitely way too high

#

that would be ultrasonic

west crag
#

i didnt know that ;-;

subtle folio
#

find out if you’re pregnant via minecraft sound

west crag
#

;-;

tender shard
#

if the normal A' tone is 440 hz, and that would be 1.0, then 10 would be 450k Hz. Normal people can hear up to like 10-20k Hz

west crag
#

xD

subtle folio
#

too much math

tender shard
#

it's just 440 x 2 ^ 10

west crag
subtle folio
#

i HATE powers

west crag
subtle folio
west crag
#

maths suck for me :()

subtle folio
#

why the s

buoyant viper
#

how could one check if a player is in the whitelist using AsyncPlayerPreLoginEvent, would i just have to loop thru whitelisted players and check against name and/or uuid?

subtle folio
#

yep

buoyant viper
#

h

tender shard
#

why don't you just check if the Result of that event is KICK_WHITELIST ?

subtle folio
#

i believe they have a custom whitelist

buoyant viper
#

bc im trying to do if server is full but player is whitelisted, let them in anyway

subtle folio
#

not using the default one

buoyant viper
#

oh no im using vanilla /whitelist im just trying to use it as a bypass player limit

subtle folio
#

oh mb

#

use what alex said but idk if you can cancel that

west crag
#

still no sound

#

vol is 10 and pitch is 1

subtle folio
#

1 1

#

vol = 1

west crag
#

vol also?

subtle folio
#

yes

tender shard
#

did you mute any soundcategories in your options?

#

add SoundCategory.MASTER to the playSound thing

subtle folio
#

that exists!?

tender shard
#

sure

#

you can play a sound to any of those channels

west crag
#

still no sound

subtle folio
#

then what’s a players point in disabling sound if you can over right it

tender shard
subtle folio
#

okay ig

west crag
tender shard
west crag
#

ok

#

error :()

tender shard
#

do you know how java works?

#

you cannot just insert it into any random no-args method

west crag
#

i asked where to add

buoyant viper
#

does vanilla /whitelist add <player> perform a profile lookup for accounts that havent joined before?

west crag
#

ah...

tender shard
buoyant viper
#

oh pog

#

that makes my job simple then

tender shard
#

and that it doesn't belong into the no-args method Event#getPlayer() is kinda obvious lol

west crag
#

yea i did this event.getPlayer().playSound(event.getPlayer(),sound,SoundCategory.MASTER,1,1);

buoyant viper
#

time to pray

tender shard
#

print out the sound

#

or use a fixed sound instead ofa random one

#

e.g. Sound.MUSIC_DISC_STAL

quiet ice
west crag
#

ok

tender shard
quiet ice
#

It does actually

#

CHM is guaranteed to never throw that exception

west crag
quiet ice
#

The only issue is that they are using LinkedHashMap, which is a bit different from CHM

tender shard
tender shard
quiet ice
west crag
#

and i am using official client

quiet ice
#

As in modded Vanilla client?

west crag
buoyant viper
#

tfw i went to edit eula.txt and deleted "false" only to write "false" again

west crag
#

paper

quiet ice
#

What exactly did you do?

#

Either way, that is modded

west crag
#

noooo

tender shard
#

it literally says "optifine" in your screenshot

manic ice
#

ure on optifine lol

#

thats not vanilla

quiet ice
#

Then write a 100 Page Thesis on how this is Not modded

west crag
#

i thought you are saying that i am using mod in my server

quiet ice
#

Should be easy enough

#

No, we are talking about the client

#

Your Server needs to be modded in Order for your Plugin to work

buoyant viper
#

-2935318891425991076

west crag
manic ice
quiet ice
#

That being Said, Velocity, Paper or a Plugin you are using might have a Bug that prevents the behaviour you want

buoyant viper
quiet ice
#

Even If it was the closest of all APIs to be exactly that

#

But paper is Not owned by Mojang to what I know, so that does Not apply either

west crag
#

okay so should i install official jar?

tender shard
quiet ice
#

For the Server you should be using spigot since you are on the spigotmc discord

#

But really paper would do the Job Just as fine

west crag
quiet ice
#

Still getting the issues?

west crag
#

yea

#

thats why i am still here

#

:/

quiet ice
#

Then what Code are you using?

buoyant viper
subtle folio
#

player quit event?

buoyant viper
#

so id have to manually check if player_count >= player_max

tender shard
manic ice
west crag
west crag
#

my volume is full

#

100%

quiet ice
#

Do you also Hear other music Discs?

tender shard
#

are you using via versio nor any other weird stuff

west crag
quiet ice
#

?jd-s

undone axleBOT
terse raven
#

or something idk

subtle folio
terse raven
#

and play at location

west crag
#

okay lemme try

short raptor
#

How can I check the player's cause of death from PlayerDeathEvent?

subtle folio
#

e.getCause?

short raptor
terse raven
#

event.getPlayer().playSound(event.getPlayer().getLocation(),Sound.MUSIC_DISC_STAL,SoundCategory.MASTER,1,1)

short raptor
quiet ice
#

SoundCategory.MASTER is a bit strange

terse raven
#

with HP <= 0

quiet ice
#

Sure that it should Not be RECORDS?

subtle folio
#

old code ontop

short raptor
#

I'll do that

subtle folio
#

custom desth even better than the normal one anyway

tender shard
quiet ice
#

I would omit that parameter

tender shard
#

yeah they only added it after I suggested that 😄

#

all I could think of is to try to use a location instead of entity as source

#

or to use the string soundname

#

did you set an api-version?

#

if you have the wrong api-version in plugin.yml the SOUND things probably use the wrong file name

#

also check your client log

#

it will tell you whats wrong with the sound

quiet ice
#

Not setting the API-version would yield a FieldNotFoundException or something along the lines of that

tender shard
#

seems like they died anyway meanwhile

rain echo
#

Hi! Does anybody know how could I create a separated inventory for each Inventories: option from my config?

Inventories:
  'ExampleMenu':
    Items:
      - DIRT 32
      - STONE 32
  'TestMenu':
    Items:
      - DIAMOND 2
      - COAL 8

tender shard
#
getConfig().getConfigurationSection("Inventories").getKeys(false).forEach(name -> {
  ConfigurationSection inv = getConfig().getConfigurationSection("Inventories." + name);
  // do something
});
rain echo
#

I tried this way, but it doesnt works and I know its s#itty

public class ItemsMenuCreator {

    public ItemsListConfigFile itemsListConfig;

    public ItemsMenu[] itemsMenu;

    private int itemsMenuID;
    private String itemsMenuName;

    public ItemsMenuCreator() {
        itemsListConfig = new ItemsListConfigFile(plugin);
        itemsMenuID = itemsListConfig.getItemsListConfig().getInt("Inventories");
        itemsMenuName = itemsListConfig.getItemsListConfig().getString("Inventories." + itemsMenuID + ".menu_name");
        itemsMenu[itemsMenuID] = new ItemsMenu(itemsMenuName);
    }

    public void openInventory(Player player, int ID) {
        player.openInventory(itemsMenu[ID].getInventory());
    }
}
public class ItemsMenu implements InventoryHolder {

    public String menuName;

    public ItemsMenu(String itemsMenuName) {
        menuName = itemsMenuName;
    }

    private final Inventory itemsMenuGui = Bukkit.createInventory(null, 36, "§7§oEditing " + menuName + " menu...");

    @Override
    public Inventory getInventory() {
        return itemsMenuGui;
    }
}
#

oohh

west crag
#

didnt work and now i am tired ;-;

subtle folio
#

.setName()?

#

if that exists

#

oh

#

if (p.getWorld().getName().equals(“aaa”))

#

anytime

#

.equals() compares two objects

#

it’s better to use iirc

#

if i remember correctly

#

mhm

chrome beacon
#

.equals checks if the value is the same
== checks if it's the exact same object

desert tinsel
#

If there are 2 scoreboard plugins on a server, which one will persist?

subtle folio
#

which one ever updates more frequently?

eternal oxide
#

whichever sets teh scoreboard last

desert tinsel
#

ok, thx

subtle folio
#

how do I add hex color support to my plug-in

chrome beacon
#

I highly recommend using Minimessage

subtle folio
#

i’ll look at it,

chrome beacon
#

It's included in Paper

subtle folio
#

html like syntax

#

does it still work in newer versions as i noticed it was archived

chrome beacon
#

archived?

subtle folio
#

the github

chrome beacon
#

This project has been merged into adventure.

subtle folio
#

oh 🙈

eternal oxide
#

import md5 ChatColor and it has hex color support

chrome beacon
#

^^ that works too

#

However MiniMessage makes it much easier for both users and devs

subtle folio
#

included with the spigot dependency?

#

i’ll look into use minimessage in my next project 😛

chrome beacon
#

ChatColor is included with Spigot
MiniMessage is included with Paper

subtle folio
#

is the future paper development 😵‍💫

chrome beacon
#

Paper has some good API additions

unreal sandal
#

Hello, I have a question : is it better to use json or database to save player's data ?

eternal oxide
#

depends what data and how often it changes

unreal sandal
#

for a system to save an inventory for example

tender shard
#

I'd let the admin decide whether to use json or sqlite or mysql or whatever

#

for example a large server will probably prefer mysql. other people don't want to set that up just for your plugin so they'd rather use sqlite. and maybe some admins prefer to be able to directly edit those files and would like json instead

unreal sandal
#

Okay, I understand what you want to say. And so what's the faster ?

tender shard
#

depends. if the sql server is not on the same machine, then saving it via json is probably faster than sending sql stuff over the network. if it's on the same machine, then sql is definitely faster. but I wouldn't worry about it because you should do both database and file i/o async anyway

eternal oxide
#

Faster to access or implement?

tender shard
#

oh yeah good question lol

unreal sandal
#

To acces and to implement because for my inventory system, it needs to implement in the database, when the player quits the server and to access when the player joins the survival world.

eternal oxide
#

Different servers?

unreal sandal
#

No, for the moment, it's only one server with differents worlds : a lobby, a survival world, a pvp box world...

eternal oxide
#

Well mfnalex explained speed of access. To implement they are not much different other than json/yaml will be easier. sqlite simplest (of the databases) and lastly mysql

#

Storing inventories per player I'd not really recommend flat file

#

Its fine, but it can be messy

#

other event?

tender shard
#

calling an event "p" is confusing lol

unreal sandal
#

Okay, so I think i'll use mysql because my server has this one, and thank you very much for you help ! 🙂 And sorry for my English, I'm french. Have a good day 🙂

tender shard
#

what are you trying to achieve?

eternal oxide
#

I'm not sure what you mean by other/different event. Does this not work for you?

tender shard
#

do you want to give them an item when they switch into the "aaa" world?

unreal sandal
#

I think you have to write p.getPlayer().getWorld().getName().equals....

tender shard
#

yeah getWorld() will never equal to a string

#

a World is not a String

#

then you have to use PlayerChangedWorldEvent

eternal oxide
tender shard
#

and do not compare the world to a string, but compare the world's name to a string

iron glade
#

which one looks better?

hybrid spoke
#

1

flint coyote
#

agreed, the first one

mellow edge
maiden briar
#

Working with sockets, how can I check from with server the socket came from?

iron glade
#

whoops didn't mean to answer you @mellow edge lol

mellow edge
#

xD

vocal pine
#

is there a way to change a function of a vanilla entity (not add a new one) in API without NMS

#

or at the very least, minimally

#

theres a very stupid part i need to change (just one line) but it's set explicitly in an entity fn no other way

#

nvm i noticed an extremely jank way to do it and its beautiful

iron glade
#

thanks, also what do you mean with "new named itemstack"?

#

you mean the shown name of the item?

desert tinsel
#
@EventHandler
    public void onJoin(PlayerJoinEvent p){
        if(p.getPlayer().getWorld().getName().equals("aaa")) {
            ItemStack item = new ItemStack(Material.RED_CONCRETE);
            ItemMeta meta = item.getItemMeta();
            meta.setDisplayName("name");
            item.setItemMeta(meta);
            p.getPlayer().getInventory().addItem(item);```
#

no need for a new event

#

you're welcome

shy shadow
#

Hey, sorry to bother you, I've selected the wrong minecraft version when starting to code my plugin, it was in 1.19 instead of 1.18.2, so I changed this line :

<dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
</dependencies>```
#

Which was previously on 1.19, so I replaced it with 1.18.2

#

But I still get this error when loading the plugin on the server :

glossy venture
#

did you change api-version in your plugin.yml

shy shadow
#

🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️

#

Thanks lol

glossy venture
#

lmao np

#

np

shy shadow
#

Jesus haha

#

Time for some coffee I guess, thank you very much

desert tinsel
#
player.getInventory().setItem(3, new ItemStack(Material.CHEST));```
#

np

granite owl
#

this the proper way to utilize the bukkit serializer?

#

i wrote this from my mind so idk xD

#
    public static boolean serializeBukkitObjectToFile(Object obj, String str)
    {
        try
        {
            BukkitObjectOutputStream s = new BukkitObjectOutputStream(new FileOutputStream(str));
            s.writeObject(obj);
            s.flush();
            s.close();
            
            return true;
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }     
        
        return false;
    }
    
    public static Object deserializeBukkitObjectFromFile(String str)
    {
        try
        {
            BukkitObjectInputStream s = new BukkitObjectInputStream(new FileInputStream(str));
            Object ret = s.readObject();
            s.close();
            return ret;
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        
        return null;
    }
    
    public static byte[] serializeBukkitObjectToByteArray(Object obj)
    {
        try
        {
            ByteArrayOutputStream bStream = new ByteArrayOutputStream();
            BukkitObjectOutputStream s = new BukkitObjectOutputStream(bStream);
            s.writeObject(obj);
            s.flush();
            byte[] ret = bStream.toByteArray();
            s.close();
            
            return ret;
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }     
        
        return null;
    }
    
    public static Object deserializeBukkitObjectFromByteArray(byte[] obj)
    {
        try
        {
            BukkitObjectInputStream s = new BukkitObjectInputStream(new ByteArrayInputStream(obj));
            Object ret = s.readObject();
            s.close();
            
            return ret;
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }     
        
        return null;
    }
tardy delta
#

try with resources when

granite owl
#

for me?

tardy delta
#

y

granite owl
#

for auto closing them?

chrome beacon
#

Yeah

granite owl
#

oh theyre from my utility class

#

but ofc i can write it to be instanced

chrome beacon
#

Try with resources it better since it makes sure things get closed

granite owl
#

cause the reader could if crashed cause a mem leak in this constellation

chrome beacon
#

Yes

desert tinsel
#

use java if (e.getPlayer().getWorld().getName().equals("aaa"))
insteadjava if(e.getPlayer().getWorld().equals("aaa"))

tardy delta
#

i mean item doesnt even exist at the point where you are trying to aadd it

desert tinsel
#
e.getPlayer().getInventory().setItem(3, item);```
tardy delta
#

i mean declare it before you try to access it

#

?learnjava moment

undone axleBOT
desert tinsel
#

where you writed it?

#

send all code

#

change world

#
@EventHandler
    public void ChangeWorld(PlayerChangedWorldEvent e){
        if (e.getPlayer().getWorld().getName().equals("aaa")){
            e.getPlayer().getInventory().setItem(3, item);
            ItemStack item = new ItemStack(Material.RED_CONCRETE);
            ItemMeta meta = item.getItemMeta();
            meta.setDisplayName(ChatColor.RED+"Are You Ready?");
            item.setItemMeta(meta);
            e.getPlayer().getInventory().setItem(3, item);
        }
    }```
#

np

tardy delta
#

how can that work as youre trying to access a not declared variable

desert tinsel
#

wdym?

tardy delta
tall dragon
#

yea i think he is removing that one

#

hopefully

desert tinsel
#

i think

vocal pine
#

is there any way to get the NMS entity of a vehicle in VehicleMoveEvent? get & set velocity r just plain not doing what i need in api - need the DeltaMovement which it doesnt seem to correspond to

#

essentially trying to bypass a cap in minecart code using some jank but it's not working as it would if those were the same - seperate mod to customentity (no nms used here although seems necessary to do this)

tender shard
#

I never understood how to exit splitscreen again - does someone know? lol

tall dragon
#

close the files

tender shard
#

but that means I'd have to close like 20 files sometimes

#

there must be an easier way

#

aaah I found it

tall dragon
#

try ctrl shift + f12

tender shard
#

right click on the bar and there is "Unsplit all"

vocal pine
#

is the only way to get NMS entity of a vehicle in a event to cast the bukkit entity to craftbukkit entity then gethandle

#

seems like a lot of steps

tardy delta
#

yes

vocal pine
#

🤷‍♂️ i guess if it works in the end right

#

Ty

broken ravine
#

Is there a way to disable spawning of specific animals per world natively? So without canceling the CreateSpawnEvent?

summer scroll
tardy delta
#

wdym with natively?

lunar schooner
#

Hey folks, how do I get a hold of a ResourceKey<DimensionManager>, I've got the DimensionManager itself, but can't find a way to wrap it in the ResourceKey

alpine urchin
#

maybe use the create method

#

or so

broken ravine
#

then bukkit keeps spawning and spawning resulting in a few hundred canceled events per sec and if some other plugins are listening on that aswell, they might execute some unecessary logic aswell

alpine urchin
#

ResourceKey.create

#

if it exists

lunar schooner
#

I dont think it does, not one which takes a single argument anyways (that is not MinecraftKey)

#

These are the ones I'm seeing:

  public static <T> ResourceKey<T> a(ResourceKey<? extends IRegistry<T>> resourcekey, MinecraftKey minecraftkey) {
    return a(resourcekey.c, minecraftkey);
  }
  
  public static <T> ResourceKey<IRegistry<T>> a(MinecraftKey minecraftkey) {
    return a(IRegistry.b, minecraftkey);
  }
  
  private static <T> ResourceKey<T> a(MinecraftKey minecraftkey, MinecraftKey minecraftkey1) {
    String s = minecraftkey + ":" + minecraftkey1;
    return (ResourceKey<T>)a.computeIfAbsent(s, s1 -> new ResourceKey(paramMinecraftKey1, paramMinecraftKey2));
  }
  
  private ResourceKey(MinecraftKey minecraftkey, MinecraftKey minecraftkey1) {
    this.b = minecraftkey;
    this.c = minecraftkey1;
  }
broken ravine
tender shard
#

why don't you use mojang mappings

lunar schooner
#

Havent converted to them yet, and I'm not sure (yet) how they go on backwards compatibility

tardy delta
#

i like nms

#

aB a .a() bc() v

subtle folio
lethal roost
#

hello, i'm a bit new to plugin development. if i want to give the player the mining fatigue effect when they are holding a wooden axe in their mainhand, how would i do that?

subtle folio
#

do you know how to listen for events ?

lethal roost
#

yeah

tender shard
#

oh wait

#

main hand

#

mb

subtle folio
#

😛

tardy delta
#

i was thinking at some inv click event smh

tender shard
#

PlayerChangeHeldItemEvent or what its called

#

the one you sent will only be called when pressing F or whatever

subtle folio
#

f?

#

to pay respects?

tender shard
#

Fired when a player changes their currently held item

#

that's probably the easiest and most reliable one

tall dragon
#

yea u should use that one indeed

#

used it for similar means before

tender shard
tall dragon
#

what!

lethal roost
#

so would i do something like this?

#

and then i check if the item matches what i want then i give the effect?

tardy delta
#

check the type yes

lethal roost
#

alright, gotcha

tall dragon
lethal roost
#

what does getNewSlot mean? sorry i'm a bit confused haha

tall dragon
#

well

#

you go from a slot

#

to a new slot

tall dragon
lethal roost
#

so if i just want to check the mainhand they player is holding currently, how would i utilize that? how do i check for the mainhand slot? because it isn't a fixed slot that i want to check, just whatever the player is holding in their mainhand at themoment

tall dragon
#

yea actually u can just use that

lethal roost
#

ah ok i see

#

tysm!

atomic niche
#

Apart from worldedit, do any other major plugins use mca or nms to place blocks directly?

(not counting plugins that rely worldedit to do mca live edits for them).
(nms/mca-level block editing is a problem as it doesn't fire the relevant events)

tall dragon
#

alot of plugins utilize nms to set blocks i would imagine

atomic niche
#

uh oh 😦

tall dragon
#

i at least do it if its alot of blocks

#

since the api method is just really slow

atomic niche
#

That seems like a pain to detect without nms listeners

tall dragon
#

what events are you looking for

atomic niche
#

Anything that could possibly change/break/place any specific block

hexed hatch
#

just place large amount of blocks in batches of no more than 1000, separated by a tick or two

atomic niche
#

so basically all of them

tall dragon
#

well using #setBlock doesnt fire events either

atomic niche
#

:L

tardy delta
tall dragon
#
    @Override
    public void setBlockFast(Block b, CompMaterial material, IBlockData blockData, boolean applyLights) {
        WorldServer nmsWorld = ((CraftWorld) b.getWorld()).getHandle();
        Chunk nmsChunk = nmsWorld.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
        BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());

        IBlockData ibd = blockData != null ? blockData : CraftMagicNumbers.getBlock(material.toMaterial()).getBlockData();
        ChunkProviderServer chunkProvider = nmsWorld.getChunkProvider();

        nmsChunk.setType(bp, ibd, false);

        if (applyLights)
        {
            LightEngine engine = chunkProvider.getLightEngine();
            engine.a(bp);
        }

        chunkProvider.flagDirty(bp);
    }

something like this is way faster

hexed hatch
# tall dragon still slow

a bit but it's easy and doesn't make much of a difference unless you're working with an enormous amount of blocks

atomic niche
#

At least with worldedit, the changes are detectable with their api.
With random plugins, its much harder to detect unless you compare the blocks against a database of expected values

tall dragon
tardy delta
#

wait wrong thread

atomic niche
#

I was really hoping not to need to run an async block verifier
I think there is a way to listen with nms, but avoiding nms where possible is always nice

#

Although, mca-level changes are a massive pain to detect, even with nms

tall dragon
#

what do u even need this for.

granite owl
#

about resource packs

tardy delta
granite owl
#

is it possible to add entries like this, and make calls to the new sprites?

#
{
  "textures": [
    "angry",
    "minecraft:big_smoke_0"
  ]
}
tardy delta
#

you mean particles?

atomic niche
# tall dragon what do u even need this for.

Our behaviour depends on the material types of hundreds of thousands of different blocks at specific locations.
For performance reasons, we assume that blocks are what and where we think they are.

We verify our assumptions on block events, chunk loads, and restarts.
Still, nms and mca screw with that; players can abuse errant blocks before the next check occurs.

To completely fix that, we would effectively need to verify every block every tick, which is not viable.
We are currently planning on having an async process that checks stuff, but that still has potential for errant block abuse.
The goal with detecting nms or mca changes would be for dynamic verification behaviour (intensifying checks where and when they are needed)

granite owl
hexed hatch
#

no

#

custom particles are not possible

pastel juniper
#

How can I change the stack size of a custom item???

granite owl
tall dragon
pastel juniper
tender shard
hexed hatch
pastel juniper
hexed hatch
#

He did a thing

granite owl
#

get max stack size is a thing

tender shard
#

you can only change the max stack size per MATERIAL

#

not per individual stack or anything

granite owl
#

but its bound to the material

#

not the IS

pastel juniper
granite owl
#

u can

granite owl
tender shard
granite owl
#

tbh i dont understand why the stacksize is hardcoded into the material instead of being a nbt flag

#

like damage

#

and literally anything else

tender shard
atomic niche
# tall dragon wow that sounds like quite a pickle

Indeed... hoping to be able to have at least some way of doing it though.
Worldedit's API is sufficient to manage this for any plugin using worldedit for the operations.

As for anything that doesn't, idk... nms listeners might be needed.
A mca scanner might also be needed, but that sounds like a massive pain.

Mostly just wondering how big the issue is (i.e. how many major plugins do this sort of thing independently of worldedit)
If it is only a few dozen, hooking into relevant apis might be an easier approach than the listeners and scanners needed for a general solution

granite owl
#

so what about custom sounds?...

#

can i call custom sounds from resource packs without overriding vanilla ones

#

xD

#

or isnt it worth the effort either

#

to attempt

hexed hatch
#

that you can

#

and it's quite easy

tall dragon
granite owl
#

hm

#

well to be fair

#

sounds are more important than particle sprites

#

still

dapper harness
#

I don't understand blockDamageEvent, what is a player "damaging" a block ?

tall dragon
#

well when they hit it?

#

it gets damaged

dapper harness
#

oh the mining animation @tall dragon ?

tardy delta
#

because its not broken yet, they are just damagin it

tall dragon
#

bassically its called when the player starts mining a block

dapper harness
#

oooooh

granite owl
dapper harness
#

thanks

iron palm
#

Hey there. I can't use 1.16.3-R0.1-SNAPSHOT from spigot (NMS) mojang remapped
I ran the build tools but its not working and maven is throwing an error which is :
Cannot resolve org.spigotmcspigot1.16.3-R0.1-SNAPSHOT

tender shard
#

also who the heck uses 1.16.3?

#

i could understand 1.16.5

#

but 1.16.3?

chrome beacon
#

1.16.5 has remapped

iron palm
tender shard
iron palm
atomic niche
# tall dragon it kinda sounds like ur gonna need to make sure any plugins that edits those blo...

That might be an option, but would introduce more compatibility issues than I am comfortable with.
I feel that selective compatibility would be too much of a burden to place on our userbase.

I think the easiest solution is probably to natively support the big plugins, and deal with specific compatibility complaints as they come in.
I would need to somehow make a list of big plugins that use nms placement independently of worldedit though, which sounds like a massive pain.

Either that or try to make some general nms listener / mca scanner... which also sounds like a massive pain.
Might need to make a library of some sort for that.

Currently, we have somehow managed to avoid nms throughout our entire codebase
I don't want this to be the reason that forces us to use it.

chrome beacon
#

Skip the remapping

chrome beacon
tender shard
#

I have to try something in a VM