#help-development

1 messages · Page 800 of 1

weak meteor
#

im going to get banned

#

idk, in my head sounded better

river oracle
#

Nah lol

#

Want word without json though ig the sentence in general doesn't make sense

wet breach
#

probably could if you changed the type

hazy parrot
#

Was talking about same name for generic parameter

wet breach
#

yeah won't work since it is an argument list

#

doesn't really make much sense to include it twice in the same list

river oracle
#

My professor for java used multiple letters for generics

wet breach
#
MethodInvocation:
  MethodName ( [ArgumentList] ) 
  TypeName . [TypeArguments] Identifier ( [ArgumentList] )
  ExpressionName . [TypeArguments] Identifier ( [ArgumentList] ) 
  Primary . [TypeArguments] Identifier ( [ArgumentList] ) 
  super . [TypeArguments] Identifier ( [ArgumentList] ) 
  TypeName . super . [TypeArguments] Identifier ( [ArgumentList] )

TypeArguments:
  < TypeArgumentList >
TypeArgumentList:
  TypeArgument {, TypeArgument}
river oracle
#

Like she'd type out words as the parameters

rotund ravine
#

A, B, C

hazy parrot
river oracle
#

It made me commit self die

weak meteor
#

like

#

Generic<Key, Value>?

river oracle
#

Ye

wet breach
hazy parrot
#

Is it like Foo<Type> or Foo<TYPE>

weak meteor
#

are there single letter classes?

#

or they cant be created so people can be happy with generics?

#

ill try

hazy parrot
#

Pretty sure u can make them

weak meteor
#

i do can

#

but that isnt a the class

#

oh nvm

#

just understood

#

how does UTF-8 works?

ornate patio
#

how can I get the direction a dispenser is facing from a Block object

#

i'm trying to modify a BlockDispenseEvent by spawning an entity at the location, but right now its spawning it inside the dispenser itself. I wanna offset it by 1 block depending on the dispenser direction

weak meteor
#

// event listening
Block block = event.getBlock();
if (block instanceof Dispenser){
    Dispenser dispenser = (Dispenser) block;
}
ornate patio
#

also is BlockDispenseEvent only for dispensers or do any other components fire this as well?

weak meteor
#

and well

weak meteor
#

then dispenser.getLocation().getPitch();

#

and youll get the direction

#

no?

ornate patio
#

so do I cast block.getBlockData() to Directional

weak meteor
#

isnt it the same?

#

well, pitch is in degrees

#

and ig it is 0, 90, 180, 270 and 360

#

east, north, west and south

#

idk

#

thought it was

ornate patio
#

alright thanks

ornate patio
weak meteor
rotund ravine
ornate patio
#

oh damn

#

ok i gotta check that then thanks

#
// Remove the egg from the dispenser
ItemStack item = event.getItem();
item.setAmount(item.getAmount() - 1);
event.setItem(item);
#

this is inside my BlockDispenseEvent handler

#

any ideas why its just not decrementing the amount

#

i dont got any interfering return statements

#
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void onBlockDispense(BlockDispenseEvent event) {
    if (!CustomEggsManager.isCustomEgg(event.getItem()) || event.getBlock().getType() != Material.DISPENSER) {
        return;
    }
    event.setCancelled(true);

    CustomEgg customEgg = CustomEggsManager.getCustomEgg(event.getItem());

    // Add the direction of the dispenser to the spawn location
    Directional blockData = (Directional) event.getBlock().getBlockData();
    Location spawnLocation = event.getBlock().getRelative(blockData.getFacing()).getLocation().add(0.5, 0, 0.5);

    customEgg.spawnEntity(spawnLocation);

    // Remove the egg from the dispenser
    ItemStack item = event.getItem();
    item.setAmount(item.getAmount() - 1);
    event.setItem(item);
}

here is the whole thing

young knoll
#

Pretty sure the item is a copy

#

So you’ll need to operate on the inventory itself

ornate patio
#

setItem won't work?

#

thats kinda annoying

ornate patio
young knoll
#

Just use removeItem with the dispensed item

ornate patio
#

yeah but how would i determine what the dispensed item is

#

dispensers shoot a random item in its inventory so how would i know which one it shot

young knoll
#

With event.getItem?

ornate patio
#

so I would do event.getItem() == item?

#

would they be the same object in memory

#

because i thought it was a copy

young knoll
#

What is item

river oracle
#

Item stacks get copied around so much you never know

ornate patio
young knoll
#

This is why I suggested removeItem

#

It’ll automatically find the first matching item

rotund ravine
#

removeItem only removes the amount of the item and the isSimilar

young knoll
#

Ye

ornate patio
#

removeItem from the dispenser inventory right

#

But if I use isSimilar then if there are multiple stacks of the same item in the dispenser, it’ll just always remove the first one

#

rather than the random one the dispenser shoots

young knoll
#

Yeah but that doesn’t really matter does it

ornate patio
#

For me it kinda does

young knoll
#

Rip

#

Can probably add the slot to the event

#

But until then you’re kinda out of luck

ornate patio
#

damn 😔

#

I guess I’ll implement my own randomizer or for now

#

For all similar ItemStacks

weak meteor
#

how big can i make InventoryType.CHEST?

#

Max 54 slots?

rotund ravine
#

A double chest is the max supported yes

weak meteor
rotund ravine
#

You cannn make it bigger by cheating, but not sure how the client behaves nowadays in that regard

river oracle
#

it'll just throw an error

#

because MenuType is registry backed if the client recieves anything else it'll just break

#

not included is the Horse which is sent via another packet

young knoll
#

I miss the old >6 row inventories

rotund ravine
pastel axle
#

A simpler time.

fossil flax
#

someone know a good login plugin for 1.8 that have the autlogin for premium users and multi lobby support with database

ornate patio
#

is there a way to check if a configurationsection exists in a config file, ignoring default values?

#
ConfigurationSection eggConfig = plugin.getConfig().getConfigurationSection("egg-recipes.custom." + customEgg.getConfigId());
if (eggConfig == null) {
    Bukkit.getLogger().warning("Could not find recipe for " + customEgg.getConfigId());
    return;
}

Even if the yaml section does not exist on the server it keeps returning the default value from the plugin's config.yml

#

i want to specifically handle the case where it doesn't exist on the server

wet breach
#

what do you mean default value?

#

what other value should the config.yml return o.O

#

I mean I wouldn't really call it a default if its in the config.yml XD

#

I think you are just using ConfigurationSection incorrectly

ornate patio
#

