#help-development

1 messages · Page 471 of 1

young knoll
#

Have you ever seen a wild bee actually make it back to the hive

#

Because I haven’t

river oracle
#

worst codebase I've seen in so long

remote swallow
#

how far ahead of the player can they see

idle iron
#

I will try 😄

floral drum
remote swallow
flint coyote
floral drum
#

ignore the field

#

still editing the class

remote swallow
#

its 4

remote swallow
floral drum
remote swallow
#

yes

young knoll
#

Papers api has a good solution to vanilla goals

#

That solution being: no

floral drum
#

:p

remote swallow
#

ur weird

floral drum
#

woah

remote swallow
#

idk what else to say

floral drum
#

:(

flint coyote
#

Most of the devs from my company code with light theme. It doesn't get any worse than that

floral drum
#

for fuck sake

remote swallow
#

how many versions has luckperms had

floral drum
#

too many

#

but also why

remote swallow
#

just downloading it and realised its high as balls

#

god im dumb

#

just made command stuff

#

and never even regsister the command

young knoll
#

That’s nothing compared to like

river oracle
#

I'm thinking of OpenSourcing my game engine I made at this server just need to replace all their proprietary utils uwu

young knoll
#

That one premium plugin optic showed

remote swallow
#

hm?

floral drum
#

gotta love this command api

young knoll
#

Idk what it was but it had hundreds of updates

remote swallow
#

is that commodore

remote swallow
#

idk the name

#

was it plots

floral drum
young knoll
#

That’s not so much a command api as it is a method to make each command

remote swallow
#

gives me bridgadier vibes but it looks different

floral drum
#

Also has argument type parsing

remote swallow
#

acf be like

river oracle
#

I have a builder for my command API but its cursed looking

floral drum
young knoll
#

Brigadier is cursed

#

Some of the vanilla commands have ungodly long builders

remote swallow
#

why shouldnt they

#

wait

#

nms.screamingsandles shows deobsfucated code technically

#

cant they get dmca

river oracle
#

where is the code

#

I only see names

remote swallow
#

all the fields and stuff

#

isnt that technically part of the code

rough ibex
#

do they contain actual method code

river oracle
#

no

#

its just names

floral drum
rough ibex
#

then no its not dmca

young knoll
rough ibex
#

public boolean isEven(int n)©® 2023

solar mauve
#

anybody knows how to loop in every items of a player in nms inventory and somehow know the index of that item in loop?

#

there is the "entity.getInventory().getContents()" function, but im not sure since its a NonNullList and you couldn't jump indexes in lists (java)

#

is it possible that mc adds ItemStack.EMPTY for null slots?

chrome beacon
#

...

#

Wrong reply

remote swallow
chrome beacon
young knoll
#

I hate that ItemStack

wet breach
remote swallow
#

not that i remember

wet breach
#

oh guess you haven't watched the video on it yet lol

young knoll
#

Okay let me help

#

1 in binary = 1 in decimal

#

👍

remote swallow
#

01101001 00100000 01100011 01100001 01101110 00100000 01110100 01100001 01101100 01101011 00100000 01101001 01101110 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01101001 01100110 00100000 01101001 00100000 01110111 01100001 01101110 01110100 01100101 01100100 00100000 01110100 01101111

remote swallow
young knoll
#

Base 10

idle iron
#

Can anyone help me create code that makes skeletons have aim bot?

#

If you want to help please dm me 🥹

quaint mantle
#

hey guys

#

anyone know how i can refer to String.valueOf(delayCounter) as %timer% in a config

remote swallow
#

String#replace()

flint coyote
#

You just do str.replace("%timer%", String.valueOf(delayCounter));

quaint mantle
#

oh yeah

#

thx

#

im kindof confused

#

BaseComponent[] components = TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', main.getConfig().getString("actionbar-timer-message")));

#

this is my line

#

should i just add

#

.replace on the getstring method

flint coyote
#

yes

bold vessel
#

Anyone know how i can allow player in survival to put spawner with egg inside ?

flint coyote
#

? you mean let them change the spawner type?

tribal quarry
#

how should i build with paperweight?

bold vessel
#

Nah just place spawner with egg inside (with a predifine mobs)

tribal quarry
#

i tried gradlew build but it left it unobfuscated

bold vessel
#

cuz we can in creative but if we place it in survival the spawner is empty

flint coyote
remote swallow
tribal quarry
#

i did

#

file is unobfuscated

#

which one should i use?

flint coyote
bold vessel
remote swallow
#

just checked, see if reobfJar works

echo basalt
flint coyote
bold vessel
#

Look at this

echo basalt
modest garnet
#

anyone got a permissions handler i can have?

echo basalt
#

well

#

ask google

remote swallow
#

luckperms

modest garnet
remote swallow
#

or just player#hasPermission

weak kayak
#

luckperms my beloved

modest garnet
#

how do u create permissions and stuff tho

flint coyote
remote swallow
#

or just check for a permission

#

you dont actually have to register it in plugin.yml

bold vessel
# bold vessel

@remote swallow do you know how i can let people in survival place spawner with mobs inside

quaint mantle
#
BukkitRunnable task = new BukkitRunnable() {
                int delayCounter = finalDelayTicks;

                public void run() {
                    if (delayCounter == 0) {
                        cancel();
                        return;
                    }
                    delayCounter -= 20;
                    int seconds = finalDelayTicks / 20;
                    int hours = seconds / 3600;
                    int minutes = (seconds % 3600) / 60;
                    int remainingSeconds = seconds % 60;
                    BaseComponent[] components = TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', main.getConfig().getString("actionbar-timer-message").replace("%timer%", hours + "h " + minutes + "m " + remainingSeconds + "s")));
                    p.spigot().sendMessage(ChatMessageType.ACTION_BAR, components);
                }
            };

            task.runTaskTimer(main, 20L, 20L);
        }```

why doesnt this work, it should be decreasing the timer but it just stays static such as 0h 0m 10s
remote swallow
modest garnet
bold vessel
remote swallow
remote swallow
flint coyote
remote swallow
#

they can place it you just need to set its mob

quaint mantle
#

oh

#

int seconds = delayCounter / 20;

#

so this should work

flint coyote
#

yes

weak kayak
#

likely

quaint mantle
#

nvm lol

#

i didnt even use my brain

wise mesa
#

okay so I just setup nexus

#

it did not come with a deployment user by default

#

can I just add one

sullen marlin
#

ye

#

deploy with admin 💀

remote swallow
#

Reposilite better

earnest lark
#

in the maven files how do i get it so that it auto compiles into my plugins folder

river oracle
#

what is the best way to think about this. I have a tab completer and a command with 2 entire separate requirements
/enchant <player> <enchantment> <level>
/enchant <enchantment> <level>

#

is there any way I can tab complete this really nicely I'm kinda stumped I'm not going to lie

#

maybe if I could validate whether the first item is a player or enchantment, but there are rare cases where both are actually true granted this is an extreme edge case

earnest lark
#

idk bro but why you remaking a already existing command

sullen marlin
#

@tender shard has a tutorial about that on his website

river oracle
#

oh nice

sullen marlin
#

but honestly I would just symlink

#

(maven plugin copy)

river oracle
#

not to me :(

river oracle
#

its sort of under powered for what it could be

earnest lark
#

eh its alright

sullen marlin
sullen marlin
#

or write a named argument system lol

#

or have another subcommand

river oracle
#

yeah no fuck the latter I'll do the former

#

and just prioritize one

earnest lark
#

blessings man

river oracle
#

god I can't visualize this is args.length 0 tab complete showed when you initially press space from the command or is args.length 1 tab complete shown I'm pretty sure its the former I just can't be positive rn lol

#

maybe my work program was right I do need a brea

#

I'll take a breaky nvm guys

earnest lark
#

is there any event for like someone clicking with an item

flint coyote
#

PlayerInteractEvent

earnest lark
#

k thanks

quaint mantle
#

i have this here

#

p.spigot().sendMessage(ChatMessageType.ACTION_BAR, components);

#

instead of sending it to only the player

#

how do i send it to the whole server

young knoll
#

Loop over Bukkit.getOnlinePlayers

quaint mantle
#

BaseComponent[] components = TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', main.getConfig().getString("actionbar-timer-message").replace("%timer%", hours + "h " + minutes + "m " + remainingSeconds + "s")));
                        for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
                            onlinePlayer.spigot().sendMessage(ChatMessageType.ACTION_BAR, components);
                        }```
