#help-development

1 messages · Page 2224 of 1

echo basalt
#

which is why they use namespaced keys

smoky oak
#

cant you do substring zero six equals story

lament swallow
#

what are namespaced keys

echo basalt
#

Basically a key that links to a specific message / resource in the client

#

minecraft:cow for example

lament swallow
lost matrix
smoky oak
#

Ive been smacked around with regex for a while so i adapted to that

#

i was unaware this method is better

lament swallow
#

okay so would there be a way to get the advancement title from a key?

#

or would i have to check for every advancement name

echo basalt
#

It's all localized

#

I doubt NMS has that

#

If you change your game's language

#

the name changes

lament swallow
#

mmm

subtle folio
#

resource pack

lament swallow
#

so i'll have to manually do it then

subtle folio
#

and the en-us.config

smoky oak
#

I've told myself screw it and done everything in en-us since

lament swallow
#

manual it is then

echo basalt
subtle folio
echo basalt
#

I guess you can convert this to yml or something

subtle folio
#

😳

smoky oak
smoky oak
#

eh thats about it

echo basalt
#

it's extremely useful to extract the default resourcepack

echo basalt
#

I have an empty 120gb ssd with minecraft's defaults

smoky oak
#

thats a politic language not a internet one lol

subtle folio
#

and not default textures

echo basalt
#

I can fetch the language files, check any existing textures

subtle folio
#

mhm..

echo basalt
#

parse the blockstate .json files

#

other files are also stored deep in the client

#

Like files for what tools can break what

subtle folio
#

use mods (fabric)

lost matrix
#

According to this map the biggest languages are: 🇺🇸 /🏴󠁧󠁢󠁥󠁮󠁧󠁿 > 🇩🇪 > 🇫🇷

echo basalt
#

I fetched this from the client and converted from json

smoky oak
#

tf are you on about spanish then

lost matrix
echo basalt
#

But they're not that big in terms of actual players

echo basalt
#

Nuremberg or whatever

subtle folio
#

nuremberg trials

echo basalt
#

For big communities, there's brazil

smoky oak
#

actually germany has a quite high number of research institutes in computer science iirc

echo basalt
#

Spain sometimes

#

Although brazilians often play in spanish servers

#

As the language is pretty similar

#

Some french, some german but not that many

#

Arabic people have their own community zone and don't touch on international servers other than hypixel

lost matrix
#

Did Fortnite become more popular again?
1.8.8 did fall again from 7% to 6.7%. Its now down from 8% in about 2 months.

echo basalt
#

Fortnite is about as popular as regular pubg

#

Not a trend anymore

sand rune
lost matrix
echo basalt
echo basalt
smoky oak
echo basalt
#

hypixel runs 1.7.10

smoky oak
#

ah

lost matrix
echo basalt
#

modified to 1.8

echo basalt
sand rune
lost matrix
#

Yes. You cant really call that spigot anymore

sand rune
#

Prison Punishing System

#

Etc

smoky oak
#

bleugh

#

prison servers

#

why

lost matrix
smoky oak
#

cookie clicker in minecraft just ptw

#

yes my numkeys are broken

echo basalt
subtle folio
#

cookie clicker 🤣

echo basalt
#

I might still have one of their interview code test files somewhere

sand rune
subtle folio
#

python 🐍

lost matrix
subtle folio
#

objects in python are similar to java

#

i had a very easy time learning python after java

sand rune
#

And I have learnt

#

Python before Java !

smoky oak
#

python loop

sand rune
#

XD

lost matrix
#

I really dislike python. The only thing im doing with python is training my reinforcement models.
To me its useless outside of data science.

smoky oak
#

the thing i hate about python is how slow it is

#

interpreted language

sand rune
#

I have made a social media website with python man

#

Anyway

#

Is it good or no

#

In PythonPluginLoader

#

That's the only question

smoky oak
#

i wouldnt bet on it, but i dont know enough to say for sure

lost matrix
smoky oak
#

personally id do java

sand rune
lost matrix
echo basalt
#

For anyone interested, and given I didn't sign an NDA, here some hypixel interview code (task was to point out literally everything wrong) https://sourceb.in/BEWsKTGYhP

smoky oak
#

java is definitively older

echo basalt
#

they still use a form of spigot

echo basalt
sand rune
smoky oak
#

oh didnt meant it like that

lost matrix
#

Oh god right away: Set<Player>

echo basalt
#

They gave me 5 minutes

#

There were like 15 different mistakes

lost matrix
#

Im at 6 now

#

Its not there. Thats the problem

echo basalt
#

Jar does not contain a plugin.yml

lost matrix
#

Apparently not

echo basalt
#

ayo 7smile7

smoky oak
#

found it

#

plugin yml belongs into src- resources

echo basalt
#

did you spot the instanceof mistake?

smoky oak
#

not into your package

echo basalt
#

line 98

smoky oak
#

its like that for spigot

#

not completely sure bout bungee

lost matrix
echo basalt
#

lol

#

I had 5 mins to point out as many things

#

they were surprised when I spotted a <bukkit entity> instanceof <nms entity>

lost matrix
#

Hope you didnt point out that the bitwise 'and' was a mistake because you could actually do that

echo basalt
#

Nah I didn't

#

I actually failed to get the job due to my lack of minigame development and microservices experience

#

or maybe due to my time management skills not sure

#

but def not due to code stuff

sweet helm
#

hey all, sorry to just pop in like this, what is 'generic movement speed's unit? 0.3 seems to be +- player speed but i want to know exactly what it is

