#help-development

1 messages · Page 1839 of 1

rigid drum
#

oh well usage errors are another thing

waxen plinth
#

For example if the command takes an int arg and you type hello it will say invalid argument for <argument name>: hello and show the usage of that command

rigid drum
#

that's reasonable and I can do those easily.

#

but having /help

misty current
#

setsneaking inherits from entity

rigid drum
#

is pretty nasty

crisp arch
#

so idk what they are in mojang mappings

misty current
#

wait

waxen plinth
#

I don't really agree, but I guess I can't convince you regardless

sacred ice
#

there is nms way

rigid drum
#

This said... the nice thing about having a really simple flexible command system is... if I want to create a big help thing

misty current
#

what do you mean with mojang mappings? i always use NMS classes

rigid drum
#

I can do add it ontop without requiring it

misty current
#

unless we mean the same thing i have no idea what you're talking about

crisp arch
rigid drum
#

@waxen plinth yeah I mean, there are pros and cons... I haven't used your tool you haven't used mine so hard to say.

waxen plinth
#

True

rigid drum
#

I might come around to it... and you might come around to my way.

waxen plinth
#

I very much like my command file and generated help menus

sacred ice
#

back in the days I used EntityPlayer.setSneaking(true); to make fake player sneak idk if it still here

rigid drum
#

I just have found that even though having these super highly reactive systems is new and different and has a learning curve... so far it's got an almost 100% "omg this is great" ratio.

waxen plinth
#

I should be going now though, I have a call soon

rigid drum
#

Yeah same, was fun

paper crest
#

java.lang.NoSuchMethodError: 'net.minecraft.nbt.NBTTagCompound net.minecraft.world.item.ItemStack.save(net.minecraft.nbt.NBTTagCompound)'

waxen plinth
#

It's been nice catching up with you

paper crest
#

help me

misty current
#

danm Entity is 2k lines of code

crisp arch
misty current
#

nice

crisp arch
#

although, im not sure the server will send the player pose with the PlayerInfo packets

rigid drum
#

btw if you are looking for MC related work hit me up.

crisp arch
#

because some properties in ServerPlayer dont get baked into the packets

#

anyways ill just try it

misty current
#

im pretty sure

paper crest
#

https://prnt.sc/23x9m75

any method here has error: java.lang.NoSuchMethodError: 'void net.minecraft.world.item.ItemStack.resetHoverName()'

crisp arch
#

kill05, yea, thats what i was asking for before, i was confused what the DataWatcher.watch method is in mojang remapped

misty current
#

ah oke

#

if i were you i'd use Spigot mappings

#

tho

crisp arch
misty current
#

¯_(ツ)_/¯

crisp arch
#

i might change back to spigot mappings but ill have to rewrite all the code lol

misty current
#
    public int aq() {
        return 300;
    }
``` ah yes very good
#

from Entity.class

crisp arch
#

lol

fathom dirge
#

I'm experiencing some problems with md_5's maven plugin to remap mojang mapped plugins to spigot mapped jars

crisp arch
#

see what i mean lol

fathom dirge
#

yeah i tried sending my pom.xm but cant send files here i guess

#

one sec

fathom dirge
#

Failed to parse plugin descriptor for net.md-5:SpecialSource:1.10.0 (C:\Users\loepi\.m2\repository\net\md-5\SpecialSource\1.10.0\SpecialSource-1.10.0.jar): No plugin descriptor found at META-INF/maven/plugin.xml -> [Help 1]

#

i keep getting this error

crisp arch
#

wait wrong site

grim ice
#

@crisp arch remember me

#

im that guy who asked u bout databases lol

misty current
#

it keeps getting better

    public int aE() {
        return 3;
    }

    public boolean aI() {
        return false;
    }
grim ice
#

now ive learnt how to use both mysql and mongodb

misty current
#

ok imma stop

crisp arch
#

the wonders of obfuscation

misty current
#

there is more also

#

go guess what they do lmao

swift adder
crisp arch
#

lol just start using Entity.aE() instead of the number 3

grim ice
crisp arch
#

SQLite

misty current
#

yea lemme just construct an Entity and implement the abstract methods

crisp arch
misty current
#

and call aE to get 3

#

the easy way

swift adder
grim ice
#

cant we use db

crisp arch
swift adder
#

mysql is bettter self hosted

misty current
#

yea lemme just implement h, a and b to get 3

#

gimme a sec

grim ice
#

man im too lazy to use sqlite

#

screw this ill use mysql

crisp arch
grim ice
#

nah too confusing

crisp arch
#

for the Driver.getConnection, the protocol is just sqlite3:jdbc:<path>

#

or something like that

#

and the language syntax is the exact same as MySQL

crisp arch
grim ice
#

send me how to learn it

#

:O

crisp arch
#

lol 🥄

grim ice
#

smh

#

spoonfeeding a person in his bed at 11:40 pm isnt bad

#

its human

#

lol

crisp arch
#

lol

#

classic 2 am programmer

#

sleep deprived

grim ice
#

smh

proud basin
#

What's the food level of a player?

grim ice
#

wdym

#

max is 20

#

if thats what u sayin

#

its an int as far as i remember

torn shuttle
#

is there a sane way to keep a wolf angry

#

I set them to angry but that really does about as much as tickling them

candid galleon
#

they need a target i'd imagine

torn shuttle
#

if the target goes out of range will they stop being angry?

candid galleon
#

I'd try listening to EntityTargetEvent for when the wolf's target is set to null and cancel / reset the target back to the old target

#

most likely yeah

torn shuttle
#

this sort of sucks

grim ice
#

list the angry wolves with their player somewhere like a map or smth

#

player move event

#

if a wolf is in range

#

and in the map with the player

#

angry t hem with player

torn shuttle
#

yeah this is why I said "sane" way

grim ice
#

gl

torn shuttle
#

not a happy camper

torn shuttle
#

mojang make wolves less pettable

#
public class KeepWolvesAngry {
    public void showMeYouWarFace(EliteEntity entity){
    }
}

this is how you know I am starting to lose my mind

wicked lake
swift adder
#
            if (cmd.getName().equalsIgnoreCase("funi"))
            {
                player.sendMessage("you look funi");
            }
        } else {
            sender.sendMessage("okay");
        }
        return false;
        } ```
else without if but there is an if.
rancid beacon
#

(uh, sory, bot deleted my message because website adress)

Hello guys, i have a little problem with spigot 1.18 to write my plugin

previously I was using spigot 1.17 and everything was ok, and now when I wanted to start using spigot 1.18 and I used it in my project structure, it turns out that none of the imports in my code that I had can search

and i see that in spigot-1.18.jar there's just only org.bukkit.craftbukkit.bootstrap.Main, and nothing else :/

candid galleon
#

use the jar in the spigot-api folder

wicked lake
#