earnest lark
#

i was going to say that but i thought there was a better option

brave sparrow
#

Nope, that’s the way

flint coyote
young knoll
#

There’s a better option for normal chat messages

#

But not action bars

brave sparrow
young knoll
#

But you don’t have to see it do the magic

brave sparrow
#

That’s half the fun

young knoll
#

Better pull out some streams then

#

Maybe some forEach

brave sparrow
#

Love me some forEach

#

Get a lovely lambda in there

quaint mantle
#

is this valid

#

worldx12.getEnvironment() == World.Environment.THE_END

#

will it work like expected

earnest lark
#

sure

rough ibex
#

probably

quaint mantle
#

ok#

rough ibex
#

try it and see

quaint mantle
#

yea

#

it doesnt work

#

..

earnest lark
#

my maven doesent have a build thingy

sacred mountain
#

guys anyone know the best way to create a gun that had a very fast bullet but still isn't instantaneous? e.g. 125 m/s

#

or is it just not worth it

earnest lark
#

make it go that far

#

every tick or smthn

#

then check if it hit something

brave sparrow
#

Yeah, you just move it every tick

sacred mountain
#

yeah ok but what should i use as a bullet

brave sparrow
#

You can use anything you want

sacred mountain
#

particle or smn

earnest lark
#

6.25 blocks every tick

sacred mountain
#

yeah but it's just clunky

earnest lark
#

make small armor stand

sacred mountain
#

is velocity accurate in mc

earnest lark
#

with button in its hand

sacred mountain
#

because teleporting at that kind of rate

earnest lark
sacred mountain
#

will look a bit bad

earnest lark
#

not really

rough ibex
#

you can create a trail behind

sacred mountain
quaint mantle
#

any alternatives to worldx12.getEnvironment() == World.Environment.THE_END

earnest lark
#

its so fast you wouldnt notice

sacred mountain
#

it just breaks

quaint mantle
#

it doesnt work

rough ibex
#

an error?