eggConfig is never null

#

the if statement never runs

wet breach
#

because you are misclassifying what you believe to be a section

ornate patio
#

i think i understand wdym

wet breach
#

egg-recipes would be a section

#

because it has many things below it

ornate patio
#

exactly

wet breach
#

but a single recipe depending how you put it in the config is most likely not

ornate patio
#

my point is that i want users to delete an entire section and have that take effect

wet breach
#

to delete a section you would have to set it null

#

so if you set egg-recipes to null it should remove it

ornate patio
#

honestly thats just more confusing then

#

do you think its better practice to have smthn like enabled: true/false in each section

wet breach
#

getConfig.set("egg-recipes", null); getConfig.save();

#

and then if you were to do getConfigurationSection("egg-recipes") it should return back as null as it shouldn't exist

ornate patio
#

like i don't want to be changing the config myself. just want to check if the section exists or not

wet breach
#

well you also have to keep in mind the server loads config.yml into memory

#

so any modifications or reading you are doing, comes from the memory

#

therefore if someone edits config.yml the changes are not reflected if your plugin doesn't use load()

ornate patio
#

yeah i understand that

#

all i need is just a method to check if the section exists in the config or not

wet breach
#

well I gave you a link that shows you an example

#

think what you are missing is the getKeys(false)

ornate patio
#

hmm

#

i dont think we're on the same page lmao

#

its fine i just thought of a better solution to this anyways

wet breach
#

well I don't really understand how you are having an issue either

ornate patio
#

yeah sorry its a little tough to explain

wet breach
#

the only thing I can think of in regards to defaults is if you are using copyDefaults() or whatever it is

#

or maybe saveDefaults()

#

this would overwrite your config.yml using the embedded config.yml in the jar

#

well it pulls the values from the embedded one anyways

ornate patio
#

ok yk how most of the config functions will check the default config file if the provided key doesn't exist

#

i want it to not do that

wet breach
#

that isn't like default behavior o.O

ornate patio
#

for the getConfigurationSection that doesnt seem to be the case

ornate patio
#

i know its like that for all the other ones like getString or getBoolean

wet breach
tender shard
#

just for the readme

wet breach
#

ah, well going to have to wait I have to find my old phone to reset my pass 😛

tender shard
#

the <name> placeholders were not shown because github strips "html" tags

wet breach
#

so it works just like all the others

#

it also does not provide a default either

#

unless I want it to

#

and yes the defunct plugin does ship with config.yml embedded too

ornate patio
#

🤔

wet breach
#

so I don't understand what you are doing wrong other then you have something coded wrong

#

but you also haven't provided code either

ornate patio
#

just dont worry about it lol i already ended up using an enabled: true flag instead

wet breach
#

somewhere in your code you have a cache

#

and I have a feeling you are having an issue between cache values and real values

#

XD

ornate patio
#

perhaps its this?

@Override
    public void onEnable() {
        saveDefaultConfig();
        ...
    }
wet breach
#

yes, that is the method I was talking about

#

I just couldn't remember its name

ornate patio
#

i thought that only copies over the embedded config if it doesnt exist on the server

wet breach
#

oh that isn't the one

wet breach
#
@Nullable
ConfigurationSection getConfigurationSection(@NotNull
String path)
Gets the requested ConfigurationSection by path.

If the ConfigurationSection does not exist but a default value has been specified, this will return the default value. If the ConfigurationSection does not exist and no default value was specified, this will return null.
#

the only way this method could return a default like you are having issues with is if you were setting a default

tender shard
ornate patio
wet breach
#

I wonder if you assigning the section like you are to ConfigurationSection object counts as a default

#

maybe try it like the way my plugin has it?

