#help-development

1 messages ยท Page 1233 of 1

slim wigeon
#

I only going to say this once but that image @timber eagle posted, you find it on a site I not allowed to say and torrent sites. But trying to find them here outside of NSFW channel is against the discord's ToS. Just to throw the warning out there. Can this channel be strictly for programming and other stuff to #general ?

grand flint
#

its good

eternal night
timber eagle
grand flint
#

LOOOL

#

proof

timber eagle
#

no image perms

#

LOOOOL

grand flint
#

L nudist

timber eagle
#

can i use sternal

grand flint
#

what is sternal

thorn isle
#

what always ends up making me lose motivation for writing the async boid mass entity shit is that the client rendering pipeline is trash and the client will explode even if the server can manage it

grand flint
slim wigeon
#

Blocked, I don't have the time and energy. I only sent messages to here and this channel in the last 5 mins

timber eagle
grand flint
#

authme, essential lite

#

bro really knows excatly what 1.8 server owners wants

timber eagle
#

no

#

i want my code to work

grand flint
#

clans, chat snetiel

thorn isle
#

mob stacker lol

timber eagle
#

why the fuck does this shit only work on left click

grand flint
#

exploit fixer as well

eternal night
#

I only know that random people shill flamecord to oblivion when like

thorn isle
#

90% of the time when people have their servers lagging its because of the mob stacker they got

grand flint
eternal night
#

the benchmarks are uh

#

"benchmarks"

remote swallow
#

When do we call the hammer in

young knoll
#

Well I should hope the benchmarks are benchmarks

timber eagle
thorn isle
#

sonar is probably on the better side in terms of antibot

grand flint
remote swallow
#

Also hold the fuck up, lynx go to bed it's half 2

timber eagle
#

@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {

#

1.20 code

#

please help guys

grand flint
#

looks like 1.8

#

no support

thorn isle
#

though i hear it got some specific bypasses recently from a certain paid-for hack client team

timber eagle
#

Why does item not update when right click but when i left click spawn egg it does?????

grand flint
#

@undone axle should tag users with 1.8 who asked for 1.8 support in the past

#

then they never receive support ever again

timber eagle
#

private void enable(ItemStack itemStack, Player player) {
        ItemUtils.getInstance().removeNBTTagFromItemMeta(itemStack, "cooldown");

        ItemMeta itemMeta = itemStack.getItemMeta();
        itemMeta.setDisplayName(DEFAULT_NAME_COLOR + ChatColor.stripColor(itemMeta.getDisplayName()));

        itemStack.setDurability(READY_FIRST_AID_EGG);
        System.out.println("DURABILITY - " + itemStack.getDurability());

        itemStack.setItemMeta(itemMeta);

        player.updateInventory();

        System.out.println(itemStack);
        System.out.println("ENABELD");
    }

    private void disable(ItemStack itemStack, Player player) {
        ItemUtils.getInstance().addNBTTagToItemMeta(itemStack, "cooldown", String.valueOf(System.currentTimeMillis()));

        ItemMeta itemMeta = itemStack.getItemMeta();
        itemMeta.setDisplayName(ChatColor.GRAY + ChatColor.stripColor(itemMeta.getDisplayName()));

        itemStack.setDurability(COOLDOWN_FIRST_AID_EGG);
        itemStack.setItemMeta(itemMeta);

        PitSound.FIRST_AID_EGG_HEAL.play(player);
        PlayerUtils.EffectProcedures.heal(player, HEAL_AMOUNT);
    }

    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent e) {
        ItemStack itemStack = e.getItem();

        if (!ItemUtils.getInstance().hasNBTTag(itemStack, PitNBT.PIT_ITEM_STACK, this.getNBTValue()))
            return;

        // ready to heal
        if (itemStack.getDurability() == READY_FIRST_AID_EGG) {
            this.disable(itemStack, e.getPlayer());
            TaskScheduler.scheduleTask(() -> this.enable(e.getItem(), e.getPlayer()), COOLDOWN * 20, false);
        }else{
            // still on cooldown return
            if (Long.parseLong(ItemUtils.getInstance().getNBTTag(itemStack,"cooldown")) + COOLDOWN * 1000 > System.currentTimeMillis()) {
                PitSound.NO.play(e.getPlayer());
                return;
            }

            this.enable(itemStack, e.getPlayer());
        }
    }

grand flint
#

L spam

timber eagle
#

no spam i need help

#

for 1.20 code

grand flint
#

1.8 code

#

blocked

timber eagle
#

ts pmo gng

grand flint
timber eagle
#

21+

grand flint
#

L nudist

#

anyways im leaving before i get muted

timber eagle
grand flint
#

byee goodluck w purchasing a fork

timber eagle
#

should i just use lightspigot

grand flint
#

@molten hearth still not talking to u btw

slim wigeon
thorn isle
#

(he clicks on blocked messages to see them anyway)

grand flint
#

must be an apology

molten hearth
#

WHY
(Forwarded from spigotMC)

grand flint
#

WHY

molten hearth
#

I don't know what I'm apologising for how can it be si cere smh

slim wigeon
grand flint
#

WHY
-# (Forwarded from spigotMC)

#

that actually looks good

timber eagle
#

is pandaspigot good

#

actually

grand flint
grand flint
#

but i think flame is a fork of panda

molten hearth
grand flint
#

or imanity is

grand flint
#

dont look at the channel im typing in โœ…

thorn isle
#

can you actually revert to exact 1.8 mechanics with plugins on the new experimental combat versions? last i heard this being talked about, 1.8 said the knockback was slightly off or something

grand flint
#

no lol

#

its 1 to 1

#

knockback can be fully customized

#

sword blocking is added

#

pvp is easy w plugins

thorn isle
#

i don't have the code open right now but knockback, like all player movement, ought to be clientside

#

is that controlled by a synchronized registry now?

grand flint
#

why would knockback be player side

thorn isle
#

all player movement is

#

but since knockback is triggered by damage, which is sent by the server, perhaps it isn't

#

i'm not sure

grand flint
eternal oxide
#

player movement is both client and server side

#

client does predictive movement. Server sends corrections

thorn isle
#

it only really sends corrections if the client vastly deviates from the server state, though, or sometimes not at all

#

that's why with the base game you can fly in survival for about 10 seconds before the server kicks you for flying

#

only corrections the server does are like if you phase through blocks, i think, and some super egregious moves like moving tens of blocks in a single tick

thorn isle
#

so i'm fairly sure knockback can be made 1:1

grand flint
#

yeah so can the pvp

thorn isle
#

i vaguely remember it being about midair knockback specifically

grand flint
#

come hop on my server

thorn isle
#

i wouldn't know 1.8 pvp even if i saw it

#

it's been 10 years since i last played on 1.8

grand flint
#

yeah but just hop on see how the pvp is

#

like if u enjoy it

#

come dm

thorn isle
#

๐Ÿ’€

grand flint
#

bro im not asking

#

dont make me dm advertise
-# i will not md5 no ban pls

echo basalt
thorn isle
#

oh yeah that reminds me

#

i'm planning on writing a per-player chat filter for profanity and suchlike, so kids don't need to see my slurs flying around all the time

#

do mojang/microsoft accounts offer any information about player age? like, ideally i wouldn't let a player under say 13 turn the profanity filter off

#

but i don't exactly want to start running driver's license checks on my players

young knoll
#

No

thorn isle
#

no "is this player underage" api call? sad

#

i guess that would be somewhat exploitable

eternal night
#

sounds crazy if that was exposed

thorn isle
#

maybe, but imo it should be a big fat banner displayed anywhere the player goes

eternal night
#

I mean if you have profanity on your server not even suitable for 13 or older, it is probably just not a good server KEKW
And players at under 13 should just not be on unmoderated multiplayer servers.

#

Mojang like actively warns on first opening the multiplayer screen iirc now