lost matrix
#
game.getPlayers().stream().forEach(player

Unnecessary overhead. You dont need a stream pipeline for 'foreach'

echo basalt
#

Here's what I got in like 5 minutes

lost matrix
#

I mean this is a gold mine for spotting mistakes. But 5 minutes seems a bit tight.

echo basalt
#

mentioned some other stuff after but I was low on time

lost matrix
echo basalt
#

that's blocks / tick iirc

#

not sure

sweet helm
#

what. ive been looking all over for this T-T

#

thanks man

lost matrix
sweet helm
#

thanks, i just got more confused, but thanks

#

player speed 0.1, zombie 0.23, but players are faster even walking

subtle folio
worldly ingot
#

The movement speed attributes are all relative lol

sweet helm
#

i took a zombie and made him target a villager, i outrun him walking

worldly ingot
#

They really are just arbitrary numbers

sweet helm
#

awh man...

earnest coral
#

Does anyone know how to update a spigot server? I am trying to update mine to 1.19

worldly ingot
#

Create a backup and replace the server jar

#

That's about it

earnest coral
#

oh

worldly ingot
#

Always backup though in case something goes wrong and your world is corrupted for some reason

#

Not likely, but it happens

quaint mantle
#

Isn't forceUpgrade also required?

worldly ingot
#

Not required

#

but you probably won't lag when loading chunks nearly as bad because it does it all at one startup

#

If you're on a small community server, it's not nearly as big of a deal

earnest coral
worldly ingot
#

Whatever you use to run your server. spigot.jar, spigot-1.18.2-R0.1-SNAPSHOT.jar

#

Something to that degree

earnest coral
#

I use a run.bat file

worldly ingot
#

Yeah and it runs a .jar file

#

If you open that up it will look like java -jar something.jar

#

That something.jar is what you want to replace

earnest coral
#

so should I just drag and drop the builtools.jar in to the server folder?

quaint mantle
#

what does your run.bat file say

worldly ingot
#

No no, you want to run BuildTools on your computer or something

#

?bt

undone axleBOT
worldly ingot
#

A lot of that wiki really is just a word salad tbh

#

It all boils down to

  • Put BuildTools.jar into a folder
  • Run it with java -jar BuildTools.jar --rev 1.19
  • Let it run for like 10 minutes or so, then it'll spit out a server .jar for you in the root directory
earnest coral
#

alright thanks

#

what do I do after I obtain the server.jar?

quaint mantle
#

replace your old server.jar or whatever name it's under with the new 1.19 server jar

subtle folio
#

run it like you would ?

tardy delta
#

Coughs back

subtle folio
#

woah 6 feet

echo basalt
#

spits

tardy delta
#

I love looking at code

earnest coral
#

@worldly ingot @quaint mantle much appreciation to helping me! It worked, have a great day

subtle folio
#

and making fun of my friend’s worse code

urban kernel
#

how do i include jdbc or whatever the sql conector is

tender shard
#

does anyone know the maximum speed of a minecart before it derails in corners?

#

or how I could find out that speed?

urban kernel
#

you could probably google it

prime kraken
#

Hello everyone, i'm trying to get the global amounts of a specific item in an inventory. My code is : for (ItemStack is : inv.getContents()) { if (is != null && is.getType().equals(Material.GOLD_NUGGET)) { numberGolden.add(is.getAmount()); } } and i use an arraylist with integer, my problem is that this method store only 1 nugget per slot instead of for example, i have two stack of golden nugget so a total of 128 golden nuggets and this method return me only 2 golden nugget (like 1 per slot), hope you understand

urban kernel
#

can u upload full code

#

?paste

undone axleBOT
prime kraken
#

yep

tender shard
last sleet
urban kernel
#

how do i include jdbc or whatever the sql conector is

prime kraken
urban kernel
last sleet
lost matrix
tender shard
urban kernel
#

how do i include jdbc or whatever the sql conector is

lost matrix
#

Oh then map the amount

next stratus
#

Hey, I wanna work out how to do something with vectors but I'm really lost as this is out of my depth. Anybody able to help?

tender shard
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!

wary harness
#

Got small problem which I am not sure how to fix

urban kernel
wary harness
#

I want to replace this placeholder with maven

#

when I compile

lost matrix
#
  public static int countItems(Material material, Inventory inventory) {
    return inventory.all(material).values().stream().mapToInt(ItemStack::getAmount).sum();
  }
tender shard
wary harness
#

I managed to replace ti but this was result

tender shard
#

you don't have to replace it in your .jar file

#

just do Plugin#getDescriptionFile().getVersion()

wary harness
next stratus
lost matrix
wary harness
#

but I wanted to be sure user can't change it

tender shard
urban kernel
lost matrix
next stratus
#

I got 0 clue how to do all this 😅

urban kernel
#

use this ver

tender shard
urban kernel
#

Bukkit.getServer().getPluginManager().getPlugin("plugin_name").getDescription().getVersion());

#

no jeff media needed

tender shard
# urban kernel no jeff media needed
  1. you do realize that this is what I suggested?
  2. What I sent was to prove that just because they hardcode the string, doesn't mean that a user cannot change it
urban kernel
#

ok

lost matrix
# next stratus I got 0 clue how to do all this 😅

Something like this

  public List<Vector> getFullRotation(Vector first, int amount) {
    List<Vector> vectors = new ArrayList<>();
    Vector current = first;
    double delta = 360.0 / amount;
    for(int i = 0; i < amount; i++) {
      vectors.add(current.clone());
      current = current.rotateAroundZ(delta);
    }
    return vectors;
  }
quiet ice
urban kernel
#

time to hardcode db credentials :)))))

tardy delta
subtle folio
#

our code

quiet ice
#

Amd the ClassWriter looks a bit inefficent given that it does not pool the read classes

quiet ice
#

Reduced IO

tender shard
#

I doubt that replacing a few strings in a .jar file will cause any IO problems

dark harness
#

How can i remove symbols like that? I synced a Discord Channel with JDA to Minecraft