hollow oxide
#
        Inventory anvil = Bukkit.createInventory(null, InventoryType.ANVIL,"Renommer");
        player.openInventory(anvil);```
#

not working, why?

knotty aspen
#

Inventories created using createInventory aren't "real" inventories. so things like the anvil logic won't work. idk if Spigot has Paper's HumanEntity#openAnvil nowadays, but if it does use that

rotund ravine
#

You gotta trick the player sometimes depending on verison etc.

hollow oxide
#

ok i know where is the issue
basacly i did open 2 inventory at the same time and the anvil one was behind

#

and thx for advices i'll try it

shadow zinc
#

How might one find all present sub-processes in the Java instance, similar to spark?

wet breach
#

by using a java agent

wet breach
#

are you asking how do you get all the children id's that are related to the parent process?

shadow zinc
#

In order to hopefully list the processes by memory usage

wet breach
shadow zinc
#

Seriously? I’ve been googling for ages

#

Probably not searching the right stuff

wet breach
# shadow zinc Seriously? I’ve been googling for ages
import java.util.stream.Stream;
import java.util.Optional;

public class ChilderenProcessTest {
   public static void main(String args[]) throws InterruptedException {
      System.out.println("---------------------------");
      System.out.println("Children Processes:");
      Optional<ProcessHandle> processHandle = ProcessHandle.allProcesses().findFirst();
      processHandle.ifPresent(proc -> proc.children().forEach(child -> System.out.println("PID: [ " + child.pid() + " ], Cmd: [ " + child.info().command() + " ]")));
   }
}
shadow zinc
#

Damn

wet breach
#

have fun 🙂

shadow zinc
#

Thank you lol

shadow zinc
wet breach
#

no

#

it was introduced in Java 9

shadow zinc
#

i see

glossy venture
#

can you send tablist information and set the player list name of a player asynchronously?

wet breach
wet breach
#

before java 9 it was quite the pain really

#

well, depends I suppose how you wanted it done

#

typically it was easier to go with ProcessBuilder and invoke some script or command line stuff

shadow zinc
#

yeah it does look easier in java 9

wet breach
#

That is because Java 9 introduced the Process interface

#

which allowed getting information from outside of the VM lol

#

all the more reason to use updated JDK versions

#

but people insist on using outdated stuff I suppose

shadow zinc
#

only reason i use java 8 is for compatability

#

if i could choose to remake my plugin i would probably have done 17

#

but its too late now

wet breach
#

never too late

#

just set a version of the plugin destined to be upgraded permanently 🙂

shadow zinc
#

around 8% of my users are under 17 do

wet breach
#

some things are not worth the trouble to be compatible for XD

wet breach
#

however, you should at minimum probably target Java 11 or 12

#

Java 17 though, has unix sockets and some other things of course

#

but native unix sockets are great

shadow zinc
#

yeah i can't see myself using that

wet breach
#

do you use DB's?

shadow zinc
#

no

bitter rune
#

I forgot which I'm building with maybe 17 I need to get the latest java paper jar and upgrade to latest. Just cause I'm learning for college and future career

wet breach
#

oh, well mysql using unix socket doesn't have the over head of the TCP stack and its faster. Also there isn't a such thing as losing the connection unless the mysql server dies.

#

I do at some point want to make a PR to bungee for unix sockets

#

and spigot

#

but, idk if I will get to it though lol

#

in that example, unix sockets are also more secure 🙂

#

but if you don't see yourself using it, may want to look at other features of java 17 and if there is nothing there I suppose just target a lower version XD

#

but you know now that the API you need to make what you are wanting easy is only available in Java 9+

bitter rune
#

I'd like to convert my filing system to a database I'm using all my mythologies for creating the config in one java file so hopefully that makes me able to streamline it better. I'm currently saving every block a person breaks in a file with just me testing it's fine but long run probably bad way to handle so much data

#

This week's computer class is advanced storage systems which refers to things like databases along with parallel arrays ... So best time to learn it

upper hazel
#

I'm wondering how itemsAdder was able to adjust blocks durability and explosion resistance if this is not possible for the block

wet breach
#

I helped someone about 4-5 years ago develop something similar to what you are doing

#

the question is how much ram can you dedicate to it

#

anyways, with the binary file, you are going to want to come up with a delimiter or two so you know when one data ends and another starts

#

you then want to use memory mapping

#

memory mapping essentially loads the file into memory but this type of loading is separate from the jvm itself

#

there are two ways to memory map, you can either memory map the entire file. The caveat here is that however large the file is, is how much ram it will consume

#

so if you don't have the ram for it, it won't load

molten hearth
#

No no but

#

If apache starts a thread for every request

wet breach
#

the other way is to create a buffer of predetermined size and you would scan the file. It will load however much into that buffer at a time. It can still be quick but slightly slower since you can't know if the data you are searching for at any given time is after the buffer or as you move along before the buffer

molten hearth
#

why can't I have a thread for each chunk 🗿

quaint mantle
#

tick sync

molten hearth
#

nuh uh

wet breach
#

anyways, back then the test done was loading and saving 20 million blocks

#

it managed to do so in 6 seconds for loading, and 3 seconds for saving

#

the other advantage of memory mapped files, well two actually

#

is one if the JVM crashes the memory mapped file will eventually get saved by the OS automatically

#

second, you can actually transfer info between two separate applications using a memory mapped file and is actually the basis for unix sockets

bitter rune
#

Thanks I'll look into it when I have the time to spare. I don't think the term gets that in depth but learning new things is good. Next term is project management which I need. I don't think of every variable when creating my hiarachy charts, flowcharts, and pseudocode. I understand how you have to teach the program like it knows nothing at all. I don't know much outside of c# and a little bit of java either I know other programming languages are easier to write and look a lot more like human speech without brackets (Python comes to mind) for now though I like the brackets. Ultimately I'm doing data science and I'll only be in Python and databases though

wet breach
#

this is because memory mapping of files is actually something the OS provides/does

#

memory mapped files are handled by the OS, so you actually invoke OS api's to create them. This is why when the application goes away without closing the memory mapped file, the OS will close it out for you

#

just takes time. In windows, I believe the time limit is 5 minutes or so

lost matrix
#

When i see frostalfs name + "memory mapping" on my screen i get flashbacks smileybolb

#

I think this is his favourite technology

bitter rune
#

Decided to try to squeeze in modularizing my plugin, rewriting file saving just the get config method the rest is already modular, and switching to a binary file, database or both this week. Which may end up being a few months instead

#

I've been writing this for almost a year now, I've kept good comments and tried to not have spaghetti code but when I added assassin's creed like sneaking that java file is a mess there's so many things you have to keep track of just to stop creatures from attacking you based on shifting, distance, if you get hit or if you do damage... Then the abilities, the exp system... I'm not amazing at math having a percentage that then increments another value and that percentage gets bigger after every level up was complicated for my brain

hushed spindle
#

i got a little thingy where im using gson to load in a list of recipes, and i'd like to be able to include newer items by default, though that also means it'll throw an exception if said items are attempted to be loaded on older versions. is it possible to tell gson to simply skip elements of the list if they throw an exception during deserialization?

drowsy helm
#

Match the material valueOf

echo basalt
#

matchMaterial

drowsy helm
#

That ^

#

If it’s null, skip

hushed spindle
#

but im not looping through the recipes myself im letting gson do that

#

its not like im using yml

drowsy helm
#

You still have to parse each gson object dont you?

hushed spindle
#

also kinda using base64 to serialize items lol

#

no i dont

drowsy helm
#

Well how then

rotund ravine
#

Seems like an implementation failure on your part then

drowsy helm
#

There will have to be some sort of iteration somewhere

hushed spindle
#

why? is this wrong to do then

rotund ravine
#

I don’t like ur theme haha

hushed spindle
#

i dont like your face

drowsy helm
#

Why does it have to be generic?

hushed spindle
#

thats rude i do like your face

bitter rune
hushed spindle
#

because i have a bunch of implementations for recipes

#

making it generic prevents me having to make one of these methods for each type

rotund ravine
#

You can implement your own gson reader or whatever it is called

drowsy helm
#

Adapter

hushed spindle
#

ill see if returning null is allowed lol

drowsy helm
#

Is clazz a custom item class impl?

#

Array of

hushed spindle
#

it just tells the method the type of object i want gson to grab

#

T in this case extends my custom recipe

#

so im wanting a list of my custom recipes

drowsy helm
#

Yeah I feel an adapter would make skipping recipes much easier

hushed spindle
#

wondering if gson wont freak out if it returns null then

drowsy helm
#

Just throw an exception

#

Catch it in the iteration

#

Pretty sure an adapter can return null anyway

shadow zinc
#

turns out i wanted threads, not sub proccesses

#

idk

#

they sound different

#
        ThreadMXBean threadBean = ManagementFactory.getThreadMXBean();

        ThreadInfo[] threads = threadBean.dumpAllThreads(false, false);
        for(ThreadInfo threadInfo : threads) {
            MessageUtil.send(commandSender, threadInfo.getThreadName());
        }```
#

so far its only prints the following

