#help-development

1 messages · Page 388 of 1

minor fox
#

I must say it looks very impressive. Would they sue if it was free of charge though?

dry yacht
#

The API is free to use, but they rely on the fact that it's a pain in the ass to use their website and their search algorithm, which is why that would blow everything they offer out of the water.

pseudo hazel
#

anyways, I am working on my plugin and want to do some minigame using player Statistics, now the question I have is how would I make a system that can keep track of a certain statistic for each world per player of the game. my first solution is to use a map of the players current progress and their actual statistic progress as determined by the server to compare them and get the progress for the game, but idk if there is a better solution

#

and if there is a way to reset a player's statistics

quaint mantle
#

depends on how you store them.

pseudo hazel
#

lets say I have a task like mine 10 stone

#

then the player might already have an existing amount of stone mined on the server from another source, so I dont want to count that

dry yacht
#

You're going to need to track your progress separately anyways.

quaint mantle
#

just listen to block break events?

pseudo hazel
#

thats just an example

dry yacht
#

If you want to scope them per world, you're going to just have one progress listener per target world, which stores the progress on it's instance. You can later persist these.

pseudo hazel
#

but how do I listen for progress on a statistic

torpid blaze
#

Hey, Many Servers have signs in the lobby to join a specific Minigame. But how do they comunicate between the minigame server and the lobby about the amount of players and when the game starts. Do they do that with Webhooks and if, is there another way to to this?

dry yacht
pseudo hazel
#

I want to able to use all statistics, and the event is not sufficient

quaint mantle
pseudo hazel
#

and it doesnt help thats its not documented what statistics it does and does not keep track of

quaint mantle
#

minecraft servers do display the amount of players currently online when you ping them.

pseudo hazel
#

I am talking about teh PlayerStatisticsIncrementEvent or smth like that

pseudo hazel
#

yes those statistics

quaint mantle
#

you know in the server list for your client where you can see the number of players online per server?

mortal hare
#

Man there are so many brigadier goodies just locked outside from bukkit api

quaint mantle
#

what is that?

mortal hare
#

mojang internal command api

#

Bukkit api wraps it so primitively

#

but its for backwards compat

dry yacht
# pseudo hazel yes those statistics

Yeah, those are scoped per world already, if I read that correctly. So you'd have to define some t0 point in time, from which you count, so you know what to subtract later on. Then, you'd just need to listen to the PlayerStatisticIncrementEvent.

pseudo hazel
#

I doubt they are tracked per world

#

well actually

dry yacht
pseudo hazel
#

idk how does minecraft know what nether and end belong to which overworld

dry yacht
#

Maybe they just misuse "world" for all worlds, don't know, you'd have to test

icy beacon
#

is PlayerLeaveEvent called when the server shuts down? if so, is there a way to detect that?

dry yacht
quaint mantle
pseudo hazel
#

well yeah lets take singleplayer for example

#

it would just have statistics for all 3 worlds in the same menu

#

but I know in singleplayer it might work a little different

dry yacht
dry yacht
pseudo hazel
#

well its wrong

#

in the docs it says it doesnt post for stats like distance walked

#

which makes sense

#

since its measured in cm

dry yacht
#

Otherwise, you could check raw GameEvents

pseudo hazel
#

meaning it would overrun the whole event system xD

#

no gameevent doesnt have all cases

#

well I guess I will make something complicated again xD

#

here I go with my "simple" ideas

dry yacht
vast raven
#

Hi, I've got a question, I'm placing a blocking using setType(), the problem is: since I'm in legacy and I need a Fern Itemstack, I've to set the material to LONG_GRASS and a durability in the ItemStack constructor to get the Fern, but if I change the block using setType(fern.getType()), he would get LONG_GRASS as type

thorn crypt
#

Hey, so I used your code and it work pretty well, just that I can't break blocks because the slime is little bigger than the blocks, and when I try to change the size, it's a too small, is there any way to fix it ?

vast raven
pseudo hazel
dry yacht
dry yacht
lost matrix
pseudo hazel
#

well I decided to use a timer to check for them periodically as I dont need it to be precise to the same tick or whatever

#

I already use a timer for the game itself that ticks every second

chrome beacon
pseudo hazel
#

and I dont need to check all stats for every game, just a subset

dry yacht
pseudo hazel
#

at most its 36 statistics per player

#

and most probably being the ones that can be tracked using the event

lost matrix
chrome beacon
#

Head is visible

#

Forgot about that

dry yacht
thorn crypt
heady spruce
#

How can I check if someone has made an rod crit to an player (im on 1.8.9)

For anyone that doesn't know what an rod crit is, its bassicly an player rods another player, then instantly switches to the sword and give the enemy an crit hit. This will then double the damage taken to the enemy.

pseudo hazel
#

I see, thanks for the help though 😄

thorn crypt
lost matrix
thorn crypt
lost matrix
#

?1.8

undone axleBOT
vast raven
#

btw I'm using 1.12.2, 1.8 def sucks

lost matrix
rough drift
#

Can I just 100% disable world gen?

chrome beacon
#

Make your own world generator that returns empty chunks

rough drift
#

Yeah but I just need to disable the minecraft:world gen

chrome beacon
#

Or if you don't want more chunks set the world border

lost matrix
# vast raven Wait, wdym

In legacy versions blocks have magic values. Some int which defines which variant the block is.
I think you need to set this value to something.

vast raven
#

That's what I was looking for, now it's googling time for these "magic values"

#

I didn't even know the existence of them

dry yacht
pseudo hazel
#

hmm

#

i see

dry yacht
#

Because it's really spammy. I kinda underestimated that, xD

pseudo hazel
#

yeah I figured

eternal oxide
#

less spammy than the move event

dry yacht
pseudo hazel
#

well...

lost matrix
thorn crypt
lost matrix
#

Wait isnt there a StatisticChangeEvent already?

dry yacht
dry yacht
lost matrix
#

Ah i see

#

Triggered

dry yacht
#

Well, that's just my own notation of <parent>__<member>. Ideas for improvement are always welcome, :).

lost matrix
#

How does this work internally because this looks hella expensive

dry yacht
#

What looks expensive?

#

It just checks for the invoked method name and extracts the required information from the args if applicable, and always routes back to the vanilla map. No idea how the proxy works under the hood tho.

lost matrix
#

The anonymous class you pass there

dry yacht
#

That's the java.lang.reflect.InvocationHandler, which in essence is an interface with just a single method.

lost matrix
#

Well all you can hope is that the JIT compiles your method invocations fast...

dry yacht
#

Oh, you're talking about the overhead I add to calling methods on the map because of the reflection "relay"?

lost matrix
#

As well as getting the method handle in the first place, which is not cheap

dry yacht
#

Not sure if I understand what you're getting at, because both method handles are known. The proxy (very likely) caches those, so the only overhead is using reflect to call methods, instead of "native" calls.

quiet ice
#

those are MethodHandles, right?

#

Not reflection Methods?

lost matrix
#

I think InvocationHandler uses java lang reflect Methods

dry yacht
#