tardy delta
#

Just get the raw message

#

In the jda side then

quiet ice
#

Now it isn't that problematic given that that would never be used as a lib, but eh - still pains me

tender shard
dark harness
# tardy delta Just get the raw message

I already tried to change
String message = event.getMessage().getContentDisplay(); to String message = event.getMessage().getContentRaw(); but nothing changes

quiet ice
#

I'll see if I can get it faster eh

tender shard
#

ok

#

looks like Main.getPlugin() returns null

#

yes

#

obviously it always returns null

#

you never assigned any object to the "plugin" field

#

just add this:

{
  plugin = this;
}
quiet ice
#

okay, why does it depends on spigotNMS?

lost matrix
tender shard
#

just try it. set the scope of spigot to provided and try to replace stuff in a spigot plugin

quiet ice
#

I see

urban kernel
#

how does one query db outside of main class

tender shard
urban kernel
quaint mantle
#

I feel so extremely dumb for asking, but I'm using the 1.8.8 spigot API and I can't find dye, I've tried searching but it doesn't appear to exist. Is it under a different name which I am not aware of or am I just being stupid?

next stratus
timid trout
#

As in you cant find the Material?

quaint mantle
#

Yes

timid trout
#

You use ink sacks and just set the item data

lost matrix
quaint mantle
timid trout
#

Nah don't worry, that shit was mad annoying when i first started

worldly ingot
urban kernel
lost matrix
next stratus
#

I honestly don't know why it's just spawning 1 tnt now lol

worldly ingot
#
Dye dye = new Dye(DyeColor.GREEN);
dye.toItemStack();```
timid trout
quaint mantle
subtle folio
crude estuary
#

it Actually is

tender shard
lost matrix
tender shard
#

all those people claiming "1.8 pvp was better" are just too stupid to properly time their attacks lmao

urban kernel
quaint mantle
timid trout
urban kernel
#

server host*

#

minecraft server host**

crude estuary
lost matrix
# timid trout No?

Yes. What do you mean by no? If a server has corrupted hard drives then it doesnt matter if you store files or a database there.

quaint mantle
crude estuary
#

True

urban kernel
#

minecrat 1.8 pvp tutorial: donload an autoclicker

crude estuary
#

2nd Step

#

get Banned

timid trout
lost matrix
#

1.8 pvpers cant fathom anything more complex than hammering one button really quick.

urban kernel
#

3rd step: join an anarchy server

#

scroll clicking 💀

lost matrix
quaint mantle
#

1.8 and 1.9 both have flaws
1.8 is just who has better ping
1.9 is let me kill you in 2 hits with my stone axe 💀

timid trout
crude estuary
urban kernel
#

time to make 50 million txt files for every player that has played ever

#

i just want to store the amount of players they have revived

lost matrix
#

Fear of file corruption is a very bad argument to make against file storage.

urban kernel
#

when u use sh*tty shared hosts it's a good argument

crude estuary
#

The Ones with a Literal Decaying Hard Drive

urban kernel
#

but yeah, ill use file storage

timid trout
#

despite database storing being faster and better performing?

timid trout
#

and essentially (statistically) being better in every single way

urban kernel
#

*and having muti server spport

#

cant read files from server a on server b

lost matrix
timid trout
restive tangle
#

If I have a bungeecord plugin which has an API. Would a plugin on a sub server be able to use the dependency?

lost matrix
#

Its not even close to being valid

urban kernel
#

eh my plugin doesnt need multi server support

lost matrix
urban kernel
#

it's a plugin for the hardcore part of the network

crude estuary
#

"eh, my plugin only Runs on Bukkit But it's Fine"

timid trout
lost matrix
lost matrix
restive tangle
#

How?

urban kernel
#

do i use

File myObj = new File getPlugin().getDataFolder()"/filename.txt");
```?
tardy delta
#

yes

#

but only filename.txt

timid trout
tardy delta
#

not the slash

lost matrix
# restive tangle How?

What dependency scope are we talking about? What are you trying to do in the first place.

urban kernel
tardy delta
#

new File(plugin.getDataFolder(), "something.txt")

urban kernel
#

kty

#

how do i use that plugin method out of the main class

tardy delta
#

yes kitty

#

what plugin method

#

?di

undone axleBOT
tender shard
restive tangle
#

A party plugin in Velocity. Sub servers will use the API for games

lost matrix
timid trout
lost matrix
tender shard
urban kernel
#

how does one create data dir

tender shard
#

mkdirs()

restive tangle
tardy delta
#

never heard about the sentence construction "how does one" lol

urban kernel
#

mkdir(plugin.getDataDirectory()) ?

tender shard
#

no

#

File#mkdirs()

distant wave
#

Can someone help me with plugin?

    private final ItemStack stack;

    public Item(String name, Material material, Rarity rarity, boolean recombobulated, DescriptionManager manager, StatsManager statsManager) {
        ItemStack stack = new ItemStack(material);
        stack.getItemMeta().setDisplayName(rarity.getColor()+name);
        if (recombobulated) manager.add(ChatColor.MAGIC + "" + rarity.getColor() + rarity.getName() + ChatColor.MAGIC);
        else manager.add(rarity.getColor() + rarity.getName());
        stack.getItemMeta().setLore(manager.getLore());

        this.stack = stack;
    }
    public void giveTo(Player player) {
        player.getInventory().addItem(stack);
    }``` ^^ Thats the class, but when i try to use it
```java
        new Item("a", Material.IRON_AXE, Rarity.EPIC, true, new DescriptionManager(), new StatsManager()).giveTo(event.getPlayer());