#
[22:21:58 INFO]: Finalizer
[22:21:58 INFO]: Signal Dispatcher
[22:21:58 INFO]: Notification Thread
[22:21:58 INFO]: Common-Cleaner
[22:21:58 INFO]: DestroyJavaVM
[22:21:58 INFO]: Log4j2-AsyncAppenderEventDispatcher-1-Async
[22:21:58 INFO]: JNA Cleaner
[22:21:58 INFO]: Timer hack thread
[22:21:58 INFO]: Yggdrasil Key Fetcher
[22:21:58 INFO]: Worker-Main-1
[22:21:58 INFO]: Worker-Main-2
[22:21:58 INFO]: Server thread
[22:21:58 INFO]: RegionFile I/O Thread #0
[22:21:58 INFO]: Tuinity Chunk System Worker #0
[22:21:58 INFO]: Tuinity Chunk System Worker #1
[22:21:58 INFO]: Paper Watchdog Thread
.....```
#

can't actually see the other plugins

rotund ravine
#

Get a thread stacktrace or whatever

shadow zinc
#

how much?

quasi flint
#

?

slender elbow
#

a thousand euros

rotund ravine
#

I’ll use them for like smth

slender elbow
#

wait what

#

no

rotund ravine
#

Sad

slender elbow
#

m sorry

hushed spindle
#

the contract is signed

#

pay up

#

if you dont have the money go out there and rob an elderly person like the rest of us

slender elbow
#

i love robbing the old

#

it's my favourite pastime

smoky oak
#

oh so yore indian

hushed spindle
#

is JavaPlugin#saveResource async or what

rotund ravine
#

Why would it be async

smoky oak
#

afaik its not

hushed spindle
#

because my configs arent properly loaded in on first startup even if i have done saveresource prior to it

#

users would have to restart their server twice which seems pretty annoying

smoky oak
#

are you loading before saving?

hushed spindle
#

nop

#

setup is literally like this and it's not loading in all of the contents

#

seems to be random as hell too

#

like its working fine for 9/14 skills but for 5 it decides some properties just arent there

#

i could try to simply delay the getConfig part a couple ticks but that just feels wrong

smoky oak
#

how bout this

#

check if it works on 1st start on a clean server

rotund ravine
#

It’s not async

#

Ur doing smth wrong

hushed spindle
#

1st startup it doesnt work, on consecutive it does

#

hence why people would have to restart twice to get the plugin to fully work

#

i know im doing something wrong but i dont even know where to begin looking because for most cases it works fine

#

and its consistently these 5 that it fails on

#

but theres functionally no difference in usage with those

odd turtle
#

Hey guys; I'm having an issue with the saving of a default config.

the .set() method works fine, I'm getting the three bottom test values in the yml.
However, the addDefault() doesn't work for me. Not in the loop; nor the test value below.
Yes, I've already googled and chatgpt'd 😉
Anyone any idea?

young knoll
#

addDefault does not add real values

#

They are magical hidden values that are used when no value has been set

river oracle
#

spooookyyyy m,agiccccc

#
/**
* @return returns Coll1234567
* @deprecated spigot dumb magic value
*/
@Deprecated(forRemoval=true) // Paper
public Coll1234567 getColl1234567() {
  return this.coll1234567;
}
remote swallow
#

is Coll1234567 instanceof Normal

eternal night
#

valid deprecation NODDERS

river oracle
#

😈

remote swallow
river oracle
eternal night
remote swallow
#

is that going to be the dom com bubble of paper forks

river oracle
#

yes

eternal night
#

tacoY2Kpurpurfish

remote swallow
#

im going to have so much fun removing the power supply from my current pc

river oracle
# eternal night tacoY2Kpurpurfish

I actually have a hush hush super secret NMS project for testing and fucking around with internals called Dripple, dont' tell anyone though CH_PepeShhh

remote swallow
river oracle
remote swallow
#

i dont

river oracle
#

then I wouldn't

remote swallow
#

if everything should be here by wednesday except the cpu do you think its a good enough time to start removing my stuff from my current pc or do i wait untill the cpus arrived

river oracle
#

or you'll have no PC

remote swallow
#

i mean i dont really care if i dont have a pc

#

its a thursday

#

nothing to actually do

lost matrix
remote swallow
#

i mean i could

#

but i could wait

#

i have all thursday to build it but it if i dont im waiting till saturday pretty much

odd turtle
#

For those wondering
Adding configuration.options().copyDefaults(true);
fixed my issue.

clear raptor
#

Hi guys... Is there any way to cancel AsynChatEvent in 1.20? I just realized that it is not getting cancelled. Probably becauise the signing?

river oracle
#

and it should work the same

clear raptor
#

And what is the way? 😄

#

Using some of those "Disable signing" plugins?

#

or some bungee/bukkit setting?

river oracle
#

no

#

it can be cancelled even if signing is enabled

clear raptor
#

and how? I literally created just AsyncChatEvent event handler and did event.setCancelled(true); and messages are still showing in chat

lost matrix
clear raptor
#

I tested 3 times... it is calling the event handler, and isCancelled is true

#

its 1.20.2 papermc server behind bungee btw

river oracle
#

well something is wrong with your code the event itself works fine

#

and has not changed

#

We can't help further without code

lost matrix
clear raptor
#

ohhh... yep... CMI is doing it... ffs 😄

#

Do anyone here use CMI and know how to override it? 😄 even priority HIGHEST is not overriding it

lost matrix
clear raptor
#

uninstall cmi... 😄

lost matrix
#

yep

clear raptor
#

... 😄

#

Not an solution atm 😄

lost matrix
#

Then find out what CMI does and if you can configure it so that it doesnt bother you

clear raptor
#

they seems to be using @EventHandler(priority = EventPriority.NORMAL)...

smoky oak
#

actually is there a resource how event handler annotations get converted into, yknow, event hooks? I'm curious

remote swallow
#

it uses reflection to find the annotations then just adds the methods to the handler list of each event

#

best is to probably just look at source

#

?stash

undone axleBOT
smoky oak
#

last time i tried that i almost made alex lose his mind

#

are you offering yourself this time?

remote swallow
#

no

blazing stream
#

im really confused, i ran ./gradlew build and it successfully compiled oraxen, i just cant find where the jar file is 👀

root@germanythpire:~/oraxen/oraxen# ./gradlew build
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :compileJava

BUILD SUCCESSFUL in 1m 51s
6 actionable tasks: 5 executed, 1 up-to-date
remote swallow
#

build/libs

blazing stream
#

thanks

remote swallow
#

some might be in craftbukkit

smoky oak
#

oh thanks

upper hazel
#

Do you think it’s a good idea to make explosion resistance using entityExploreEvent and the recorded durability in the block?

#

The only thing I don't know is what the default value is for tnt creeper, crystal, bed, and whizzer's head.

torn shuttle
#

@lost matrix I think I figured out what is causing the issue

#

actually I am pretty sure that I have

#

but I'm having a hard time fixing it

torn shuttle
#

is

#

so what I suspect is happening is that I have a mismatch between a global coordinate system and a local coordinate system

blazing stream
# blazing stream im really confused, i ran `./gradlew build` and it successfully compiled oraxen,...

tried compiling latest version from github, error:

Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :
w: file:///root/oraxen/oraxen/oraxen/build.gradle.kts:40:13: 'paperDevBundle(String? = ..., String = ..., String = ..., String? = ..., String? = ..., String? = ..., String = ..., ExternalModuleDependency.() -> Unit = ...): ExternalModuleDependency' is deprecated. Replaced by extension methods

> Configure project :core
Branch: master

FAILURE: Build failed with an exception.

* Where:
Build file '/root/oraxen/oraxen/oraxen/core/build.gradle.kts' line: 56

* What went wrong:
null cannot be cast to non-null type kotlin.String

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 2m 11s
root@germanythpire:~/oraxen/oraxe
torn shuttle
#

such that the rotation is "correct" insofar as that is it rotating on the "right" axis, but when it gets inherited down the chain the position of that axis remains the same on the local coordinate but not the global coord

torn shuttle
#

I can actually replicate this 1:1 on the model editor by using local rotations

#

it's a toggle it has

#

so I am decently certain that's the issue

#

now how I'm supposed to fix that is uh...

#

have not figure that one out yet

#

I feel like I should be rotating the rotation, but maybe that's the wrong approach?

upper hazel
#

what the entity will be bed in explore moment?

#

i was not find

lost matrix
upper hazel
#

oh

#

just one entity?

torn shuttle
#

any clue 7smile7?

upper hazel
#

one block"

#

wither skull this entity explore?

lost matrix
dark arrow
#

i m trying to create a spigot plugin project in intelligi using mc devlopment project but it does not seem to work , it gives a lot of error , i think its unable to sync and build option does not work either

fluid river
#

yo guys

#

my profile received an update

fluid river
#

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

fluid river
#

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

dark arrow
#

and its more than 10 mins and still its loading

fluid river
#

what's in your pom xml

#

and where does error appear

fluid river
dark arrow
#

but now its showing error everywhere as if it cant use the bukkit files

fluid river
dark arrow
#

in pom.xml i get error here:

  <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.4</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
fluid river
#

why are u using java 8 for building for 1.19 minecraft tho

dark arrow
#

its java 17

fluid river
dark arrow
#

i selected 1.17 that version during project creation

fluid river
#

no it's not

#

well change it to 17 in properties

#

and try Maven -> Update project

#

idk how to do that in idea but in eclipse its like this ^

dark arrow
#

wow it fixed everything

molten hearth
#

how da hell does isPreferredTool work

#

im getting true on wood.isPreferredTool(pickaxe) lol

young knoll
#

This is why you use the tags

molten hearth
#

bro

young knoll
#

isPrefferedTool is more like canBreakBlock iirc

molten hearth
#

😔

#

rename this shi

molten hearth
#

😭

#

😭

#

maybe itll actually work with isPreferredTool

#

oh mah god it does

molten hearth
young knoll
#

hmm?

molten hearth
#

nuh uh

#

im tripping

#

im not sure how to handle swords actually

#

i guess i just hardcode that

#

nuh uh

#

Tag.SWORD_EFFICIENT it is

#

no okay i think its trolling me again hold up

#

💀

#
Material blockType = Material.COBWEB;
ItemStack itemStack = Material.IRON_SWORD;

return (Tag.SWORD_EFFICIENT.isTagged(blockType)  && itemStack.getType().toString().endsWith("_SWORD"); // false```
#

