#help-development

1 messages · Page 790 of 1

chrome beacon
#

sort of like how arrows get stuck on the player

rough drift
#

that's actually quite hard

quaint mantle
#

just make them ride the entity

hushed spindle
#

ill just make it so the arrows drop as items when they hit a dummy

chrome beacon
lavish cliff
#

guys i have a issue with maven

#

but i don't have this (import / dependecy) in my plugin

storm crystal
#

Might look good but code might be jank

#

Cosmetics is subjective

dry hazel
#

make sure you have the latest version of it, a supported compiler and a compatible jdk

storm crystal
#

Also looks pretty similar to hypixel lol

hushed spindle
#

my indicators?

#

i wouldnt know i havent played on hypixel lol

storm crystal
#

It is p much hypixel

#

Lol

glad prawn
#

he is just lying

storm crystal
#

Huh

pseudo hazel
storm crystal
pseudo hazel
#

maybe, but both of those are hard to measure accurately

storm crystal
#

Yall didnt have no problem to tell me how scalable my code is so make ur mind 🤷‍♀️

hushed spindle
#

i was going more with the noita-style damage indicators honestly

pseudo hazel
hushed spindle
#

i mean you know what programmers are like lol

proud badge
#

wait so uh if I have a database lookup for on block break event and I use an external thread for the database lookup, what if someone for example uses like haste 2 on a bunch of blocks, does that open a bunch of threads at the same time? (my server has 3 threads)

hushed spindle
#

we like to correct people and tell people they are wrong even if their implementation works perfectly fine for them

#

i could post the code for that damage indicator and there will always be people saying its wrong or how many mistakes it has

#

granted, it absolutely does have lots of little mistakes and looks terrible, but thats besides the point

hushed spindle
#

and cant you just use async tasks

proud badge
#

to check if the block is natural with CoreProtectAPI

proud badge
hushed spindle
#

yeah but you probably dont have to implement multithreading like that yourself

proud badge
#