``` it gives me plain iron axe without anything changed, why?
urban kernel
#

or whatever the data method is

lost matrix
tender shard
lost matrix
#

PDC

tardy delta
#

should file.createNewFile create the folder automatically?

urban kernel
#

idk

tender shard
#
ItemMeta meta = myItem.getItemMeta();
// do something with meta
myItem.setItemMeta(meta);

@distant wave

lost matrix
lost matrix
tardy delta
#

ah then do plugin.getDataFolder().mkdirs()

urban kernel
#

oop

tender shard
#

?learnjava

undone axleBOT
tardy delta
#

use dependency injection we said

#

🤦

lost matrix
urban kernel
#

its the main class

lost matrix
tender shard
#

have you ever defined any variable or field called plugin?

#

obviously not

tardy delta
#

then dont use plugin but use 'this' or just nothing

urban kernel
#

ok

lost matrix
#

this.getDataFolder()

tardy delta
#

ew no this 💀

tender shard
lost matrix
urban kernel
#
        if(!this.getDataFolder().exists()) {
            this.getDataFolder().mkdirs();
            getLogger().info("CREATED PLUGIN DATA DIRECTORY");
        }``` ?
urban kernel
#

now we make the third event

tender shard
#

except for the screaming log message lmao

urban kernel
#

idrc

distant wave
urban kernel
#

it will only show once or twice: main and test

steel swan
#

?paste

undone axleBOT
tender shard
distant wave
urban kernel
#

what is ChatColor.MAGIC

lost matrix
#
throw new ImprotantMessageException(">>> CREATED PLUGIN DATA DIRECTORY!!! <<<");
urban kernel
#

no

tender shard
urban kernel
#

hang on a sec, i dont need to specify the data directory as a method, i can use a file path :)

lost matrix
tender shard
#

oh yeah that sounds reasonable

urban kernel
#

and ur address so it can post u a letter

#

Letter letter = new RoyalMail.letter()

tender shard
#

that's not valid java

lost matrix
#

config.yml

paypal-name-for-post-stamps: ""
urban kernel
#

didnt ask

tender shard
#

idrc

lost matrix
tender shard
#

well then it's a fucked up naming scheme

lost matrix
#

Yes very

#

This is so wrong

urban kernel
lost matrix
urban kernel
#

lmao

#

theoreticly i could speciy the dir as
/plugins/PLUGINDATADIRNAME/FILENAME.XYZ instead of using the data dir method

urban kernel
tardy delta
#

why when i load yml files, the ' ' are gone from strings?

#

i thought they were supposed to be there

urban kernel
#

because yaml is being rude

lost matrix
tardy delta
#

so when i would write the file manually without ' ' it would still work

lost matrix
tardy delta
#

use the File constructor that takes two parameters: the parent file (the plugin datafolder) and the name of the file

urban kernel
#

yeah

distant wave
#

ChatColor.BOLD + "" + ChatColor.MAGIC + "a " + rarity.getColor() + rarity.getName() + " " + ChatColor.MAGIC + "a"
is this right? the entire lore should be bold and first and last character obfuscated

next stratus
#

Man, this is so confusing lol. I've been trying to work out how to do this Circle thing for a while and it just won't work perfectly.

urban kernel
#

bold isnt workin

distant wave
#

why

kind hatch
#

I'm pretty sure there is a certain order you have to put those in.

urban kernel
#

idk

kind hatch
#

I think bold comes last

urban kernel
#

yeah

next stratus
#

first

#

wait

#

🤔

kind hatch
#

No, definitely last.

next stratus
#

last ye

#

my bad

distant wave
#

ok lemme try

lost matrix
next stratus
#

I don't think it was working exactly how I was trying to do it unless I was doing stuff wrong

distant wave
#

its not working + why the first obfuscated letter seem to be italic

kind hatch
#

Probably due to the default formatting Minecraft puts on items.

distant wave
#

ok i fixed it finally

#

but why is the first letter still italic

kind hatch
#

You probably don't have a color code on it.

weak wasp
#

lore is italic by default isn't it?

kind hatch
#

Yes

distant wave
#

how to remove

kind hatch
#

&5&o is the default formatting.

#

You can't remove it. You can only overwrite it.

weak wasp
#

just use chatcolor strip

next stratus
next stratus
#

I'm at -122 161 -173 and it's spawning at like -310 91 -336, so ye the locations are slightly out.

lethal roost
#

can someone help me figure out what this error means? trying to make a simple config file for my plugin

next stratus
#

I've been given

    public static List<Vector> getFullRotation(Vector first, int amount) {
        List<Vector> vectors = new ArrayList<>();
        Vector current = first;
        double delta = 360.0 / amount;
        for(int i = 0; i < amount; i++) {
            vectors.add(current.clone());
            current = current.rotateAroundZ(delta);
        }
        return vectors;
    }
kind hatch
humble tulip
#

A horizontal one?

#

Or vertical

weak wasp
#

clearly states this.config is null

#

so fix your config variable to be initialized

humble tulip
#

Also can ibsee where you call getFullRotation and use tue vectorlist?

urban kernel
#

indexing is annoying

#

File myObj = new File("/home/container/plugins/datadir"); will this work

next stratus
humble tulip
#

Ok

#

But

kind hatch
urban kernel
#

i am

urban kernel
#

ptero only runs under binux

lethal roost
# kind hatch It seems like your config isn't being recognized. That could be due to it not be...

yeah it's not generating when i run the server, any idea why?