solid

torn shuttle
#

I AM A SHINY GOLDEN GOD

#

BOW DOWN TO MY SUPERIOR MATHEMATICAL PROWESS

#

it finally works

#

jfc

#

ga-ga-ga-ga-ga-gaming

grand flint
#

its so ugly wtf

torn shuttle
#

then make your own fucking model

#

I made the system not the model

grand flint
#

i fucking will

#

it wont have fingers

#

looks like a hytale figure in the middle of minecraft

#

😂

torn shuttle
#

so you're saying I can sell my plugin to Riot

grand flint
#

probably not

torn shuttle
#

bidding starts at 1.5bil usd

grand flint
#

1.7

molten hearth
#

better patent fingers

torn shuttle
# grand flint 1.7

I'll wait for your paypal transfer of 1.7 bil usd to come through before calling the auction off

#

do you like the green boy more

#

man this was so easy to fix too

#

if only I hadn't spent a week trying to reinvent how bones worked and I had just gone and checked how blender does it in the first place

molten hearth
#

forgot to give him fingers

molten hearth
#

personal preference or acc reason

torn shuttle
#

blockbench? I did use blockbench

#

wdym

molten hearth
#

oh

#

tbf you said you checked how blender did bones

#

i assumed blockbench also did bones

torn shuttle
#

oh

#

blender has good support forums and blockbench is basically done by one dude I think

#

so blender happened to have someone who nerded out over matrices

#

very easy explanation really, absolutely minuscule amount of math

molten hearth
#

fair enough ty

torn shuttle
#

I'm shocked I actually got it right straight away too, took me like 10 minutes to implement it

#

after two weeks of sweating over this system

molten hearth
#

when the code works first try

torn shuttle
#

basically yeah

molten hearth
#

my honest reaction

torn shuttle
#

now I have to go back and tear out my old code structure though

#

friendship ended with EulerAngle class, my best friend is now Quaternion

grand flint
#

apart from whatever the hell

#

the thing on his side is

#

also it looks like

#

his hands is inverted

#

it has to be on the other side

#

since if he is gripping it

molten hearth
#

lmao

#

bro's using the back of his palm

torn shuttle
#

yall are making some wild assumptions about goblin anatomy

#

who's to say their hands aren't backwards

grand flint
#

bc they arent

torn shuttle
#

source?

grand flint
molten hearth
#

i have a short friend we can use as the src

grand flint
#

ye i got u

#

@sullen marlin

molten hearth
#

LMFAO

grand flint
#

didnt even mean to ping him 💀

molten hearth
#

i thought you were gonna say yourself ngl

grand flint
#

bro gonna ban me 😭