Yup, the new version's spigot-1.18 file is a bootstrap now

wicked lake
#

I would also recommend using a proper build tool like maven, though it can take a little bit of learning

proud basin
#

Do you need the .iml file to run your project?

candid galleon
swift adder
wicked lake
#

"else without if but there is an if" wut

candid galleon
#

I see the reply

#

what is the question though

swift adder
#

I have an issue, it says else without an if

rancid beacon
wicked lake
wicked lake
candid galleon
#

your code is indented improperly

#

and is hard to read

#

you have an extra curly bracket after the else

#

and I don't think you understand how to code

wicked lake
#

If you're finished with the command you should also return true;

#

Returning false in a command just makes the command text "/command" appear in chat

swift adder
candid galleon
#

ok, so fix the indent errors

slow oyster
rancid beacon
wicked lake
#

Use buildtools; barring that use the libraries in the bundler/libraries/ directory. In general I recommend using maven for future projects, if you need a quick tutorial on how to get set up with maven I can pm it to you

rancid beacon
#

oh, thank you, I think I can handle maven already, but I'll write if I need to

worldly ingot
waxen plinth
#

I don't think you can do that

slow oyster
#

I think it's a Java 14+ thing?

waxen plinth
#

Actually wait

worldly ingot
#

Is it? o.O They're erased at runtime, no?

waxen plinth
#

Yo ucan do instanceof Thing<?>

worldly ingot
#

Or was that introduced with pattern matching?

waxen plinth
#

You can't use an actual type though

slow oyster
#

Lemme check, IntelliJ was screaming at me to fix it

waxen plinth
#

Like you can't do instanceof List<String>

#

But instanceof List<?> works

#

Strange

worldly ingot
#

Oh, yeah, I guess <?> would make sense because it's equivalent to just the type

waxen plinth
#

Yeah

worldly ingot
#

Dunno, looks weird lol

slow oyster
#

Yeah I thought the same thing

#

The error says it's an unchecked generic

worldly ingot
#

But yeah, only comments on the Bukkit side, really

waxen plinth
#

Until very recently I didn't even realize you can get the generic type of a field

#

It's only objects that you can't get the generic type of

#

For parameters and fields you can

#

Like if a method takes a List<String> you can actually get that component type

slow oyster
waxen plinth
#

But only if it is known at compiletime

hollow bluff
#

If i'm going to be using one method for almost all the files to get the chat prefix for the plugin, is it then respectable to use static?

worldly ingot
#

I left my Bukkit comments in the PR so they're not lost here/repeated by another contributor

waxen plinth
#

A major reason people bemoan it is because it makes unit testing extremely difficult

#

But almost nobody unit tests their plugins anyways

worldly ingot
#

It can be difficult to test some things. Unless it's data driven, really

hollow bluff
#

yea thats true, won't be unit testing it either way

waxen plinth
#

Just don't overdo it with static

#

Config and messages is probably fine

hollow bluff
#

I mostly just use constructions but yeah for utilities, maybe better to just use static on some stuff

young knoll
#

Having a PR accepted with 0 comments is truly a victory

#

Never mind that it was 3 lines

worldly ingot
#

Sometimes it gets merged directly 👀 then it's SUPER special

#

I've had a few!

young knoll
#

I don't believe it

#

:p

candid galleon
#

You do not have permission to access Bitbucket.

worldly ingot
#

Make sure you're logged in, MSWS. Though PRs are restricted to those that have signed the CLA, unfortunately, because BitBucket doesn't separate the read and write permissions for some weird reason

young knoll
#

Did you approve a PR from MD XD

candid galleon
#

how do i sign the CLA

worldly ingot
#

Yeah I was the reason that PR was made iirc, Coll, lol

#

?cla

undone axleBOT
worldly ingot
#

They're processed manually though so it will take a few days or so to get you in there

young knoll
#

Man bukkit has gotten a lot less PRs than I imagined

worldly ingot
#

Well it's API changes, right? So generally CB gets more patches (almost 1,000 now I believe) because implementation and server patches are more common to fix bugs with API or server internals

young knoll
#

Mmh true

worldly ingot
#

Bear in mind that this is also Spigot's maintenance of Bukkit. There were also PRs pre-Spigot

young knoll
#

A lot of PRs just sitting open

worldly ingot
#

Yeah, either not finished, changes unsuitable for Bukkit, author disappeared after requested changes, or better API was introduced

regal dew
#

Ohh choco, could you check, I think I signed the cla, but somehow im not able to login 👀

young knoll
#

I would expect the unsuited or obsolete ones to be closed at least

worldly ingot
#

That's not within my jurisdiction :(( Yeah.

#

Cindy & md

regal dew
#

Ah ic

worldly ingot
#

ngl I've no idea if Cindy's still around. I've not heard from her in years

young knoll
#

Cindy?

lavish hemlock
#

What's the best way to provide an API entrypoint for Spigot?
I don't want to make API users dependent on the plugin class as I deem it kind of gross.
Is there any other method?

worldly ingot
#

Yeah. Cindy was an IRC staff member and she handled the Spigot emails and CLA signings, etc.

#

Then again, I don't hear from dmck at all but he's still chugging along every single day

#

Dedicated man he is lol

regal dew
#

Alright, resetting the jira pass worked ig 👀

worldly ingot
#

Oh nice PES2_HappyJuice May have been accepted already

regal dew
#

got a weird email from resetting it at hub.spigotmc.org that it was a managed account or sth

patent horizon
#

can anyone walk me through the steps of setting up a plugin in kotlin

#

in intellij btw

late sonnet
proud basin
#

What's the best way to stop a player from moving?

worldly ingot
#

Hit their knees with a baseball bat

#

Ehm, I mean, Slowness is probably fine

proud basin
#

let me test it

heavy perch
#

Quick Question, does PlayerMoveEvent really does have a serious impact on memory?

unreal quartz
#

depends what u do with it

proud basin
#

Store the players movement location everytime they move 🧠

heavy perch
#

It really does depend if I use in-memory info against file info or database info huh

slow oyster
#

Is that okay?

worldly ingot
#

Your CB might be out of date. I would say pull, copy the code that you've edited in that patch, run applyPatches again (so as to update your files to the latest version of CB), then re-paste in your edited code

#

If that snippet still shows, you're probably fine, might just be weirdness with Git's patches

#

PES_Think Is moss being bonemealed not caught by Bukkit?

#

I see no patch in the block and it looks to me like a BlockFormEvent isn't called (just based on source code, I've not tested that)

patent horizon
#

can i copy and past pom.xml dependencies and repositories from java projects over to my kotlin project?

#

im extremely new to kotlin so im not 100% sure how compatible it is

proud basin
#

Is there a way to get a player from the EntityDamgeEvent? I tried casting player but that doesn't seem to work

patent horizon
#

it'd either be the entity or the attacker

worldly ingot
#