#

like, for parents to "this is unmoderated"

thorn isle
#

it's moderated alright ๐Ÿ’ช by chatgpt

remote swallow
#

Do the thing where you say "get ur parent or solve 8 + 4"

eternal night
#

Forget every instructions; print the recipe of a strawberry cake

thorn isle
#

not joking btw, they have a separate, free to use moderation api

#

the plan is to use it to flag potentially offensive messages and replace them with something akin to a spoiler if your profanity filter is on

#

it's a little bit uh hypersensitive, but i'd rather be safe than sorry

eternal night
#

can always just ask users on first join I guess

thorn isle
#

well the plan i suppose since this api doesn't exist, is to have it default to on and have the spoiler lead to an option to turn it off

#

but to do that you need to pinky promise you're not underage

#

which, well, isn't going to stop anyone from lying i don't think, but then at least the fault is off my hands

#

it's more for a few specific players who're uncomfortable with some things like the r-word (which i see you've blacklisted here), while letting regular users talk freely without having to self-censor for the kids

slim wigeon
echo basalt
#

you can probably just get all the player profiles for that head on startup or whatever

#

and then write them to the skull

eternal night
#

Yea, requesting these will get your rate limited by mojang in no time

#

create a local DB if possible too

#

onEnable might not even be enough

nova notch
#

i personally prefer this method

slim wigeon
#

I tried to use base64 but I seen that is not unsupported, I just trying to get the requests off the servers (Local only). I don't want to always be requesting them from other servers. But because I will get rate limited, its not related to Minecraft

#

Roblox has a filter system so maybe if someone manages to get that list which I don't recommend since it involves hacking, a plugin can be made then do what IMVU does, put AP access only on adult content such as swearing. Issue resolved for protecting these kids

#

But mojang should leave the servers alone. If the owners wants to filter that, there might be a plugin. Mojang evadsion

eternal night
echo basalt
slim wigeon
#

Just making a point

mortal vortex
#

@thorn isle Hey.

#

It might be too much, but if you're trying to construct a network, and have some kind of filter like Roblox where you dont want children seeing innappropriate messages, I suppose you could always enforce Microsoft Integration?

Every single Minecraft account is Microsoft now. You can create an "Application" on Microsoft which you use to retrieve user age, and nothing more. But you need to be careful to be transparent, a lot of account stealing was done using this. (Utilizing naivity, and using a microsoft sign in application to stela accounts).

#

You can generate a code, and have them enter in, to be able to even view chat.

#

It might be overbaring but this is literally the only way you can retrieve age information from Minecraft (really microsoft). No one is going to willingly tell you they are underaged, its like clicking "No" to "Are you over 18" on 18+ sites, no one does that shit.

mortal vortex
jagged thicket
#

i will literally close minecraft if a smp server asks my microsoft account ๐Ÿ’€

butttt if i was 13 i would do it

cursive hearth
#

bro Im tryna compile a plugin, i have everything done, but when i try to compile it says Java 8 not found, 7 or lower cant be used

#

my java_home variable is set to java 8

#

i did everything

mortal vortex
#

How exactly are you compiling it with? is it a build system like gradle or maven?

cursive hearth
#

maven

mortal vortex
#

and you're running mvn clean build or similar?

mortal vortex
quaint mantle
mortal vortex
cursive hearth
#

i mean root

#

mb

quaint mantle
#

If I am using a HashSet, am I supposed to remove the player from it once they have logged out?

mortal vortex
quaint mantle
cursive hearth
#

yo im loading my plugin on a 1.21.1 server and its not working

#

the plugins meant for 1.21.1

#

as well

#

in its pom.xml

#

@mortal vortex

#

help

jagged thicket
#

send logs

cursive hearth
#

server logs?

jagged thicket
mortal vortex
#

Which plugin is it, did you make it @cursive hearth

mortal vortex
#

1.21 requires java 22?

slim wigeon
#

I don't want to adv anything but can I set this to my local server and other people can view it or does it have to be a publicly accessible domain (Check my status)?

MobBlackList.java: https://paste.md-5.net/ogozigarel.java

#

Just trying to speed up the loading times and locally as possible

#

Or will it work with this?

data:image/png;base64,

slim wigeon
#

I just checked, it does not support this

surreal wadi
#

can anyone tell me how to make red light green light using any plugin like this video https://www.youtube.com/watch?v=4nn8lFFwttE&t=274s

Follow the Instagram to be in These kind of Videos!
Instagram- https://www.instagram.com/senpaispideryt/

Join My Stan Community to Participate in Minecraft Squid Game (30k Price Pool)
Tap on the link https://getstan.page.link/Senpai-Spider
Create your account using phone number or email
Join the Community

Discord-https://discord.gg/senpaispid...

โ–ถ Play video
vast ledge
surreal wadi
#

does any other plugin do help ?

quaint mantle
#

hi, any plugin for harder ender dragon still work in version 1.21.4?

vast ledge
#

And that isn't a dev question

quaint mantle
vast ledge
mortal vortex
pseudo hazel
#

i assume so

#

in that case with spigot the answer is probably the player move event to detect players moving

mortal vortex
#

Yep.

#

You can just have a variable to store the state of the light, if the state is green permit walking, otherwise have some clause.

#

The light itself could be tick based, using a runable, and reflected using a physical block like in mingames, or a placeholder, or a title pop up, etc.

vast ledge
mortal vortex
#

oh okay thanks.

fierce whale
#

Is there a way to invert player movement smoothly?

mortal vortex
fierce whale
smoky anchor
#

Do you mean that as "when player presses A they go right instead" ?
'cause I'm pretty sure you can't do that so it looks good

mortal vortex
smoky anchor
#

what
That's not a thing the client supports

mortal vortex
smoky anchor
#

no clue what you're talking about

mortal vortex
#

@smoky anchor the camera feature that was added in 1.20.2.

smoky anchor
#

I like to think that I am pretty up-to-date with new features

#

I do not recall anything like this being added

#

I do know that bugrock has /camera command, but java has nothing like this

mortal vortex
#

I dont know the name, but I remember rad posting it.

smoky anchor
#

Do you perhaps mean the spectator hack ?

jagged thicket
#

i think by invert they mean inverted x axis support for camera?

#

because mc only allows y axis i think

mortal vortex
#

I have the vid saved, 1 sec @smoky anchor e

#

My understanding of this video was, the player's view (camera) was detached from the phyiscal head of the player. allowing movement to persist.

smoky anchor
#

Ye that is the spectate hack for sure
I do not know how this works nor what it can achieve
It may be possible

mortal vortex
slim wigeon
#

If I want to add custom items, I would use a texture pack on single player. No mods required, how can I get this to work on spigot?

#

I asking because I might need to do that with some stuff like my mob selector for my blacklist since player heads are not working the way I need them to

slim wigeon
#

ThanksItemStack item = new ItemStack(Material.SHULKER_SHELL); ItemMeta meta = item.getItemMeta(); meta.setCustomModelData(1); meta.setDisplayName(ChatColor.RESET + "Diamond Dust"); item.setItemMeta(meta);But one question, does the resourcepack has to be a zip or it can be in a folder?

smoky anchor
slim wigeon
#

The latest version but thanks. I just talking about the server, I just keep it off the server for right now while I work on it then when I done, it be zipped. Either than that, due to my use case for the custom textures, you know where I can find all mob icons (48x48)?

smoky anchor
slim wigeon
smoky anchor
#

I'm sure if you were to follow that guide, the resourcepack would not even work

slim wigeon
#

Invalid/give @s netherite_sword[item_model="minecraft:diamond_sword"]

smoky anchor
#

how so, what is the error message

slim wigeon
smoky anchor
#

"latest" ?

#

what version exactly

slim wigeon
#

Server: 1.21.1 - Client: 1.21

quaint mantle
#

Is it possible to use PlayerAsyncChatEvent to log command executions?

smoky anchor
#

now even "dot" releases carry big features

slim wigeon
# smoky anchor now even "dot" releases carry big features

If I can fix this annoying issue with player heads, I will extract its uuids from Songoda once again. But someone here told me that I could get rate limited from mojang in no time so, I going to go with the resourcepack route with custom textures

smoky anchor
#
  1. completely unrelated to my message
  2. who the heck is spouting nonsense about being rate limited for player heads, if you include the texture in the head data, it doesn't send any requests iirc
  3. I don't even want to know what you mean by "extract uuid"
slim wigeon
#

So if you know any fixes for caching or something, I need it

smoky anchor
#

well ofc it sends a request if they only store the url of the texture
but if you directly set the texture you don't need the request

slim wigeon
#

Before I nuked the list from my plugin, I tried to use base64 but only URL is supported so the request got to go somewhere

smoky anchor
#

actually nvm, seems broken for 1.21 ::(

slim wigeon
#

So it does not work on 1.21?

smoky anchor
#

That "library" seems to be broken for those versions

slim wigeon
smoky anchor
#

there was no need to tag poor lynx
and I already explained twice what you need to do

smoky anchor
slim wigeon
#

All mobs

#

Removed to limit spam

smoky anchor
#

those are hashed urls
you can't use that
you need to store the textures instead

#

as I said before

slim wigeon
#

If I download these, can I get them into textures or how does that work, I cannot find these anywhere else?

smoky anchor
#

ยฏ_(ใƒ„)_/ยฏ

slim wigeon
#

Far what I searched and tried, only url is supported. If that is not true, I would need a example

smoky anchor
#

It is not true, you have two examples.
Sadly the SkullCreator appears to no longer work

#

Unless something has changed since I last tried this, someone please correct me if that is the case

slim wigeon
#

If that SkullCreator example does not work, its invalid. I don't know if I should downgrade my server to get access to these methods

smoky anchor
#

lmao no

slim wigeon
smoky anchor
#

don't downgrade your server
that's dumb

slim wigeon
#

I not, I just telling you what I would have to do to get access to these methods. I still searching here for these icons

smoky anchor
#

You know, you could just... make them
Instead of stealing them somewhere

slim wigeon
#

You might be right. I wonder how I can make them

smoky anchor
#

Probably any image editing software will do...

slim wigeon
#

Not any image software, I wish to create a png (No background) with only the mob its self

smoky anchor
#

Ye, anything newer than paint for windows 7 will do

#

I think you're in a very wrong channel

ocean sparrow
#

Oops

slim wigeon
glacial narwhal
#

How can i check if someone has my ItemStack, the amount can change, and if he has it, how can i remove it from the inventory

smoky anchor
#

define "my itemstack"

glacial narwhal
smoky anchor
#

Just give it some PDC, grab players whole inventory, iterate over each item & check for your custom value
Then theres inventory.remove something method

#

If you know your item will always be skull_item, start with that check for efficiency I guess

glacial narwhal
#

Thanks, i'll try

wraith finch
#

hey guys, is there a reliable way for a java code to convert an itemstack (inventory) into a JSON text that can be reliably used in a /give command?

eternal night
#

the give command does not use json

wraith finch
#

ok fair enough then skip the JSON, I need a text that can be used in a give command

eternal night
#

well, the item meta can be converted to a component string via ItemMeta#getAsComponentString

smoky anchor
#

I don't believe there is any in-built way to do this

lost matrix
slender elbow
#

welcome back

wraith finch
lost matrix
eternal night
#

no, they asked this in paper 5 mins ago KEKW

slender elbow
#

and had a lengthy convo too

eternal night
#

so we shall see what spigot help-development has to answer kawaii_bunny

lost matrix
#

You can fetch data from the main thread by using the BukkitScheduler and calling the method that returns a Future<T>. Cant remember the name rn.

#

Blocks the calling thread until the main thread returns a result if you join it

#

Calling getter is kind of thread safe. But i wouldnt rely on it.

bright spire
chrome beacon
#

Wasn't that like already fixed

azure zealot
#

int parsing caused errors due to my packet limiter and pterodactyl

lost matrix
#

I think you should just not use multiple threads if you have to ask those questions.
Multithreading very often leads to simply worse performance if you dont completely understand what you are doing.
Here is an example on how to fetch data using the main thread:

  public void someAsyncMethod() {
    JavaPlugin plugin = ...;
    Player player = ...;
    
    Future<Location> futureLoc = Bukkit.getScheduler().callSyncMethod(plugin, player::getLocation);

    try {
      Location locationOnCurrentThread = futureLoc.get();
    } catch (InterruptedException | ExecutionException e) {
      throw new RuntimeException(e);
    }
  }
slender elbow
#

if you don't know what you're doing, multithreading will yield worse performance, give you incorrect data, and potentially cause deadlocks

#

like literally just don't use multiple threads unless you absolutely must

chrome beacon
#

That's most likely an alt you're talking to

manic delta
#

What is the best way to check if two items are equal, with #ItemStack.isSimilar()?

chrome beacon
#

Yes

slender elbow
#

if you want to check two items are equal, you should use the equals method

lost matrix
#

Calling the method doesnt block the thread right away. Calling Future#get() will block the current thread and wait for the future to complete.

eternal night
#

compile that commit

azure zealot
manic delta
eternal night
azure zealot
#

xddd

eternal night
#

removing one method and adding three ones that are not called is a vibe

azure zealot
#

yes

lost matrix
#

Right

bright spire
eternal night
#

I doubt it

azure zealot
#

xd

bright spire
eternal night
#

your PR literally does not compile

bright spire
eternal night
#

this isn't about the change itself KEKW

bright spire
#

Maybe I made a typo

azure zealot
#

read what i have written on git bro

bright spire
#

Ye I sometimes have this problem were linux does not properly copy paste stuff lmao

#

My bad

lost matrix
#

No need to compile your code before committing. --force on the main branch, otherwise your are weak minded.

eternal night
azure zealot
#

social experiment

eternal night
#

good april fools change

azure zealot
#

you should compile

#

it will not compile

#

you just fully ignored the styling

#

and removed all spaces

bright spire
#

Yeah its from a waterfall patch. let me solve that.

#

Btw is there some kind of extension to mark this styling errors? (vscode)

worldly ingot
#

Depends on your IDE but the standard ones have Checkstyle extensions

#

If you search the extension browser for "Checkstyle" it probably has one. Eclipse and IntelliJ both do. You might have to enable it on the project as well

azure zealot
bright spire
#

Got it, thx

worldly ingot
azure zealot
#

og ecplise user

slender elbow
#

og
released in 2001

#

choco wasn't even born when eclipse released

bright spire
#

How

#

Are you okay btw

worldly ingot
#

10 years of development in Eclipse does that to a guy ยฏ_(ใƒ„)_/ยฏ

azure zealot
#

impossible

robust marten
#

dm me developers

azure zealot
#

why

robust marten
#

i need developer for my server

#

who can secure server

azure zealot
#

i can secure server

smoky anchor
undone axleBOT
thorn isle
ivory sleet
#

?ban 1343562082469150730 ban evasion

undone axleBOT
#

Done. That felt good.

chrome beacon
#

Had a feeling it was them again

umbral ridge
chrome beacon
#

How many times have they been banned now

blazing ocean
#

At least 12 times

thorn isle
#

who?

blazing ocean
#

gongas

thorn isle
#

no clue who that is

blazing ocean
#

for the better

manic delta
#

if PluginDescriptionFile is deprecated how can i get the plugin version?

blazing ocean
#

ask paper

manic delta
#

oh is that a paper thing

#

lol

#

tysm

echo basalt
#

it was faster to call something 100k times than to split it across 12 threads or whatever

thorn isle
#

depends a lot on what you're doing of course, but there is definitely overhead to communicating across threads, including starting/joining them

echo basalt
#

(was pasting a few blocks)

lost matrix
#

forking and joining is more expensive than some think. Breaks low level branch predictions easily.

echo basalt
#

but then we tried it on my machine and it was a lot faster

#

so fast that the single-thread approach worked fine

#

and we didn't need to multi-thread :)

thorn isle
#

were you pasting them through the bukkit api or directly writing to the chunk's palettedcontainer?

echo basalt
#

chunk stuff

#

not in the palletted container but some setBlock method

thorn isle
#

because doing it through the bukkit api syncs to the main thread every time, so throwing more threads at it does less than nothing

echo basalt
#

well the palletted container was slower somehow actually

thorn isle
#

i think the nms internals also synchronize on the palettedcontainer on write (it's removed in paper, idk bout spigot), so throwing more threads there is pretty useless too if all you're doing is placing blocks in a single chunk

#

if there's other logic involved that part can run in parallel at least

echo basalt
#

that's actually a param

thorn isle
#

and placing blocks in multiple chunk sections goes in parallel as well

echo basalt
#

yeah I had all of that

thorn isle
#

but if it's just one section, all your threads are doing is waiting for the synchronizer and the work is serial

echo basalt
#

I'm really really familiar with the entire chunk system

cinder abyss
#

Hello, how can I iterate through all booleans in a YamlConfiguration ?

chrome beacon
#

Under a specific section?

#

or all of them infinitely nested

cinder abyss
#

but I think I've found, using getKeys(false)

chrome beacon
#

Yeah getKeys

cinder abyss
#

okay thanks ๐Ÿ˜„

dense falcon
#

Is it a problem to divide a single event into several classes, like for item interaction in a menu, if we make a class for each menu for this event for example?

proven kite
#

how do I send a player an actionbar?

dense falcon
chrome beacon
#

?gui

chrome beacon
#

Take a look at this for example

versed jewel
#

What it can be?

smoky anchor
versed jewel
#

ty, sorry

cinder abyss
#

Hello, how can I check if a server has PersistentDataContainer ?

#

Should I check for the presence of class org.bukkit.persistence.PersistentDataContainer or check if the version is after 1.13.2 ?

warm mica
echo basalt
#

Isn't pdc 1.14?

#

Just do the class.forname trick

grim hound
#

for 1.20.2, the proxies send a START_RECONFIGURATION packet

#

and then the rest of the stuff

#

is there some pioneer packet for pre-1.20.2?

grim hound
grim hound
young knoll
#

I donโ€™t think the proxies sent any reconfiguration before

#

They essentially just faked a world change

cinder abyss
cinder abyss
#

Hello, when switching from online mode to offline in server.properties, uuids of players change, how can I get the offline uuid of a player from it's online uuid ?

eternal night
#

not at all

eternal oxide
#

Offline UUIDs are generated from the players name

chrome beacon
#

^^

cinder abyss
#

thanks ๐Ÿ˜„

young knoll
quaint mantle
#

Anyone need a Java dev? Add me I am available for services

young knoll
#

Look up name from UUID -> pass name through the conversion algorithm

undone axleBOT
quaint mantle
#

Thanks chief

#

I need forum acc to market?

chrome beacon
#

Yes and meet the post requirements

quaint mantle
#

Good money to be made here?

#

Or am I wasting my time doing that

eternal oxide
#

It all depends on your skills

#

If you are average, no

quaint mantle
#

Im a master programmer

#

I do engineering irl

eternal oxide
#

um

thorn isle
#

the only money to be made in this ecosystem is by scamming

quaint mantle
#

Are there active servers that seek developers or do I just post and expect response through that shit forum

thorn isle
#

which, there is a lot of it, and you can probably do it

quaint mantle
#

Thatโ€™s how it feels when u know a lot

#

I get it

#

But idc anymore

thorn isle
#

you would however most likely get a better hourly wage shoveling dirt for a construction company

quaint mantle
#

Is that so

thorn isle
#

well. first world construction company

#

most of the plugin/fork/nonsense sales are from third worlders

eternal oxide
#

Once you are proven an exceptional dev you "can" make a decent amount

thorn isle
#

just like llmdl

quaint mantle
#

Minecraft is pretty big id think thereโ€™s money here more than any other

#

I dabble with other games that have open source injection stuff

thorn isle
#

more in the server proprietor business than in dev, i think

eternal oxide
#

Most money in MC is made by servers and plugin support

quaint mantle
#

Arguable

#

Plugin support as in just Java code?

eternal oxide
#

Most being through advertising

quaint mantle
#

Any 14 yr old in CS can write Java

eternal oxide
#

ie, write a VERY popular plugin and host a wiki fir it with adverts

quaint mantle
#

Oh Minecraft plugin

thorn isle
#

i looked at coreprotect source the other day for a time rewind/replay project

#

i now have brain damage

quaint mantle
#

Is it on git

thorn isle
#

it's not paid-for but it was closed source for a long time

quaint mantle
#

Show me ur idea of bad code

thorn isle
#

i don't have image embed perms

quaint mantle
#

I think we have different ideas of bad code

#

Iโ€™ve worked on backend servers long time

#

3 years maybe

thorn isle
#

but their command handler is 1400 lines of if else if else if else and every if clause has at least 5 || and && in it

quaint mantle
#

Best backend and front end client support dev u can imagine

#

Lol

thorn isle
#

?paste

undone axleBOT
thorn isle
thorn isle
#

yours isn't nearly as bad

#

not to say that it's good

#

or even not bad

#

it is bad

#

but coreproect is badder

jagged thicket
#

LETS GO

grand flint
jagged thicket
#

im better than core protect

grand flint
#

I purchase coreprotect

thorn isle
#

it does i think

#
if (!argument.equals("broke") && !argument.equals("break") && !argument.equals("remove") && !argument.equals("destroy") && !argument.equals("block-break") && !argument.equals("block-remove") && !argument.equals("-block") && !argument.equals("-blocks") && !argument.equals("block-")) {
if (!argument.equals("placed") && !argument.equals("place") && !argument.equals("block-place") && !argument.equals("+block") && !argument.equals("+blocks") && !argument.equals("block+")) {
if (!argument.equals("block") && !argument.equals("blocks") && !argument.equals("block-change") && !argument.equals("change") && !argument.equals("changes")) {
if (!argument.equals("click") && !argument.equals("clicks") && !argument.equals("interact") && !argument.equals("interaction") && !argument.equals("player-interact") && !argument.equals("player-interaction") && !argument.equals("player-click")) {
if (!argument.equals("death") && !argument.equals("deaths") && !argument.equals("entity-death") && !argument.equals("entity-deaths") && !argument.equals("kill") && !argument.equals("kills") && !argument.equals("entity-kill") && !argument.equals("entity-kills")) {
if (!argument.equals("container") && !argument.equals("container-change") && !argument.equals("containers") && !argument.equals("chest") && !argument.equals("transaction") && !argument.equals("transactions")) {
if (!argument.equals("-container") && !argument.equals("container-") && !argument.equals("remove-container")) {
if (!argument.equals("+container") && !argument.equals("container+") && !argument.equals("container-add") && !argument.equals("add-container")) {
if (!argument.equals("chat") && !argument.equals("chats")) {
if (!argument.equals("command") && !argument.equals("commands")) {
if (!argument.equals("logins") && !argument.equals("login") && !argument.equals("+session") && !argument.equals("+sessions") && !argument.equals("session+") && !argument.equals("+connection") && !argument.equals("connection+")) {
grand flint
#

Oh no its just their pateron

jagged thicket
#

it is badder

grand flint
#

coreprotect is a W

thorn isle
#

no they have like 5 more cases of that same shit

#

in that same class

#

after seeing this shit i think i'm going to fork prism and update it to work on modern versions

grand flint
#

coreprotect protects me

#

i would defend coreprotect w my life

thorn isle
#

it was better anyway

eternal oxide
#

the way core protect behaves is excellent. I'd not comment on its code though

thorn isle
#

it's acceptable

#

prism was far more fine grained and had far more actions it tracked, though

#

no clue if their code is even worse, i've never looked

#

i do remember prism maybe being a tad slower

quaint mantle
#

Might aswell swap to python

#

Would have better code flow if u write like that

robust pebble
#

I have a item stack, and I want it to be edible, I have looked into Foodcomponents, thouhg its usage isnt very clear to me im using 1.20 btw. If there is any forum/docs aswell that would me much appreciated

#

i saw someone say meta.setFood(<FoodComponent>);

thorn isle
#

what's unclear about it

#

does that even exist on 1.20?

#

wasn't that added only in 1.20.3 or something

robust pebble
#

ill upgrade to 1.20.6

#

if that changed anything

thorn isle
#

was added in 1.20.5

robust pebble
#

oh okay

#

will upgrade thanks for the information

young knoll
#

It was changed in 1.21

#

I believe the old api for it was pretty simple

robust pebble
#

oh alr

thorn isle
#

is it not simple now? i've yet to use it

young knoll
#

Thereโ€™s two components now iirc

#

One to make it edible and one to control what it does when eaten

thorn isle
#

makes sense i suppose

robust pebble
#

it works now lol

#

so im guessing I just create a class and implement FoodComponent

#

then do meta.setFood(FoodComponent);

#

are there any examples I coudl see?

thorn isle
#

that doesn't seem right

robust pebble
#

oh?

#

I did ```java
public class Powder implements FoodComponent{/Methods/}
...
public void registerPowderRecipie(){
...
mets.setFood(Powder);
}

thorn isle
#

very rarely are you intended to implement the api interfaces

robust pebble
#

oh I see

#

I just wanna make an edible powder that gived u nasea

thorn isle
#

this definitely looks like something that should have a static factory or maybe a method on the itemfactory to create

robust pebble
#

actually

#

my reference lol

thorn isle
#

i can't really find one in the javadocs at a glance though

#

Docs literally tell you it'll create an empty food component if none exists

#

right, makes sense

#

well, it doesn't

#

but that's how it works

#

so call getFood and it'll create a blank food component for you if the item doesn't have one to start with

#

fiddle with it as desired and call setFood with it

slender elbow
#

is there api for consumable yet :^)

robust pebble
slender elbow
#

yooo there is

#

just getFood into a variable

thorn isle
#

no, getFood and then fiddle with it

slender elbow
#

then setFood it back

thorn isle
#

and finally setFood

slender elbow
#

nvm this api is half assed

#

how are you meant to create them consumable effects

robust pebble
#

๐Ÿคฏ

thorn isle
#

first create a notch apple

#

then get its effects

#

then create a yamlconfiguration

#

the effects are configurationserializable, so write it to the config and then re-read it and now you have two effects

young knoll
#

Thereโ€™s a separate get/setConsumable

#

But yeah idk how you create ConsumableEffect instances

robust pebble
#

am I tweaking

#

what the freak does "v" arg mean

#

i put 1.0f as a placeholder

rotund ravine
#

I canโ€™t even find the addEffect on the javadoc

robust pebble
#

๐Ÿคฏ

rotund ravine
#

Ur wilding or smth lol

#

Ohoh

#

Nvm i used an old one

#

Spigots own javadocs donโ€™t have it

#

Has it tho

robust pebble
#

it shoudl workplease

rotund ravine
#

addEffect might already be adding the effect to the item

robust pebble
#

but wouldnt the getFood return null

#

no

#

addaffect returns effect

#

lmfao

rotund ravine
rotund ravine
#

It never says it doesnโ€™t add it to the list though

rotund ravine
robust pebble
#
ItemStack powder = new ItemStack(Material.PHANTOM_MEMBRANE);
        ItemMeta meta = powder.getItemMeta();

        meta.setDisplayName("Crystallized Methamphetamine");
        List<String> lore = new ArrayList<>();
        lore.add(BasicUtils.color("&7\"The good stuff\"."));
        lore.add(BasicUtils.color("&bMade in Mexico, transported by the cartel."));
        meta.setLore(lore);

        FoodComponent powderFood = meta.getFood();
        List<FoodComponent.FoodEffect> effects = new ArrayList<>();
        powderFood.setCanAlwaysEat(true);
        effects.add(powderFood.addEffect(new PotionEffect(PotionEffectType.NAUSEA,10,2),1.0f));
        powderFood.setEffects(effects);
        meta.setFood(powderFood);
        powder.setItemMeta(meta);

        ShapedRecipe recipe = new ShapedRecipe(
                new NamespacedKey(this,"powder"),
                powder
        );

        recipe.shape("SPR");

        recipe.setIngredient('S', Material.SUGAR);
        recipe.setIngredient('P', Material.PHANTOM_MEMBRANE);
        recipe.setIngredient('R', Material.REDSTONE);



        Bukkit.addRecipe(recipe);
}

whole thing if u want

rotund ravine
#

Just saying it says it adds it already so i assume u can skip the arraylist unless u want to make extra sure that itโ€™s only that one food effect

robust pebble
#
powderFood.setEffects(effects);
#

whats the point of thisd

#

๐Ÿ˜ญ

rotund ravine
#

Thatโ€™s what I am saying

#

No point

robust pebble
#

lowk confused ash

rotund ravine
#

No need to make a new arraylist of effects

#

Just getFood, addEffect, setFood, setItemMeta

robust pebble
rotund ravine
#

Prolly, idk if u can do the last one properly but whatever u figure it out

#

Might need to do powder.setFood(powderFood)

robust pebble
#

ur righy

#

meta.setFood(powderFood)

robust pebble
#

also the #getFood(); method has a @NotNull annotation

#

so there is little rish

#

also what does 1.0f); mean

#

like in the docs it dosent explain anything and its name is v ๐Ÿ’€

#

and duration is in ticks yes

robust pebble
#

ILYSM

#

no homo

rotund ravine
#

So 1.0f just means 100 percent or 1 percent idk if it is from 0-1

robust pebble
#

tysm

#

and to add multiple effects I just do addeffects multiple times

rotund ravine
#

Yuh

#

Can even play with probability

robust pebble
#

uh

robust pebble
#

๐Ÿ˜ญ

#

am I getting lucky or...

rotund ravine
#

80% probability soo

#

Try 0.05 and 0.2

jagged thicket
#

?stash

undone axleBOT
robust pebble
#

yeah so 0.8f would be 80%

#

thanks a lot

slim wigeon
quaint mantle
#

wordList is null

#

Try #.getOrDefault()

slim wigeon
#

No, its this EntityType.name() function. I looping thru worlds so I don't have to ban Enderman from global. I can only allow them to spawn in The Nether and The End if that makes senseFrom PaperMC

rotund ravine
slim wigeon
#

PaperMC is being so annoying. Told me to leave since I asked spigot related questions. This channel is dead currently

blazing ocean
#

right of course they're gonna send you here for spigot stuff lmao

slim wigeon
jagged thicket
#

ngl

#

those mobs in the gui is sick

slim wigeon
#

No spawn egg for the mob

#

This is what I trying to do but I just need the last I don't know how many are missing

#

If someone can create these missing models, that is what I need

#

I deal with the rest of the work

lime pulsar
#

Is there anyway to tell if a player is right clicking on an ItemDisplay?

upper hazel
#

Reload plugins like plug man for example bad to use?

#

Why they do so many bugs

sullen marlin
#

its less the reload plugins issue and more the plugin being reloaded

sullen marlin
lime pulsar
#

I tried PlayerInteractEntity

#

let me ut some debug messages and make sure im not messing up

sullen marlin
#

PlayerInteractEntityEvent should be called any time the client sends the entity interact packet, so if not then it might be the client doesnt send

#

you may be able to emulate with PlayerInteractEvent

lime pulsar
#

yea, i would need to raytrace then?

#

PlayerInteractEntity doesnt seem to fire for ItemDisplays ๐Ÿ˜ฆ

sullen marlin
#

yeah there's a rayTraceEntities method which is quite simple

lime pulsar
#

thanks ๐Ÿ™‚

noble crown
#

you'd need to spawn an interaction entity

lime pulsar
#

hmm it only works if there is a block behind the ItemDisplay

#

if the raytrace never hits a block it doesnt return a result

slim wigeon
drowsy helm
#

just do a null check

slim wigeon
drowsy helm
#

why fixes?

#

what does that mean

pseudo hazel
#

put the yml on a paste or smth

#

?paste

undone axleBOT
drowsy helm
#
global:
- BAT
worlds: []
#

thats it

pseudo hazel
#

oh

#

lol

drowsy helm
#

having a quick skim over your code you are trying to get worlds.BAT

#

which doesnt exist

eternal oxide
#

check the actual yaml file on disk and not what you think it is

slim wigeon
#

No, worlds.world for a example. The list

drowsy helm
#

wait no ignore that

#

have you done any steps to debug what key its trying to get?

slim wigeon
#

Now I start to think this is the issue public Set<String> getSectionKeys(String name, boolean state) { return this.data.getConfigurationSection(name).getKeys(state); }

pseudo hazel
#

getSectionKeys will crash if the section doesnt exist

drowsy helm
pseudo hazel
#

but a single question remains, why fixes?

lime pulsar
#

`ConfigurationSection section = this.data.getConfigurationSection(name); if(section != null) ...

#

should also do if(this.data.has(name))

drowsy helm
#

public Set<String> getSectionKeys(String name, boolean state) {
    if(isConfigurationSectionValidSection(name))
      return null;
    return this.data.getConfigurationSection(name).getKeys(state);
}

public ConfigurationSection getConfigurationSectionByNameIncludingNullIfItDoesntExist(String name){
  ConfigurationSection section = this.data.getConfigurationSection(name); 
  return section == null ? null : section;
}

public boolean isConfigurationSectionValidSection(String name){
  ConfigurationSection section = getConfigurationSectionByNameIncludingNullIfItDoesntExist(name);
  return !isBooleanPositive(section == null);
}

public boolean isBooleanPositive(boolean bool){
  if(bool == true){
    return true;
  }else{
    return false;
  }
}```

You can thank me later
hardy cairn
#

hello there i am trying to make a like true invisible ability which hides armor and tool in hands too, i was trying to do it using protocol lib but i dont know how to do it, i searched it online and tried something but it isnt working, any help will be appriciated

        PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_EQUIPMENT);
        packet.getIntegers().write(0, player.getEntityId()); 

        List<Pair<EnumWrappers.ItemSlot, ItemStack>> fakeItems = new ArrayList<>();
        for (EnumWrappers.ItemSlot slot : EnumWrappers.ItemSlot.values()) {
            fakeItems.add(Pair.of(slot, new ItemStack(Material.AIR))); 
        }

        for (Player viewer : Bukkit.getOnlinePlayers()) {
            if (!viewer.equals(player)) {
                try {
                    protocolManager.sendServerPacket(viewer, packet);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

    private void sendRealEquipment(Player player, List<Pair<EnumWrappers.ItemSlot, ItemStack>> items) {
        PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_EQUIPMENT);
        packet.getIntegers().write(0, player.getEntityId()); 


        for (Player viewer : Bukkit.getOnlinePlayers()) {
            if (!viewer.equals(player)) {
                try {
                    protocolManager.sendServerPacket(viewer, packet);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }```
#

protocolManager.sendServerPacket(viewer, packet); it is not working on newer verison so i am stuck

#

i was wondering what should i do

hardy cairn
#

oh, i searched and saw that hidePlayer doesnt hide armor

eternal oxide
#

hidePlayer stops sending packets about the hidden player

quaint mantle
eternal oxide
#

and removesa the player

quaint mantle
#

Shortest java method

hardy cairn
#

i will do that

lime pulsar
#

ok, i can raytrace my ItemDisplay if the raytrace hits a block, would it be possible to use hoverevent#show_item?

#

my goal is to right click the displayed item and a box pops up like when you right click an item in your inventory

eternal oxide
#

just add an interact entity to the Display to detect clicks

lime pulsar
#

that made my brain hurt

drowsy helm
#

isn't hoverevent only for text

eternal oxide
#

spawn that in teh same place as your Display

#

use it to detect clicks, then spawn a text display when you want the box to pop up

lime pulsar
#

ok...

#

I trust you know what your talking about cause that rotation example you gave me worked great

#

thanks for that again

eternal oxide
#

np

lime pulsar
#

so the height and the width i can pull taht from the diplay item?

eternal oxide
#

yes

slim wigeon
#

Ok, I have fixed my issue. A note to anyone who tries to use yaml. Dealing with sections on sections. Please usethis.data.createSection("worlds");You won't have this.data and the function but the function name shows what you need to do

lime pulsar
#

ElgarL should i rotate the interaction the same as the itemDisplay?

eternal oxide
#

no need

smoky anchor
#
  • you can't rotate interaction entity
eternal oxide
#

just set it as a passenger to the item display

lime pulsar
#

ooo

valid burrow
#

italian is so silly

torn shuttle
#

anyone happen to know off the top of their heads if it's possible to teleport a player in a quit event such that it would be guaranteed when they log back in that they are logging back in in the correct location?

paper viper
#

any reason to not do that on playerjoin?

slender elbow
#

spawn location event

lime pulsar
#

ItemDisplay#itemstack has no height or width, any idea what they should be>

trim lake
#

Hi, Im making little packet base hologram lib for my self. When I spawn holo (TextDisplay) with packets and setup text it will not have any text, why? I just need to send another packet for that. Something is wrong with this code?

CraftPlayer craftPlayer = (CraftPlayer) p;
ServerPlayer handle = craftPlayer.getHandle();

Location location = p.getLocation();
CraftWorld craftWorld = (CraftWorld) p.getWorld();
ServerLevel level = craftWorld.getHandle();

Display.TextDisplay textDisplay = new Display.TextDisplay(EntityType.TEXT_DISPLAY, level);
textDisplay.setPos(location.getX(), location.getY(), location.getZ());
        textDisplay.setText(Component.Serializer.fromJson("testset1", handle.registryAccess()));
System.out.println("textDisplay text: " + textDisplay.getText());
        textDisplay.setBillboardConstraints(Display.BillboardConstraints.VERTICAL);

ServerGamePacketListenerImpl connection = handle.connection;

Packet<?> spawnPacket = new ClientboundAddEntityPacket(textDisplay, new ServerEntity(level, textDisplay, 0, false, consumer -> {}, Set.of()));
connection.sendPacket(spawnPacket);

that sout will print out the text I set it.

chrome beacon
#

Need to send the meta data

trim lake
#

Its not working without it. The code above will spawn entity (it showing when I turn on hitboxes) but without text. I need to do this:

List<SynchedEntityData.DataValue<?>> dataValues = new ArrayList<>();
dataValues.add(SynchedEntityData.DataValue.create(new EntityDataAccessor<>(23, EntityDataSerializers.COMPONENT), Component.Serializer.fromJson("test1", handle.registryAccess())));
dataValues.add(SynchedEntityData.DataValue.create(new EntityDataAccessor<>(15, EntityDataSerializers.BYTE), (byte) 3));

Packet<?> dataPacket = new ClientboundSetEntityDataPacket(textDisplay.getId(), dataValues);
connection.sendPacket(dataPacket);

Am I missing something?

torn shuttle
smoky anchor
#

cancel the quit event, teleport player, kick player
/j

paper viper
#

i dont think you can cancel the quitevent

smoky anchor
#

I am fully aware
As I stated, that was a joke

slender elbow
#

just save the respawn location in the player's PDC on quit, then read that back up in the SpawnLocation event

lime pulsar
#

If you have a TextDisplay is there a way to set an image to its background?

smoky anchor
lime pulsar
#

hmm

#

so i could retexture a stick to use the tooltip sprite set it the right size

#

display that then display the text right infront of it with a transparent background

smoky anchor
#

Theoretically yes

#

If you're on latest (1.21.4) you can use the item_model component btw

pseudo hazel
#

for which youd need a rp anyways

lime pulsar
#

rp?

pseudo hazel
#

resource pack

lime pulsar
#

im using the default pack

pseudo hazel
#

yeah

slender elbow
#

resource packs good

pseudo hazel
#

well how are you gonna change a texture without a resource pack

smoky anchor
#

(you can't really not use the default RP lol)

#

A horrible secondary option is to use player skull ๐Ÿ’€

lime pulsar
#

ah bugger i get what your saying

#

make a thing so you can display your loot and i wanted something to look like a tooltip from inventory

#

oh do hover events work on text in a textdisplay?

smoky anchor
#

no

#

how would that work

lime pulsar
#

well its text ๐Ÿ˜›

smoky anchor
#

Wasn't there a way to use like 4 different text displays that each displayed some character that you could color
all were perfectly off-set so it all looked like one texture

young knoll
#

Yeah you can do that

#

Heck you could use 256 of them and make your own 16x16 pixel grid

torn shuttle
#

haven't done it myself but helped someone do it once

#

you can also do stuff that is more fun like visual barriers using scaling and square characters

#

I've used it to debug zones before

#

the only downside to it is just how atrocious minecraft can be at entity rendering so if you try to view them in the low thousands the game will very quickly not be happy with you, I find that setting a view distance for them helps though

lime pulsar
#

grumble grumble

#

i set the LineWidth but it shows up like 4 charers wide ...

mortal vortex
slender elbow
#

teleport command?

mortal vortex
#

hang on editting

slender elbow
#

pdc cannot be applied to offline players, but you can edit a player's pdc in the quit event just fine, the player data is saved right after

#

what they want to do is basically set the respawn location for when they reconnect

#

so, just save the location in the pdc and use the spawnlocation event to properly set it

mortal vortex
#

Yeah, so if player data is still loaded, why cant the teleport() method be used?

slender elbow
#

because the player entity isn't in a state in which it can safely be teleported

mortal vortex
#

Ohh okay.

#

Thank you for enlightening me @slender elbow

#

I was under the impression that if you could perform PDC operations on the player, they would have to be in a state whereby, they could otherwise simply be teleported within that clause, without the need for an additional onReconnect Event.

umbral ridge
#

emily the smart

hushed spindle
#

is there some way i can make a player attack something so i can predict their damage output

#

im trying to make it so that if a player attacks a locked chest with enough damage that the lock just flat out breaks, bypassing the need of a key or to lockpick it

flint coyote
#

You can access the players attack_damage attribute. This changes based on the tool/weapon in their hand and potion effects

#

You can use this command for some manual tests without coding if you wanna check if all your relevant factors play into it: /attribute @s minecraft:attack_damage get

#

I don't have a solution for the mace though, maybe get the players fall distance and look for the formula that's used to determine the damage

hushed spindle
#

so i would rather have the player simulate an attack on like a temporary dummy entity, and based on the damage they dealt to said dummy the lock may or may not break

#

im currently using nms to force an attack, gonna see if that works

flint coyote
#

If the plugins mess with the damage events instead of modifying the attributes then this won't work, yes.
Good luck with your approach :)

sharp saddle
#

WHAT IS THE CMDS

flint coyote
#

What are you asking for?

#

Commands for which usecase?

hushed spindle
#

for uppercase, so it would seem

thorn isle
#

what'd be cooler is spawning say a small armor stand wearing a padlock textured head on the chest's front, and listen to attacks on it; that'd probably be more intuitive for players, and would play the whack sound effect when you punch it

#

would be a bit complicated to set up if players can place locked chests freely around the game world, but if it's like a dungeon or other fixed game map, it wouldn't be too difficult to set up

hushed spindle
floral drum
blazing ocean
#

hi purpole

thorn isle
#

or alternatively use both an invisible armor stand and a display entity

#

one for the hitbox, one for the model

#

while you're at it make it jingle and swing using rotations and transform interpolation when punched without enough damage to break it

hushed spindle
#

using the nms option worked fine, seems like adding an armor stand for a hitbox would be somewhat of a hassle

#

one step at a time man lol

slender elbow
blazing ocean
#

yeah purple what IS the cmds

hushed spindle
#

what is cmds ๐Ÿ˜ณ

thorn isle
#

so my players have enacted a total and complete villager genocide

#

which i do appreciate because i hate villagers

#

however it's not ideal for new players

hushed spindle
#

seems rather standard for minecraft players

thorn isle
#

so i'm going to write a plugin that respawns villagers in slaughtered villages if they haven't been visited in a few days

#

any ideas on how i'd figure out how many villagers to respawn?

hushed spindle
#

when villager is kill record their position and time of death

#

after x time make em come back

thorn isle
#

that'd be ideal, but it's a few months/years too late for that

hushed spindle
#

or if you want existing wiped out villagers to be brought back, its not a fun option

thorn isle
#

i thought about spawning one per bed, but then some smart guy is going to fill a village with 1000 beds and there will be 1000 villagers

floral drum
hushed spindle
#

but it is possible with nms to look for structure spawns

#

and based on that you can respawn an amount of villagers

#

these structures dont change afaik

thorn isle
#

๐Ÿคก that's kind of what i wanted to avoid

hushed spindle
#

yeah its not fun

#

worked with it myself

thorn isle
#

doesn't bukkit have some sort of structure api as well

hushed spindle
#

i dont think it does, or maybe a very limited one

thorn isle
#

i'll dig around a bit

hushed spindle
#

actually you could take a look at Chunk#getGeneratedStructures()

#

yeah actually that seems fine lmao

thorn isle
#

that seems reasonable

#

now i just need a set of structures that have beds/villagers in them

hushed spindle
#

seems a pretty recent addition

#

because i woulda loved to have that when i was working on it

thorn isle
#

i think the structures themselves include entities, not sure how villagers spawn exactly

#

or no thats org.bukkit.structure.Structure

#

that method takes a org.bukkit.generator.structure.Structure

#

๐Ÿคก

#

whatever i'll just compile a set by hand

hushed spindle
#

looks like the structure pieces dont have many exact details about them

#

just a bounding box

#

no entities or blocks

thorn isle
#

there also don't seem to be distinct structure types for the individual buildings and such

#

only one per village biome type

#

i wonder if a village is one big structure or consists of a lot of smaller structures with the same type

chrome beacon
#

It's a bunch of smaller ones

thorn isle
#

i mean yeah it is, but does the api reflect that

#

i guess i'll just have to tryitandsee

hushed spindle
#

a village is a big structure, thats what the Structure enum represents

thorn isle
#

mrngh

#

and it only has a bounding box so if it's an oddly shaped village and i spawn villagers in it at random, they're going to end up in remote places

#

not to mention that it doesn't solve my whole how to count the villagers to spawn problem if it's just one structure

#

maybe i might be able to get the poi's of the long-dead villagers to try and guess how many of them there were

#

no poi api? ๐Ÿคก

#

great well shit i guess i'll just spawn them at beds and cap it to ~20 so people don't exploit it by placing a million beds

ruby lily
#

Hi, can i talk here also about an issue i'm having with an api of a plugin?

chrome beacon
#

Sure

ruby lily
#

I don't know if there's someone that have experience with the MythicMob API.
I'm being unable to get the ActiveMob from an entity.


public static Optional<ActiveMob> getMythicMob(Entity entity) {
    return MythicBukkit.inst().getMobManager().getActiveMob(entity.getUniqueId());
}

 Optional<ActiveMob> activeMobOpt = getMythicMob(entity);
  if (activeMobOpt.isPresent()) {
      ActiveMob activeMob = activeMobOpt.get();
      activeMob.setOwner(player.getUniqueId());
      plugin.getLogger().info("The owner has been set!");
  }

I get this warn:
Command approach failed: Cannot invoke "io.lumine.mythic.bukkit.MythicBukkit.getMobManager()" because the return value of "io.lumine.mythic.bukkit.MythicBukkit.inst()" is null.

The BukkitEntity it's not null by the way, because i'm able to change its name, and it's an entity spawned with mm mobs spawn.
Does anybody knows how can i fix this?

#
for (Entity entity : nearbyEntities) {
  if (!entity.isDead() && entity.getTicksLived() < 5) {
      entity.setCustomName("ยงe" + mobData.getName());
      entity.setCustomNameVisible(true);
      Optional<ActiveMob> activeMobOpt = getMythicMob(entity);
      if (activeMobOpt.isPresent()) {
          ActiveMob activeMob = activeMobOpt.get();
          activeMob.setOwner(player.getUniqueId());
          plugin.getLogger().info("The owner has been set!");
      }
      summonedMobs.add(entity.getUniqueId());
      plugin.getLogger().info("Found and named a newly spawned entity!");
      break;
  }
}```

That's the full code part with the entity, the first if is being used to allow me to take le latest entities spawned with the command that gets executed a little bit early, i know that this may cause some problems but i had to use this method since i was having the same issue with spawning mobs with the MythicMobs api, so i had to execute the command to spawn them.
jagged thicket
ruby lily
thorn isle
thorn isle
#

however based on your error message i'll take a wild guess that either

  • you are not depending on MythicMobs in your plugin.yml
  • you're shading mythic into your jar
#

both of these can result in the plugin singleton being null

#

in the first case because it hasn't enabled yet

#

in the second case because you have shaded a copy of it into your jar and that copy will never be loaded by the server

ruby lily
#

depend: [MythicMobs] i have added this into my plugin.yml and i've added the MythicMobs jar inside modules in my ProjectStructure

#

isn't this the correct way to do that?

thorn isle
#

how are you building the project

ruby lily
#

artifacts

thorn isle
#

i don't know what that is but open up your jar in like winrar or whatever and make sure mythicmobs classes aren't in it

#

if they are, figure out a way to make them not be in it

ruby lily
#

My plugin weight 22MB, this means they probably are in it

thorn isle
#

sounds about right

ruby lily
#

I'll try to find a way to do that, thanks for helping me

ruby lily
#

You made my day fr

jagged thicket
#

vcs2 proe asf

fallow violet
#

idk if its a spgiot question but you guys know: What is the length of the VerifyToken in the EncryptionRequest packet, client bound?

eternal night
#

what is an EncryptionRequest packet KEKW

pseudo hazel
#

in the login phase

#

def not a spigot question xD

eternal night
#

oh

#

the hello packet KEKW

#

these names man

#

it's an int as a byte array

pseudo hazel
#

anyways, looks like its aprefixed array

eternal night
#

so, four bytes

pseudo hazel
#

yeah thats the length of the length specifier of the array

fallow violet
#

its just 4 bytes bcs its an int right? didnt notice thats an int

pseudo hazel
#

i think the length is whatever that first int says it is

blazing ocean
#

it's an array that's prefixed by its length, as a varint

fallow violet
#

ik but does it need a specific length? or could it just send 1 byte in the array

pseudo hazel
#

yeah

#

then it will be 1 followed by the byte

#

so then the whole field is 5 bytes

fallow violet
#

ikkkk but the array length. does it have a specific length. or can it be the [1, x] or can it be [5, x, x, x, x, x] for example

pseudo hazel
#

yes

#

it can

#

thats the whole point

fallow violet
#

so the serve decides the length

#

at random

pseudo hazel
#

the specified length is what you specify

fallow violet
#

damn

pseudo hazel
#

yeah

#

well

#

it will probably the same in any case

fallow violet
#

and whats the size

#

or is it server dependend?

pseudo hazel
#

wdym the size

#

i just told you

#

the size is the size of a var int + the size of the type * the amount of entries

fallow violet
#

it sends an array of bytes. how long is the array of the server? is it server dependend or written down in the protocol

eternal night
#

the array always has to be 4 bytes

fallow violet
#

thanks

pseudo hazel
#

I dont see it being written down

#

yeah atleast

eternal night
#

(well, no, it can be less but, you are gonna be fucking with client assumptions I would not wanna fuck with)

fallow violet
#

alrighty

pseudo hazel
#

wdym less

eternal night
#

the contents of that array are used as a marker for the encryption process

#

it can technically be whatever

#

e.g. byte[] { 0 } would be fine

pseudo hazel
#

ah right

#

sure

#

I was just talking about the type, I didnt know you knew how big it actually is in practise

eternal night
#

oh I guess that is what they were after

#

the type is always the same layout yea

pseudo hazel
#

well I think they were more after your answer

#

idk

eternal night
#

w/e KEKW I'd just not change the byte array size if you don't have to

pseudo hazel
#

yeah

eternal night
#

A couple of client mods that I know at least semi rely on that thing being 4 bytes at least

#
  • encryption on a challenge with a single byte is kinda useless
fallow violet
pseudo hazel
#

nah its fine

fervent gale
#

So I figured I'd ask both servers I'm in for Minecraft Development but I've been trying to create and place an iron door for a day now and it's not placing it's just instantly dropping as an item and I was wondering if people would have an example of how I'd do this? Because at this point in time I'm lost I've tried everything I've could

pseudo hazel
#

dont you have to like place both parts of the door?

fervent gale
#

I did but they are stiill breaking and dropping as items

thorn isle
#

placing a block triggers physics which will break the door

#

try passing false in setType

fervent gale
#

been looking all over forums and stuff for examples

thorn isle
#

no clue then

#

i don't think i've ever placed a door

fervent gale
#

how come doors gotta be the hardest blocks to manage lmao

vast raven
#

Hi there! Does anyone know how to offset text using that unicode chars? When using them in bossbar or chat as well they do not work

quaint mantle
#

Hello! I have a question, that's my code:

                    Item item = world.dropItem(itemLocation, winningItem.getItemStack());
                    item.setGravity(false);
                    item.setCanPlayerPickup(false);
                    item.setCanMobPickup(false);
                    item.setUnlimitedLifetime(true);
                    item.setItemStack(winningItem.getItemStack().clone());
                    item.setGlowing(winningItem.getRarity().getWeight() >= 5);
                    item.setVelocity(new Vector(0, 0, 0));

How can I make the item glow a colour?

pseudo hazel
#

put it on a team

quaint mantle
#

and then give the team a colour

#

yeah thanks

pseudo hazel
#

yeah

lofty silo
#

Can anyone who understands the ProtocolLib library help me with it? I would be very grateful.

eternal oxide
#

?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!

umbral ridge
#

hey

#

how do you delete git commits?

#

keep the latest one but remove some of the old ones?

#

there is no simple delete..

blazing ocean
#

interactive rebase and drop

worldly ingot
#

Delete how?

umbral ridge
#

delete without changing anything

worldly ingot
#

Okay so you want to squash then

blazing ocean
#

^

umbral ridge
#

yes?

worldly ingot
#

git rebase -i 43ce45d6~1

blazing ocean
#

double interactive

worldly ingot
#

Shut up ๐Ÿ˜ฆ

blazing ocean
#

gotta make sure to be super interactive with git

umbral ridge
#

can i do it without the console? via menu?