quaint mantle
#
if (worldx12.getEnvironment() == World.Environment.THE_END) {
                            delayCounter -= 20;
                            int seconds = delayCounter / 20;
                            int hours = seconds / 3600;
                            int minutes = (seconds % 3600) / 60;
                            int remainingSeconds = seconds % 60;

                            BaseComponent[] components = TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', main.getConfig().getString("actionbar-timer-message").replace("%timer%", hours + "h " + minutes + "m " + remainingSeconds + "s")));
                            for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
                                onlinePlayer.spigot().sendMessage(ChatMessageType.ACTION_BAR, components);
                            }
                        } else {

                        }
#

worked in the overworld

#

no error

#

oh its because

#

yeah i see it now

wise mesa
#

need a bit of maven help

#

so I have a plugin with two modules

#

?paste

undone axleBOT
wise mesa
#

here's the main project's pom

#

so there's two modules, api and impl

#

impl depends on api

young knoll
#

I wonder if market entities would be good bullets

wise mesa
#

I want to include api inside impl

#

basically shade api in impl

#

i just don't know if there's a better way then using shade plugin

#

i saw some stuff about maven-assembly plugin but I didn't really understand how to use it

#

i tried this

#

but it added all of my dependencies to the jar, not just the other module

#

does anyone have any clue what to do here

#

i don't want to make a separate api plugin because that would be a pain

#

and wouldn't make sense anyways

tepid turret
#

Quick question, I keep forgetting this. But how do i reference my plugin in a class over then my main?

quaint mantle
tepid turret
#

Like when using bukkit schedulers and runTaskTimer it wants me to reference the plugin and im being dumb

young knoll
#

Doesn’t it only shade stuff marked as compile?

undone axleBOT
earnest lark
#

how does Bukkit.getWorld work

wise mesa
#

much much better

earnest lark
#

what are its parramiters need

wise mesa
#

?javadoc

brave sparrow
young knoll
#

There’s several versions

#

Or at least two

#

One for name and one for uuid

earnest lark
#

nvm got it

#

.getName

brave sparrow
brave sparrow
wise mesa
#

i forgot to mark something as provided

#

that I was using libraries in plugin.yml to acquire

earnest lark
young knoll
#

Wh

#

What

brave sparrow
#

Why are you doing that

remote swallow
#

that gives you the world object

brave sparrow
#

^

young knoll
#

Why do you need to getWorld when you already have a world

brave sparrow
#

^

earnest lark
brave sparrow
#

So?

wise mesa
#

no those are all seperate worlds

brave sparrow
#

If you already have the world

earnest lark
#

no i dont tho

brave sparrow
#

Why are you calling Bukkit.getWorld

#

How do you not have the world

young knoll
#

player.getWorld returns a world

brave sparrow
#

That’s what entity.getWorld() gives you

young knoll
#

Bukkit.getWorld also returns a world

wise mesa
#

player.getWorld() is the same as Bukkit.getWorld(player.getWorld().getName())

brave sparrow
#

^

wise mesa
#

and is far far far more efficient lmao

brave sparrow
#

I mean

earnest lark
#

oh i see

brave sparrow
#

I don’t know that it’s significantly more efficient

#

But it’s better

earnest lark
#

i was thinking of something else

young knoll
#

Developers hate this one trick to achieve 50000000% more performance

earnest lark
#

10^10^10^10^100% more efficient

young knoll
#

Doesn’t the compiler already optimize that

#

Or even the cpu

brave sparrow
#

Sometimes

#

But it’s something to take advantage of when designing too

young knoll
#

Always divide by powers of 2

brave sparrow
#

For example, Java’s hashmaps grow by powers of 2

#

Because you can use bitwise & rather than mod to compute the bucket

earnest lark
#

also why doesent my maven have a build thing

young knoll
#

To save CPU time on resizing a map simply use an initial size of 2^31

tepid turret
brave sparrow
#

Like, I have 128 GB of RAM, it might make more sense to optimize for CPU than RAM

brave sparrow
tepid turret
#

will it not let me send ss in here

#

dam

young knoll
#

I’d be more interested to know why you need that man map entires :p

young knoll
undone axleBOT
brave sparrow
earnest lark
#

big cap

#

i like to be proven wrong

#

do it

tepid turret
earnest lark
tepid turret
wise mesa
#

inside of your class its working fine

tepid turret
#

in the main it has issues

wise mesa
#

the problem is that when you construct the class in your plugin you need to pass the plugin in

#

now that you've added a parameter to the constructor

#

you have to pass that parameter in

#

somewhere in your plugin you'll have a line that includes new playerMoveEvent()

#

change it to

#

new playerMoveEvent(this)

tepid turret
#

Thanks!

#

that seems to work so far

wise mesa
#

did i just spoonfeed

#

whoops

tepid turret
#

yep all works

#

you did

#

💀

wise mesa
#

congrats

earnest lark
#

bru can i get help

#

my maven has no build tool

tepid turret
#

wdym???

brave sparrow
tepid turret
#

did you set up artifacts in intellij properly.

earnest lark
tepid turret
#

show us a ss of how u set it up

#

god damn it

rough ibex
#

did you paste your pom

tepid turret
#

my plugin no work again

#

:)

earnest lark
#

im looking at a video npow

#

if it still doesent work ill post a ss

tepid turret
#

I dont see what i did wrong.

#

It doesnt send player.sendMessage("jump");

#

to player so

#

idk

earnest lark
#

why

#

is there a new function

wise mesa
#