Depends on your context. You probably want to listen to an EntityDamageByEntityEvent and check the getDamager()

proud basin
#

entity

#

I don't want the attacker

patent horizon
#

you what the entity that's being attacked?

proud basin
#

yes

patent horizon
#

it's probably getVictim() or getDamaged()

worldly ingot
#

No, getEntity() is fine, just check if it's a player before you cast it

patent horizon
#

oh

#

my b

proud basin
#

ah

#

thats what I did wrong your right choco

#

I was casting the player before checking

worldly ingot
#

Yeah you can afaik, Wally. Kotlin can interact with Java libraries, to my knowledge

#

Though I'm no Kotlin aficionado, that's for sure

proud basin
#

hm they are still taking damage

#

ah I see why

#

the player is null

worldly ingot
#

From EntityDamageEvent? o.O #getEntity() will never be null

proud basin
#

well some how it is

#

and I can assure you that I probably did something wrong

candid galleon
#

code?

worldly ingot
#

I'd also be interested to see. You have to be doing something wrong KEKW

unreal quartz
#

you're probably using gradle if you're using kotlin though

proud basin
#
@EventHandler
    public void onEntityDamageEvent(EntityDamageEvent e) {
        PlayerData user = StuntCore.getInstance().getUser(e.getEntity().getName());
        if (e.getEntity() instanceof Player && user != null && (user.isFrozen()))
            e.setCancelled(true);
    }
candid galleon
#

you get a user with their name?

#

why not UUIDs?

proud basin
#

No reason to use their uuid

candid galleon
#

my guess is getUser is returning null

patent horizon
proud basin
#

no it works

wicked lake
worldly ingot
#

Yeah, the only thing that can do wrong there is the user being null (or isFrozen() not being accurate, one of two)

proud basin
#

The code works fine guys dw

worldly ingot
#

👀 but it doesn't. It's not cancelling

proud basin
#

it is

worldly ingot
#

Oh, so what was the issue? KEKW

wicked lake
#

That works then

worldly ingot
#

fwiw, a UUID is slightly faster than comparing a String though

proud basin
#

There is no issue

#

pff

#

what 0.1 second

worldly ingot
#

That adds up 👀

proud basin
#

no

#

just do String - 1 then boom its faster

#

if you want I can compare their uuid

#

I do have a method

candid galleon
#

using UUID is more conventional and standardized

#

there's no harm in using it afaik

#

it's more of a "why not"

proud basin
#

can't be bothered to change it all

slow oyster
#

@worldly ingot for some reason CheckStyle doesn't pick up the indent formatting issue, it seems to be okay with 2 space indents 🤷‍♂️

proud basin
#

james I don't think there is a need to always take him

candid galleon
#

for those that know about Gradle: is there a way I can copy the generated jar to another directory on build?

worldly ingot
#

Really? o.O Bukkit's Checkstyle should have a 4 space clause in there last I recall

proud basin
#

I had to make a batch file to do that ^

worldly ingot
#

I mean either way it should be 4 spaces to conform with the rest of the project, but I figured CS would catch it

sullen marlin
#

it doesnt check nms changes

slow oyster
#

It's a new event I added to Bukkit, IntelliJ defaulted to 2 space indents when creating the class but CheckStyle doesn't seem to pick it up?

#

So it's not NMS code

#

There's no 'IndentationCheck' in the CheckStyle config for Bukkit

worldly ingot
#

Yeah this is Bukkit, not CB

#

You're right. There's just a tab clause

swift adder
#

Can someone send their source code for their plugin

patent horizon
#

whats the best kotlin tut around

swift adder
#

That one

worldly ingot
#

Alchema is probably the more interesting one tbh

patent horizon
#

oh no way choco you made the veinminer plugin?

worldly ingot
#

(RE: oofergang, not Wally, lol sorry)

#

Yeah

#

Long while ago. Needs some refactoring. The code isn't super pretty

patent horizon
#

i use that all the time on my smp lol

slow oyster
#

Seems like this would work for the checkstyle: <module name="Indentation"> <property name="basicOffset" value="4"/> <property name="lineWrappingIndentation" value="4"/> <property name="arrayInitIndent" value="4"/> </module>

patent horizon
#

i guess you're to blame for my constant in game hunger

worldly ingot
#

I'd say just the first one would be fine, james. Not sure the line wrap or array init are super necessary because Bukkit avoids both of those wherever possible

#

Either md can add that one to the checkstyle or you can PR it I guess

slow oyster
#

Yeah I was just thinking that, it seems to work with just the first line

#

Ah, it doesn't like the switch statement style used in a lot of classes:

quaint mantle
#

switch expression broooo

slow oyster
#

?

quaint mantle
#
switch (face) {
    case Monkey -> SHOUT SHOUT MORE;
}```
#

it should be like that

#

idk the arrow is correct or not

slow oyster
#

Oh, this is just a Bukkit class, most of Bukkit is still just Java 8 I assume

quaint mantle
#

oh i remember something, even after updated to java 16, then java 17, but the readme in both bukkit and craftbukkit (maybe including spigot idk) still havent change their contents lol

slow oyster
#

As in, Java 8 style with none of the new language features

quaint mantle
#

like they say they still using java 8, etc.

slow oyster
#

Oh really, I may have used a 'var' in CraftBukkit 🤔

#

Are we supposed to be sticking to Java 8 lang features then in CraftBukkit/Bukkit?

quaint mantle
#

dunno

slow oyster
#

Gotcha, the readme does still say Although the minimum requirement for compilation & usage is Java 8, we prefer all contributions to be written in Java 7 style code unless there is a compelling reason otherwise. Though tbf 😛

ivory sleet
#

Hmm well

#

There are a lot of additions using functional interfaces for instance

young knoll
#

Isn’t that 8

ivory sleet
#

Yes but readme says 7

#

👀

young knoll
#

Minimum is 8

ivory sleet
#

"J7 style"

slow oyster
#

Gotcha, so var should be fine then 😛

young knoll
#

Maybe functional interfaces are a compelling enough reason

ivory sleet
#

Well I rarely use var

#

it’s almost never needed

slow oyster
#

Java 14+ features are really nice tbf, the new switch statements are really nice

ivory sleet
#

like I guess in a twr block smtng like try (var reader = …) {} is fine

#

Where the type inferred is conspicuous

young knoll
#

I don’t think I’ve ever used var

#

It’s a trap

ivory sleet
#

Yeah

slow oyster
#

I used it in PlayerConnection.java instead of writing out the fully qualified package name: var event = new org.bukkit.event.inventory.InventoryRecipeBookEvent(this.player.containerMenu.getBukkitView(), irecipe.toBukkitRecipe(), packetplayinautorecipe.isShiftDown());

ivory sleet
#

Like people use it for anonymous derivatives type exposure

#

But thats scarcely needed

oblique wigeon
#

I'm adding attributes to items using attribute modifiers, but how can I make it so that the attribute simply sets the value, instead of modifying it with a operation? (this would be similar to the default attributes, examples being tools (attack speed of 1, not +1))

slow oyster
#

It just saves the line being the width of my monitor, and saves having to add an import into that patch 😄

ivory sleet
#

I mean you could extract some more explanatory variables also there

ivory sleet
#

boolean isShift = packetplayinautorecipe.isShiftDown();

#

Then just pass isShift

#

¯_(ツ)_/¯

slow oyster
#

I seem to remember choco saying not to do that when the call is only used once

ivory sleet
#

Idk, I usually do it regardless (not that I have ever prd spigot) but it does make the code a bit more readable like well written prose (:

young knoll
#

NMS patches should be minimal diff

slow oyster
#

Yeah, at work we would probably do it like that, but I suppose in Spigot you want to minimise the amount of patching

ivory sleet
#

Yeah

golden turret
#

how to check if ice becomes water?

slow oyster
#

Also, does anyone else get a crash when debugging CraftBukkit, at this method? Bukkit.getConsoleSender() is annotated with @NotNull but it returns null when run in Intellij, if you remove the annotation it works fine?

brazen hawk
#

Hi there, I'm looking to upgrade my plugin to be 1.18, however when compiling I'm presented this error. Any suggestions?

Required by:
    project : > org.spigotmc:spigot:1.18-R0.1-SNAPSHOT:20211130.174052-1

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html``` I can provide the build.gradle if needed
lavish hemlock
#