this is my code


    FileConfiguration config = getConfig();

    @Override
    public void onEnable() {
        // Plugin startup logic
        config.options().copyDefaults(true);
        saveConfig();

        Bukkit.getLogger().info(config.getString("name") + " is my name and my age is " + config.getInt("age"));

        new PlayerHeldItemHandler(this);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

    @Override
    public FileConfiguration getConfig() {
        return config;
    }
}```

config.yml is located under src -> main -> resources
kind hatch
lost matrix
#

Wasnt this what you wanted?

lost matrix
humble tulip
#

Ur using location.toVector

weak wasp
# urban kernel i am

you are using a relative path, not absolute, so it will work on any OS, but it is going to be relative to where spigot is.

urban kernel
#

bloody indexing

kind hatch
# urban kernel tf is that

A utility built into java that gets the proper file separator based on what OS you are using.
UNIX = /
WIndows =
Anything else = Whatever it uses.

urban kernel
#

but yeah, it will be used on one server only

humble tulip
urban kernel
#

and that's a unix based server

humble tulip
#

If you use the location as a vector, that's gonna be the radius

kind hatch
next stratus
urban kernel
#

indexing is AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

kind hatch
lethal roost
#

ah, i see. i got it working, thank you so much!

urban kernel
#

aaaaaAaAaAaAaAaAAaAaAaaaAaAaAAAaAAAaAAAaaAAAAaAaAAAAaaaaaaaAAaAaAaAaAAA

dusk flicker
#

...

urban kernel
#

why willn't it index

#

show them?

next stratus
#

but you've hidden them

urban kernel
#

so show them

next stratus
#

what

urban kernel
#

use #setInvisible

#

i think thats the method

#

?

#

did it get removed

#

so why cant u use it

kind hatch
#

I don't know how else to put this.
The solution you are looking for is not something built into a single method in the API.

#hidePlayer will remove the player from view and on the tablist.
#showPlayer will restore the player to view and add them back to the tablist.

You will have to use a different approach.

urban kernel
#

it exists in a lower ver

#

use packets

kind hatch
#

Literally anything else we have suggested over the last few days.

#

(╯°□°)╯︵ ┻━┻

urban kernel
#

hiwo do i make intellij index

tardy delta
#

???

urban kernel
#

is this uh bad

kind hatch
proper notch
proper notch
#

CodeWithMe, the plugin that got disabled

urban kernel
#

eh im relaunching the ide

kind hatch
#

Not all of them, but if that won't work for you. Make the player invisible then.

urban kernel
#

player#setInvisible

#

i clearly do

#

otherwise i wouldnt be suggesting u shit

dusk flicker
#

Be nice

kind hatch
#

I mean, you are the one asking for help. HIs answer is valid. Player#setInvisible() is part of the API. I'm pretty sure it goes back to 1.18 or 1.17.

#

Also, there is another way to make players invisible. It's one of the core mechanics of the game.... Ya know. Potion effects.

dusk flicker
#

LivingEntity#setInvisible was introduced in 1.16

tardy delta
#

💀

dusk flicker
#

no

#

lol

urban kernel
#

i cant wait to make invisible ender dragons ands spawn them on ppl

#

jk im not rude

kind hatch
#

The other thing we suggested was to use Scoreboard teams to add the player back to the tablist.
However, at this point, I'd just recommend updating to a new version of the API.

urban kernel
#

what the fuck

dusk flicker
#

?

urban kernel
#

my class was wiped

#

thanks intellij idea

eternal oxide
urban kernel
#

"indexing" tf u indexing

dusk flicker
#

Itd be helpful if we actually knew what version zak was using

kind hatch
#

I'm betting 1.8

dusk flicker
#

as far as I am aware they havent said it- only that he isnt on 1.19

#

Probably

kind hatch
#

Oh? That's a surprise. A welcome one to be sure.

urban kernel
#

so update to a newer version of the api that has the methhods u need

kind hatch
#

Scoreboard teams are probably your best bet then.

dusk flicker
#

you could probably do it via packets, but honestly would probably suck

vale stag
#

basic question, which even would trigger when a player equips something on their armor slot? (or well any equipment slot I guess)

urban kernel
#

how does i make indexing faster intellij idea

quiet ice
#

?jd-s

undone axleBOT
tardy delta
#

download more ram

quiet ice
#

There are libraries to simplify that however

tardy delta
#

buy more ram/ memory

urban kernel
proper notch
#

or just don't need to re-index

tender shard
urban kernel
kind hatch
small current
dusk flicker
#

I wasnt able to find it in any earlier vers looking at Paper javadocs

tardy delta
#

imagine buying more ram but not installing it :kekw:

vale stag
urban kernel
weak wasp
#

pausing your AV will speed up your compile time substantially, duno about indexing

small current
quiet ice
urban kernel
#

im being rate limited

quiet ice
#

InventoryClickEvent being one of those I assume

small current
#

buy anti rate limit

urban kernel
#

i cant download anymore money today ive alr downloaded £50

#

i cant it's £56 and i have £5 + £50 downloaded

kind hatch
#

I don't even know what he's talking about.

harsh matrix
#

This is so random

tardy delta
#

sometimes i dont either

urban kernel
#

how does one kill someone

harsh matrix
#

/kill

#

ez

urban kernel
#

in the api

harsh matrix
#

oh

eternal oxide
#

damage

urban kernel
#

sethealth(0)?

kind hatch
#

I believe that's one way to do it.

urban kernel
#

setmaxhealth(0)?

kind hatch
#

No

harsh matrix
#

damage(10000.0)

kind hatch
#

No

harsh matrix
#

remove()

kind hatch
#

Don't ever change the max health unless you are changing health scales.

urban kernel
#

im making a hardcore plugin where to revive someone u lose 5 herts forever and if u are at 0 u die

#

so do i use maxhealth when i change it from 10 hearts to 5

kind hatch
#

Maybe, but I'm pretty sure it'd be better if you use the generic attributes instead.

#

It's been a minute since I've messed with player hearts.

urban kernel
#

will this work

#

because every heart is 2 health

tardy delta
#

make that player a variable pls

harsh matrix
#

Problem with plugin logic, can't figure it out

last sleet
urban kernel
kind hatch
#

Player#setAttribute()

smoky oak
#

do attributes reset on relog btw?

ivory sleet
#

Some do

#

But iirc (all) the default ones accessible through api are persistent

urban kernel
#

how does i set the max health in attribute

kind hatch
#

Attribute.GENERIC_MAX_HEALTH

last sleet
smoky oak
#

I'll make a note to reset all attributes on relog then

smoky oak
#

its in half hearts

last sleet
#

value is a double indicating whatever the health is. 1 = 1/2 hearts

urban kernel
#

w h a t

last sleet
#

cast sender to player.

urban kernel
last sleet
# urban kernel ?

Cast a sender type to a player type to use its corresponding methods.

urban kernel
#

??

#

how does i

harsh matrix
#

Player p = (Player) sender;

last sleet
#

Use Player player = (Player) sender
This is basic java, if you don't know how to cast I'd strongly recommend learning it before, I made that mistake when first programming plugins

verbal slate
#

Do a check before the switch statement if the clicked item is null, or air

urban kernel
#

so ``` p.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(((Player) sender).getMaxHealth() - 10);