is there a way to stop the server immediately during startup

#

not immediately

brave sparrow
tepid turret
brave sparrow
brave sparrow
wise mesa
young knoll
#

You can alternatively crash the JVM for extra fun

tepid turret
#

yes

brave sparrow
#

Then maybe your logic is wrong

tepid turret
#

What is the difference between delay and period in runTaskTimer?

wise mesa
# wise mesa oh

@brave sparrow does this stop other plugins from starting up

young knoll
#

Delay is the time before the first run

#

Period is the time between subsequent runs

tepid turret
#

so 20

#

would be 1 second right

#

or 20 ticks

brave sparrow
#

They don’t move up a whole block in one go I’m pretty sure, it’s a progressive movement upwards

young knoll
#

Yes 20 is 1 second

tepid turret
brave sparrow
#

So it’s not going to have a delta y of > .9

young knoll
#

Yeah the move event is called frequently

#

You’d have to be going very fast to move that far at once

brave sparrow
#

^

wise mesa
#

?pluginyml

tepid turret
#

right. So how would I check for the player jumping

wise mesa
#

aww

tepid turret
#

is there an action?

wise mesa
#

what's the command

brave sparrow
#

Lol

wise mesa
#

i need it and don't feel like googling

remote swallow
wise mesa
#

appreciate it

brave sparrow
#

Detecting jumping is a pain in the ass

#

There’s all kinds of weird edge cases

tepid turret
wise mesa
#

i listed a plugin as a depend and yet it is still loading before the one its depending on

tepid turret
#

true.

brave sparrow
tepid turret
brave sparrow
#

What if they have a potion effect

tepid turret
#

if u walk up half a block then you don't get it.

#

Thats on purpose.

wise mesa
#

oh nvm

#

its not doing that

#

im just dumb

#

i saw load and then enable

#

the dependency definitely loads first

#

different issue i guess

tepid turret
#

is going up a slab instant?

#

or the same speed as jumping***

wise mesa
#

i mean

#

it's almost definitely gonna happen in 1 tick

#

maybe not 1 frame

#

but that doesn't matter on the server

tepid turret
#

so could i say, "to.getY() - from.getY() < 0.5"

wise mesa
#

yea but what if they jump

tepid turret
#

because when u jump it isnt instant.

wise mesa
#

jumping is slow

tepid turret
#

thats the point

wise mesa
#

it all depends

young knoll
#

The easiest way is to use the StatisticIncrementEvent

tepid turret
#

that wont trigger when going up a slab because a slab is 0.5

wise mesa
#

on lag and internet and ticks and all of that

tepid turret
#

and thats other

young knoll
#

But even that has edge cases

tepid turret
earnest lark
#

ok i redid my things but i still dont have a build thing in my maven

young knoll
#

Mhm

#

It can still give false positives but it’s not terrible

tepid turret
#

I'll try that.

earnest lark
#

aall i get when i use the one in run configurations is a folder

tepid turret
#

wait now im confused

#

how would i see what statistic is incremented

young knoll
#

Iirc there’s an event.getStatistic

#

Or something

tepid turret
#

there is but that asks for a statistic to be parsed in the ()

#

nvm im dumb

earnest lark
#

bro

#

pls

#

my maven still aint have build

remote swallow
#

where doesnt it have build

earnest lark
#

lifecycle

remote swallow
#

you use package

earnest lark
#

nope

#

gives me a folder

wet breach
#

helps if we can see the pom

remote swallow
#

you should have this

#

double click package

#

the jar will be in /target/

earnest lark
#

yup

#

i want it going strait to my plugins folder

remote swallow
#

did you follow the guide i sent you

earnest lark
#

yup

#

i used <outputDirectory>D:\serv\plugins</outputDirectory>

remote swallow
#

enable the profile

#

did you do method 1 or 2

earnest lark
#

1

remote swallow
#

okay, have you reloaded maven

earnest lark
#

i have

#

stioll only gives me a folder

remote swallow
#

?paste your pom

undone axleBOT
earnest lark
remote swallow
#

you didnt follow the guide

wet breach
#

Lol

remote swallow
#

you need the maven jar plugin

earnest lark
#

can u give me the link again

#

ill redoo it

remote swallow
#

delete line 30

#