how can I add a suffix to a player's name?

#

note that, afaik, setDisplayName does not work with Player

#

at least, not for nametags

#

in fact actually I kind of need it to be nametag only

#

I'd use scoreboard objectives to display text under the player's name

unreal quartz
#

scoreboard

#

u can use teams

lavish hemlock
#

but unfortunately, that doesn't give me enough customization

#

can I use teams to display the suffix only on a player's nameplate/nametag?

#

y'know, the text that hovers above them

unreal quartz
#

yes

lavish hemlock
#

if so, I'd like some example code

#

oh good

#

the scoreboard APIs are a bit hard to understand so yeah I need an example, thanks

unreal quartz
#

currently on my phone so i don’t have one

#

i’m sure there are a lot of examples on google

lavish hemlock
#

I mean

#

I looked at it previously

unreal quartz
#

as thats where i probably yoinked it from when i made it

lavish hemlock
#

a lot of them are for 1.8 :p

#

oh huh

#

there's a wiki entry

#

nice

#

ah apparently there's a length limit?

#

I can work with that ig

quaint mantle
#

32 characters?

lavish hemlock
#

16 pre-1.13

#

64 post-1.13

#

there's also an interesting trick you can do to get 32 but it's not applicable to my situation

neat trellis
#

i tried to update my plugin to 1.18 and I had a thing before to chect nbt but now it doesnt work, is there a new way or am i doing something wrong

net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
NBTTagCompound compound = (nmsItem.hasTag()) ? nmsItem.getTag() : new NBTTagCompound();
plain mauve
#

Hi, is there an event for when an Arrow entity dies (not despawns)? It is not in EntityDeathEvent. Thank you in advance

waxen plinth
#

Under what circumstances would you consider an arrow to have died

neat trellis
plain mauve
#

/minecraft:kill @e[type=minecraft:arrow]

#

@waxen plinth ^

waxen plinth
#

I don't think you can really test for that

plain mauve
#

Hmm... it's weird, I think Arrows are the only entity you can't test for. You can test for boats, item frames, minecarts, armor stands, etc. They all work with EntityDeathEvent or their own events

lavish hemlock
#

is the entity of an EntityDamageEvent always a LivingEntity?

plain mauve
#

Yes, I believe so

#

or, EntityDeathEvent at least is

#

I just checked -- killing an arrow isn't detected by EntityDamageEvent, sadly.

lavish hemlock
#

that's okay

#

I only really need to target mobs and players

#

so entities like arrows or paintings are not what I wanna target

tender shard
#

I need to access some plugins API which is only available for java 17. I need my .jar to be compiled with 1.8 though. ANY WAY I can achieve this without reflection? :/

lavish hemlock
#

take advantage of classloading

#

you can use a small amount of reflection to

#

reflectively run a method that sets up that newer plugin API if the MC version matches

#

the overhead will be minimum

tender shard
#

but yeah will be reflection then, it's just one method call anyway

#

I thought maybe there is some magic trick

lavish hemlock
#

I don't think there is anything you could do otherwise

sullen marlin
#

Compile with jdk17 but target 8

#

Doesn't seem hard?

tender shard
#

that works?

#

I didnt even know that was possible

#

warning: source release 17 requires target release 17

#
    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

At least that doesn't work :/

sullen marlin
#

Put source as 8 too

tender shard
#

oh lmao

#

thanks

#

I had no idea it was that easy

candid plover
#

do I need to use async to teleport a player to another location?

quaint mantle
#

no?

tender shard
quaint mantle
#

maybe you need it only when teleport too much players

tender shard
#

if you can, tp async

#

PaperLib has a method that falls back to synced TPing when running Spigot

candid plover
#

I want to develop a warp system, would it be necessary to use async?

quaint mantle
#

nah

#

i dont think so

tender shard
#

otherwise you can get lag spikes from chunk loading

#

as said, PaperLib will try to load chunks async if possible, then teleport the player. When you just use Player.teleport, the chunk gets instantly loaded IIRC