They are reflection methods, not my wrappers, as the proxy only operates on java lang stuff. My wrappers don't add any cost either tho, they are just singleton wrappers which add separate features

quiet ice
#

Good thing for you that reflection now uses method handles internally

dry yacht
#

Oh, so you're talking about something entirely different

quiet ice
#

But for older versions that is a performance issue irrespective of whether they are cached

lost matrix
#

Cached methods still have an overhead

quiet ice
#

I myself generally make such proxies through just a wee little bit of ASM

lost matrix
#

Man i really need to jmh benchmark method invocations in newer versions

dry yacht
#

All I can say is that I expect the Proxy to behave as efficient as possible, and that I don't know of any other way to get called whenever a map is being modified, xD.

I don't think the overhead is of any significance, but I guess a little timing wouldn't hurt.

dry yacht
lost matrix
#

Well method invocations in java 8 could be from anywhere between 20x and 100x slower

#

*Pre JIT

dry yacht
#

The thing is that I'd guess that they do quite some optimization under the hood. It's not like these are two dynamically fetched methods, both of them are known and this is the application for a Proxy.

quiet ice
#

I wouldn't be too surprised if there aren't any optimisations for Proxy

dry yacht
quiet ice
#

the worst thing is one knowing how a method descriptor works and knowing that doubles are longs are of computational category 2 and thus occupy 2 slots in the local variable table

#

(doubles and longs are the worst thing to happen to JVM bytecode tbh)

gloomy gust
#

Bson not being built into plugin jar

small hawk
#

Is there a method to grab how much time of ban left from the banned-players file ?

tardy delta
#

banentries

dry yacht
#
2.789042ms
10.712125ms

First is 1M calls without the proxy, second is 1M calls with the proxy just rerouting, not doing any additional work. I guess it would be fine for what I used it for, but it's really hardly optimized.

finite grail
#

hello, someone unaware of me changed my e-mail address and password

haughty storm
#

How do you spawn a FakePlayer using nms? in 1.19.2

onyx fjord
#

do bungee and spigot share any object of message receiver (something like commandsender)?

quaint tapir
#

How do I get the direction the player is facing using spigot

lost matrix
quaint tapir
#

How do I get the direction the player is facing using spigot

lost matrix
quaint tapir
#

as a vector

lost matrix
#

getEyeLocation().getDirection()

eternal oxide
#

player body or head facing?

quaint tapir
#

head facing

#

thank you

quiet ice
lost matrix
#
Benchmark                                 Mode  Cnt   Score   Error  Units
ReflectionBenchmark.callMethodPublic      avgt    5   0,987 ± 0,003  ns/op
ReflectionBenchmark.handleMethodPrivate   avgt    5   3,851 ± 0,006  ns/op
ReflectionBenchmark.handleMethodPublic    avgt    5   3,908 ± 0,210  ns/op
ReflectionBenchmark.reflectMethodPrivate  avgt    5  16,220 ± 1,851  ns/op
ReflectionBenchmark.reflectMethodPublic   avgt    5  15,788 ± 0,993  ns/op

Well not as bad as i expected honestly. This is small sample for java 17.0.2 and only 1 fork but still a visible diff.

ivory depot
#