then copy ```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<outputDirectory>C:\MyTestServer\plugins</outputDirectory>
</configuration>
</plugin>

earnest lark
#

i did that

#

it says the version is wrong

remote swallow
#

reload maven

earnest lark
#

or its giving me a error

#

nope

remote swallow
#

?paste your new pom

undone axleBOT
earnest lark
#

nvm ig

#

it just started working

remote swallow
#

3.3.0 is latest so check maven is finished reloading

earnest lark
#

it works now

#

thanks for the help

modest garnet
#

anyone know where i can get an account to test plugins?

#

or i have to buy one?

earnest lark
#

so does carpet mod

wise mesa
#

alright I am in such a loss

earnest lark
#

how would i set a sheeps velocity right after spawning it

#

bc i try to make it EntityType but then i cant set its velocity

wise mesa
#

in plugin 1, I have this code. the registration is not null. there is a registration

#

in plugin 2, which depends on plugin 1, i have this code

#

it definitely runs after

#

for some reason in plugin 1 there is a registration, adn it isn't null

#

but by the time plugin 2 loads it is null

weak meteor
wise mesa
#

im so confused

#

can anyone help me?

plush nest
#

Gui help

earnest lark
#

ok ok

#

im spawing a sheep

#

and i want to set its velocity right afterwards

#

but i cant make a sheep because the spawnEntity requieres entityType

#

and EntityType doesent let me set its velocity

worldly ingot
wet breach
#

choco beat me

wise mesa
#

or frostalf or anyone really

#

i just see that you guys are here

#

damn

#

no one knows

#

tragic

#

int cannot be null

#

primitives can't be null

#

Integer can be

#

int cannot

#

i willl bet you a million dollars

undone axleBOT
wise mesa
#

that java primitives can't be null

vagrant stratus
rough ibex
#

that's the parameter

#

getItem is returning null

#

getItem(int) means it takes in 1 int

wise mesa
#

getItem returns an item

rough ibex
#

not that it is returning an int

wise mesa
#

not an int

#

you're tripping

young knoll
#

ItemStack can be null

weak meteor
young knoll
#

Yay null

livid tundra
weak meteor
#

and they have like 40 domains

#

so i upload totally random

#

sometimes i get smth sus like that

#

other times like

#

ilovedogs

wise mesa
#

yea but that's not the return

livid tundra
#

you would have to get the entity that spawnEntity returns and set that velocity

wise mesa
#

the int is not the thing that's null

#

its the ItemStack that it's returning

#

that's null

#

and it's null because there's nothing in the slot i assume

young knoll
#

== null

wise mesa
#

you can't do .equals null

young knoll
#

You can’t call .equals when something is null

rough ibex
#

null has no .equals method

wise mesa
#

.equals is a method

#

can't run a method on null

weak meteor
#

.equals always for names and stuff

wise mesa
#

.equals is for anything except primitives and null

young knoll
#

.equals is never for null checks

weak meteor
#

also like instances i think

wise mesa
#

if it's a primitive use ==

#

if you're checking for null use ==

#

yes if you want to see if two instances are the same also use ==

#

otherwise use .equals

#

the reason you can't do .equals when checking is for null is because there's no object for it to run the .equals function on

#

instead you're trying to see if both references point to the memory address 0

wet breach
#

not sure why everyone is using finals everywhere all of a sudden

wise mesa
#

oh

#

frostalf is here

earnest lark
wise mesa
#

thank you frostalf

earnest lark
#

i want to make its accualy mod

wise mesa
wet breach
#

except used incorrectly it presents problems

wise mesa
#

uh

#

that's anything

livid tundra
#

Basically, you would do something like this:

/*(something goes here)*/.spawnEntity(/*location goes here*/,EntityType.SHEEP).setVelocity(/*velocity goes here*/)
wise mesa
#

and it's a lot easier to use mutability badly than immutability

#

doesn't mean you can't use mutability

#

but it should be used with caution

wet breach
earnest lark
young knoll
#

Netbeans tells you what can be final

#

I’m sure other ides can too

livid tundra
wise mesa
#

im the one who wrote final var

#

i wrote final var when i wrote that line

livid tundra
#

which is returned by the spawnEntity function

wise mesa
#

i assume everything can be final

#

and then I carefully consider if it can't and why

#

anyways

#

while a good discussion

tepid turret
#

i'm doing an idiot

wise mesa
#

this is irrelevant to the issue im having

wet breach
#

are you sure?

wise mesa
#

yes

tepid turret
#

How do i check a statistic against a command arg?

wise mesa
#

and you know that it is

wet breach
#

alright then, I am not needed then 🙂

wise mesa
#

frostalf please

#

i need your help

tepid turret
#

like setting a variable to it

wise mesa
#

but final just means you can't set a variable to something else

tepid turret
#
Statistic statistic = player.getStatistic((Statistic) args[1]);
wise mesa
#

i will remove every final from those two functions and test if it makes you happy

wet breach
#

no need

weak meteor
wise mesa
#

just to double check it is not the cause of the issue

echo basalt
wise mesa
#

im gonna kms

#

i have no clue why this is happening

#

i am in distress

livid tundra
wise mesa
#

perhaps registered service providers are not meant to be used in onLoad?

#

but I can't find any information anywhere about if this is true or not

tepid turret
echo basalt
#

try registering it onLoad and getting it onEnable ?

tepid turret
#

how do i set a variable to a statistic thats gotten with command args

wise mesa
echo basalt
#

onLoad fires before worlds are loaded

tepid turret
#

args[1] being the argument of a cmd

wet breach
wise mesa
#

if that is the issue it is slightly annoying

#

my code will not work how I hoped

#

but alas

#

what can you do

echo basalt
#

expose a singleton skullWazowski

livid tundra
wet breach
echo basalt
#

like luckperms does

earnest lark
#

is there any way to find like how many degreese the player is facing in a way

wise mesa
#

fineeeeee

earnest lark
#

how

weak meteor
#

I thought it wasnt castable, but i wanted to try.
I need the list to loop around it and check for the permission on the player to let him execute it with the name: tengucore.reclaim.sectionNameFromList
But it isnt castable, so now what can i do?

echo basalt
#

well

tepid turret
echo basalt
#

"degrees" is a bit arbitrary

tepid turret
#

I'm just confused with the getStatistic();

echo basalt
#

A player's location is consisted of:

  • World

  • x

  • y

  • z

  • Yaw

  • Pitch

tepid turret
#

as i want to use it with a command argument

wet breach
echo basalt
#

Pitch is vertical rotation, so

#

think of pitch in a musical instrument where it goes up/down

wet breach
#

I was going to say something along the lines of that

#

lmao

earnest lark
#

coo

echo basalt
#

Yaw is not the pitch, it's horizontal

earnest lark
#

thanks

echo basalt
#

You probably want yaw

wise mesa
#

and players cannot roll

#

crazy

echo basalt
#

so yeah

#

roll would be X rotation?

wise mesa
#

yes

echo basalt
#

I think

#

yeah

wise mesa
#

thing of a plane doing a barrel roll

#

display entities can though

echo basalt
#

Yaw is Y rotation

tepid turret
#

no roll would be turning the head 45 degrees.

wet breach
wise mesa
#

can't wait to make kind of physically accurate planes

echo basalt
earnest lark
#

im using the player but i dont see any functions for yaw pitch or roll

wise mesa
#

im not very far along

tepid turret
wise mesa
#

you're wrong

#

that's yaw

tepid turret
livid tundra
wise mesa
#

roll would be craning my neck 45 degrees

livid tundra
#

enums have the method valueOf

tepid turret
wise mesa
#

that one is pitch

#

look i know this i have the maximum amount of expertise possible

#

i play kerbal space program

#

😎 😎 😎

#

lmao

young knoll
#

What about kerbal space program 2

tepid turret
#

nvm found issue

echo basalt
#

Look to your right, that's yaw

wise mesa
#

I HATE ksp2

#

no i don't

echo basalt
#

look above, that's pitch

wise mesa
#

I want it to be good

#

but it isn't

echo basalt
#

crack your neck, that's roll

wise mesa
#

and won't be for a while

#

so I will wake

livid tundra
#

It's really picky though, so you'll need to make the string all uppercase and replace spaces with underscores

tepid turret
#

Also i understand that

wise mesa
tepid turret
#

by tilting ur head "45 degrees" i mean like how anime girls do it in the kawaii pose type shit idfk how to explain it in degenerate language

wet breach
young knoll
#

You will have to capitalize it

#

And handle exceptions

tepid turret
echo basalt
#

Statistic.valueOf(name.replace(" ", "_").toUpperCase(Locale.ROOT));

wet breach
#

well you said you didn't know how to getStatistics()

#

so I showed how you would do it

earnest lark
#

bro now my thing is just all math

echo basalt
#

but if you can't handle an enum I doubt you'll know how to turn multiple args into one string

young knoll
#

getStatistic may require additional arguments

wet breach
#

it can take additional args

young knoll
#

The block related ones require a material, the entity related ones require an EntityType

young knoll
#

Only the handful of generic ones don’t need an extra arg

echo basalt
#

but given you asked about rotation

#

this might help

young knoll
#

It’s all fun and games until Mojang adds a vector with a 4th value

echo basalt
#

you could represent both a yaw and pitch with a short hmm

#

and roll too

#

nvm im idiot but you can use an int

wise mesa
#

why int over float/double?

young knoll
#

What even is a Quaternion

wise mesa
#

god

young knoll
#

Pretty sure that’s a fake word

wise mesa
#

surely

#

math was a mistake

young knoll
#

Reject math

#

Embrace monke

livid dove
#

So I'm making an addon for coreprotect called moreprotect (no regrets on the name at all, I'll die on that hill 🤣).

Just wondering if anyone has had experience with coreprotect and has any QoL ideas to add to the project todo list. Figured u lovely devs would be the best place to ask 😁

livid dove
tepid turret
#
Caused by: java.lang.IllegalArgumentException: Tag name must match pattern [!?#]?[a-z0-9_-]*, was statName
        at net.kyori.adventure.text.minimessage.internal.TagInternals.assertValidTagName(TagInternals.java:53) ~[adventure-text-minimessage-4.12.0.jar:?]
        at net.kyori.adventure.text.minimessage.tag.resolver.TagResolver.resolver(TagResolver.java:95) ~[adventure-text-minimessage-4.12.0.jar:?]
        at net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.component(Placeholder.java:82) ~[adventure-text-minimessage-4.12.0.jar:?]
        at net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.unparsed(Placeholder.java:68) ~[adventure-text-minimessage-4.12.0.jar:?]
        at me.assailent.worldbuildingserverdev.commands.stats.onCommand(stats.java:29) ~[WorldBuildingServerDev.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        ... 23 more
```???
#
org.bukkit.command.CommandException: Unhandled exception executing command 'stats' in plugin WorldBuildingServerDev v1.0-SNAPSHOT
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R2.CraftServer.dispatchCommand(CraftServer.java:931) ~[paper-1.19.3.jar:git-Paper-404]
        at org.bukkit.craftbukkit.v1_19_R2.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.19.3.jar:git-Paper-404]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[paper-1.19.3.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:316) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:300) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2288) ~[?:?]