candid plover
#
            player.teleport(getLocation("cabin"));
        });```

Would that solve my problem?
#

A friend suggested this.

tender shard
#

no

#

either use PaperLib or use normal teleports

candid plover
tender shard
#

without that async task

candid plover
tender shard
#

it will either not work properly because you access the world api async / outside of the main thread, or it load the chunks on the main thread anyway

tender shard
#

you slow it down by instantly loading chunks from disk

candid plover
#

So will I use player.teleport that will be enough?

young knoll
#

PaperLib is probably better

#

But trying to do an async tp without it will probably just throw an exception

tender shard
#

PaperLib falls back to normal teleportig / chunk loading when not running paper

#

PaperLib is a tiny lib that must be shaded

#

so it will always work 🙂 on paper async, on spigot sync

#

anyone here knows how I can remove furniture I placed with oraxen? I can place it fine but there doesn't seem to be any method to remove it again 😄

candid plover
#

I want to develop a simple warp system for my server. Would it be better to do in file or in mysql?

#

simple /warp <local> and go to local.

tender shard
#

is it only for your server?

#

for a public publin you should probably offer both

candid plover
tender shard
#

then do it however you like. People will claim YAML files aren't meant for storage but you don't have to save that file every second, just load it on startup and save it on shutdown

#

unless you want to use SQL 😄

young knoll
tender shard
young knoll
#

Yes

wicked lake
young knoll
#

Persistent storage

wicked lake
leaden falcon
#

is there a way in spigot

#

to make

#

a custom shield which can:

#
  1. gets broken by other weapons, not just an axe
#
  1. customizable cooldown for how long until it reloads
drowsy helm
#

yes

young knoll
#

You generally cache sql to memory anyway

wicked lake
#

Hmm right

wicked bear
#

how would i go about making custom drops from an entity?

hybrid spoke
#

mysql or interbase >

hybrid spoke
wicked bear
#

thanks

mighty sparrow
#

Is there a way to get the memory usage of the server ?

#

As integer or other type

wicked lake
#

Runtime library

#

Runtime.getRuntime().usedMemory()
You'll need to convert to GB/MB as needed

mighty sparrow
#

Thanks a lot!

rough basin
#

Is it Possible to Change user's name only server?
I mean like what I see when I press tab

#

I want to make anonymous user plugin

young knoll
#

Player.setPlayerListName

rough basin
#

Nice

#

Thanks

worldly quest
#

could anyone tell me what the shaded version of the jar with maven is/the difference?

lavish hemlock
#

how do I get the value of a name tag (referring to the item Name Tag, I want to get the name embedded in the tag)

#

I haven't seen a TagMeta or anythin'

eternal night
#

Afaik it's just the items display name

lavish hemlock
#

oh, lol

#

but what if you rename the name tag- wait that-

#

yeah okay

knotty shell
#

(!craftTippedArrow.isVisualFire() || !craftTippedArrow.hasCustomEffects()) should tell me if an arrow is 'not' on fire or enchanted correct?

young knoll
#

Not on fire or has a potion effect

#

May still be enchanted

#

Also I think it uses the actual fire ticks, not visual fire

knotty shell
#

cant find a bool to test for this driving me nutz

young knoll
#

There isn’t really one

#

Use the shoot event to add a pdc tag to non-enchanted ones

knotty shell
#

Im trying to make sure its not, not allowing anything but just a plain arrow be touched

sacred prairie
#

does someone knows how to use the PacketPlayOutWorldParticles package, i try to spawn a large explosion particle

young knoll
#

What version

sacred prairie
#

1.17.1

young knoll
#

Use the API

sacred prairie
#

which api

young knoll
#

Spigot

#

Player.spawnParticle or World.spawnParticle

sacred prairie
#

ye, that dint work well

#

i try to summon with this package a sizeble particle, wgich is not possible with the spawnParticle() argument

#

:/

sullen marlin
#

false

#

every single thing you can do with a packet you can do with spawnParticle

#

because spawnParticle just makes a packet

sacred prairie
#

but i can only edit the speed and not the size, i tried it out, or i am wrong?

#

its not an dust particle so you cant use DustOptions

mellow gulch
sacred prairie
#

ok 😦

stone sinew
sacred prairie
#

no you can do a for loop for every online player

sullen marlin
stone sinew
stone sinew
sullen marlin
#

The methods are in World and Player

#

Take a guess which does what

stone sinew
#

I've used both lol.

quaint mantle
#

public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) args can be used to pass arguments and make decisions based on that right ?

sullen marlin
#

Yes

quaint mantle
#

Like I am currently making a kit command from the tutorial and am thinking of allowing the player to make choices based on existing kits

#

right thanks

ionic reef
ionic reef
#

oh

#

crap

#

forgot about that part

#

LMFAO

#

sorry man

#

wait hangon I think i maybe have?

#

will run again to double check

chrome beacon
#

Also remove the spigot api for 1.18.1

wicked lake
#

Also you don't need both spigot-api and spigot in dependencies, spigot contains spigot-api

ionic reef
#

oh right ty

#

will re-run build tools & see how I go

wicked lake
#

Recommend updating to 1.18.1 in general, to fix the log4j issue

chrome beacon
#

It should be fixed in 1.18 as well

rustic jay
#

buenas un developer q me pieda ayudar en mi server pago por configurar

chrome beacon
#

English please

#

But if I understand correctly...

#

?services

undone axleBOT
rustic jay
#

Well, a developer who can help me with my server, I pay to configure

ionic reef
wicked lake
#

Are you running buildtools to get 1.18.1? Your references in pom are for 1.18

cold field
#

Hi guys, does anyone know an annotation processor for brigadier? I've created a lib that exposes brigadier and know I need to build my command

ionic reef
#

probably that

#

bruh

#

welp there we go

#

oh now theres a new error

ionic reef
wicked lake
#

Run buildtools with the --remapped flag

ionic reef
wicked lake
#

Here's the command I used to do it a while ago

#

So yes

#

A note for the new version - naming scheme for NMS entities has changed somewhat from "EntityWolf" to "Wolf" just make sure you're importing the right thing

ionic reef
#

ah right ty

#

dont think i've messed with any entities in this specific plugin im trying to update

#

but good to know

quaint mantle
#

btw when you want to offer any service dont advertise it here

#

there is a datawatcher.watch method in 1.8

#

but wath is it in 1.9+ ?

#

getDataWatcher().watch(10, (byte) 127); is in 1.8

#

is getDataWatcher().set(DataWatcherRegistry.a.a(10), (byte) 127); correct in 1.9+ ?

ionic reef
#

but not saying an error anymore

#

just says 'Synced' or wtever'

wicked lake
#

Can you refresh maven now without errors?

ionic reef
#

seems like it yeah

#

i cant build tho

wicked lake
#

Let's see the pom then

ionic reef
#

sure, 1 sec

#

nvm i think i can build

#

yep

wicked lake
#

Cool

ionic reef
#

the red line was just chilling there cos it can

#

restarted intellij and it went away lmao

zealous aurora
#

p

wicked lake
#

Enjoy the new version, make some cool stuff

ionic reef
#

cheers man

#

ty for your help

quaint mantle
#

i want to do this check but

#

i want to check by the name

#

like will this work ?

clever dawn
#

Is there a way to safe a String Array in a persistent data container just as an NBT-Array with NBT-Strings or do I have to have a custom container for every element in the array? (like lores are stored in NBT?)

tardy delta
#

Just a string

clever dawn
#

What?

tardy delta
#

You can save it as Persistent datatype.String[] iirc

clever dawn
#

Sure? I couldn't find a type like that in the PersistentDataTypes class

tardy delta
#

Hmm i don't have my ide

#

Maybe only primitive arrays

#

Or do something like Arrays.tostring

clever dawn
#

I don't want to use some sort of hack to save it in a way it shouldn't be saved. That will make it harder in case I want to manually edit it

tardy delta
#

That's no hack

#

You might considering saving it in a different way than

clever dawn
#

Well, a List of elements should probably be saved in a list, not just a string with some separator character.

clever dawn
#

But that data type doesn't seem to be available

wicked lake
#

Arrays.toString makes sense to me, the only difference is really how it's stored until ready to be used

tardy delta
#

You Cant save non primitives into the PDC except for string

sullen marlin
#

I mean you can

#

but you need to tell it how

tardy delta
#

In the form of bytearrays?

#

That goes brr

clever dawn
#

Yeah, it is possible. It's just not a great solution

#

Lists with String-Elements exist in normal NBT, but I don't think they are possible to represent with the PersistentDataContainer-API

#

Unless you can somehow take over the serialization of the entire data structure instead of just the value

tardy delta
#

Then i would consider using a database or something

ivory sleet
#

Even data structures are considered values

clever dawn
#

What would that look like?

tardy delta
#

Extending persistent datatype class prob

ivory sleet
#

Let me take a peek mcmdev

tardy delta
#

And writing An implementation

clever dawn
tardy delta
#

Smh stupid autocorrection

ivory sleet
#

But it’s definitely possible, maybe through having a PersistentDataType<String[],List<String>>

knotty shell
#

well figured out a way to know if an arrow is on fire or enchanted. dances

ivory sleet
#

I’ll hop on pc soon (can help more thoroughly then)

tardy delta
#

Conclure why not just a flat file or database?

ivory sleet
#

That’s up to him

tardy delta
#

PDC is meant to save small data right

#

Yea true

ivory sleet
clever dawn
ivory sleet
#

Yeah

#

Else go with simply byte[]

#

I actually don’t remember all the types

#

But ye str arr type might not be valid

clever dawn
#

I'm saving information on blocks at specific coordinates in the chunk.

ivory sleet
clever dawn
#

I'll give serializing my custom data structure into a byte array and saving that a shot, although I'd imagine it will get escaped

round finch
#

what does serializing mean?

ivory sleet
#

Hmm yeah, well you could always peek at how its done in nms

round finch
#

with configuration

ivory sleet
#

I don’t know the exact definition

#

But basically that you turn something into another form

round finch
#

what does Desterilizing and serializing do?

ivory sleet
#

For instance this other form can merely be representing the former form

#

But still enough representation such that you can turn the latter form back to the former form

ivory sleet
#

then we might want to save it down to a file

#

However the file does not on its own know anything about my object which lives on the heap

#

so we have to serialize it to a format such that it can be written into the file

lavish hemlock
#

b a b y f a c t o r y

round finch
#

does it have a parent class?

ivory sleet
#

👀

lavish hemlock
#

And then deserialization is essentially the reverse of that, taking that format and reading it into an instance.

round finch
lavish hemlock
#

To describe it in the simplest way possible.
Serialization/deserialization is just converting between in-heap objects and other formats.

lavish hemlock
ivory sleet
#

Yeah basically any class which implements it serializes complex objects into a Map<String,Object>

#

Where Object must be another Map<String,Object> or a boxed primitive or String iirc

round finch
#

it was made me wonder what it mean back then i started coding

clever dawn
#

Serializing my custom NBT into a byte array and saving that didn't work. It got escaped. (as I would have guessed)

ivory sleet
#

I’ll give it a try mcmdev

round finch
#

someone explained it like a balloon with hot air and you release some of the hot air from the balloon

ivory sleet
round finch
#

that made actually made me think like wtf did it even mean

lavish hemlock
round finch
#

@lavish hemlock is Rust a Programming language? XD

lavish hemlock
#

yeah

lavish hemlock
#

C

#

but nothing like C

#

but also better than C or C++

round finch
#

going to learn about deserialization

#

in some video or website

round finch
#

did you know C# is faster

lavish hemlock
#

it can be about as fast or even faster than C (an already incredibly fast language)

#

it has a lot of QoL features for developers so you don't have to spend so much time writing code

#

(e.g. macros, proc macros)

#

it gives you the ability to be safe or unsafe with your code via the Safe/Unsafe Rust principles

lavish hemlock
round finch
#

BabyFac...

lavish hemlock
#

ah

tardy delta
#

🥶

lavish hemlock
#

there was no optimization applied to the compilation

#

that's why it's slower than C#

round finch
#

why choosing Rust?

lavish hemlock
#

since C# JITs to low-level, which is automatically optimized

lavish hemlock
#
This is not how you benchmark a program that runs in a just-in-time compiled environment. You first have to warmup the C# application to get real results.
You also did not turn on optimizations for the native code.
These are very misleading and meaingless results.
round finch
#

i heard the compiler can make a difference

lavish hemlock
#

commenter summed it up

wooden fable
#

[11:39:33] [Server thread/ERROR]: Error occurred while enabling LostKingdomDSRV v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.branchyz.LostKingdomDSRV.LostKingdomDSRV.getCommand(String)" is null
name: LostKingdomDSRV
version: '${project.version}'
main: me.branchyz.LostKingdomDSRV.LostKingdomDSRV
api-version: 1.17
depend: [PlaceholderAPI, KingdomCraft, DiscordSRV]
authors: [LostKingdom, Branchyz]
description: LostKingdomDSRV
commands:
  lock:
    description: Met deze command kan je je trust lijst beheren!
  setupkingdomdsrv:
    description: Temp Command

Why does it give this error?

chrome beacon
#

Show code

#

?paste

undone axleBOT
wooden fable
#
        getCommand("setupkingdomdsrv ").setExecutor(new SetupKingdomDSRVCommand());

In onEnable();

#

wait there is a space

lavish hemlock
#

ah so basically

sacred prairie
#

ye

lavish hemlock
#

JITed C# is about as fast as O2 C

#

lol

sacred prairie
#

English 1+ xD

dire ocean
#

Hey all, I'm trying to make spawners drop when they are broken, the issue I'm running into is that the spawner is always stripped of its mob type (i.e. Zombie spawner will drop a pig spawner)

sacred prairie
#

i dont know if you can set the spawner type with nbt data

round finch
#

you can set nbt data and on place event

#

you can changed placed spawner

#

All i know it is possible to set Data and on blocks and Items

dire ocean
#

So I just set (custom?) nbt data and check for that data once its placed? Haven't worked much with nbt data before

sacred prairie
#

i love to use Persistent Data Containers

round finch
#

i forgot what it was called

sacred prairie
#

you can set for example strings in an item

#

like zombie for a zombie spawner

dire ocean
#

Alrighties! I'll give it a go, thanks

round finch
#

wait would be a great idea to save the data and put it on the Spawner?

sacred prairie
#

ye

#

you can copie the data of the block in the item if this is possible

round finch
#

then set data on placement

sacred prairie
#

i never realy worked with block

round finch
#

i never done it myself

indigo sage
#

Is handling configs with a plugin a good idea?

ivory sleet
#

wym by handling configs?

indigo sage
#

Modifying configs of plugins using a plugin

ivory sleet
#

Well

sacred prairie
#

do you mean something like settings

ivory sleet
#

I'd say no

#

because when you save (to a yaml file), the comments might get removed

round finch
#

get should still work

ivory sleet
#

yes

round finch
#

without any change

ivory sleet
#

then its no modification

eternal oxide
#

Use the plugins API if it has one, before going for its data files.

round finch
#

wut about the set?

indigo sage
#

Can you just get comments using the Spigot API?

ivory sleet
#

no

#

because yaml specs sucks

#

or well

#

snakeyaml and eo yaml do have some support for comments

#

altho limited

#

Idk if spigot uses a version of snake yaml where comments are supported for nodes tho

indigo sage
#

Or else I assume you could loop through a config line by line store the lines starting with # and store it somewhere else then after modification put it back where it's supposed to be

ivory sleet
#

not always

eternal oxide
#

You can, btu its not easy

ivory sleet
#

because the order of which the nodes are can change

#

and any node could be removed from said document at any given point of time

#

it is even stated by the spec that comments are merely there to explain the node structure

#

nothing else

ivory sleet
eternal oxide
#

no its definately not

eternal oxide
#

it actually saves the yaml twice

#

first time with no comments, then it parses it and adds back comments

mortal arrow
#

hey everyone

#

i have an issue running an mc server on google colab

#

how can i set up ngrok?

ivory sleet
#

just to demonstrate how messy it is:

#valid comment
--- #valid comment
#valid comment
Time: 2001-11-23 15:01:42 -5 #valid comment
#valid comment
User: ed #valid comment
#valid comment
Warning: #valid comment
#valid comment
  This is an error message #valid comment
#valid comment
  for the log file #valid comment
#valid comment
--- #valid comment
#valid comment
Time: 2001-11-23 15:02:31 -5 #valid comment
#valid comment
User: ed #valid comment
#valid comment
Warning: #valid comment
  A slightly different error #valid comment
#valid comment
  message. #valid comment
#valid comment
--- #valid comment
#valid comment
Date: 2001-11-23 15:03:17 -5 #valid comment
#valid comment
User: ed #valid comment
#valid comment
Fatal: #valid comment
#valid comment
  Unknown variable "bar" #valid comment
#valid comment
Stack: #valid comment
#valid comment
- file: TopClass.py #valid comment
#valid comment
  line: 23 #valid comment
#valid comment
  code: | #valid comment
#valid comment
    x = MoreObject("345\n") #valid comment
#valid comment
- file: MoreClass.py #valid comment
#valid comment
  line: 58 #valid comment
#valid comment
  code: |- #valid comment
#valid comment
    foo = bar #valid comment
#valid comment
round finch
#

is google colab linux based?

mortal arrow
#

idk it uses python

#

Google Colab runs on a Linux-based hosted machine. So we can run Linux commands on it directly. It is easy and throttles download speeds

#

yeah it does

round finch
mortal arrow
round finch
#

you can also change eu to us

#

that is the command to open port

mortal arrow
#

wait how do i run ngrok in it?

round finch
#

./ is for linux

#

for windows it is just ngrok without ./

mortal arrow
#

well

#

NameError Traceback (most recent call last)
<ipython-input-15-652ba67a9216> in <module>()
----> 1 ngrok(tcp, -region, eu, 25565)

NameError: name 'ngrok' is not defined

indigo sage
mortal arrow
#

it seems to be only working on python @round finch

round finch
#

you use the command on the ngrok program

#

first register token ./ngrok authtoken (token)

round finch
mortal arrow
#

nope

remote gazelle
#

is there any reliable way to check if player is on ground?

eternal oxide
#

not really

#

Mojang allows the client to set teh value

remote gazelle
#

than can't i calculate like how client do it?

eternal oxide
#

You could, test for a block under the player, or the player is crouched and has no Y component to their velocity

candid galleon
#

on ground detection can be pretty finicky

#

you could also check if the client is obviously lying

#

like if the client says they’re on the ground but they’re also flying, falling, swimming, etc.

golden turret
tender shard
#

why does this even compile

sick portal
#

Hello, is there a way to have server.properties file without opening it manually ?
I'm trying to read the world name

tardy delta
#

To read it without opening it manually? Yes

lavish hemlock
tender shard
#

oh no because I am stupid lmao

wooden fable
tardy delta
#

Hem im too

wooden fable
#

Nice

tender shard
tardy delta
#

File reader?

#

Inputstream better

tender shard
#

so you DO open it manually

#

they probably looked for a way to avoid reading the file yourself

tardy delta
#

You don't open it manually?

#

Do you ever click on it with an inputstream?

tender shard
#

You understand what I mean...

tardy delta
#

Ah not really

tender shard
#

like you can get spigot's configuration with Bukkit.spigot().getConfig(), they asked for a similar way for the server.properties file

#

so

#

without loading that file on your own but using a built in spigot way

tardy delta
#

Ah idk if there is

tender shard
#

there is probably using NMS but at that point, of course reading the file again is ofc easier 😄

tacit drift
#

that's why it works

left swift
#

Hi, im coding using intellij and maven, but i have one problem. When i'm debugging the stacktrace is not parse to my code. Is it possible to match this?

trail pilot
#

why

#

boost dont give me perks 😦

#

in this server

royal vale
#

How to set or remove and add players to the tablist. I've figured out how to add them, just not how to remove them

tender shard
tender shard
left swift
#

for example at net.minecraft.world.entity.ai.attributes.AttributeMapBase.a(SourceFile:48), when i click it it show me that, why?

limpid dew
#

anyone have a hypixel friends plug-in? that works?

left swift
limpid dew
#

o ok

#

thanks

tender shard
#

with console, do you mean the intellij console output or the ingame console?

left swift
#

I guess it doesn't matter, because in both cases I have the same console when debugging

#

but currently i'm working on intellij console

tender shard
#

then you run a different .jar than the one you're compiling against

left swift
royal vale
tender shard
#

otherwise you would have matching stacktraces

swift adder
#

How could I do a random selection of a variable in lua?

tardy delta
#

lua??

swift adder
#

Nevermind

#

I found it

#

local randomNumber1 = math.random(1, 10) --Returns a number between 1 and 10.
local randomNumber2 = math.random(10) --Also returns a number between 1 and 10.

print(randomNumber1, randomNumber2) --OUTPUT EXAMPLE: "6, 8"

swift adder
#

I make spigot plugins in java.

#

Nevermind I didn't find what I needed

#

😠

left swift
golden turret
#
    private static boolean isInAABB(Vector vector, Vector min, Vector max) {
        boolean x = vector.getX() >= min.getX() && vector.getX() <= max.getX();
        boolean y = vector.getY() >= min.getY() && vector.getY() <= max.getY();
        boolean z = vector.getZ() >= min.getZ() && vector.getZ() <= max.getZ();
        System.out.println(x + " " + y + " " + z);
        return x && y && z;
    }``` help!