torn shuttle
slender elbow
#

you are clearly photoshopped

torn shuttle
#

you can tell by the pixels

#

nah I just look this good

#

hard to believe, I know

grand flint
dark arrow
#

i get not found error when i try changing maven spigot-api to spigot for nms , i have installed the buildtools

grand flint
#

oh nvm

#

just use gradle

dark arrow
grand flint
#

yes, use gradle

molten hearth
#

?nms

molten hearth
#

did you follow this

#

also do you have your maven local repository specified

slender elbow
dark arrow
molten hearth
#

hmm maven might automatically use your local actually, my bad

sacred mountain
#

hello i'm making a small chess project, was wondering if there was a better way to wait for the stockfish engine, whilst not freezing the rest of the program along with it.

The code above works, but causes the whole thread to sleep (it's not my code, its a wrapper on github)

#

was thinking about multithreading but not sure with java swing

young knoll
#

Use a completable future or something

sacred mountain
remote swallow
#

heres guide

lost matrix
sacred mountain
#

looks like it should work

#

i think

#

i'll do some testing now

#

seems to not crash at least

#

nevermind i forgot something i think

lost matrix
torn shuttle
#

yeah I'm real happy

#

I think it will be a popular one

sacred mountain
#

oh i just realised

#

i am a total idiot

#

i was appending "text" instead of the variable text that i made

fluid river
young knoll
#

Yes

torn shuttle
fluid river
#

i once worked on a server called Pulsar, they tried to implement per-planet mobs like this

#

i was coding interplanetary spaceship bungeecord travel system for them

native bramble
#
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R1.block.data.CraftBlockData cannot be cast to class org.bukkit.block.data.type.Snow (org.bukkit.craftbukkit.v1_20_R1.block.data.CraftBlockData and org.bukkit.block.data.type.Snow are in unnamed module of loader java.net.URLClassLoader @67424e82)```

in line: Snow snow = (Snow) blockData;

how i get block data:
```java
org.bukkit.block.data.BlockData blockData = block.getBlockData();```
#

cant understand why is it typing that im trying to cast org.bukkit.craftbukkit.v1_20_R1.block.data.CraftBlockData

#

i even not import that

remote swallow
#

thats the implementation class for BlockData

native bramble
#

so how can i resolve?

remote swallow
#

the block isnt snow im guessing so thats what the issue, if it is snow no clue what the issue is @young knoll might

native bramble
#

before that i write block.setType(Material.SNOW);

torn shuttle
#

... social security just sent me a newsletter

#

what

#

why does social security need a newsletter?

#

this is so dumb I'm opening this pdf in my VM just in case it's a scam

#

nope it's legit

#

great I guess the tax man now has a newsletter

sullen wharf
proud badge
#

?paste

undone axleBOT
proud badge
sullen wharf
#

you need to register the command

proud badge
#

ok, how could I do that?

sullen wharf
proud badge
#

ok thanks

sullen wharf
#

🫡

#

wait no

#

that website is trash

proud badge
sullen wharf
#

new Launch() not heesetroll

proud badge
#

Ok

young shell
#

whats the reason for Bukkit PRs getting declined but then their contents are still merged into master

proud badge
#

Thanks

sullen wharf
#

You're initializing your main class over and over again 🤔

remote swallow
#

merges 10 commits as 1 for example

young knoll
#

Yeah md likes to rebase

young shell
#

Unless Bitbucket doesnt support them

#

Which wouldn't suprise me honestly

sullen marlin
#

They're often slightly edited

#

Declined just means closed in bitbucket

#

Can't usually squash merge either since commits must be gpg signed

remote swallow
#

md ur here early

young knoll
#

He fixes our terrible spelling

#

Actually that might just be me

remote swallow
#

it might be choco too

proud badge
#

How would I go about registering multiple commands though? this.getCommand("launch").setExecutor(new Launch()); this.getCommand("alert").setExecutor(new Launch()); appears to not work

eternal oxide
#

new Launch, new Alert.

remote swallow
#

have 1 instance of the class and pass that

#

Launch launch = new Launch()
this.getCommand("launch").setExecutor(launch);
this.getCommand("alert").setExecutor(launch);```
young knoll
#

Or just have 1 class per command

tough mica
#

hello, i wrote a ffastats command, but now is the problem ihave to execute the command two times , that the stats will be updated:
https://pastebin.com/1cQduhuH

proud badge
#

Alert.java and Launch.java

#

Oh and yeah I fixed it by replacing Launch with Alert in the 2nd one

inner mulch
#
        PacketType type = PacketType.Play.Server.ENTITY_DESTROY;
        PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(type);

        packet.getIntegerArrays().write(0, entityIDs);

        ProtocolManager manager = ProtocolLibrary.getProtocolManager();
        manager.sendServerPacket(reciever, packet);
    }```
this doesnt destroy entities when provided a entityid, any ideas why?
lost matrix
inner mulch
#

virtual

echo basalt
#

might be an intlist nowadays

#

I usually just writeSafely both values

quiet ice
#

What do you people generally use for HTTP(-S) webservers written in Java? It doesn't need to be anything fancy, it just needs to listen to webhooks emitted by github

echo basalt
#

spring?

#

jetty?

inner mulch
echo basalt
#

It basically writes if the field exists

#

and doesn't if it doesn't exist

#

instead of throwing an error

lost matrix
echo basalt
#

I guess jetty is fine

quiet ice
#

Yeah, though spring would ordinarily be fine but I have next to no experience with it

inner mulch
#

1.20.1

lost matrix
lost matrix
inner mulch
#

oh

#

int list?

#

what does it contain nowadays?

dry hazel
#

I mean, java also has a web server built in nowadays, might be worth a shot if you just want super basic stuff

quiet ice
#

Oh it has? Let's see how usable it is

inner mulch
lost matrix
#

An IntList iirc

dry hazel
young shell
#

Do the spawn limits in the World Class only apply to natural spawns or also to Entities spawned with the spawn() method

quiet ice
dry hazel
#

yea since 2006

#

jetty/javalin should be ok

young knoll
#

Spawn methods bypass everything

quiet ice
#

javalin is a library I have not heard of so far

#

I suppose it has nothing to do with kotlin, right?

dry hazel
#

well it has kotlin compatibility

#

it's just a wrapper around jetty under the hood I think

quiet ice
#

Actually javalin looks fancy, I guess I'll use that one instead

young shell
quiet ice
#

Looks equally great. Thanks for all the suggestions. I didn't expect that there were so many options out there

dry hazel
#

but it's meant for java use as well

young shell
#

I mean you could use spring, but thats not lightweight :D

quiet ice
#

Yeah I was just wondering about the name

quiet ice
#

And I rather avoid it given that I know it is a bit different with it's use of annotations. Probably not a problem for today's me but I'd rather avoid learning something I may not understand

young shell
#

Well Spring can be quite useful to know when wanting to go into Java Developement professionally, since it's the most commonly used enterprise Framework

quiet ice
#

Thankfully I don't actually intend on doing any sort of programming professionally. I'd much rather keep it as a hobby

#

Perhaps if I get desperate I might need to, but at the moment I have plenty of other doors wide open

cinder abyss
#

Hello, is there an event when an entity drop an item?

#

found : EntityDropItemEvent

quiet ice
#

What exactly are you referencing? Like drops while they die or while they are still alive?

inner mulch
#

entitydeathevent

#

get the drops

storm crystal
#

do I even need to make method of updating cache Map if I can just use this database's DAO and update it with getter and setter?

inner mulch
#

*playerdeathevent

storm crystal
cinder abyss
#

(my bad, I thought it was for me, sorry TwT)

young shell
#

Do the Spawn Limits in World also apply to CreatureSpawners?

inner mulch
#

hello, i want to set an entity as a player's passenger once a player loads into vision of another player. Sadly, once the PlayerTrackEntityEvent gets called, the player hasnt fully loaded in and the entity that should be a passenger end up on the ground.

Any ideas on how i can fix it?

young shell
#

Is there a reason for CraftWorld checking if the spawncategory is null in the first precondition, only to have it as one of the checks in CraftSpawnCategory.isValidForLimits()

young knoll
#

Probably not

#

Free performance gain!!!11

glossy venture
#
PacketBuilder.create(PacketType.Play.Server.PLAYER_INFO)
        .edit(packetContainer -> {
            packetContainer.getPlayerInfoAction().write(0, EnumWrappers.PlayerInfoAction.REMOVE_PLAYER); // action: remove
            packetContainer.getIntegers().write(0, 1);                                              // number of players to remove
            packetContainer.getUUIDLists().write(0, Lists.of(player.getUniqueId()));                     // uuids to remove: player
        })
        .broadcast();
``` anyone know why `getIntegers().write(0, 1)` throws an error while the wiki.vg page for my current protocol (client 1.8.9, server 1\_8\_R3) says there is an integer field for the number of players
young shell
torn shuttle
#