so uh getServer().getScheduler().runTaskAsynchronously(this, () -> { is this async or is this multithread

hushed spindle
#

also you can probably do it the other way around, i apply a little persistent data tag to blocks that have been placed and see if blocks are natural or not in that way

lost matrix
proud badge
#

ok cool

#

getServer().getScheduler().runTask(this, () -> { and this puts me back to my main thread?

hushed spindle
#

yes

lost matrix
hushed spindle
#

are you planning to modify the blockplaceevent by the way

proud badge
#

ok and if I want to save data for example isBlockNatural boolean inside of the thread do I need to use AtomicBoolean?

proud badge
#

or what

hushed spindle
#

for example yes

proud badge
#

no

#

I just need to save a HashMap and send a chat message

lost matrix
proud badge
#

ok but can I access the natural variabale in getServer().getScheduler().runTask(this, () -> {
(main thread)

lost matrix
lost matrix
proud badge
#

na sorry thats not what I meant I forgot, I dont need a hashmap in my other thread I just need a boolean

#
            if(!event.isCancelled()) {
                boolean containsBlock = false;
                Material[] blockedBlocks = {Material.DIRT, Material.CAVE_VINES, Material.GRASS_BLOCK, Material.TALL_GRASS, Material.GRASS, Material.NETHERRACK, Material.OAK_LEAVES, Material.SPRUCE_LEAVES, Material.JUNGLE_LEAVES, Material.BIRCH_LEAVES, Material.DARK_OAK_LEAVES, Material.CHERRY_LEAVES, Material.ACACIA_LEAVES, Material.MANGROVE_LEAVES};
                for (Material blockType : blockedBlocks) {
                    if (blockType == material) {
                        containsBlock = true;
                    }
                }
                if (containsBlock == false) {

                    List<String[]> lookup = CoreProtect.getInstance().getAPI().blockLookup(block, 2147483647);
                    if (lookup != null) {
                        boolean hasPlaced = CoreProtect.getInstance().getAPI().hasPlaced(playerName, block, 2147483647, 0);
                        boolean hasRemoved = CoreProtect.getInstance().getAPI().hasRemoved(playerName, block, 2147483647, 0);
                        for (String[] result : lookup) {
                            CoreProtectAPI.ParseResult parseResult = CoreProtect.getInstance().getAPI().parseResult(result);
                            String lookupPlayer = parseResult.getPlayer();
                            if (!lookupPlayer.startsWith("#")) {
                                if (!hasPlaced) {
                                    if (!hasRemoved) {
                                        doAlert.set(true);
                                    }
                                }

                            }
                        }
                    }


                }
            }```
#

right now its atomic from yesterday but ill change it

lost matrix
#

Try to also crop your methods length

proud badge
#

will that cause issues? the method length

lost matrix
#

It makes your code horribly dirty and hard to read

lost matrix
# proud badge will that cause issues? the method length
  @EventHandler
  public void onJoin(PlayerJoinEvent event) {
    Player player = event.getPlayer();
    // This is an early escape, if the player is not an op, we don't need to do anything.
    if (!player.hasPermission("op")) {
      return;
    }
    String playerName = player.getName();
    Bukkit.getScheduler().runTask(this, () -> broadcastOpJoin(playerName));
  }

  // This is a named method to make the code more readable.
  private void broadcastOpJoin(String playerName) {
    for (Player online : Bukkit.getOnlinePlayers()) {
      // This is a variation of early escape to skip a loop iteration.
      if (!online.hasPermission("view.op")) {
        continue;
      }
      online.sendMessage(playerName + " joined the server.");
    }
  }
proud badge
#

also doesnt the word final mean that its final and cant be altered anymore? or does java not care about english grammar

river oracle
#

You can still do stuff and use the setters and getters

#

You just can't reassign that variable

lost matrix
# proud badge will that cause issues? the method length

PS: This is how the code looks with nesting and no named methods

  @EventHandler
  public void onJoin(PlayerJoinEvent event) {
    Player player = event.getPlayer();
    if (!player.hasPermission("op")) {
      String playerName = player.getName();
      Bukkit.getScheduler().runTask(this, () -> {
        for (Player online : Bukkit.getOnlinePlayers()) {
          if (online.hasPermission("view.op")) {
            online.sendMessage(playerName + " joined the server.");
          }
        }
      });
    }
  }

Its significantly less readable and you need to really dig into everything to understand whats happening

proud badge
lost matrix
proud badge
#

Ok thanks

lost matrix
#
  • Less nesting
  • More methods with meaningful names
proud badge
#

Cannot assign a value to final variable 'natural'

damn

undone axleBOT
#

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

proud badge
#

?paste

undone axleBOT
lost matrix
rotund ravine
#

Imagine guessing smh

proud badge
#

so what you mean make a chunkSnapshot variable, then get the block from the chunkSnapshot variable?

tall dragon
#

no

#

i think hes saying you should load all blocks of a chunk into memory from the database when the chunk loads

#

whichever u have data about in your database

#

then in your events access that data, not the database

knotty aspen
#

Unless you need to do global lookups you can also just store your data in the chunk PDC, no need for the complicated database stuff

proud badge
#

na so for every block in a chunk I need to access the coreprotect database, and put it into a variable?

storm crystal
#

What can I store in plugin configs

proud badge
#

aint that a bit too laggy

proud badge
storm crystal
#

I mean in what cases do I want to use them

young knoll
#

Yes

lost matrix
river oracle
#

anything as long as you make an adapter

young knoll
#

And you can write custom adapters, so yeah basically anything

hushed spindle
lost matrix
river oracle
young knoll
#

I mean data can be stored in yaml

#

but ehhh

lost matrix
young knoll
#

You have a ton of options for data: yaml, json, PDC, database, binary

#

etc

proud badge
#

check if the block is natural, and if the player has placed the block or na

hushed spindle
lost matrix
whole lintel
#

since there's no state here

knotty aspen
storm crystal
hushed spindle
#

yes im just saying generally speaking

storm crystal
#

xdxdddd

hushed spindle
#

its "fine" there are just better solutions

young knoll
#

I mean if you are going to run a server with a million total players

#

Maybe avoid yaml

storm crystal
#

So now I have to start from scratch

whole lintel
#

(which you're not)

young knoll
#

But for the average server it's technically fine

lost matrix
knotty aspen
#

I rather have plugins storing data in yaml than Devs not understanding databases and blocking the main thread with them

hushed spindle
#

for example, im doing a custom crafting plugin. if i didnt have guis to edit my recipes, yml would be the best approach as humans need too be able to read and edit them. but since i have guis i dont have to make them readable, so in my case i use json

young knoll
#

I still want an api for NBT files

hushed spindle
#

but i could also just use a database or something

young knoll
#

That would be cool

river oracle
hushed spindle
#

you dont have to scratch all your work

proud badge
#

cant I just make it so it wont create more threads if one is open? Like queue them all up

storm crystal
lost matrix
hushed spindle
#

in any case, gson is very easy to use for json storage

river oracle
hushed spindle
#

converting your yml solution to json will not be a lot of effort

lost matrix
#

Ah missed it

old cloud
#

Hi, how can i make a mob Walk to a specific location?

proud badge
#

what about blocks that were placed before the plugin is installed? My map is 4 months old, will they all render as natural? (i assume yes)

lost matrix
# proud badge here I sent it

This is also technically possible with CoreProtect, but you need a very good understanding of their internals
and when data is in memory/queried from a DB

whole lintel
#

Oh god

#

core protect

lost matrix
whole lintel
#

easiest way to get 999 dupes on your server

proud badge
#

because I dont rollback stuff before I trace back to where it went

whole lintel
#

They're mostly not public

old cloud
old cloud
#

Ok and setTarget would look most natural right?

valid burrow
#

how can i get a biome from a certain location

rough drift
#

World#getBiome

young knoll
#

Yes setTarget should be natural

#

And you should be able to use an invisible mob for the target

lost matrix
storm crystal
#

I guess Sql?

#

But maybe later now im rather demotivated

serene sigil
#

guys, i need help with something

slender elbow
#

good luck

slender elbow
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!

eternal oxide
#

Not sure I can advise on something

slender elbow
#

but i thought you knew about something

near night
#

i have a folder in the resources folder called assets, how can i access it though code?

#

i need to copy files out of the assets folder to a difrent folder

eternal oxide
#

name the folder correctly in your jar

#

then Plugin#saveResource

#

no need to bother messing with folders then

near night
#

yeah but i am making a plugin that other plugins will put fils in the said assets folder then my plugin needs to mess with those files

#

my plugin is gonna copy the files out of resource folder

river oracle
#

i'd advise against letting other plugins inject things into your resource folder

#

do what ElgarL said and use Plugin#saveResource

river oracle
#

because that's mainly because its unnecessarily complex and, but also opens you up to more vulnerabilities

#

you'd be providing an API to inject content into your jar

#

why not just uhh idk, use the plugin data folder that spigot already oh so graciously gives you instead of doing some convoluted weird shit

near night
#

i'm copying files from other plugins resource folders into my plugins data folder

near night
#

not for me tho xD

river oracle
#

it'd be much easier and safer to provide developers with API to add files into your plugin data folder

near night
near night
#

welp thanks for your help! i gtg now

serene sigil
# slender elbow ?ask

what is the event that gets called when a block breaks because a block below it boke

#

broke*

#

for example what is the event if you break a grass block and on top of that is a sapling

rotund ravine
#

Eh probably physics update or smth

#

BlockBreakEvent tho 💪🏻

serene sigil
rotund ravine
#

It’ll only trigger for one of em ye

serene sigil
#

yea

#

and what is physicsupdate?

rotund ravine
#

The other thing is just physics i guess

#

An event that gets called a fuck ton

serene sigil
#

is it good for the cpu to actually implement a listener for an event that gets called so many times?

rotund ravine
#

Meh

#

Also just check if there is a sapling above in the blockbreakevent

serene sigil
#

how?

#

because i cant just check the block above it...

rotund ravine
#

Why

serene sigil
#

actually i need it for rails

#

not saplings

rotund ravine
#

So you can

serene sigil
#

that was just an example

rotund ravine
#

Same principle

serene sigil
#

because rails can also be on top of gravel and if u break a gravel 5 blocks below it, it also drops

rotund ravine
#

?jd-s

undone axleBOT
serene sigil
#

?

rotund ravine
#

I was just checking smth

serene sigil
#

ok

proud badge
#

decompiling my plugin jar wont effect how the code works right?

rotund ravine
pseudo hazel
#

cant you just listen for the block break of the rails?

rotund ravine
#
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;

// Implement the Listener interface
public class BlockBreakListener implements Listener {

    // Handle the BlockBreakEvent
    @EventHandler
    public void onBlockBreak(BlockBreakEvent event) {
        // Get the block that was broken
        Block block = event.getBlock();
        // Check if there is a rail above the block or the pile of sand/gravel
        if (hasRailAbove(block)) {
            // Cancel the event
            event.setCancelled(true);
        }
    }

    // Helper method to check if there is a rail above a block or a pile of sand/gravel
    private boolean hasRailAbove(Block block) {
        // Get the block above the block
        Block above = block.getRelative(0, 1, 0);
        // Get the material of the block above
        Material material = above.getType();
        // Check if the material is a rail
        if (material == Material.RAIL || material == Material.POWERED_RAIL || material == Material.DETECTOR_RAIL || material == Material.ACTIVATOR_RAIL) {
            // Return true
            return true;
        }
        // Check if the material is sand or gravel
        else if (material == Material.SAND || material == Material.GRAVEL) {
            // Recursively check the block above
            return hasRailAbove(above);
        }
        // Otherwise, return false
        else {
            return false;
        }
    }
}
quaint mantle
rotund ravine
#

That’s just a physics update

quaint mantle
#

It does not make bugs or something but makes the codebase worse

pseudo hazel
#

oh does that not send the event?

eternal oxide
tranquil ferry
#

Hey anyone knows how to get ur plugin downloads from 5k to 50k downloads ping me if u know

pseudo hazel
#

I wish I knew

eternal oxide
#

patience and regular updates (if needed) and support

rotund ravine
#

Just told bing to write it cause i was lazy

pseudo hazel
#

lmk how to even get to 5k lmao

eternal oxide
#

lazy ass 🙂

rotund ravine
pseudo hazel
#

also doing that recursively is kinda pointless

tranquil ferry
pseudo hazel
#

I see

rotund ravine
pseudo hazel
#

gettings blocks until you reach a rail

#

or doing anything

rotund ravine
#

Why?

rotund ravine
pseudo hazel
#

you could use a list or a while loop

rotund ravine
#

Gravel falls from any height as long as the block under it broky

#

Sure

#

Or i could just do it recursively

pseudo hazel
#

yes

#

I mean it still works ofc

#

I guess bing was just in the mood for recursion

rotund ravine
#

I told it to just do it like that at the end

#

It was trying some other schenanigans

pseudo hazel
#

i see

quaint mantle
#
java.lang.IllegalStateException: Already scheduled as 14
        at org.bukkit.scheduler.BukkitRunnable.checkNotYetScheduled(BukkitRunnable.java:162) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.scheduler.BukkitRunnable.runTaskLater(BukkitRunnable.java:78) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at net.fabledrealms.entityMotion.EntityULMHandler$1.run(EntityULMHandler.java:67) ~[fabledrealms-1.0.0.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1506) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:486) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1420) ~[purpur-1.20.1.jar:git-Purpur-2062]

when running this function :

public void playAnimation(List<TeleportData> teleportDataList) {
        currentIndex = 0; // Reset currentIndex at the beginning
        int ticksPerSecond = 20;
        int delay = 1000 / ticksPerSecond;

        BukkitRunnable runnable = new BukkitRunnable() {
            @Override
            public void run() {
                if (currentIndex < teleportDataList.size()) {
                    TeleportData teleportData = teleportDataList.get(currentIndex);
                    entity.teleport(teleportData.toLocation());
                    currentIndex++;

                    // Recursive call after the delay
                    runTaskLater(plugin, delay);
                }
            }
        };

        // Schedule the BukkitRunnable
        runnable.runTaskLater(plugin, delay);
    }```

What could it possibly be ?
rotund ravine
#

You can’t rerun the same runnable

quaint mantle
#

maybe runTaskLater ?

upper hazel
#

hey how i can get line number from config?

rotund ravine
#

@upper hazel ?

upper hazel
#

1, 2, 3 etc

quaint mantle
pseudo hazel
#

you should never need the line number in a config file

upper hazel
#

in config

eternal oxide
#

configs are not treated as having line numbers

rotund ravine
quaint mantle
#

something like that

eternal oxide
#

no

quaint mantle
#

oh he meant the line of the config

upper hazel
#

not exists

eternal oxide
#

yep

quaint mantle
#

i thought an int value in the config

rotund ravine
#

Scanner i guess

#

Glhf with weird stuff

eternal oxide
#

line numbers mean nothign in a config as whitespace is ignored when parsed

pseudo hazel
upper hazel
#

i want log were plugin search error value in config

#

for more information

quaint mantle
#

you can manually map the keys with an error message and onEnable you check all your key values and if they're not valid you throw the error message

pseudo hazel
rotund ravine
#

You want a yaml linter then

upper hazel
rotund ravine
#

Yaml linter

upper hazel
#

what?

pseudo hazel
#

a linter

#

like probably some library that will read the yml file and spit out errors and lines

#

for syntax errors mostly

upper hazel
#

but I can’t find out the line number where I got the value from the config?

rotund ravine
#

Seems unnessacary

upper hazel
#

which is like section.getInt().getLine

pseudo hazel
#

if you have a section you know the path to the section probably

#

so you can just look up what line it is

upper hazel
pseudo hazel
#

is this for users or just for debugging

upper hazel
#

The problem is that there may be gaps there. The config section is not displayed for some reason

pseudo hazel
#

that means its probably null

upper hazel
#

no i mean plugin.getConfig.getSection.getPath not shows the way

#

I wanted to display an error something like - config.yml/key1/key2

#

but now this - /key1/key2

pseudo hazel
#

so the path of key1.key2 is not showing up?

upper hazel
#

config.yml/ - not exists in log

pseudo hazel
#

are you working for microsoft or something

rotund ravine
#

I broke it sec

upper hazel
#

just keys insade config

pseudo hazel
#

well the section is just for the file

rotund ravine
#

Getting the line number of a key and value in a YAML file using SnakeYAML is not a straightforward task, as the library does not provide a built-in method for that. However, there are some possible ways to achieve this, depending on your use case and requirements.

One way is to use the org.yaml.snakeyaml.error.Mark class, which represents a position in a YAML stream. This class has methods such as getLine() and getColumn() that return the line and column numbers of the position. You can obtain a Mark object from a Node object, which represents a YAML node in the abstract syntax tree (AST) generated by SnakeYAML. To get a Node object, you can use the org.yaml.snakeyaml.composer.Composer class, which parses a YAML stream and produces a single node. For example, you can use the following code to get the line number of the key FirstKey in your YAML file¹:

import java.io.FileInputStream;
import java.io.IOException;
import org.yaml.snakeyaml.composer.Composer;
import org.yaml.snakeyaml.nodes.MappingNode;
import org.yaml.snakeyaml.nodes.Node;
import org.yaml.snakeyaml.nodes.NodeTuple;
import org.yaml.snakeyaml.parser.Parser;
import org.yaml.snakeyaml.parser.ParserImpl;
import org.yaml.snakeyaml.reader.StreamReader;

public class LineNumberDemo {

    public static void main(String[] args) throws IOException {
        // Create a parser for the YAML file
        Parser parser = new ParserImpl(new StreamReader(new FileInputStream("./config.yaml")));
        // Create a composer that produces a single node from the parser
        Composer composer = new Composer(parser);
        // Get the root node of the YAML file
        Node rootNode = composer.getSingleNode();
        // Check if the root node is a mapping node
        if (rootNode instanceof MappingNode) {
            // Cast the root node to a mapping node
            MappingNode mappingNode = (MappingNode) rootNode;
            // Iterate over the key-value pairs in the mapping node
            for (NodeTuple nodeTuple : mappingNode.getValue()) {
                // Get the key node and the value node
                Node keyNode = nodeTuple.getKeyNode();
                Node valueNode = nodeTuple.getValueNode();
                // Get the mark of the key node
                Mark keyMark = keyNode.getStartMark();
                // Get the line number of the key node
                int keyLine = keyMark.getLine();
                // Get the mark of the value node
                Mark valueMark = valueNode.getStartMark();
                // Get the line number of the value node
                int valueLine = valueMark.getLine();
                // Print the key, the value, and their line numbers
                System.out.println("Key: " + keyNode + ", Value: " + valueNode + ", Key line: " + keyLine + ", Value line: " + valueLine);
            }
        }
    }
}

The output of this code is:

Key: FirstKey, Value: {SecondKey={Enabled=true, ID=Some text}, AnotherKey={AValue=true}}, Key line: 0, Value line: 0
Key: TestKey, Value: {TestValue=More text}, Key line: 4, Value line: 4

Another way is to use the org.yaml.snakeyaml.events.Event interface, which represents an event that occurs during the parsing of a YAML stream. This interface also has a method getStartMark() that returns a Mark object for the event. You can use the org.yaml.snakeyaml.Yaml class to parse a YAML stream and iterate over the events that it produces. For example, you can use the following code to get the line number of the key FirstKey in your YAML file²:

#
import java.io.FileInputStream;
import java.io.IOException;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.events.Event;
import org.yaml.snakeyaml.events.MappingEndEvent;
import org.yaml.snakeyaml.events.MappingStartEvent;
import org.yaml.snakeyaml.events.ScalarEvent;

public class LineNumberDemo2 {

    public static void main(String[] args) throws IOException {
        // Create a YAML object for the YAML file
        Yaml yaml = new Yaml();
        // Parse the YAML file and iterate over the events
        for (Event event : yaml.parse(new FileInputStream("./config.yaml"))) {
            // Check if the event is a scalar event
            if (event instanceof ScalarEvent) {
                // Cast the event to a scalar event
                ScalarEvent scalarEvent = (ScalarEvent) event;
                // Get the value of the scalar event
                String value = scalarEvent.getValue();
                // Get the line number of the scalar event
                int line = scalarEvent.getStartMark().getLine();
                // Print the value and the line number
                System.out.println("Value: " + value + ", Line: " + line);
            }
        }
    }
}

The output of this code is:

Value: FirstKey, Line: 0
Value: SecondKey, Line: 1
Value: Enabled, Line: 2
Value: true, Line: 2
Value: ID, Line: 3
Value: Some text, Line: 3
Value: AnotherKey, Line: 4
Value: AValue, Line: 5
Value: true, Line: 5
Value: TestKey, Line: 6
Value: TestValue, Line: 7
Value: More text, Line: 7

I hope this helps you with your question. If you need more information, you can check out the following links:

Source: Conversation with Bing, 14/11/2023
(1) Java - SnakeYaml | Get all keys of a file - Stack Overflow. https://stackoverflow.com/questions/67880449/java-snakeyaml-get-all-keys-of-a-file.
(2) java - How to Access the inner(nested) key-value in an YAML file using .... https://stackoverflow.com/questions/48744919/how-to-access-the-innernested-key-value-in-an-yaml-file-using-snakeyaml-librar.
(3) Java - SnakeYaml | Get all keys of a file - Stack Overflow. https://stackoverflow.com/questions/67880449/java-snakeyaml-get-all-keys-of-a-file.
(4) Java - Get all keys of a map recursively - Stack Overflow. https://stackoverflow.com/questions/67938579/java-get-all-keys-of-a-map-recursively.
(5) Reading and Writing YAML Files in Java with SnakeYAML - Stack Abuse. https://stackabuse.com/reading-and-writing-yaml-files-in-java-with-snakeyaml/.
(6) undefined. https://www.java-success.com/yaml-java-using-snakeyaml-library-tutorial/.

pseudo hazel
#

presumably you opened the file somewhere with a path name

rotund ravine
#

Hf trying to get what gpt-4 says is true to work

rotund ravine
upper hazel
#

Then why, when syntax errors occur, does the console display the line number of the config where it happened?

#

why i not can get this line from config at will

pseudo hazel
#

because those are separate systems probably

upper hazel
#

not in a sophisticated way

pseudo hazel
#

what do you mean

rotund ravine
#

Just catch the error msg 👌🏻

#

Jkjk

upper hazel
#

not using libraries, systems. Why can't I get the line number using 1 method?

dry hazel
#

syntax errors are thrown by snakeyaml during the parse process, it simply doesn't store this metadata beyond the deserialization process

rotund ravine
#

Fraud?

#

cause snakeyaml does not care about lines

upper hazel
rotund ravine
#

Also the error snakeyaml gives is not always indicative of the actual error

#

Yaml can be broken in many ways where snakeyaml suddenly doesn’t know what to do

deep herald
#

anyone know how to check if a player is in a region?

#

worldguard

deep herald
#

all im doing is that. i want to factor out the region so it doesnt effect the region

chrome beacon
#

Just check if there's a region at the players location

deep herald
#

whats the method to check

chrome beacon
#

Read the documentation page

rotund ravine
#

?tryandsee

undone axleBOT
deep herald
#

lmao

chrome beacon
#

it really shouldn't be that hard to read the page

slender elbow
#

the realisation when a player can be in multiple regions

#

:chatting:

rotund ravine
slender elbow
#

the global one

#

prevents everything

rotund ravine
#

Exactly

deep herald
#

so that'll factor out spawn?

whole lintel
#

?pastebin

#

?paste

undone axleBOT
whole lintel
#

any idea?

knotty aspen
whole lintel
#

GiveBallCommand.java:24 is ```java
ItemManager.getInstance().giveItem((Player) commandSender);

#

which is

#
    public void giveItem(Player player) {
        player.getInventory().addItem(pokeBallItem);
    }
icy beacon
#

?tas

undone axleBOT
icy beacon
#

yeah

whole lintel
#

the item cant be null

#

its initialized in constructor

river oracle
whole lintel
#

oops

#

im blind

river oracle
#
    at codes.domino.pokeballmc.PokeballMC.<init>(PokeballMC.java:12) ~[?:?]```
whole lintel
#

but

#

i didnt reinitialize it lol

river oracle
#

clearly you did somehwere :P

#

get searchin

#
    at codes.domino.pokeballmc.PokeballMC.<init>(PokeballMC.java:12) ~[?:?]
    at codes.domino.pokeballmc.PokeballMC.getInstance(PokeballMC.java:33) ~[?:?]
    at codes.domino.pokeballmc.item.ItemManager.<init>(ItemManager.java:26) ~[?:?]
    at codes.domino.pokeballmc.item.ItemManager.getInstance(ItemManager.java:87) ~[?:?]
    at codes.domino.pokeballmc.command.GiveBallCommand.onCommand(GiveBallCommand.java:24) ~[?:?]```
whole lintel
#

yeah i did

#

💀

#

i used a normal singleton pattern

#

forgot im working with bukkit

#
    public static PokeballMC getInstance() {
        if (INSTANCE == null) {
            INSTANCE = new PokeballMC();
        }
        return INSTANCE;
    }
#

this

river oracle
#

yeah lol rough

#

that'd do it

whole lintel
#

ah right

#

how do u make an item glow again

#

u cant just give it infinity 1 and hide it anymore

austere cove
#

at least make your lazy init thread safe

river oracle
#

this is minecraft, what is thread safety?

arctic shuttle
#

hey how would I set a 1/10 chance to get an item?

whole lintel
#

pointless really

whole lintel
river oracle
#

you just add an enchantment

#

than use the HIDE_ENCHANTMENTS flag

arctic shuttle
river oracle
#

you can usually use google for those kind of questions

arctic shuttle
river oracle
#

the same logic applied for the 10%

arctic shuttle
#

but

river oracle
#

look at the approved answer on that thread I sent

#

it will have a green checkmark

dull mango
river oracle
#

this is a good one

grim hound
#

what's the best way to check that a player has started holding an item?

chrome beacon
arctic shuttle
river oracle
arctic shuttle
arctic shuttle
river oracle
#

do what?

#

run code

#

you juts uhh type it out

#

and compile it

#

then put hte plugin in the server

arctic shuttle
river oracle
#

you need to use random

#

just follow the suggetsion of the thread I posted earlier

#

there isn't really a much better way than that

arctic shuttle
#

ok

#

sorry if I'm annoying lol

slate tinsel
#

How do I change a player's fall speed?

tall dragon
#

does any1 know if its feasable to cancel knockback? as in when i hit an entity it should take damage as normal. but take zero knockback

river oracle
lost matrix
tall dragon
#

i did try that but it stops it in its tracks

#

and it looks weird

river oracle
tall dragon
#

getting the right attack damage is also pretty tricky tho

#

haha

river oracle
#

doesn't EntityDamageByEntityEvent give you a damage

#

?jd-s

undone axleBOT
tall dragon
#

im never sure if final damage is with all calculations done

#

it should be right?

#

hm yea i could try this. but im pretty sure this will not show my client the hit visually

river oracle
#

using EntityDamageByEntityEvent#getDamage should work

tall dragon
#

which is a problem

river oracle
tall dragon
#

i think so indeed.

river oracle
#

bukkit might have API for that for some reason I remember there being API for that

tall dragon
#

il see if i can figure that out. thanks for the insight

river oracle
#

https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#sendHurtAnimation(float)

#

only for player 🥲

tall dragon
#

yikes

#

thats pretty interesting

#

shoulnt that be the same code for all livingentities

river oracle
#

oh I think that does incoming damage

lost matrix
tall dragon
#

ohh

#

thats interesting as well

river oracle
#

that should actually work better

tall dragon
#

yea il defo try that first thanks

slate tinsel
lost matrix
slate tinsel
knotty aspen
#

best option is using the potion effect for that

#

everything else will look janky because the client and server will disagree about velocity

lost matrix
#

This actually sounds like something that could be added to spigots API with a bit of work. Entity#setGravityScalar(double)

knotty aspen
#

for other entities that will work fine, visually for other players too. just for the player itself not really

autumn cave
#

Bukkit.getEntity(UUID) called in ChunkLoadEvent returns null, even after 1 tick. Is there a way to know when entities are 'registered' and Bukkit.getEntity(UUID) is safe to use with newly loaded entity uuids from loaded chunks?

lost matrix
autumn cave
#

Actually this might be exactly what I am looking for

young knoll
#

👍

serene sigil
#

how to cancel a minecart move where the player pressed "w"

arctic shuttle
#

hmm this worked for 1 but not 2
int min = 0;
int max = 8;
int result = (int) Math.floor(Math.random() * (max - min + 1) + min);
if(result == 1) {

lost matrix
# arctic shuttle hmm this worked for 1 but not 2 int min = 0; int max = 8...

Its good if you do this by hand for some experience, but java has built in methods for that.

Random random = ThreadLocalRandom.current();
int min = 0;
int max = 8;
// Rolls a random number from 0 (inclusive) to 8 (exclusive)
// So possible values are: 0, 1, 2, 3, 4, 5, 6, 7
int roll = random.nextInt(min, max);
grim hound
#

yo if I register custom commands but I don't want to do so whenever Essentials' present

#

but just checking whether the command was already registered doesn't work (Essentials only problem)

#

can I do some loadbefore magic

#

to fix this?

lost matrix
#

Check if essentials was loaded and do a softdepend on Essentials

young knoll
#

Still makes me sad that ThreadLocalRandom has nextInt(min, max) but regular Random doesn't

lost matrix
#

Ah right

grim hound
young knoll
#

Yeah but still

#

java y

grim hound
lost matrix
arctic shuttle
undone yarrow
#

I know this isnt completely spigot related but idk where else to ask this. I have an animatronics plugin which lets me play an armorstand animation when I use /anim play test
I can put that cmd in a command block too and it works fine, but I want to run it whenever a player is at a certain location. I wanted to do that with
/execute if entity @p[x=-1040.441,y=71,z=-1336.528,distance=..1] run anim play test
but the anim play test part is not recognised. It does however recognise other plugins' commands. Any ideas? I'd like to keep it in 1 cmd block if possible

young knoll
#

Generally spigot commands don't work with /execute

lost matrix
grim hound
young knoll
#

Other plugins may be using a library that registers them

undone yarrow
#

Hmm damn

#

So what should I do in this case?

#

Add another cmd block and activate that command block with this one?

young knoll
#

Chain command blocks ig

arctic shuttle
native bramble
#

how can i create potion arrow entity?

autumn cave
native bramble
#

i find org.bukkit.entity.Arrow.setBasePotionType, but cant understand, how can i initialize a variable

whole lintel
young knoll
whole lintel
#

Caused by: java.lang.IllegalArgumentException: Specified enchantment cannot be applied to this itemstack

young knoll
#

Use the unsafe method

#

addUnsafeEnchantment iirc

#

Or for ItemMeta there is a boolean as the last arg

grim hound
#

what

autumn cave
# young knoll Not sure, are you sure the UUID is correct

Yeah basically doing this:

@EventHandler
fun onChunkLoad(event: EntitiesLoadEvent) {
    for (entity in event.entities) {
        println("${entity.uniqueId} <> ${Bukkit.getEntity(entity.uniqueId)?.uniqueId}")
    }
}

First uuid is not null, but the second one is with Bukkit.getEntity

grim hound
arctic shuttle
# lost matrix https://discord.com/channels/690411863766466590/741875863271899136/1174078525523...

int min = 1;
int max = 8;
int roll = Random.nextInt(min, max);
if(roll == 1) {
if (target != null) {
ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
ItemMeta meta = item.getItemMeta();

                // Check if meta is not null before setting display name
                if (meta != null) {
                    meta.setDisplayName("§6§lORANGE §b§lSWORD");
                    meta.setCustomModelData(1);
                    item.setItemMeta(meta);
                    target.getInventory().addItem(item);
                } else {
                    sender.sendMessage("Failed to get item meta.");
                }
            } else {
                sender.sendMessage("Player not found.");
        if(roll == 2) {
             if (target != null) {
                 ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
                 ItemMeta meta = item.getItemMeta();

                 // Check if meta is not null before setting display name
                 if (meta != null) {
                     meta.setDisplayName("§d§lPINK §b§lSWORD");
                     meta.setCustomModelData(3);
                     item.setItemMeta(meta);
                     target.getInventory().addItem(item);
                 } else {
                     sender.sendMessage("Failed to get item meta.");
                 }
             } else {
                 sender.sendMessage("Player not found.");
grim hound
#

checking if roll == 2 after a roll == 1 if statement?

arctic shuttle
grim hound
lost matrix
young knoll
#

Outside the if (roll == 1) block

lost matrix
grim hound
#

on how big the gif the can be?

#

sucks

young knoll
#

Yes there is a file size limit

grim hound
#

hmm

young knoll
#

You can embed from a free external host

#

Like imgur

autumn cave
young knoll
#

Probably multithreaded jank

wet breach
#

because the event can be cancelled therefore it makes no sense for the rest of the server to know about an entity which ultimately never existed 😛

young knoll
#

It can't be cancelled

young knoll
#

They are using it

#

event: EntitiesLoadEvent

eternal oxide
#

ah ok, all I saw was chunk load

#

ah his method name was chuink not entities, so confusing

wet breach
#

well its still the case that the event still knows before hand before other things

#

or at least that is typically how it is for the events anyways

whole lintel
#

itemStack.getItemMeta().getPersistentDataContainer().get(key, PersistentDataType.STRING) != null;

#

returns false

#

even tho i just did

#

meta.getPersistentDataContainer().set(key, PersistentDataType.STRING, entity.getUniqueId().toString());

#

itemStack.setItemMeta(meta);

grim hound
#

how do I make it

#

show the gif

#

well?

#

and I mean

#

for like

#

spigot resources

#

but shit ain't cooperating

wet breach
grim hound
#

doesn't work

wet breach
#

it might be imgur not allowing embeds possibly?

#

only thing I can think of unless you are using the img tag incorrectly

#

typically its [img url=""](text here that shows up if img does not[/img]

fallen lily
#

No markdown megusta

grim hound
#

just tell me what's missing

fallen lily
#

¯_(ツ)_/¯

#

Markdown is missing

grim hound
#

What

#

uis

#

that

grim hound
#

you're being extremely useless right now, you know that?

fallen lily
#

Well, what I said has no relation to your problem

#

Im pointing out the poor design of the post editor

#

It should utilise markdown

#

Its more portable

#

Simpler

#

And is used almost everywhere

wet breach
#

it uses the good old BBCodes

wet breach
fallen lily
wet breach
#

no

#

markup is things like html

#

or the documentations formatting

fallen lily
#

BBCodes is markup, Markdown is a play on words

#

Its a separate thing

fallen lily
#

BBCodes & Markdown are both markup languages

wet breach
#

Markdown itself isn't a markup language

fallen lily
#

It is though

wet breach
#

unless there is a lib called Markdown

fallen lily
#

Bro

#

Markdown is the language, CommonMark is the standard

#

You obviously have preprocessors to interpret the language into images/html

#

But its a markup language

grim hound
#

I like the funny words you both speak

#

But would you be so kind to help me?

wet breach
#

oh, which editor are you using?

#

now that I remember

#

you need to use the editor that lets you edit everything

grim hound
#

Well I guess I'll just go fuck myself

wet breach
#

I learned this hard way myself long time ago with Bukkit

quaint mantle
#

anyone know a good builder generator for intellij

grim hound
orchid gazelle
#

yo! any ideas why my test-bots cannot connect to my server? ```/127.0.0.1:64226 lost connection: Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(7) + length(8) exceeds writerIndex(8): PooledUnsafeDirectByteBuf(ridx: 7, widx: 8, cap: 8)

grim hound
#

I use another botter for my antibot testing

orchid gazelle
#

well it's not antibot

#

I just need it to test my gun system functionality

grim hound
grim hound
#

It has very little recognition to how well it's written

#

It's for spigot servers

quaint mantle
grim hound
orchid gazelle
#

it seems to use the wrong protocol version for 1.20.2

#

"Outdated server! I'm still on 1.20.2"

grim hound
#

It has a different release version for each mc ver

orchid gazelle
#

yeah but im running 1.20.2

#

and im using the release for 1.20.2 lol

grim hound
#

Also my antibot is called AlixSystem if you could test it

grim hound
orchid gazelle
#

yeah

grim hound
#

Download ViaVersion then

orchid gazelle
#

ehhh thats gonna cause issues with my plugin

grim hound
#

It's not

#

Like if the version is the same it wouldn't make sense

orchid gazelle
grim hound
#

Also ViaVersion seeme to be decently written

orchid gazelle
#

had the same issue with the old botting software

#

I just changed the protocol version there

grim hound
orchid gazelle
#

but yeah it's not that easy here

grim hound
orchid gazelle
grim hound
#

You do know how testing works, right?

orchid gazelle
#

im also not gonna rely on ViaVersion for testing

#

thats a factor than can cause errors which makes it uncomfortable

grim hound
#

It's probably the most reliable plugin out there

orchid gazelle
#

not really

grim hound
#

You're being really pessimistic for an unknown reason

orchid gazelle
grim hound
#

Maybe packet analysers also

#

But not for some gun plugin

orchid gazelle
grim hound
orchid gazelle
#

it's not only a gun plugin

orchid gazelle
#

and even my gun system might mess with some packet stuff indeed

#

it's not just normal entity guns

#

it's a custom written projectile system with my own raycasting algorithm and hitboxes lol

#

the fact is that im not gonna use viaversion

grim hound
#

Yeah then it won't matter

golden turret
#

I am creating a vehicles plugin and I am creating a train. I want this train to move on rails. The problem is that when the train is fast enough, he leaves the rail. How can I get the current rail even if the train is fast?

orchid gazelle
grim hound
#

There's a lot of implementations out there already

orchid gazelle
#

I have not seen any

#

show me one

grim hound
#

And even a built-in one

grim hound
orchid gazelle
#

raycasting algorithm? Yes. A raycasting algorithm customized to my needs? no

#

because it's raycasting my custom projectiles

grim hound
orchid gazelle
grim hound
orchid gazelle
#

no

grim hound
#

And ViaVersion only matters for 1.14 changes pretty much

storm crystal
#

what was the name of that SQL something shit

#

for databases in plugins

#

I cant find it

grim hound
#

But that's only for anticheats

grim hound
orchid gazelle
#

I am tracking player bodyparts as custom Cuboids with my own hitbox intersection algorithm on the playermodel

grim hound
#

That's subjective

orchid gazelle
#

you shoot your gun, it raytraces and can exactly tell you on what pixel of the SKIN you hit, not the normal hitbox

orchid gazelle
golden turret
orchid gazelle
#

This approach has not been done publicly by now

grim hound
wet breach
#

unless its an entity that doesn't exist in the server

orchid gazelle
golden turret
grim hound
#

Hmm

orchid gazelle
#

dumped at least 100-200 hours into working on it lol

wet breach
grim hound
#

I have no idea right now of how I could do it with pixel accuracy with the player's body turned and great distance calculation offsets

grim hound
orchid gazelle
wet breach
storm crystal
wet breach
#

however, saying pixel accuracy is a bit of a misnomer due to the fact that there is two different kinds of pixels

orchid gazelle
grim hound
orchid gazelle
#

you gotta calculate it by reversing the client code lol

wet breach
orchid gazelle
wet breach
#

as long as you know the size you know its size in the server

#

and you can then do calculations on that

#

basic algebra

orchid gazelle
grim hound
orchid gazelle
#

and size is not the deal

#

I am confused on why you are talking about texture size

grim hound
orchid gazelle
#

it's not like it's a flat 2D texture

grim hound
wet breach
orchid gazelle
wet breach
#

skin textures are just a flat 2d png

orchid gazelle
#

and?

grim hound
wet breach
#

you can measure the size of a skin

storm crystal
#

how do I manage SQL database in plugin

orchid gazelle
wet breach
#

once you have the skins size you know how large it is in the server

grim hound
orchid gazelle
storm crystal
#

yeah im asking for a tutorial

orchid gazelle
#

because there are 10000 rotations, tracking and so on

storm crystal
#

not kody simpson cuz guy literally just does "well you put it here because I say so" without explanation

orchid gazelle
wet breach
#

you obviously fail at basic math

orchid gazelle
#

?????????????????????????????????????????????

grim hound
orchid gazelle
#

you seem to not understand what im even doing

grim hound
#

Are you really that ignorant?

storm crystal
wet breach
#

I am not ignorant just I know how to do pixel accuracy as being claimed and that it isn't super difficult, I already helped someone do pixel accuracies last year

storm crystal
#

if I dont get where did shit come from

grim hound
#

You can search for the code explanation on the web

orchid gazelle
#

do me a favour and explain to me what you think im doing

wet breach
#

I was replying to the part doing pixel accuracy on trajectories of bullets is not hard

grim hound
storm crystal
#

if you want to make actual trajectory you need more than basic math (trig)

#

and basic understanding of physics

grim hound
orchid gazelle
#

if you have a fucking flat 2D texture you know 0 shit about the rotation of the player model and so on

storm crystal
storm crystal
#

they dont really teach trig and its application in primary school usually

orchid gazelle
#

it's not easy to track an exact player skin model on a serverside player

storm crystal
#

rare case if you are academically gifted

grim hound
wet breach
grim hound
#

I ain't english-native

orchid gazelle
wet breach
#

trig can obviously be used here and may make it easier in terms of formulas to use

grim hound
#

Middle school

wet breach
#

however, algebra is more the sufficient for this

storm crystal
wet breach
#

if that is all you know that is

grim hound
#

Show how you did it

#

Or explain in detail

orchid gazelle
#

linear algebra is NOT basic maths

#

but yeah you won't come any far with just linear algebra knowledge lol

storm crystal
#

yes it is not basic at all

wet breach
#

ok, you don't consider algebra basic but I do since you learn algebra in middle school and beginning of high school in the US

storm crystal
#

which could be technically useful if you want to do some shenanigans with planes

orchid gazelle
storm crystal
#

like vector conversion from x,y,z to x,y

orchid gazelle
#

but there is a huge difference between high level algebra and low level algebra, for example

wet breach
storm crystal
orchid gazelle
storm crystal
#

you'd have to say what you consider basic in algebra

wet breach
#

k-5'th is elementary school. 6-8th grades is middle school

#

the rest is high school

storm crystal
#

because there are both complex and basic things in algebra chapter

orchid gazelle
#

you do not learn complex linear algebra in 8th grade

#

you still continue to learn this stuff even in uni

wet breach
storm crystal
#

are you asian by any chance

wet breach
#

no

storm crystal
#

have you been oppressed by someone

wet breach
#

I am Half Canadian French and Half native american

storm crystal
#

into learning linear algebra before hs

orchid gazelle
storm crystal
#

you might do it in your free time

orchid gazelle
#

yeah

#

oh yeah I learned a lot of linear algebra in my free time

storm crystal
#

I learned basic calculus in 8th grade

#

cause I liked to watch black pen red pen

orchid gazelle
#

I learned like 30% of algebra because of the gun system and shit lol

#

back in the days

#

I started this project years ago and returned

storm crystal
#

im not balls deep into algebra

orchid gazelle
#

yeah same

storm crystal
#

I prefer analitic math

orchid gazelle
#

but alf bro you are just ignoring anything else while just saying "tHiS iS bAsIc MaThS"

storm crystal
#

like when I learn that sine can actually be expressed as power series

orchid gazelle
#

without even understanding what is being done

wet breach
wet breach
#

you don't live in the US

#

so your opinion is moot

storm crystal
#

I live in Poland my school barely could afford heating

orchid gazelle
grim hound
storm crystal
#

we had 2 weeks off cuz they couldnt afford to pay

grim hound
#

Bracie kurwa

orchid gazelle
#

you are ignoring anything else while just hooking on one stupid thing

grim hound
#

Witaj

grim hound
#

Polska gurom

orchid gazelle
#

I have been to Poland

storm crystal
grim hound
storm crystal
orchid gazelle
#

think im gonna drop the botting stuff for today then

storm crystal
#

nostalgic ghetto

grim hound
storm crystal
#

I dont talk in absurd insulin price

wet breach
# storm crystal thats the most american thing I have ever heard

Sure, but it doesn't make it any less true. To believe that just becacuse in your country you didn't learn it doesn't mean it applies to another country especially one as large as the US where just going the next county over is the difference in a good education or a bad one

orchid gazelle
orchid gazelle
storm crystal
#

carbide

#

CaC

orchid gazelle
#

ah shit I gotta learn some French for tomorrow too

storm crystal
orchid gazelle
#

and it's already 11pm

storm crystal
#

your understanding of basic math is way beyond average person at this point

wet breach
grim hound
storm crystal
#

even one that is kind of into maths or technical stuff

grim hound
#

I wake up at 6 am

orchid gazelle
storm crystal
grim hound
#

Jak dobrze że ja jeszcze w średniaku

orchid gazelle
#

it is a combination of a lot of mid-tier-complex systems that make it so special

storm crystal
#

:]

orchid gazelle
#

thats the same video

#

lmao

storm crystal
#

yeah mb

#

exothermic reactions are fun

orchid gazelle
#

oh yes

wet breach
storm crystal
#

or like ester of HNO3 and celuloze

storm crystal
#

point being basic math term isn't static and same for everyone

orchid gazelle
#

which is still, kinda complex but 1000x better

grim hound
#

Gl y'all 👍

wet breach
grim hound
#

Amma head to temporary slumber of nothingess

orchid gazelle
wet breach
#

not many people here attempt such things 😛

#

yeah just to see how you were going about it

orchid gazelle
#

well imma try to remember but it's from like 2.5 years ago lmao

wet breach
#

well I don't need you to replicate it lmao its fine

orchid gazelle
#

imma try to find the project rq maybe I still have it

#

had to use EulerOrders, basically I have a playerTransform, limbTransform and then that calculates into every single limb of the player which I then save

#

so you have a Quaternion centered on the player, which applies it's rotation and so on on halfExtents

#

which yea, you gotta let that all happen in relative space and then translate it to world space and so on

#

iirc the software basically creates the representation of the rotated playermodel in relative space and then translates it into world space

orchid gazelle
#

then I switched up to my matrix mult system, which was literally the way how I learned about a lot of algebra stuff in the first place

#

fun story, I learned how matrix mults applied on vectors work and then like 10 weeks later we learned it in school

storm crystal
#

yeah vectors are just matrices

#

but multiplying matrices isnt really AxB = BxA idk how its called in English

#

you get what I mean

#

you gotta transpose it

#

so yeah need to get a gist of basic operations

orchid gazelle
storm crystal
#

surprisingly for mathematicians its not common to assume that a+b = b+a

orchid gazelle
#

applying rotations on vectors and so on

#

without calculator

storm crystal
#

we do it w/o calculator too

#

we just get small numbers

orchid gazelle
#

yeah it's fun

#

that was part of my 10th grade final exams, my old school

storm crystal
#

its not

orchid gazelle
#

now after graduating on it I switched to the gymnasium

wet breach
#

it is such a useful theorem that can be applied almost anywhere lol

orchid gazelle
#

yeah lmao

exotic obsidian
#

Does anyone know how to hide potion details?

young knoll
#

Hey the name fits for once!

river oracle
#

HIDE_POTION_EFFECTS does much more than that

#

oh nvm I get what you meant now lol

exotic obsidian
#

bruh

young knoll
#

Wait

exotic obsidian
#

i used it all but nothing work! i just want to hide the details in the circle

young knoll
#

Why does the armor trim flag say it hides trim from leather armor

young knoll
#

Otherwise maybe hide attributes

valid burrow
#

how can i set an entitys max health

knotty aspen
#

its an attribute, getAttribute(generic_max_health) and set/modify that

valid burrow
#

thx

storm crystal
#

How bad is it that I pretty much want to replicate hypixel skyblock mechanics and make an indicator of how well I manage to recreate them and after that adjust them to my needs

sterile token
storm crystal
#

And then adjust or build additional things to my need

#

Like use hypixel mechanics as base

valid burrow
#

also why cant i do entity.setHealth just found that in the living entity class

knotty aspen
#

you can use set health, but max health is an attribute

#

but you don't need to apply anything. you either add an AttributeModifier, or you set the base value

sterile token
#

setHealth() is for setting the health itself, not for declaring how much health can have in total

knotty aspen
#

a player is an entity

valid burrow
#

i know but its two different classes

#

and if i red correclty

knotty aspen
#

well yes but player extends entity

valid burrow
#

oh okay then spigot forums lied to me

#

good to nkow

#

i can not get this to work ?paste

#

?paste

undone axleBOT
valid burrow
hazy parrot
#

i think that error is pretty descriptive

valid burrow
#

yh apart from the fact that it is not null

#

its right there

#

it finds the key

#

but the data itself is null

hazy parrot
#

yeah casting to List<Object> seems really wrong

valid burrow
#

well what else would i do

#

theres 10 million differnt data types in there

hazy parrot
#

make your own (de)serializer

valid burrow
#

but why cant i just cast it to List<Object> all of them are objects arent they

#

and i asked previously and everyone agreed that lists can contain differnt data types

hazy parrot
#

its configurationsection

valid burrow
#

oh fair enough

hazy parrot
#

list is for example something: [1,2,3]

sterile token
#

Lists can just have 1 data type per object, if that what you mean

hazy parrot
#

you treat whole section as a list

valid burrow
#

yh i though its possible to do that

sterile token
valid burrow
#

but yh makes sense

storm crystal
#

😭

valid burrow
#

its supposed to be if the creature has a gender or not

sterile token
sterile token
valid burrow
#

ark

sterile token
#

Because what you sent seens more to be a config section, atleast the yaml format you sent

valid burrow
#

dinosaur

#

rawr

sterile token
#

oh you masking ark evolved?

valid burrow
#

yes

#

the cojnfig is supposed to let you create and edit all creatures

#

in various ways

#

thats why i have so much data in there

storm crystal
#

idk it worked for me like that

#

and it can read values normally

sterile token
#

that still a section

#

from what i seeparamite and paramite2 are config section object

#

but yeah as they have said i would make a custom serializer for that format saver

valid burrow
#

this should work then im too lazy to make it rn

#

wanna test if the other 100 classes work

sterile token
#

remember smth

#

the first thing which is hide in the cap

#

you still have a section let say

#

gian_octopus is an array, thats true

valid burrow
#

i know its supposed to be like that

sterile token
#

but the father of giant_octapus is a section*

#

why using anm array for that?

valid burrow
sterile token
#

there you have array with more arrays inside

valid burrow
valid burrow
#

i pass everything into a class constructor afterwards anyways

sterile token
#

its extrange i would treat as you did before with config sections

hazy parrot
#

why not just make custom serializer for your object ?

sterile token
valid burrow
#

im to lazy RN

sterile token
valid burrow
#

i wanna test out the other stuff first

sterile token
#

GPT less than 10m

valid burrow
#

alright alright

#

ill let it make one