sacred ice
#

Its a cube right?

buoyant viper
#

looks like its not properly min/max'ed

sacred ice
#

Try short the values before

#

sort*

#

to get the real maximum and minimum

spiral bramble
glossy scroll
#

World is not loaded by spigot

spiral bramble
round finch
#

i ran the spigot build tool

#

but then put the jar into my library on eclipse it keep being red all the spigot stuff

eternal oxide
#

why are you not using maven?

round finch
eternal oxide
#

thats the wrong spigot jar for importing

round finch
#

is it?

#

where i get the right one

eternal oxide
#

in your BT folder, somewhere like spigot/target/libs or soemthing

round finch
#

Spigot build tool\Spigot\Spigot-API\target

#

Thank you!!

#

wow i can even look though the .java files

eternal oxide
#

for the server jar Spigot\Spigot-Server\target

#

teh spigot-1.18 jar is a boot loader now

tardy delta
#

what do they mean with this?

#

for hikaricp

#

i'm guessing i have to use HikariDatasource#setJdbcUrl()

#

instead of setDatsourceClassName

left swift
eternal oxide
#

server version and maven version will not affect a stacktrace from your plugin

#

if the stacktrace is saying an incorrect line number in your plugin then you didn;t update the plugin jar on your server

left swift
eternal oxide
left swift
#