alright all cleaned up now, my code for bone rotation logic is a 150 line class

#

noice

#

there's a lot of optimization work that can be done here but right now I just want something that works

#

actually it's bone rotations and the other entity manipulations like setting the name to visible so that's real good

young knoll
#

Is it open source

#

Kek

echo basalt
#

Rather than the uh

torn shuttle
glossy venture
#

time to run buildtools

#

ig

young knoll
torn shuttle
#

I sort of wish I got the updateTickPositionBasedOnParentRotation working with quaternions instead but 🤷

glossy venture
#

anyone know how to fix 3rd person nametags

#

im pretty sure itll show fine for other players

#

but i cant figure out how to show it for myself

#

ill try respawning myself with entity destroy and spawn but i dont think the client will like that idk

eternal oxide
#

you mean you want to change your name?

glossy venture
#

i want it to show the formatted name which is shown in the tablist

#

above my head

#

and im pretty sure itll do that for other players

river oracle
#

isn't your own nametag client side? I don't think vanilla client does that

eternal oxide
#

btw never send your own client a destroy packet

glossy venture
glossy venture
#

ima try

eternal oxide
#

your client will no longer be able to move the player

glossy venture
#

oh i just got this

#

might be bc im on 1.8

rotund ravine
glossy venture
#

its a lunar mod

rotund ravine
#

Ah

glossy venture
#

if youre talking about displaying the nametag

eternal oxide
#

?paste for me

undone axleBOT
eternal oxide
glossy venture
#

oh maybe its the set entity data

#

im basically doing exactly that rn

young knoll
#

Sending the client a destroy packet for themselves sounds great

glossy venture
#

my current code

#

im using the display name

#

field

#

which is a text component

#

ill try this

#

ig

young knoll
#

Names are still capped at 16

#

Afaik

glossy venture
#

i know

#

not display names tho

#

wtf

#

it accepted the name

#

im pretty sure &6* &4&lOrbyfied is over 16 chars

#

wait nah

#

its exactly 16

#

and lunar still hasnt updated it

young knoll
#

You can make good fake name tags with display/interaction entities

#

But yeah not in 1.8

opaque scarab
#

What server bound packet with mojang remappings lets the server know a block is left-clicked (beginning to be mined) ?

#

I have been searching endlessly, with no result

final wharf
#

What's the best way to learn Java?

opaque scarab
final wharf
opaque scarab
#

Wdym by you can't type it, if you don't mind me asking?

final wharf
#

I can read it

#

But not make it

#

I can read src

opaque scarab
#

Your IDE doesn't let you type?

final wharf
#

Nono

#

I just can't make it

#

I can't explain it geez

#

I can't figure out how to code it

#

But I understand what other people make

opaque scarab
#

Oh alr

final wharf
#

I can't replicate it that's it

opaque scarab
#

Yeah that skill comes with experience. Try and not start with something too complex. Work your way up as your skills develop

#

What are you trying to code?

final wharf
#

Well

#

Just a simple core plugin

#

For my server

#

That I can add simple commads

#

Like a alternative to essentials

opaque scarab
#

When I started, i really liked the tutorials by technoVision on YT

#

It teaches you the basics of spigot dev

final wharf
#

I watched like 2 or 3 hours of brocode's tutorial

final wharf
#

Anyways

#

I'll try

#

Thanks

opaque scarab
#

What API are you using?

final wharf
opaque scarab
#

The tutorial works fine with paper too. Paper is an extension of spigot

final wharf
#

I know

#

Paper is just more optimized in my opinion

opaque scarab
#

It is

final wharf
#

Everybody should use whatever they want

#

I'm not going to use paper tho

#

As a server jar

#

Xd

opaque scarab
#

When designing plugins, I usually start with "sudo code" Just write the overall functionality, and break it down into steps.

final wharf
#

Whats that

#

This weekend I'm 100: starting to try making it but for now I'm just going to watch tutorials

final wharf
#

😭

final wharf
storm crystal
final wharf
storm crystal
#

I learn new thing -> I immediately implement it into a plugin to see why its important