young knoll
#

What are you doing with minimessage

tepid turret
#

thats it i didnt bother with any clickables and stuff

#
(TagResolver)Placeholder.unparsed("statName", args[1]),
livid dove
#

Yeah wrong thing for messages in adventure

tepid turret
#

seems to be the line in question

young knoll
#

It doesn’t allow caps

tepid turret
#

Huh

livid dove
#

If its just for colored messages use the component methods.

tepid turret
#

Weird qurik

#

quirk*

tepid turret
livid dove
#

shrugs

young knoll
#

If it’s just for colored messages you just need MiniMessage.parse(whatever)

#

Or something like that

tepid turret
#

really?

young knoll
#

That will give you an adventure component

tepid turret
#

idk i tried looking at the java docs and its weird

young knoll
#

You can turn that into a spigot component or just a string

tepid turret
#

Check if stat exists?

#
Statistic.valueOf(args[1]) != null
#

tried this but didnt work

young knoll
#

It throws an error

#

It does not return null

tepid turret
#

and i check if it throws an error how?

young knoll
#

try catch

#

You never change empty

#

Also I’d be faster just to loop every space and check if it’s null

#

What

#

for (int index = 0; index < inv.getSize; index++)

tepid turret
#

what errow does it throw?

#

nvm am dumb