last sleet
#

I think the error is in the 29th line of TeleportHome.java, as indicated by the error, not onClick ( I suppose both have inventory click listeners)

last sleet
#

could you highlight the 29th line please

proper notch
#

Then config.getString("Home.World) is null. Have you checked that path is in the config?

tardy delta
#

do the early return first lol

proper notch
#

Have you also checked if your x, y and z values are retrieved correctly? If they aren't retrieved correctly that might lead you to the issue.

eternal oxide
#

why not save and load an actual Location? let the serializer do all the decoding

tardy delta
#
void onClick(InvClickEvent event) {
  if (event.getClickedInv() == null)return;
  // rest of your code
}```
quiet ice
#

@tender shard Did the PR - Getting rid of a custom classwriter entirely works too I guess. I would test it on your stuff however - while I hadn't had any issues with my stuff I am not entirely sure how well it fares against your jars.

tender shard
quiet ice
#

Because you expanded the frames, but that is pointless

urban kernel
#

can i call classes the way i call a function in js

#

so <class>()

quiet ice
#

Plus since we inherit the old symbol table I do not think that even if frames were expanded that anything would happen there

tardy delta
#

?pdc

urban kernel
#

gsruhuhdughuehguheugywrgsyuysrgyfgyegy why are the broadcst methods depricated

quiet ice
#

Paper?

urban kernel
#

bukkit

quiet ice
#

Ah, probs the new chat features

#

Just read the docs

urban kernel
#

screw it im using the depricated method

quiet ice
tardy delta
#

FileConfiguration#get, look at the methods to get specific stuff too

quiet ice
#

What method exactly are you using though?

tender shard
urban kernel
#

Bukkit.broadcastMessage();

quiet ice
#

Because that method is not deprecated under spigot

tender shard
#

in paper, every second method that usually takes a string is deprecated lol

urban kernel
quiet ice
#

I haven't seen to many issues with that personally

urban kernel
#

i decided to use paper because uh my servers run paper

dusk flicker
#

deprecated != broken

quiet ice
#

Only the bungee-chat stuff got deprecated from what I see but I couldn't care less about it

dusk flicker
#

Just there is better alternatives

urban kernel
quiet ice
#

Yeah, in that case it's adventure

urban kernel
#

how would i remove stuff from the max health and then check what it is

last sleet
#

wdym by that, remove some health and check how much you removed?

lost matrix
urban kernel
dusk flicker
#

?xy sounds more of an xy rather than anything

undone axleBOT
last sleet
#

Use attributes to remove it and try player#getmaxhealth maybe?

lost matrix
urban kernel
lost matrix
# urban kernel does player#getMaxHealth work
  public double reduceMaxHealth(Player player, double amount) {
    AttributeInstance attribute = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
    attribute.setBaseValue(attribute.getBaseValue() - amount);
    return attribute.getBaseValue();
  }

Something like this. It reduces the players max health and returns the amount he has afterwards.

sand rune
#

I know that this question can be stupid but

Which better in playing and Coding

Multiworld

Or

BungeeCord

dusk flicker
#

bungee but really depends on what you are actually doing

lost matrix
tender shard
#

inter-server communication on bungee is a paiiiin

proud basin
#

just use redis pff

lost matrix
#

Redis does a very good job for that

sand rune
#

Like SkyPvP , SkyMines, PvP , RedstonePvP, Etc

lost matrix
echo basalt
#

Ideally both to maximize performance

urban kernel
#
 if (reduceMaxHealth((Player) sender, 5) == 0) {
                    Bukkit.broadcastMessage("send some stuff");
                    getServer().dispatchCommand(getServer().getConsoleSender(), "kill " + sender.getName());
                }```
will this work
sand rune
lost matrix
sand rune
#

Docker Based

In My Hosting

lost matrix
sand rune
#

It's the Container that contains the Starting file
As

java bla bla bla nogui server.jar bla bla bla

smoky oak
#

epsilon is maximum difference

urban kernel
#

ok

smoky oak
#

doubles rarely are integers

urban kernel
#

so i use =?

smoky oak
#

thats assigning

urban kernel
#

ok

smoky oak
#

you do < and >

#

cant type an example rn

sand rune
#

7smile7 is Typing

last sleet
#

Wouldn't Double.compare work?

urban kernel
#

i always forget what > and < are

sand rune
#

• • • Several people are typing

urban kernel
#

what they mean*

lost matrix
#

It contains a spigot server with all plugins installed.
For example you have one docker image for "SkyWars" and every time someone starts a SkyWars
lobby, you prepare the container.

Honestly. If you are just starting out then you should just create one world per minigame.
Performance wise this is garbage because all games will have to listen to events from other games
but if you dont expect a big playerbase then it does not matter at all.

tender shard
#
private static final double EPSILON = 0.0000001D;
public static boolean isEqual(double d1, double d2) {
  return Math.abs(d1-d2) < EPSILON;
}

sth like this

sand rune
#

So I will create a world of each minigame

tender shard
#

500 CPU, ok

dusk flicker
#

500 CPU?

iron glade
#

.getClass() == Boolean.class and instanceof Boolean is the same?

sand rune
tender shard
sand rune
# lost matrix No

So it better to make a world pre minigame for my start as my experience is new
Or no ?

iron glade
# lost matrix No

What would you advise to use for checking if an object is a boolean?

lost matrix
#

In this specific case yes because Boolean is final. But generally speaking: No

proper notch
#

instanceof Boolean

tender shard
#

I mean, it's not the same, but it will always result in the same thing

urban kernel
#
if (reduceMaxHealth((Player) sender, 10) < 0) {
                    target.setGameMode(GameMode.SURVIVAL);
                    Bukkit.broadcastMessage("send some stuff");
                    getServer().dispatchCommand(getServer().getConsoleSender(), "kill " + sender.getName());
                }```?
dusk flicker
#

what are you actually trying to Deveroonie

lost matrix
sand rune
urban kernel
#

amd if ur health is 0 u die

dusk flicker
#

ah

urban kernel
#

for my hard core server

lost matrix
dusk flicker
#

👏

urban kernel
#

?

#

why reply to me

lost matrix
urban kernel
#

should i ?paste the full code

tender shard
#

don't call reflection fkery :<

lost matrix
urban kernel
#

intellij idea fre

fiery panther
#

is there something like a GoatHornMeta to get/set the sound of a goat horn item?

eternal night
#

iirc open PR for it ?

lost matrix
fiery panther
#

oh ok

tender shard
#

whoa

#

how could md5 forget about goat horn meta

#

it's the most important item of all items

lost matrix
urban kernel
tender shard
#

not even "stal"'s flute solo

urban kernel
#

will it work

tender shard
urban kernel
#

i cant test

#

i need 2 players to test

tender shard
#

why are you still checking for "< 0" instead of "< 0.00001" ?

urban kernel
#

and i cant launch mc cos lag

tender shard
#

?

urban kernel
#

zero is fi ne

tender shard
tardy delta
#

if you hear alex using that horn every time ingame you really want to die trust me

tender shard
#

it's fine for integers and longs and shorts and bytes and chars

#

it's not "fine" for doubles or floats

urban kernel
#

can u guys help me test

tender shard
#

that's too many decimals

tardy delta
#

no need for an else if youre doing an early return

urban kernel
#

0.01

tardy delta
#

looks ugly af too

tender shard
#

5 or 6 decimals should be fine as epsilon

urban kernel
#

can someone and someone else help me test

#

it will take like 5m

#

: )

#

somehow

harsh matrix
#

black magic

tardy delta
#

¯_(ツ)_/¯

lost matrix
#

What do you mean by that? This can be quite complicated and especially quite useless.

urban kernel
#

can someone is are help test

eternal oxide
#

see if it has an ==: entry

urban kernel
#

pls

ornate patio
#

how do I run it async

#

im not that experienced with java im more of a python guy sry

#

also do you think its fine if i implement all this pathfinding through the bukkit API like you have? Would it be slower compared to if I did it with the NMS API?

eternal oxide
#

new Pathing(plugin, source, player).runTaskAsynchronously(this)

#

that will show you how it works

#

it will attempt to find a path from a source block to the player

smoky oak
#

aint there different kinds of pathing

ornate patio
#

yeah im not experienced in this pathing stuff

eternal oxide
#

Yes, this is just an algorithm I was playign with

smoky oak
#

ah k

ornate patio
#

do you think i should re-implement this in NMS or nah

eternal oxide
#

I'd try it out first and see if its useable

#

you'll have to modify it to search from your Entity to yoru source block

#

but thats not difficult

#

The two constants at teh top control how long it will attempt to find a path and how efficient it is

#

its default is to look for 10 seconds

ornate patio
#

hm alright

eternal oxide
#

but as you already know your start and end you can trim that down drastically

ornate patio
#

I need it to target specifically air blocks that are directly above a water block, which has a solid block next to it

#

I can do that though

eternal oxide
#

@lost matrix was also playing with a A* pathing algoritm to navigate a maze.

lost matrix
eternal oxide
#

nope. @ornate patio is trying to find a path from a horse to water. for a PathfinderGoal

#

I remember you were playing around with that

ornate patio
#

@eternal oxide the path it finds goes over any kind of wall

#

but if I stand behind the wall and not the fence it can't find any path, expectedly

#

situations like this also don't work unfortunately

#

(diamond block is the target)

brave sparrow
#

?learnjava

undone axleBOT
tardy delta
brave sparrow
#

Sorry 😂

tardy delta
#

now i am vewwy sad

river oracle
brave sparrow
#

Like lightning

tardy delta
river oracle
#

It should be painfully obvious you cant get a number from a list of player objects

river oracle
#

new to the spigot API?

#

that has nothing to do with your issue

#

you've clearly never touched java

tardy delta
#

😏

river oracle
tardy delta
#

myesssir

river oracle
#

ahhh I remember when I made my first plugin I thought'd it be fun and easy going in with 0 java experience I was very wrong

#

it was the most painful experience of my life

#

don't ask how I got to where I am with no pure java projects I couldn't answer that

tardy delta
#

i believe i still have my first plugin

river oracle
#

I deleted my first plugin lol

tardy delta
river oracle
#

I could probably recover it since its burned into my hard drive

tardy delta
smoky oak
#

bleugh light mode ide

river oracle
#

One thing I will say that I'm proud of is right off the bat I used dependency injection

#

I've never used static access

tardy delta
#

im not using eclipse anymore lol

river oracle
#

is... That Visual Studio

#

FourteenBrush

humble tulip
#

Eclips and light mode

#

Uhmmmm

tardy delta
#

eclipse lol

brave sparrow
#

Sometimes you need some VS yk

tardy delta
#

glad i stopped using that

eternal oxide
river oracle
#

uninstall it

brave sparrow
#

I have VS enterprise

#

Sometimes you need it

river oracle
#

for what?

tardy delta
#

vscode 😍

river oracle
#

vscode ❤️ its my baby

eternal oxide
# ornate patio

if you increase the time to search it will find a path from that corner

river oracle
tardy delta
#

ah i forgot i was busy on editing the tmux config file

#

such a pain

harsh matrix
#

mmmmmm
tmux

ornate patio
tardy delta
#

that shit isnt accepting anything of what i put in the config

#

doesnt make sense at all

brave sparrow
river oracle
brave sparrow
#

Lol

river oracle
#

gross C++ eww eww

#

me no likey

ornate patio
#

is it possible to steal the villager's AI, because they can make their way around obstacles to get to their workstation

lost matrix
tardy delta
#

we are not stealing anything here

river oracle
harsh matrix
lost matrix
#

If it was C++ i would give it a shot

river oracle
harsh matrix
#

yes.

#

but fuck microsoft

molten hearth
#

Precisely why it sucks

tardy delta
#

i also like the linq and the $"{var}" thing

harsh matrix
#

the only thing good that microsoft made is vscode

river oracle
#

so true

lost matrix
#

C# has some good concepts like delegates and no runtime type erasure

molten hearth
#

Visual studio isn't bad either imo

harsh matrix
#

I hate vscode

river oracle
#

I love vscode

molten hearth
#

(WEll no actually it is last time I had to wait 15 minutes for a function I made to be cached)

ivory sleet
brave sparrow
river oracle
# ornate patio bump

with some NMS access I wouldn't think its impossible you'd just have to dig around a bit

harsh matrix
#

vim > atom > notepad++ > vscode

harsh matrix
ornate patio
#

yeah im trying to find it

#

i have no idea where it is

lost matrix
molten hearth
#

SpigotPress when

river oracle
#

should be under like world/entity

brave sparrow
#

Trying to write minecraft plugins in php is wack

lost matrix
crisp steeple
#

seriously whos idea was it to make functions in c# uppercase

harsh matrix
tardy delta
ornate patio
molten hearth
#

I have a problem with anyone who uses WordPress

ivory sleet
molten hearth
#

The plugin system is one of the most annoying ones I've workee with

tardy delta
#

i thought that my teacher was talking shit when he said that fields where prefixed with an underscore

crisp steeple
#

think they just did it to be quirky

ornate patio
#

thing is villagers dont have normal goalSelectors and targetSelectors

harsh matrix
ocean lion
#

?jd

ornate patio
#

they have their own memory crap

tardy delta
#

i made a website for school with jimdo 😢

molten hearth
ocean lion
#

?learnjava

undone axleBOT
harsh matrix
river oracle
tardy delta
#

we learned html and css and then for another subject they told us to make a website

#

nobody usin the shit we learnt

molten hearth
#

I'm actually a php enjoyer so I have fun making stuff from scratch most of the time

ivory sleet
#

I mean php8 isnt apparently that bad

crisp steeple
#

in cs last year they just taught us how to use some random js library instead of how to actually use js

harsh matrix
mortal hare
molten hearth
#

Yes but like its so dirty it doesn't deserve to be used

ivory sleet
#

I mean java has reifiable types

#

just that it gets verbose using em

harsh matrix
molten hearth
#

Its like when u have no food and no time so instead of cooking food you go to the greasiest fast food there is in town

harsh matrix
#

yea

tardy delta
#

not in my entire life

harsh matrix
#

or write your own single-use-os, http protocol and a webbrowser in x86 assembly💀 💀 💀 💀 💀

harsh matrix
tardy delta
#

i'd rather write a website in binary

river oracle
#

brainfuck is an impressive engineering feat. I personally use it for all my low level programs

harsh matrix
#

x86 assembly is worse than binary

tardy delta
#

good

ornate patio
#

if brain is present

harsh matrix
lost matrix
river oracle
#

can't wait to start writing wasm in rust uwu

molten hearth
#

I only used wasm when I wanted to particularly annoy people trying to reverse engineer

river oracle
#

I hate JavaScript with a burning passion so anything I can use to not use java script makes me happy

molten hearth
#

Damn

river oracle
#

there is a reason I'm not a web developer

molten hearth
#

It's my favourite language😩

river oracle
#

you're a monster an absolute monster

molten hearth
#

Here I am enjoying js and php lol

river oracle
#

atleast use TypeScript

ornate patio
#

i love javascript roo

lost matrix
#

javascript is an actual pile of garbage

harsh matrix
ornate patio
#

yes it is. i'll fight back dont try me

harsh matrix
#

js is .. ok
but typescript is the best

tardy delta
river oracle
#

this is too

tardy delta
#

lomobkk aaaa

molten hearth
#

For me Typescript is just js but with another layer of being annoying

river oracle
lost matrix
waxen plinth
#

there is also redcommands

tardy delta
#

there is also acf

tender shard
tardy delta
#

vscode good

harsh matrix
# ornate patio yes it is. i'll fight back dont try me

either you use one pretty decent "ide" for 10 programming languages filled with telemetry and sell your soul to microsoft, use 10 shitty ides by 10 different developers with 10 different ui layouts for 10 different programming languages or 10 great ides by the same devs with the same ui perfectly optimized for their single language