final wharf
#

Nice

echo basalt
#

?learnjava!

undone axleBOT
river oracle
#

lots of good resources above ^^^^^^^^^

storm crystal
echo basalt
#

that's because you were in denial

storm crystal
#

no they just suck

#

maybe not oracle one cuz its official and they know what they are talking about

opaque scarab
# final wharf Whats that

Just text in a notebook or whatever, and write what you want a command to do for example. Once you know what the command does, try to break it down into parts. How is the command initialized for example.

This command makes a circle of particles around the player. 

Steps:

The command is registered.
Get the player location.
Make a var stating degrees.
Run a task that does the following every tick:

get degrees.
Calc new point from axis at player pos
Spawn particle at new point.
Degrees = degrees + 1

Then interpret that into Java code.

final wharf
#

For that academy

river oracle
#

crazy right

storm crystal
#

nobody forces you to buy premium account on any of those sites

eternal oxide
#

They are all free

final wharf
eternal oxide
#

never pay to learn java, only use free resources

opaque scarab
#

^

storm crystal
#

there is no such thing as for free

slender elbow
#

the only thing you need to pay is attention

storm crystal
#

you are paying with something one way or another

opaque scarab
#

Yeah when it's free, your paying with your attention by seeing ads, and getting data collected on you...

slender elbow
#

i don't think that's how paying attention works

storm crystal
#

most of those free resources either have premium accounts or force you into making an account

river oracle
storm crystal
weak meteor
#

The problem is, when i call CooldownLoader#setCooldown, nothing happens

#

lemme upload a video

hazy parrot
weak meteor
#

going

#

oh

hazy parrot
weak meteor
#

implements Key?

hazy parrot
#

no, just override equals and hashCode

#

those are methods from Object class

weak meteor
#

oh

#

okay

hazy parrot
#

intellij can do that automatically for u

weak meteor
#

how?

hazy parrot
#

alt + enter -> override equals and hashcode

quaint mantle
#

how do I go about testing when I have to deal with files

river oracle
weak meteor
#

thanks bro

quaint mantle
river oracle
#

if you need to make files you can probably utilize tmp directories

#

java supports creating Tempory files very easily with the old java io and java nio API

young knoll
#

Yay delete on exit

hazy parrot
weak meteor
#

No

#

lol

hazy parrot
#

can u explain "noting happens" ?

weak meteor
#

Cooldown isnt applied

#

this is the code block

#

Kit is given, message is sent but, manager.setCooldown(kit, player.getUniqueID) isnt applied

#

and well, if he have cooldown manager.hasCooldown(); is true

hazy parrot
#

can you check if hashmap have correct values

#

print it

weak meteor
#

okay

#

seems that manager isnt executing at all

#

But nothing is printed on COnsole

#

The ItemStack is showed when player claims the kit

torn shuttle
#

interesting, I've managed to break intellij for the first itme in a good long while

#

it did not like me reverting to a previous git commit

molten hearth
#

are potion effects like haste/mining fatigue client sided?

#

nvm i dont think they are

young knoll
#

They are both

molten hearth
#

oh thanks

grand flint
#

why does it say static before my variable

eternal oxide
#

you typed static?

grand flint
#

no it just appeared

eternal oxide
#

The IDE suggested it and you selected it

grand flint
#

nuh uh it said static

eternal oxide
#

the IDE by default tells you to make it static if you try to access it in a static manner

#

don't take the IDE's advice

grand flint
#

whats static

eternal oxide
#

only one instance of the field across all class instances

rotund ravine
#

Huh i thougt fase was better than this

echo basalt
#

jan about to link to his own post where he stole my index

rotund ravine
echo basalt
#

bro indexed a bing post

rotund ravine
#

💪🏻

echo basalt
#

the disrespect

mortal hare
#

ah yes

#

im making a T

#

but i do require a T

#

🙂

#

update: fixed it, i was making another generic type T inside inner class when outer class already declares it

storm crystal
#

Whats up with naming invention __likethat__ ? Is it any useful in spigot shit?

torn shuttle
#

ayo animation states are now implemented

#

what a great day today was

#

just need to do some cleaning up tomorrow and add hitboxes

#

very cool, very pog

mortal hare
#

its just a hacky way to hide variable from autocompletion

#

and mark it for not public usage

storm crystal
#

Whats autocompletion

mortal hare
#

when you type in IDE

#

you get suggestions

#

the suggestions are autocompletion

#

for you

opaque scarab
#

How should I change the block mine sound of a block for a specific player, using reflection?

mortal hare
#

literally

#

Player.playSound()

#

you cant change sounds imo

#

you can only emit it

#

block breaking is clientside

#

but verification of those blocks is serverside

#

if the server lags you still get block breaking sounds, its not as if server halts and you cant hear any sounds when interacting with world around you (except for entities, that's for some reason is serverside)

opaque scarab
# mortal hare

I need the previous original sound to be stopped as well. While could do stopSound, let’s say another player breaks a wooden block with the same sound as the other at the same time. It will stop all of the wooden block break sounds. I am adding custom blocks using noteblocks, and I need the break sound to be dependent on each block’s blockstate

quaint mantle
#

why is {} not a json obj

mortal hare
#

its clientside

hazy parrot
mortal hare
#

its easily provable

#

just hop on to laggy server

#

and when the server lags

#

try to break blocks

#

youll still hear the block breaking sounds

#

no matter if server handles your block breaking requests or not

#

that's only achievable with clientside mod

mortal hare
opaque scarab
# mortal hare its clientside

I know it’s client side. You can stop clientside sounds though using world#stopSound(sound) though. Anyways, to my knowledge, a packet is sent to the client that states some data on the block, such as its mining sound. The client does not rely on material to determine the sound type I thought

young knoll
#

It does

hazy parrot
#

{"smth": {}} is valid tho

opaque scarab
young knoll
#

Yes

mortal hare
#

ok

opaque scarab
#

Brilliant. I have the memory of a goldfish

mortal hare
#

maybe im wrong, or it was changed in modern versions of minecraft

#

i dont remember block breaking sounds being serverside

quaint mantle
#

ive never had this error ever

#

where "\n" was included in the parsing what

young knoll
mortal hare
hazy parrot
mortal hare
#

it depends what do we call a serverside

mortal hare
opaque scarab
hazy parrot
#

but it acts as null ig

mortal hare
young knoll
#

Not sure if you can control them server side

#

I mean you could remove the sounds via resource pack and then play your own ig

mortal hare
#

what about this?