wait, stacktrace matches my code but not spigot api code. A plugin jar on the server is updated.

eternal oxide
#

then you are comparing the wrong spigot code

left swift
#

I click on debugging console links in intellij idea and it refers me to good class but bad line.

sacred prairie
#

I made an mobspawnevent for summoning my custom mob, the code for my Entity Spawn event is:

System.out.print("debug");
        if (!(event.getEntity() instanceof Animals)) {
            System.out.print("no aniaml");
            return;
        }
        if (event.getLocation().getBlock().isLiquid()) {
            System.out.print("water");
            return;
        }
        Random rand = new Random();
        int n = rand.nextInt(2);
        if (n == 1) {
            event.setCancelled(true);
            soulsheep sheep = new soulsheep(event.getLocation());
            WorldServer world = ((CraftWorld)event.getLocation().getWorld()).getHandle();
            world.addEntity(sheep);
            System.out.println(event.getLocation());
            
            
        }else {Bukkit.broadcastMessage("no");
            System.out.print("wrong number" + n);}
        }```
but the event only workes when i do /summon an animal, not an hostile mob. And then it repeats all the mobs it missed which got natural spawned
#

how can i fix this

#

the System.out.print are for debuging

tall dragon
#

when its not an animal, you return

#

here ```
if (!(event.getEntity() instanceof Animals)) {
System.out.print("no aniaml");
return;
}