Hi, i want count all items from custom itemstack in inventory, java public int amount(Player p){ int amount=0; for (ItemStack is : p.getInventory().all(coin.coin()).values()) { //gets all Stacks with the specific Material //checks, if the damage is correct amount = amount + is.getAmount(); //adds the amount of the stack to the counter amoun } return amount; } this every time returns 0

quaint mantle
#

?java

#

?j

quiet ice
quaint mantle
#

?learnjava

undone axleBOT
quiet ice
#

Although, I guess that even in the real world you won't reflect that often. The method bodies themselves will make up most of the difference

lost matrix
#

Usually you dont want to reflect at all... At least not like that. Only for meta programming and you would use a lot of Annotations for that.

#

But yeah 15x is still quite a bit

lost matrix
charred blaze
#

someone link me bukkit schedulers

lost matrix
#

?scheduling

undone axleBOT
charred blaze
#

thx

ivory depot
lost matrix
ivory depot
#

okay, thx

tardy delta
#

Inventory#all(Predicate<ItemStack>) where \👀

rough drift
#

Parent.Child.update()

should I do something like this? (Rather than calling it ParentChild.update())

#

Just for style points tbh

tardy delta
#

what context

rough drift
#

It's mostly a utility class

#

well utility classes

#

And I have one utility that adds to another

pseudo hazel
#

usually utility classes if thats even a thing, dont use inheritance

rough drift
#

Yeah they don't

#

static classes

#

just wanted to know some naming for better context

#

rather than doing Parent.updateChild()

pseudo hazel
#

I usually have an update method on the child

rough drift
#

Mainly because Parent already has like 6 methods

#

don't want to make it responsible for Child as well

pseudo hazel
#

then dont make it a parent

graceful oak
#

Would anyone be able to point me in the direction of generating custom ores or even just changing vanilla ore generation? I have been trying to find anything to get me started but I cant seem to find anything.

pseudo hazel
#

since parents are responsible for its children

rough drift
#

I mean it's not exactly a parent, I just figured giving more context to a subset of methods would be sort of making it a parent/child thing

#

Where the methods are still technically of Parent, just wanted some better naming for em lmao

pseudo hazel
#

well then I would need to know the actual context since its a preference thing anyways

buoyant viper
pseudo hazel
#

it should xD

buoyant viper
#

some of these children get no parenting and it shows

rough drift
#

Well I figured naming it ParentChild would work better

pseudo hazel
#

but just like bad code it can fail

rough drift
#

no need to make a sub class

#

It's really like

#

NameCategory

tawny remnant
rough drift
#

but whatever

rough drift
tawny remnant
pseudo hazel
#

again, without context I cant give a better answer

rough drift
#

You can use the spawn method to apply things to the entity pre-spawn

rough drift
#

also

#

please store player and inventory into a variable

#

easier to read

#

and

#

@tawny remnant

#

FYI don't use lore to store enchantments

#

?pdc is a better alternative

rough drift
#

you can still display the enchantments in the lore, but you should really query from pdc

tawny remnant
rough drift
#

did the same thing as you

pseudo hazel
#

your loss

rough drift
#

maybe you can check some mc source and see how they do generation

pseudo hazel
#

people have to fail at it to see why it should be changed

rough drift
#

then apply that in a chunk generator

#

Might work

haughty storm
#

How can I deobfuscate nms so the method names arent a() or b()

rough drift
#

?buildtools is the way

undone axleBOT
rough drift
#

add --remapped to get deobfuscated

eternal oxide
#

?nms

rough drift
#

also that

graceful oak
rough drift
#

not made by me

#

uses NMS though

#

an easier way is on chunk load, if the chunk doesn't have a pdc key, set it and replace some part of stone with the ore

#

that way it only gens once

#

and is a bit easier to do

#

though it ain't the best way imho

#

oh wait yeah you can just use isNewChunk()

#

no need to store pdc

#

wait nvm

#

this is the thing that is meant to do block generation

#

you can use it to generate ores

graceful oak
#

ok thank you for all of this

frank kettle
#

Why do cats get affected by scoreboard teams prefixes/sufixes?

#

Cats or other tamed animals I guess

native nexus
#

Probably because the code is checking livingentities and not just a player

frank kettle
#

It's checking players

#

And then adds the player as a OfflinePlayer to the Team

native nexus
#

Do you have a snippet of the code?

frank kettle
#

I'm out right now but I can send in like 2 hours 😭😭

#

Someone sent me this from my server

wet breach
charred blaze
#

is there any event of potion drink?

#

is there any event of reborn with totem?

wet breach
wet breach
haughty storm
wet breach
#

check out the javadocs and search using the search bar

quaint tapir
#

how do I change the damage of an item
like the attack damage

wet breach
#

instead of just asking

wet breach
quaint tapir
#

sure

#

lets say I want to change the damage of a diamond sword to 3

wet breach
#

there is api stuff for changing attribute modifiers

quaint tapir
#

instead of 7

charred blaze
#

found it. but not by the javadocs (just asked the AI lol)

wet breach
#

ok I guess you can do that

wet breach
#

going to have to play around with the attribute modifier stuff

quaint tapir
#

thank you

wet breach
#

that isn't the only thing in regards to what I link

#

just a link to give you something to go in the right direction 😛

quaint tapir
#

meta.setAttributeModifiers(); I got this but I'm not sure what I put in for the item damage

#

meta is the ItemMeta for my item btw

tawny remnant
#

Is there any variable to get all the Online Players? (I'm trying to send a Title to all players)

echo basalt
#

Bukkit.getOnlinePlayers

dry yacht
eternal oxide
#

yep

quaint tapir
#

thank you

rough drift
haughty storm
#

because I used that cmd to run the buildtools but it still is obfuscated

rough drift
#

hm?

#

send your pom.xml

#

?paste it

undone axleBOT
haughty storm
hazy parrot
frank kettle
#

Not mine

#

Someone on my server

#

Is serb a bad name? 😳

ancient jackal
#

Yes it's cultural appropriation 🤓

grand magnet
#

?paste

undone axleBOT
grand magnet
rough drift
#

Plugin load and unload events?

zealous osprey
#

Is there an easy way of finding the changes between two inventories?

#

nvm, solved it

quaint tapir
#

is there a way to remove the displayed damage of a diamond sword

#

like so it doesn't say +7 damage

#

when I hover over it in inventory

dry yacht
#

You can only hide all attributes, don't think there's a selective way to do so

#

meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);

tawny remnant
remote swallow
#
Bukkit.getOnlinePlayers().foreach(player -> {
    player.sendTitle(stuff);
});
dry yacht
#

Or just don't obscure your code and use the real deal, xDD

remote swallow
echo basalt
#

ew forEach

coral kelp
#

. My idea is kinda like this so when a name tag is right clicked when holding it activates a command for example it creates the use who pressed it a tag

hybrid spoke
dry yacht
pseudo hazel
#

he is asking about your ide color theme

dry yacht
#

Oh, theme

#

omg, it's too late

dry yacht
hybrid spoke
mortal hare
#

what kind of monstrosity i've made

#

i've managed to hook brigadier to bukkit api

#

so basically to have a hybrid of both lmao

#

it doesnt use minecraft fallback prefix as you can see

#

wow

#

var x = 100; this is legal java declaration

#

since java 10

#

so basically i've had auto type from cpp and i didnt knew anything about it

dry yacht
#

I did something similar once, only difference being that I didn't go through hooking into brigadier, I just wrote my own little highlighter, xD.

dry yacht
mortal hare
#

it doesnt lose its type

#

as you can see intellij fully autocompletes that

tall dragon
#

i dont like em

dry yacht
#

Of course not, but the compiler - your best friend - won't complain anymore. If you call a function and store the result in a var, the only thing that matters is that all call sites using that variable still work. The underlying object could have changed to a point where it's not even assignable anymore. It obscures things, there's nothing good about it. I wouldn't look up to cpp features, as cpp is a steaming pile of shit and a huge featurecreep.

mortal hare
#

auto does work correctly on cpp

#

it just simplifies the type

dry yacht
#

...

mortal hare
#

it does compile the same as if I wrote it

#

if i had an compile time error

#

auto would also prevent that

#

at least in cpp

analog thicket
#
public class particleAnimation {

    public particleAnimation(Location loc, Player player){

        player.sendMessage(String.valueOf(loc));
        Location chestLoc = loc.add(0.5, 0.5, 0.5);

        Location particleLoc = chestLoc.clone().add(0, 2, 0);

        Vector direction = particleLoc.subtract(chestLoc).toVector();
        double distance = particleLoc.distance(chestLoc);

        for (double i = 0; i < distance; i += 0.1) {
            Location particle = chestLoc.clone().add(direction.clone().normalize().multiply(i));
            ParticleEffect.FLAME.display(particle);
        }
        new crateRewards(player);
    }
}

Why the hell does this make particles fly to the moon, and not just two blocks?

mortal hare
#

and multiplying each of the components of vector by 0 would return you a normalized vector of (0,0,0)

#

although im not sure

analog thicket
#

and particle loc is 107

#

106*

#

For some reason it sets the distance to 362??

mortal hare
#

what i mean is that your for loop starts at 0

analog thicket
#

hmm could be lemme try something else

mortal hare
#

you're multiplying by scalar value of 0

#

If a vector is multiplied by zero, the result is a zero vector (0,0,0).

analog thicket
#

I started it at 1 this time, still flying to the moon

#

Also it worked before when i didnt have it in its own class

mortal hare
#

can you output it?

sterile token
analog thicket
mortal hare
#

yea i just realised that the zero multiplication would work just fined here because you clone the objects

analog thicket
sterile token
#

thank you

mortal hare
sterile token
#

its really better reading now

analog thicket
analog thicket
sterile token
mortal hare
#

even assembly

#
mov eax, 1
sterile token
#

Also one recomendation for better coding, classes must be named using capital letters. Its specified on Java conventions and its pretty recommended to follow them

tardy delta
#

move 1 to accumulator registry?

#

just guessing

analog thicket
mortal hare
wet breach
#

but it helps to know what the size of i

#

is

#

because if its a large value that would explain why its going crazy

analog thicket
#

Yeah thats true, lemme just check

wet breach
#

also you don't check for negative values

analog thicket
#

Yep thats the problem

analog thicket
sterile token
mortal hare
#

no shit sherlock 😄

sterile token
#

no need to bully

mortal hare
#

soz

analog thicket
#

Arh, but yep i goes crazy

wet breach
#

Vector direction = particleLoc.subtract(chestLoc).toVector();
when subracting vectors, you can have a negative vector

sterile token
#

idk what im doing i had a too lang night i must be currently sleeping, i code whole night and didnt even go to sleep

sterile token
#

🤣

wet breach
sterile token
#

right

orchid gazelle
wet breach
#

Anyways, in either case, first should start with knowing what values it is obtaining

mortal hare
#

good thing i have uni lectures tomorrow at 12AM

orchid gazelle
#

But I know what im doing when coding at like 4am lol

wet breach
#

otherwise how else you suppose to check if the math is correct if we don't got any numbers 😛

sterile token
#

yeah that its the devs lifestyle, working too much, hard and sleeping few hours, sometimes not even sleeping

orchid gazelle
sterile token
orchid gazelle
#

Well I gotta get up at 6.30 and go to school at 7.05

analog thicket
#

How would i fix the "i" problem?

mortal hare
#

i've used to code till 3 AM and get up at 7AM

#

but i cant imagine doing this anymore

orchid gazelle
mortal hare
#

i felt like i was rotting from the inside

analog thicket
orchid gazelle
#

Show me your loop please

sterile token
orchid gazelle
#

And whats wrong about the loop?

mortal hare
#

well my school was 2km from my home location

orchid gazelle
#

It adds .1 each iteration and compares it to the distance

mortal hare
#

and i always went to it by foot

analog thicket
orchid gazelle
#

I am going 2km by foot too

coral kelp
#

can anyone make a rainbow animated text into a hex for me please?

orchid gazelle
#

And back

mortal hare
#

my man

wet breach
orchid gazelle
analog thicket
#

Dang im stupid it had .multiply at the end of the location "Particle"

mortal hare
#

i thought this want intentional as if you were trying to make the particle "accelerate"

analog thicket
#

Is there a .add instead of .multiply, because .add isnt it..

spare mason
#

how i can set an item to unstackable

coral kelp
#

How do I make items like a snowball have a rainbow animation running to the left

tawny remnant
undone axleBOT
low crow
#

hey im having a small problem with the buildtool, where can i find help about it ?

hazy parrot
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

coral kelp
#

How to I make animated rainbow hex?

#

How do I make items right click to run a command?

spare mason
#

how i can make that you can't have more than an specific quantity of an item

orchid gazelle
coral kelp
orchid gazelle
remote swallow
#

?events-api

#

?event-api

undone axleBOT
orchid gazelle
#

Please note that Copy-Pasting that won't make it work automaticly

coral kelp
orchid gazelle
#

Yes

coral kelp
#

Is it okay if you can show me an example in DMs or something please

orchid gazelle
#

No example for it, just gotta identify the nametag(idk how you specificly wanna do that) and run it based on that

coral kelp
#

Yes but I don’t want to effect the actual name tag

orchid gazelle
#

effect what?

coral kelp
#

So for example deluxetags I wanted to rename a name tag and then when players right click it runs a command giving the player the same name as that name tag

#

Then once right clicked disappeared

#

Wdym

#

Alright I’m new so I don’t even know where or how

#

Lmao

orchid gazelle
#

In the InteractEvent I told you

orchid gazelle
coral kelp
#

Your gonna know the answer lol 😂

remote swallow
coral kelp
#

Kinda it depend on how hard it is more hard it is I would pay

orchid gazelle
#

Thats very easy

#

If even

#

Yeah

coral kelp
#

Oh

orchid gazelle
coral kelp
#

Is it okay if someone made it for me?

undone axleBOT
remote swallow
#

never

low crow
#

Okay so i'm running the buildtool for 1.12.2 on java 8 with git bash on Win10 and im getting this error (look at the error's pastebin : https://pastebin.com/ipT8xGMW) and i checked the help post about it and it gives a solution for Linux users (see picture) but, the twist is, im on Windows and i can't seem to find anything about it for my situation, Im sure it's a dumb error but i cant find a solution hope you guys know smth about it

opaque scarab
#

Does it seem like a bad idea not to use a database for storing custom data for a player, such as their rank and wealth? Although it’s easier not to use such a system, are there dangers in using other methods?

coral kelp
#

Could you dm me link to the page when it’s uploaded?

orchid gazelle
opaque scarab
coral kelp
#

My deluxe tags won’t work with essentials chat for some reason

orchid gazelle
orchid gazelle
#

For things like ranks and wealth I would definitely use a database(in that case some SQL-engine like mariadb)

#

You can easily scale that and access data from different services like different servers, or even integration from lets say a discord bot or a website easily

coral kelp
#

So how easy would you is it to create rank papers for example

orchid gazelle
#

What is rank papers

coral kelp
#

So say just a paper saying like Rank Note: Owner for example then once right clicked it runs lp user group parent set but on the places that right clicked only

orchid gazelle
#

Another 5 minutes of work lol

coral kelp
#

Ah right I need to learn that will there be any tutorials on how to do item that when right clicked runs commands cause I searched it and it just comes up with like right click counter on Minecraft and stuff

orchid gazelle
#

You are supposed to learn java and then the bukkit API

#

Not randomly try out stuff you read by copy-pasting something someone wrote on some forum

mortal hare
#

tbh splitting it have some pros

#

it allows decoupling of the separate instances

#

you can disable these events anytime you want just by removing the specified class listener

#

but i would use GUI api anyways

dry yacht
#

Wohooo, first proper use-case of my parser, lol

wary harness
#

Is it possible to print out custom mesagge for missing dpendancy

#

not soft dependency

hazy parrot
#

get dependency api .. If null print message

torn shuttle
#

peer into my dark heart

#

I'm a bit of an artist

remote swallow
#

whats that meant to be

hazy parrot
#

I would assume hearth

remote swallow
#

looks like an engine

#

of some kind

mortal hare
#

it looks like a heart

#

real human heart

#

but without violet vessels

torn shuttle
#

yall just don't understand my art

#

it speaks to the darkness in my heart

remote swallow
#

a heart has more than 4 holes?

dry yacht
remote swallow
#

is my anatomy that bad

torn shuttle
#

the three vertical ones in a row are tied to the same artery

remote swallow
#

is that top thing not 2

torn shuttle
remote swallow
#

makes sense

#

does it beat

torn shuttle
#

only when you play dubstep

#

is there a way to spawn custom particles from a resource pack via the spigot api?

remote swallow
#

you can animate with bloch bench

torn shuttle
#

yeah I plan to

#

it's going to be a pain to do

mortal hare
#

does any of you know how brigadier colors work

#

i've been trying to research those but to no avail

#

ik they're somehow tied to parse type of client

#

but i cant replicate it

dim gulch
#

Hi. I know that this is probably a very common topic, but is there any plugin or other simple solution to keep entities active in a specific chunk? Something like /forceload x z, but to keep the entities loaded.

It can even be a fake player BOT placed under a farm to keep the nearby chunks entities loaded.

The way with BOTs and ProtocolLib seems quite complicated NGL. Something ready to use?

Thanks for help!

torn shuttle
#

@remote swallow

remote swallow
#

is that model based off a rabit

torn shuttle
#

no, it has no base

remote swallow
#

i see a rabbit

mortal hare
#

cooked one

mortal hare
torn shuttle
#

ngl making models is quite fun

fervent panther
#

Detecting when a block gets powered

torn shuttle
#

wish I had more time to do that

#

any ideas if it's possible to show custom particles somehow?

mint oracle
#

anyone looking for a plugin developer?

remote swallow
#

?services

undone axleBOT
torn shuttle
#

this would be a weird place to ask it for considering almost everyone here is a developer

#

or at least trying to become one

remote swallow
#

well if 90% of people that are in here are devs, here would be a good place to come for developers

hybrid spoke
#

i'm looking for customers

mortal hare
#

i cant replicate the argument coloring of brigadier no matter what

primal goblet
#

uhmm

mortal hare
#
        com.mojang.brigadier.tree.CommandNode<CommandSourceStack> bchildnode = Commands.literal("gg").then(Commands.argument("", DoubleArgumentType.doubleArg())).build();
        root.addChild(bchildnode);
#

results in

#

when native minecraft command /attribute achieves this:

#

i always get the cyan color no matter what

remote swallow
#

is it like param number colouring

mortal hare
#

i cant seem to grasp what's wrong

remote swallow
#

because the cyan is first on both

mortal hare
#

you see in attributes double is green

primal goblet
#

which is the best way to delete a world and reload it again (in case i edit the world's folder) cuz i have issues with load chunks, and the tps is so bad
btw, i can provide some code also

mortal hare
#

while in my example its cyan

mortal hare
remote swallow
#

its not basing it off the type

#

its basing it off where the arg is

#

if you add another arg to that command you might have it end up being yellow

mortal hare
#

but shouldnt player be gray then?

remote swallow
#

the first is literal

#

so its not a param they choose

#

it exists for them already

#

like how the get is gray

mortal hare
#

so its indepedent from arg type

remote swallow
#

yeah

remote swallow
#

im guessing there might be packets or some internal thing you have to modify for it to change

#

just hope its not client sided

dim gulch
#

Keep entities active in specific chunk

mortal hare
#

that's the thing, there's no field that i currently know inside wiki.vg that specifies anything like this

#

i initially thought this was controlled by their types

#

thanks for your help

#

you saved me lots of hours of research that would turn into nothing

#

🥲

primal goblet
#

i'm facing issue with my tps, when new world loaded the tps dead cuz of chunks

#

any can help?

mortal hare
#

preload them

graceful oak
#

Im trying to figure out how to change things with Minecraft chunk generation and im starting with just putting trees around the world. The reference video I found was from 10 years ago and I think im doing it correct with the new methods but I keep crashing I believe because I am trying to get a block that isn't generated in yet.

I am using populate and adding it to the worlds populators here is what I have so far

https://pastebin.com/WJ4tgus3

Im not sure exactly how the populate works but even if I add a way to check if the chunk is loaded in wouldn't the populate not run again since it would of had to run to crash in the first place?

primal goblet
mortal hare
#

worldborder plugin allows you to do that

#

pregenerated chunks would take more disk space, but cheap to compute

primal goblet
#

@mortal hare then i'm gonna ask is that normal?

#

is this will decrease the performance?

mortal hare
#

did you check for lag machines

primal goblet
#

the details for the lag spike

mortal hare
#

hmm

#

i cant really help you rn

#

sorry

primal goblet
#

sad

#

if someone can help, please let me know ur oponion

graceful oak
primal goblet
#

in range between 17 - 20

#

and i'm lagging so hard

#

its cuzing tp also

#

is thats not a development thing? cuz it happens to me when i try to copy a folder and load the world folder to spigot

#

so uhmm yep

vocal cloud
#

Is it because of a plugin you wrote?

primal goblet
#
new BukkitRunnable() {
            @Override
            public void run() {
                try {
                    for (World world : getServer().getWorlds()) {
                        if (world.getName().equalsIgnoreCase("sglobby-v1"))
                            continue;
                        getServer().unloadWorld(world, true);
                    }

                    for (Arena arena : arenas) {
                        if (new File(arena.getMapName()).isDirectory()) {
                            FileUtils.deleteDirectory(new File(arena.getMapName()));
                        }
                    }
            
                    for (DeathMatch dm : deathMatches) {
                        if (new File(dm.getMapName()).isDirectory()) {
                            FileUtils.deleteDirectory(new File(dm.getMapName()));
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                GameStatus.set(GameStatus.LOBBY);
            }
        }.runTaskLater(this, 20L);
``` this code will run in onEnable func
#

sglobby-v1 this map is the lobby so i need him

#
public synchronized boolean cloneUWU() {
        try {
            FileUtils.copyDirectory(new File("/minecraft/servers/SurvivalGames/maps/" + this.getMapName()), new File(this.getMapName()));
            World world = Bukkit.createWorld(new WorldCreator(this.getMapName()));
            if(world != null) {
                world.getSpawnLocation().getChunk().load();
            }
            return world != null;
        } catch (Exception e) {
            return false;
        }
    }
``` this function make the load and copy the world folder (skip the name please)
#

and i have a hard lag, and tp issues but i don't know why

terse ore
#

I don't know if I can ask here but is the most related, how could I get the player list of a server through a request?

#

when you reload the server in the server list you send a request for getting the player list, how could I replicate that?

terse ore
#

I want to send a request to the server directly

#

and tbh I have no idea how to do this

#

I would like a link or some resource if possible

primal goblet
graceful oak
#

Does anyone know if the BlockPopulator works with the newest version of spigot I might just be dumb but every time I keep trying to do something I am crashing / freezing my server does anyone know how to use it that I can ask questions to?

lost matrix
lost matrix
#

You can even try to do this with PostMan first

#

Actually let me try that

terse ore
lost matrix
#

Your JavaPlugin class?

#

This creates a new instance of your JavaPlugin class. That is not allowed. There can only one instance for this class
and its created by Spigot.

wet breach
#

seems like you should try it 🙂

echo basalt
#

?di

undone axleBOT
lost matrix
#

You need to pass around the instance you have in your onEnable method.

wet breach
#

either pass the instance or make a static method thing

#

either or works

#

typically should use DI though

knotty gale
#

Hi I am starting to make plugins, I just wanted to try to make a hello world plugin, but the import extends JavaPlugin on my main class isn't working. It doesn't give me an option to import. I have spigot 1.18.2 added as an external jar

young knoll
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

graceful oak
#

Im trying to learn how to change world gen with the populate and the depreciated one just comes with a chunk but the newer one comes with chunkX and chunkZ and I dont think im getting the chunk to change blocks correctly would anyone be able to help me out? Im just getting a frozen console when I start the server. I have more information here if anything doesnt make sense let me know https://www.spigotmc.org/threads/i-cant-get-blockpopulator-to-work.593659/

knotty gale
quaint mantle
#

uhh how does supporting multiple versions of mc for a plugin work?

late sonnet
knotty gale
young knoll
young knoll
graceful oak
young knoll
#

Yes

#

Also see its super interfaces

quaint mantle
graceful oak
#

So I would just need to check if it is in the region and if its not just return or am I dumb?

young knoll
#

Then it’s generally as simple as putting the lowest api version you want to support in plugin.yml and using that versions api when developing

#

Spigot is generally forwards compatible

#

Although if you want to support pre 1.13 and post 1.13 you may want to consider a library like xMaterial

graceful oak
# young knoll Yes

Sorry to keep bothering you but im still not quite understanding I see that I can use getBuffer to get an x and z coordinate but how would I use that to compare if I can change something in the chunk becuase if this is being ran wouldnt that mean the chunk is being generated also meaning that it would be too late to do what im doing?

lost matrix
young knoll
#

getBuffer tells you how far from the X and Z passed to the method you can safely modify

#

Well, how far away from that chunk actually

graceful oak
#

So I would multiple the chunkX and chunkZ and compare to the buffer to check if its safe to modify?

young knoll
#

The chunk at those coordinates should always be safe

#

The buffer tells you how far outside that chunk is safe

#

Show SwitchChild class

#

No @EventHandler annotation

#

(On the method)

eternal oxide
#

don't extend GMSwitch

#

GMSwitch extends JavaPlugin, of which you MUST only have one

#

?di

undone axleBOT
bold vessel
#

Hi, i try to make a placeholder %wommr_country% thats display the mmr of a country (assaultPlugin.getStorageManager().getMMR(country);
)

https://paste.md-5.net/iwazigajif.java

But this isnt working ig

graceful oak
young knoll
#

You can’t use the Chunk class

#

For a chunk that is being generated

#

You need to make use of the provided LimitedRegion and the methods it contains (setBlockData, setBiome, etc)

graceful oak
#

Oh so everywhere I set blocks I would use limited region instead of using the chunk and instead of getting the block I would use limited region to check it?

young knoll
#

Yes

graceful oak
#

Ok thank you

#

Ill give that a try

knotty gale
#

when I try to export my plugin, it asks for me to select an export wizard, but i don't know which one to do

#

there is team, java, run/debug, etc

hollow hill
#

what are you using? IntelliJ?

knotty gale
hollow hill
#

I can help if you use intelliJ lmao

knotty gale
#

damnit

hollow hill
#

I'd say try run

round finch
hollow hill
#

that's what it is for intelliJ

round finch
#

export? ez

hollow hill
#

oh

round finch
#

i'm an eclipse user

quaint mantle
#

whatsthe best way to create arena's but not save them if the server crashes or stops mid way through the duel also the best way to save the players inventory incase of a crasjh

round finch
#

you can code it as such then the battle is over it saves your stuff

quaint mantle
#

not incase of a crash

#

im not 100% if onDisable is always called

#

i've heard rumors

round finch
#

i mean what more can you do it is really stopped

#

no more tasks

young knoll
#

You can serialize the inventory to yml easily enough

#

But something like a database is probably better

graceful oak
#

@young knoll Sorry to keep bothering you with the @ but im so close I appreciate all the help I am able to move around in chunks but I have my isInRegion not checking correctly would you be able to help me out with the bounds I can seem to get it right. Either I only make it the first chunk because when I multiply by my x and y the first one is always 0 which is the first chunk. Then why I try to use 16 for the chunks it crashes when I move at all

https://pastebin.com/WWdmvQTj

quaint mantle
#

do you know how much space a base 64 string takes up?

buoyant viper
#

probably depends on the length of the string i think

worldly ingot
#

String#contains()

#

These are among the first few methods you learn when learning Java

#

I don't know what you mean "it only accepts chars". It accepts a CharSequence iirc which includes a String.

#

If you want to check if two strings are equal to another, you have equals() and equalsIgnoreCase()

#

If you're wanting the similarity between two strings, there are algorithms for that

graceful oak
lost matrix
graceful oak
#

Quick question to check my math if I was scanning a chunk from top of world to bottom does this look correct for x and z coords?

int Xcord = (chunkX * 16) + X;
int Zcord = (chunkZ * 16) + Z;

X and Z are just in loops going from 0 to 15

The main reason I am questioning this is because when a chunk loads in im clearing out all of the ores and replacing with sponge just so I can visualize it and im noticing some ores aren't changing so im wondering if I am maybe skipping some blocks

https://pastebin.com/5CFYfieS
This is my full code if you need it

worldly ingot
#

Yes, LGTM

#

You can use a bitshift instead if you want to be fancy

buoyant stag
graceful oak
#

Im not really sure whats going on if it is scanning through all of the blocks because im ending up with this underground and while a majority of the ores are sponge now I still have some not changing
https://i.thick.at/kV6gD9Ex.png

buoyant stag
#

What

#

👍

bold vessel
#

Hi, i try to make a placeholder %wommr_country% thats display the mmr of a country (assaultPlugin.getStorageManager().getMMR(country);
)

https://paste.md-5.net/iwazigajif.java

But this isnt working ig

lost matrix
#

How are you testing if this is working?

bold vessel
#

/papi parse me

lost matrix
#

Is the placeholder called?

bold vessel
bold vessel
lost matrix
#

Which of the placeholders methods are called?
I assume you debugged them

lost matrix
bold vessel
#

i add a console.log (things like that) ?

lost matrix
#

! before any conditions, in the first line of your method

#

Sure

bold vessel
#

ok i try this

lost matrix
bold vessel
#

how do i fix this ?

lost matrix
bold vessel
#

ok i do this soon i need to finish somethings first

quaint mantle
#

I mean does it take up a lot of space to encode hunderds of itemstacks with base64?

#

in mongodb

lost matrix
graceful oak
# graceful oak Im not really sure whats going on if it is scanning through all of the blocks be...

Is it possible while using the populate I am beating Minecraft to putting the ores in the chunk because I checked the logs after printing out every block the plugin is replacing and the ores that don't get replaced are showing as stone when it checks them. If thats the case how can I solve this because im not really sure what I can do. I tried to add a delay but apparently I cant populate outside the tick it starts or something like that

fierce whale
#

Is there a way to save object in db?

lone jacinth
# graceful oak Is it possible while using the populate I am beating Minecraft to putting the or...

This is Caused because chunks can also change blocks in neighbor chunks. Let A und B be chunks which are next to each other. First Chunk A is being populated with vanilla featers than your block populator removes all ores. Now Chunk B gets the vanilla features, it generates a ore vein at the chunk border between chunk A and therfore extends the ore vein into Chunk A, which you already checked. After this you populator gets called on Chunk B which only limited the search to chunk B. This is how you end up with some blocks not converted to sponge.

quaint mantle
graceful oak
spice shoal
#

`@EventHandler(priority = EventPriority.HIGHEST)
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
Location loc = new Location(Bukkit.getWorld("Crystal"), 86, 77, 312);
p.teleport(loc);

    if (p.hasPlayedBefore()) {
        e.setJoinMessage("ꑂ");
        e.setJoinMessage(ColorUtils.color_1("&f                             &#3bcf41&lBENTORNATO"));
        e.setJoinMessage(ColorUtils.color_1("&f        &f➥ &#5ac920Bentornato &2&n" + p.getName() + "&7 su &e&lJuice&d&lPvP"));
        e.setJoinMessage("");
        String nuovo = "lp user " + p.getName() + " permission set suffix.0.ꑅ";
        Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), nuovo);
    } else {
        String free = "lp user " + p.getName() + " permission unset suffix.0.ꐮ";
        Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), free);
        e.setJoinMessage("ꑂ");
        e.setJoinMessage(ColorUtils.color_1("&f                             &#3bcf41&lBENVENUTO"));
        e.setJoinMessage(ColorUtils.color_1("&f        &f➥ &#5ac920Benvenuto &2&n" + p.getName() + "&7 su &e&lJuice&d&lPvP"));
        e.setJoinMessage("");
    }
}`

someone can help me to fix that?

#

don't send message onJoin

lost matrix
fierce whale
lost matrix
lost matrix
spice shoal
lost matrix
spice shoal
#

nop

#

execute the command but don't send messages

fierce whale
lost matrix
lost matrix
spice shoal
#

essential i think

lost matrix
fierce whale
#

So I thought about serialize object to byteArray and save it

lost matrix
# spice shoal essential i think

Well you already have your event priority on highest which means the other plugin has its priority also on highest (Which is completely stupid for join messages)
So if you really want to force it then you need to either disable the other plugin, depend on the other plugin (so that your listener is registered later)
or use the priority MONITOR which is a really bad way.

fierce whale
#

But I couldn't find save byteArray in mysql

lost matrix
lost matrix
# fierce whale But I couldn't find save byteArray in mysql

Just Base64 encode your byteArray and store it as a String (If you really dont want to query any parameters on that).
Best practice would be: Serialize the object to json using a library like Gson and then store the json String in your DB.

fierce whale
#

ahha

#

Okay I got it

fierce whale
lost matrix
orchid gazelle
#

Yes, do it async

fierce whale
#

ahha Thx 🙂

lone jacinth
graceful oak
quaint mantle
#

We need a plugin for ore like in Rusta

Stone, Iron, Sulfur (it’s not growing, but I have yes)

They appear on the surface of the earth. Not in the mines. And when poking, it decreases

You don’t need to get them by breaking them, you need to click on them

From a wooden pickaxe is extracted 2 pcs per click, with stone pickaxe 3 times, with iron pickaxe 4 times, with diamond pickaxe for 5

#

Who can do it?

undone axleBOT
lost matrix
bold vessel
#

ok i try

bold vessel
# lost matrix Yeah

Do you know what this warning mean
[WARNING]
[WARNING] Some problems were encountered while building the effective model for fr.worldorder:WOMmrList🫙1
[WARNING] 'dependencies.dependency.systemPath' for dev.joones:joones:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/WOAssault.jar will be unresolvable by dependent projects @ line 89, column 25
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]

lost matrix
# bold vessel

This should not be in your resources folder. Everything in resources will be copied into your jar

bold vessel
#

I put it where ?

lost matrix
#

Ideally you dont put it in your project at all but install it as file in your local maven repository.
But if you insist on keeping this in your project i would at least use a folder like ${project.basedir}/libs

bold vessel
#

How i put it as local repo ?

#

ctrl shift alt s and librairies doesnt work

lost matrix
#

Never manually add libraries if you are using maven

bold vessel
#

So how i do this ?

lost matrix
#

How do you compile your plugin?

bold vessel
#

mvn clean install

lost matrix
#

Just put it in a libs folder and depend on it for now...

bold vessel
#

Okk

#

I try it and

lost matrix
#

Perfect. Now go figure it out. Not too hard to see what you did wrong now.

bold vessel
#

i find

#

ahah

#

im dumb

lost matrix
#

?

bold vessel
#

nvm

#

thats not that

#

args 0 instead of 1 ?

#

Is the params count as args 0 or 1 ?

lost matrix
#

Also not it

#

Earlier

#

Look at the String and what you do with it

bold vessel
#

this ?

#

What wrong ?

lost matrix
#

What is params?

bold vessel
#

the things after _

lost matrix
#

In case of wommr_Canada this will result in what?

bold vessel
#

Canada ?

lost matrix
#

And does it make sense to split "Canada" at "_"?

bold vessel
#

oh

#

So do i only do somethings like this ?

lost matrix
#

Yes. Unless a country name contains spaces

buoyant viper
#

hmm

#

wat does MMR stand for

bold vessel
#

mmr like in ranked games

buoyant viper
#

oh

bold vessel
#

so

#

an int

lost matrix
#

*Originally from chess btw

buoyant viper
#

thought maybe it was something to do with MaxMinds, since ur getting a country

bold vessel
#

Nah its for country war

buoyant viper
#

(MaxMinds has a geoip db for getting location from ip)

bold vessel
#

If a country win an assault he won elo/mmr

bold vessel
#

like UnitedStates

opal sluice
#

Hi does someone know how to update the Player Entity metadata through NMS after spawning a NPC to allow the second skin layer to show up? They messed up with the packets on 1.19.3 and the old method used isn't working 😵‍💫

lost matrix
#

Show your old method
@opal sluice

lost matrix
# opal sluice Hi does someone know how to update the Player Entity metadata through NMS after ...

Anyways here is the equivalent for changing Armorstands. Metadata now uses List<WrappedDataValue> for synchronisations.

  private void prepareMetaPacket() {
    this.metaPacket.getIntegers().write(0, this.fakeID);

    WrappedDataWatcher.Serializer byteSerializer = WrappedDataWatcher.Registry.get(Byte.class);
    WrappedDataWatcher.Serializer chatSerializer = WrappedDataWatcher.Registry.getChatComponentSerializer(true);
    WrappedDataWatcher.Serializer boolSerializer = WrappedDataWatcher.Registry.get(Boolean.class);

    List<WrappedDataValue> dataValues = new ArrayList<>();

    Byte flags = 0x20;
    dataValues.add(new WrappedDataValue(0, byteSerializer, flags));

    Optional<?> optChat = Optional.of(WrappedChatComponent.fromChatMessage(this.text.replace("&", "§"))[0].getHandle());
    dataValues.add(new WrappedDataValue(2, chatSerializer, optChat));

    Boolean nameVisible = true;
    dataValues.add(new WrappedDataValue(3, boolSerializer, nameVisible));

    Byte armorStandTypeFlags = 0x10;
    dataValues.add(new WrappedDataValue(15, byteSerializer, armorStandTypeFlags));

    this.metaPacket.getDataValueCollectionModifier().write(0, dataValues);
  }

You need to do the same with your meta packet for players. Just with different flags ofc.

opal sluice
#

Thx for the example, gonna make it fit to the player entity 😉

haughty storm
#

I ran BuildTools with this cmd, but nms is still obfuscated

java -jar BuildTools.jar --rev 1.19.2 --remapped
opal sluice
#

Otherwise you'll use the obfuscated jar

lost matrix
haughty storm
#

this is my pom.xml

haughty storm
lost matrix
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.19.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <classifier>remapped-mojang</classifier>
        </dependency>

You missed the classifier

opal sluice
haughty storm
#

ok, thank you

opal sluice
#

And it will pick up the right jar for you

lost matrix
#

Did you read the NMS article??

#

?nms

opal sluice
#

Yup without it, the conversion will not be made and the code will not work 😊

haughty storm
#

Thanks again

quaint mantle
#

Is it possible to make a plugin for a landing?

vocal cloud
#

Landing?

fierce whale
#

Is there a way to save String to mysql without length limit?
When I serialize some object to string, It's length is so long.

warm light
#

String is server name right?

vocal cloud
#

I imagine so. You can always try it and see

vocal cloud
vocal cloud
#

Hopefully they don't have to use LONGTEXT

fierce whale
vocal cloud
#

Means that someone can use it to do bad (in theory). As long as whatever you're storing is known by you you're fine. If, for example, you store any object and someone makes an extremely large one they can take a server down my filling the db very fast.

fierce whale
vocal cloud
#

Well it really depends what you're saving and why. It's a matter of "do you really need to save XYZ as a whole to the db"

opal sluice
#

Ofc, if you can avoid saving useless I formation that's better

#

But if you want to store full ItemStack objects for example, b64 is the way to go

vocal cloud
#

Use TEXT only if you absolutely need to you shouldn't need anything bigger. If you do then you're storing too much in one TEXT

green prism
#

Is there a way in MythicMobs to identify a drop?
I'd like to make a "Shop/Exchange" using those drops.
Can I associate them with something like a Custom PDC?

quaint mantle
#

Hi

#

Guys

#

Help plis

#

How to make a plugin

tall dragon
#

Write code

quaint mantle
#

Help

quaint mantle
vocal cloud
#

Good luck

vocal cloud
quaint mantle
#

You can’t just climb on your head

vocal cloud
#

You can try it but it's not that simple

#

Get a friend turn on creative and see for yourself

#

You could make a player "jump" on another by placing a barrier at the feet of the jumper but it'd be imperfect

#

Especially for anticheats

quaint mantle
#

Help please

#

Can you make plugin please 🙏

#

90₽

vocal cloud
#

The forums is the best place to ask for someone to make plugins

#

You should probably figure out exactly how you want it to work since the picture isn't clear either

green prism
#

Are NBT Tags a reliable method in 2023?

#

for identifing an Item

vocal cloud
#

Yeah they are. That's what PDC is

quaint mantle
#

Can you do it? I’ll describe it to you in full, please

vocal cloud
#

I don't have the time atm

quaint mantle
#

Please

drowsy helm
#

?services

undone axleBOT
green prism
drowsy helm
#

pdc is a wrapper for nbt

#

so yes sort of

vocal cloud
#

PDC is a sanitized version

green prism
vocal cloud
#

It prevents plugins from conflicting

green prism
#

WOAH, that's pretty cool

vocal cloud
#

Yes assuming mythic mob mobs drop custom items

green prism
#

yep

#

thank y'all

drowsy helm
#

i think mythic mobs would use a namespaced key though

vocal cloud
#

If you need to rip raw NBT that's a bit more work

#

Shouldn't need to tho

#

You can fake a namespace key if need be anyways

green prism
green prism
#

ripraw?

drowsy helm
#

get raw nbt

vocal cloud
#

No as in figuratively rip

green prism
#

ohh okay

#

haha

vocal cloud
#

Like get the raw NBT for an item. That's like NMS and gross

#

md_5 upset level of gross

quaint mantle
#

Who Can make plugin?

#

Please

vocal cloud
#

He'll show up and start hitting you with a stick

drowsy helm
#

i mean you can get namespaced key with an instance of mythic mobs

quaint mantle
drowsy helm
#

but you need to know the name of the tag

green prism
#

Maybe creating an Util for reading NBTs could be more useful before proceeding writing that thing

green prism
#

Wait

#

Do I need a nsk to read a NBT?

drowsy helm
#

nah if you watch to serach an nbt with pdc you need the namespaced key

#

which needes an instance of the plugin

#

or you can manually parse the raw nbt string

vocal cloud
#

Maybe figure out how to make a plugin that has compatible drops with MythicMobs

quaint mantle
#

Help

green prism
quaint mantle
#

Help

#

Helpo

#

Help

#

Help

drowsy helm
#

@quaint mantle stop

quaint mantle
#

Ok

drowsy helm
#

no one is going to make a plugin for you, if oyu want to pay go to the services forum

quaint mantle
#

90₽

green prism
quaint mantle
#

I have 90₽

drowsy helm
#

raw parsing is probably hardest

#

since its so variable

#

but ig if you do it right it could be easy

#

pre sure nbt is in json format anyway

green prism
#

NBT tag is in json? wtf?

vocal cloud
#

Your best bet would probably be to use MythicMobs items and figure out how it stores the internal names

drowsy helm
#

^

drowsy helm
#

decompile and have a look

vocal cloud
#

My guess is the Internal_Name

green prism
vocal cloud
#

Wym can't do anything about it?

#

They should contain unique data somewhere that MythicMobs uses to identify them

#

You can see that data too

green prism
#

Okay that's a great idea

#

ty haha

vocal cloud
#

The only problem would be linking them together but that should be easy since the ID should be what you put in the config

green prism
# vocal cloud The only problem would be linking them together but that should be easy since th...

Bruh

package io.lumine.mythic.api.items;

import io.lumine.mythic.core.items.MythicItem;
import java.util.Collection;
import java.util.Optional;
import org.bukkit.inventory.ItemStack;

public interface ItemManager {
    Collection<MythicItem> getItems();

    Collection<String> getItemNames();

    Optional<MythicItem> getItem(String var1);

    boolean isMythicItem(ItemStack var1);

    String getMythicTypeFromItem(ItemStack var1);

    Collection<MythicItem> filterItems(Collection<MythicItem> var1, String var2);
}
vocal cloud
#

Fancy

quaint mantle
#

Will build artifacts in Intellji use build.gradle file? I mean build artifacts of Intellij as same as using gradlew build command?

vocal cloud
#

No

green prism
quaint mantle
#

Micheal

green prism
#

?

quaint mantle
#

Can you make plugin please?

green prism
#

Only geol can

tardy delta
#

In all the time youve been crying you couldve learnt how to work with the api

quaint mantle
#

Geol

#

@quiet ice

tardy delta
#

Dont

quaint mantle
#

Future

green prism
#

yo

quaint mantle
#

Can you make plugin please?

green prism
#

Yesn't

quaint mantle
#

Pleaseeeee

#

Dm’s?

vocal cloud
#

Make a forums post you've been begging all night

green prism
vocal cloud
#

Yes. There's better ways to do it than that's it's 3am and I'm going to sleep so maybe I can help tomorrow if I remember

regal scaffold
#

Good morning all

regal scaffold
green prism
green prism
# green prism GUI Shop
public Component sell(Player player, Sellable sellable, List<Map.Entry<String, Integer>> priceDrops, int amount, int slot) {
        //Amount isn't used yet, but it will be used in the future

        if(!doesInventoryContain(player, priceDrops)) {
            return Lang.YOU_DONT_HAVE_THIS_ITEM.replaceText(TextReplacementConfig.builder()
                    .matchLiteral("{items}")
                    .replacement(formatItems(priceDrops))
                    .build());
        }

        removeItems(player, priceDrops);

        ItemStack item = getItem(sellable, slot);
        item.setAmount(amount);

        player.getInventory().addItem(item);
        return Lang.YOU_BOUGHT_THIS_ITEM.replaceText(TextReplacementConfig.builder()
                .matchLiteral("{items}")
                .replacement(item.getType().name())
                .build());
    }```