livid dove
#

try{basicJavaKnowledge.acess} catch (LackOfKnowledgeException exception) {system.out.println(urltoyoutyoutubeVideoOnTryCatchStatements)} 😆

young knoll
#

Wait until they hear about finally

rain sierra
#

have a hashmap that contains a UUID as a key, and an entity as a value, trying to loop over all the entities and set their health to 0, but it's not letting me? just straight up saying .health is an invalid refrence.

young knoll
#

?nocode

undone axleBOT
#

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

livid dove
#

Uuid on its own aimt gonna cut it chief

#

Oh misread

rain sierra
#

well i would send my code but im coding in kotlin, heard we dont like kotlin here

livid dove
#

Mb

rain sierra
#

this is literally all

#
for((uuid, entity) in VoidWalkerDamageListener.voidWalkers) {
  entity.health = 0.0
}
#

thats it

livid dove
#

Sounds like a kotlin problem to me.

Almost as if not being able to declare your object classes can sometimes actually suck 🤔

rain sierra
#

?

#
var voidWalkers = HashMap<UUID, Entity>()
lost matrix
rain sierra
#
import org.bukkit.entity.Entity
young knoll
#

Entity doesn’t have health does it

lost matrix
#

Ah wait

young knoll
#

That’s only LivingEntity

lost matrix
#

Only LivingEntity has health

#

Ah fk

rain sierra
#

ok well question

livid dove
#

Lmao

rain sierra
#

the main issue im trying to fix is that i want to kill all of a specific mob right

#

but the code i used previously wont kill the mob if the chunk its spawned in isnt loaded

young knoll
#

kill or remove

rain sierra
#

both? i guess

young knoll
#

Yeah you can’t modify entities in unloaded chunks

#

You would have to load them first

livid dove
#

Ah bukkit you slipepr fucker.

Brought to you by the same code where the Player class only deals with online players, and the Offline Player class deals with all players...

young knoll
#

Also if you just want to remove them, use .remove()

lost matrix
rain sierra
#

so theres no way to fix my issue?

lost matrix
#

There is for sure a way to fix your issue

rain sierra
#

which is

lost matrix
#

We just need to find out what the issue is in the first place.
What is your game plan?

rain sierra
#

I just want to be able to run a command like /vw kill, and it will kill all voidwalkers, in loaded and unloaded chunks.

#

(im coding a boss plugin, the boss is called voidwalker)

wet breach
lost matrix
#

Killing mobs in unloaded chunks means you need to gradually load all chunks on the server
and kill the mobs in them. That can take hours for big maps.

rain sierra
#

ok well

#

how about

#

actually wait

#

im gonna try something rq, ill update yall

livid dove
#

Wait wait wait hang on when do the void bois need killing?

young knoll
#

You could keep the chunk bosses are in force loaded

echo basalt
lost matrix
#

How about this:
You create a state represented as an integer.
Every time you spawn a mob you simply tag it
with the current integer.
On kill you remove all active mobs and increment the integer.
If a chunk loads with mobs tagged that is older
than the current tag, you remove it before it loads.
@rain sierra
PS: A simple timestamp (long) for when the mobs spawned works for this.
Then you need to define a "death line" in time for this type of mob.

livid dove
#

Because if its a clean up job we could hella cheat here and GOD DAMNIT IMMULSION STOP STEALING MY THUNDER! 😭

echo basalt
#

get sniped

young knoll
#

Delete the entire world folder and regen the world 👍

livid dove
rain sierra
#

that is a super clever idea though

young knoll
#

I wonder

#

Could you theoretically load an entire region file into a PDC

echo basalt
lost matrix
livid dove
lost matrix
livid dove
#

Also why has nokne said the obvious and told this poor man to just go buy mythic mobs and download the api? 😅

young knoll
#

No no we aren’t using the PDC to store the region file somewhere

lost matrix
livid dove
#

Like they have spent years working on these problems do we don't have to 🤣

young knoll
#

We are just loading the entire region file into a PDC for wrapped access to the contents

livid dove
echo basalt
#

if you have that many regions you're probably rocking a raid0 nvme setup

echo basalt
lost matrix
#

3G/s persistent storage is really nice to have
Thats like DDR 1 but persistent.

livid dove
#

But like ong why?

Being able to scan 900 regions in a minute is fine..

No user is gonna complain at that 🤣

echo basalt
#

but you're most likely just skimming through tile entities instead of actual blocks

#

I pray

young knoll
#