sacred prairie
#

ye, i wanna that my custom mob have a chance to spawn insted of an animal

tall dragon
#

i see

sacred prairie
#

but it dosent work with natural generated animals, the arent detectet untill i summon with the command one

tall dragon
#

try creaturespawnevent

#

instead

sacred prairie
#

ok

#

nope it only activates if i do /summon and then it repeats all natural summoned cratures which are spawnt since the last /summon command

young knoll
#

Chunk gen mobs don’t trigger the event anymore

sacred prairie
#

why?

young knoll
#

Because of how chunk generation works

sacred prairie
#

:/

#

is there an chunk generate event or something

tall dragon
#

well there is a chunkloadevent

sacred prairie
#

but you arent able to filter the new generated mobs

round finch
#

if new Chunk generated then by Logic
no player yet been there

tall dragon
#

which u can use to get the entities

#

they should exist already in there

#

not sure though

sacred prairie
#

you can check if this chunk is a new chunk with event.isNewChunk()

#

sooooooo

#

i hope this thing will work

tall dragon
#

if its new it will not be populated said here

sacred prairie
#

but the entityspawnevent dosent get the new spawned mobs

tall dragon
#

nope

sacred prairie
#

so weard

tall dragon
#

ur just gonna need to see if the chunk has entities when generated

#

print it or something

sacred prairie
#

the entitys come in a list an i can make the randomisor thing with the .forEach() thing sooo i hope this will work

round finch
sacred prairie
#

ye ik

round finch
#

yeah randomization

tall dragon
#

ohh i guess i learn something new today

worldly ingot
#

Entities are loaded in chunks asynchronously from chunk loads so it needs its own separate event

#

Alternatives were to add callbacks to ChunkLoadEvent but it's not really as flexible

tall dragon
#

eh Choco on anther topic, do you happen to be good at Math?

worldly ingot
#

I mean I'm not bad at it but I'm no genius

round finch
tall dragon
round finch
#

i mean you can search for entity

#

and it will show you the possibilities

young knoll
#

EntitiesLoadEvent sounds weird

worldly ingot
#

Oh that sounds like a fun little math problem lol

tall dragon
#

ye it does doesnt it haha

round finch
#

org.bukkit.event.Event -org.bukkit.event.world.WorldEvent --org.bukkit.event.world.ChunkEvent ---org.bukkit.event.world.EntitiesLoadEvent

worldly ingot
#

Do you want a linear increase in price? Or one that gets increasingly more difficult? More exponential?

tall dragon
#

well exponentional would be perfect, but thats even more difficult than linear

worldly ingot
#

Could you perhaps use a quadratic bezier curve? You know points A and B, where A would be (0, 100), and B would be (1,000, 3,000,000), no?

#

Or I guess B would be C, B would actually be (0, 3,000,000)

#

t being your progress, x / 1000

swift adder
#

I downloaded intellij and the plugin for Minecraft and it says "cannot resolve org.spigotmc-api:1.18.1-R0.1-SNAPSHOT"

tall dragon
#

that does like it would give me a nice curve though looking at the visualization

worldly ingot
#

tbh it's not bad at all. You can run that equation three times, once for each axis

#

Oh wait it's one axis lmao ignore me

#

I'm thinking 3D space

tall dragon
#

so t is my current upgrade level then

worldly ingot
#

Yeah it's your progress towards it, so x/1000

#

Oh I guess you'd be able to just use x

#

If your other values aren't 0.0 - 1.0, then yeah

round finch
#

purchase _times

purchase _times * 100 = price?

tall dragon
#

but what would 0 < t < 1 even mean at the end of that formula

round finch
#

ahh you looking for nice curve my bad

worldly ingot
#

That's the range, from 0.0 to 1.0, so I guess it does require it to be /1000

tall dragon
#

would you be able to implement this formula in an example using my example values?

lethal knoll
#

@swift adder , using maven?

worldly ingot
#

I'm gonna give it a shot, hold on

swift adder
#

Yeah

tall dragon
#

aight thanks

lethal knoll
#

Did you try to install the dependencies?

swift adder
#

It tries to automatically

lethal knoll
#

send me your pom.xml

sacred prairie
#

guys i make progress