Actually in theory you should be able to load any NBT data into a PDC

#

Like a schematic

echo basalt
#

let's store an operating system in pdc

young knoll
#

Which means PDC would actually make a good schematic api

echo basalt
livid dove
#

Ngl the big dream project is reverse making the way they store block data in binary longs and palletes to use as a compression archiving method for plugons that have large databases that need purging from time to time

lost matrix
echo basalt
#

true

#

or if you're a PS5 and have hardware compression

livid dove
#

I mean ur average user js used to async world edit being fast... I dont think they will complain at 900 regions a minute 🤣

lost matrix
#

Damaged pins i would assume

echo basalt
#

improper contact with data pins or a fucked controller

#

or fucked lanes overall

lost matrix
#

I just recently learned that those lines ar brittle af.
Rolled over a cable with my chair and it just was unusable afterwards.

#

Or im just fat

echo basalt
#

HDMI cables are made to break easily

#

so that you don't break the ports

#

source: I've broken a cable by unplugging it from my gpu

#

the connector was stuck inside

young knoll
#

Even smarter would be to strengthen the first bit of each end so it doesn’t break in a way that leaves the connector jammed inside

echo basalt
#

they're smart but not that smart

echo basalt
young knoll
#

Just use ram as your ssd

#

Duh

echo basalt
#

and then you fill up your drive and your pc is fucked

tepid turret
echo basalt
#

your IDE is yelling at you

#

for a reason

tepid turret
#

When i run /stats assailent entity mob_kills enderman

lost matrix
tepid turret
#

it returns false

tepid turret
#

what'd i do

echo basalt
lost matrix
#

You are hiding exceptions. Never do that.

tepid turret
#

whats wrong with the highlights idgaf abt them

echo basalt
icy beacon
lost matrix
#

Also those

echo basalt
#

I can spam your command with random strings and crash your server

icy beacon
#

compare strings with String#equals

echo basalt
icy beacon
#

not ==

echo basalt
#

you'd understand

#

that your IDE is yelling at you

lost matrix
#

Use .equals() for Strings and pretty much any other object

echo basalt
#

for a fucking reason

icy beacon
#

and why the | instead of ||

#

that's plain weird

echo basalt
#

That's literally how I learned java, I just fucked up enough times and my IDE babysat me

icy beacon
#

^

tepid turret
#

i ignore it

icy beacon
#

ffs

young knoll
#

🤡

echo basalt
#

yeah bro I code in microsoft fucking paint

tepid turret
young knoll
#

Hey you joke but paint ide is a thing

wet breach
#

the advancement in technology that it can now teach you

echo basalt
wet breach
#

I wish I had that

echo basalt
#

this you?

tepid turret
#

based

echo basalt
lost matrix
#

| will check the second condition even if the first was right.
Which i dont think is needed here.

tepid turret
#

Nah i use edge

#

I type in the url

icy beacon
#

you remind me of that dude who spent like 15 hours here trying to code a plugin by being 1000% spoonfed

livid dove
icy beacon
#

down to the process of installing ide

lost matrix
#

Thats... An OR

tepid turret
#

Installing an ide aint being spoonfed bro

echo basalt
#

yes I'm an idiot and it's almost 6am

icy beacon
tepid turret
#

thats called telling someone how to install an ide

echo basalt
#

but that was part of my hypixel dev interview challenge

young knoll
#

Okay but what about

echo basalt
#

& is and, | is or, ^ is XOR

young knoll
#

&|

icy beacon
tepid turret
#

which is stupid

#

because | does both

#

lol

echo basalt
#

then there was something about <<< being different than <<

young knoll
#

It’s for quantum states

lost matrix
#

Didnt you get a fked up class where you have to find as many bugs in like 5mins?

young knoll
#

InventoryOpenEvent

icy beacon
#

inventoryopenevent

tepid turret
#

nah

echo basalt
#

they were doing http requests onPlayerMove

tepid turret
#

use

young knoll
#

That’s not a bug

#

That’s a feature

tepid turret
#

StatisticIncrement or whatever and then check for each time a thing happens

#

fweajfweajfa

echo basalt
#

they were also doing location checks with a single |

#

and checking if a bukkit entity was instanceof NMS' Player

#

was like

young knoll
#

Seems obvious enough so far

tepid turret
#

when i do (array).length() does it return the length starting from 1 or 0?

echo basalt
#

if(entity instanceof EntityPlayer) and I was the first one to point it out in all of their interviews

icy beacon
#

length is length

#

returns the amount of items

tepid turret
#

like [1, 2, 3] is i and i.length() = 3 or 2???

icy beacon
#

also length is a variable not a function

echo basalt
#

or they had the nms player import or something

icy beacon
livid dove
young knoll
#

?tas

undone axleBOT
rough ibex
#

plus that kind of question is basic programming knowledge

#

not even specific to spigot

icy beacon
#

maybe a more useful command would be

#

?learnjava

undone axleBOT
rough ibex
#

yep

young knoll
#

Maybe we’ll get a #help-java channel

rough ibex
#

please no

icy beacon
#

this is already help java technically

livid dove
young knoll
#

Okay well

#

#help-bedrock

icy beacon
#

plus I bet that the channel would be used as #spoonfeed-java

icy beacon
livid dove
icy beacon
#

lmao

young knoll
#

internet

echo basalt