#help-development

1 messages · Page 1112 of 1

shadow night
#

And both require admin perms

viscid carbon
#

one is for

lunar current
chrome beacon
shadow night
quaint mantle
lunar current
#

Change my mind: 70% of anti cheat steal all your data

quaint mantle
#

Not VAC 😈

chrome beacon
shadow night
#

Most anti cheats are utterly useless

#

And even harmful

chrome beacon
lunar current
#

hahaha

#

how do you get kernel access in the first place

quaint mantle
#

The user allows it

shadow night
lunar current
#

oh..

chrome beacon
#

Many anticheats are kernel/driver level

quaint mantle
#

I mean, you won't get any virus if you are smart enough

shadow night
#

A driver can technically do anything

chrome beacon
#

and if they break or have a vuln someone can take full control of your system

shadow night
chrome beacon
viscid carbon
#

Yo just remote into a windows VPS and play it that way like everyone else 🧌

viscid carbon
lunar current
#

same

#

i just ignore it

viscid carbon
#

It happend after i downloaded sources/docs

#

xD

lunar current
#

I don't have a single build without that tbh

#

But it has not altered my code

chrome beacon
viscid carbon
#

It doesn't but people with ocd it annoys

viscid carbon
chrome beacon
#

someone did

viscid carbon
#
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>24.1.0</version>
        </dependency>```
#

found it

#

annnnnd its gone

quaint mantle
#

Add the provided scope if you don't want to have jetbrains annotations compiled in your project

viscid carbon
#

i just removed it and redownloaded the sources/docs and it fixed it

#

anyone tried this yet?

lunar current
#

use tabnine

chrome beacon
#

so I'm kind of forced to

#

but just in Rider

viscid carbon
#

does it just auto complete?

#

xD

chrome beacon
#

it will try to suggest code

#

like github copilot

#

if you've seen it before

viscid carbon
#

ive watched some dev videos where they use it. looks nifty but really lazy

chrome beacon
#

I don't recommend using it

#

or any AI for that matter

viscid carbon
#

I feel like you would just forget everything because you rely on AI 💀

chrome beacon
#

yeah you will end up with what some call the "Copilot pause"

#

basically you stop writing and wait for AI to finish it for you

split tinsel
#

What is the event called when a player hits a fireball

quaint mantle
viscid carbon
#

Lol i made a method for it to make it easier java public void addCommand(String command, CommandExecutor commandExecutor) { Core.getInstance().getCommand(command).setExecutor(commandExecutor); }

lunar current
#

💀

quaint mantle
#

lol

quaint mantle
chrome beacon
#

Cloud and ACF are pretty good too

quaint mantle
river oracle
chrome beacon
river oracle
#

you're a beginner AI does more harm than good

chrome beacon
#

so yes I can compare it

viscid carbon
quaint mantle
river oracle
#

but for beginners its often a crutch

chrome beacon
#

You make your commands with annotations etc and it will handle the brigadier part

quaint mantle
quaint mantle
#

I don't know if that's the right place, but I seriously need help.

private static final String LICENSED_TO_USER_ID = "%%__USER__%%";

Spigot is not replacing this placeholder. I asked a friend of mine to download the resource which he has purcharsed, and when I inspect the .jar file, the placeholder wasn't replaced

Is there something I should know or something I am doing bad?

split tinsel
#

?nms

quaint mantle
# chrome beacon

Oh god, where can I find this information? I mean the thread post url

remote swallow
#

fukkit actually exists iirc

tardy delta
#

ah man

humble tulip
#

fukkit

torn shuttle
#

random cursed question, has anyone here ever tried to add a lua scripting thing to their plugin as a way to script stuff

zinc moat
#

how do i get minecrafts source code preferably so i can edit it.

rough drift
#

don't know if that counts

tall dragon
#

is there a data structure that allows for this? bit hard to see maybe. but bassically each index inherits the previous indexes values as well

torn shuttle
tall dragon
# rough drift what for?

well im making kits which are locked untill you reach a certain level. but the levels also have access to the previous level's kits

quaint mantle
rough drift
#

=

hybrid trellis
#

Does quote enclosed text counts an argument in commands?

humble tulip
torn shuttle
#

Like, not me

rough drift
#

When using a kit, just check if the required level is less than or equal to the player's level @tall dragon

torn shuttle
#

I'm wondering if it's worth doing something like this for scripture custom model props

tall dragon
#

yea how do i find the requiredlevel

#

loop over all levels? -,-

quaint mantle
rough drift
brittle geyser
slender elbow
#

subList in shambles

tall dragon
#

thats not my issue

brittle geyser
#

what are your issue

rough drift
#

if you have a kit, check the level of the kit

brittle geyser
#

your kits in gui yes?

rough drift
tall dragon
#

i want to avoid looping over all levels to see if that kit is in its level

rough drift
#

OH

#

use a treelist

#

it sorts based on level

#

you can get the highest key based on that level

#

loop until that level to display all

brittle geyser
#

you have kit list then do getting kit from level

humble tulip
#

Map<Integer, List<Kit>>

rough drift
#

downside is you can't unlock two kits per level, but you can use a MultiTreemap or whatever it was

humble tulip
#

Each list has all the lists below it

#

Like a Collections.addAll

rough drift
tall dragon
#

^ yea

humble tulip
#

Eh is it tho?

tall dragon
#

it stores a bunch of useless data then

rough drift
#

You can also just store an int[] which are the indices in a big list of kits

humble tulip
#

You lookup your level and get a list

rough drift
#

so TreeMap<Integer, int[]> and use those as indexes into an array/list

tall dragon
#

yea but the worst kits are stored however many levels there are times

brittle geyser
#

how do you want to do getting specific kit

#

from gui?

tall dragon
#

ill look into the treemap

slender elbow
#

I mean you can just have one List with all the kits and use subList to have a List that restricts to the lower levels

rough drift
slender elbow
#

????

humble tulip
slender elbow
#

there is absolutely 0 data duplication lmao

rough drift
#

isn't sublist inefficient as hell, as it creates a new collection?

slender elbow
#

no?

humble tulip
#

Uses a tiny bit more memory

slender elbow
#

it's a view over the original collection

#

it doesn't copy anything

rough drift
#

oh I must have been mistaken then

tall dragon
#

i have never even heard of sublists lol

rough drift
#

because I'm used to substring doing that

slender elbow
#

it's just a pair of indices

pseudo hazel
#

substring makes a new string

#

because strings

rough drift
#

yeah

#

I figured sublist did the same

humble tulip
rough drift
#

TIL

rough drift
#

what's the point of not using a view

slender elbow
#

java strings are stupid

rough drift
#

They are

pseudo hazel
#

strings are stupid

rough drift
#

Nah

#

Am I the only one that can't be bothered sometimes so I just chuck a cache to an algorithm and if it works I just call it a day

pseudo hazel
#

every function is an algorithm

#

what does that even mean

#

like sorting algorithms?

rough drift
#

Yeah I'm fried as shit

pseudo hazel
#

or what

rough drift
#

I am talking about something like uhhhhh simple but fib seq

worthy yarrow
#

Bump, I’m sure you guys have got some good advice

rough drift
#

imagine it could be optimized without a cache*

pseudo hazel
#

probably

#

if it works it works

rough drift
worthy yarrow
#

Hmm

humble tulip
#

I didn't know what I should put where

worthy yarrow
#

I guess how would you guys go about designing such a large project

humble tulip
#

So i literally coded it and then refactored

pseudo hazel
#

you shouldnt start by writing interfaces until your head pops off

#

you should start by making the damn plugin work and do what you want

humble tulip
pseudo hazel
#

and then improve it

rough drift
#

^

humble tulip
#

And i ended up getting nothing done

worthy yarrow
#

Yeah that makes sense, just wasn’t sure if there was perhaps something you guys did to make it a bit easier

rough drift
#

Get a product, improve it, repeat from step 2

pseudo hazel
#

exactly, cuz we are terrible at predicting what we actually need

worthy yarrow
#

Fair enough kek

rough drift
#

Not only

#

it gives you a lot of motivation to keep going

#

because now it's a rolling stream of dopamine

pseudo hazel
#

like every time I start with an interface, I have to end up rewriting it or it becomes obsolete or whatever

worthy yarrow
#

Yeah but to actually get a product for a project this large…

#

Gonna take some time

pseudo hazel
#

its much easier to continue working if you already have some part that works fully

#

same things with modules

#

you dont start out by creating modules

worthy yarrow
#

Sure, guess I’ll just focus on skyblock mechanics first

rough drift
#

Exactly, I cobbled together a fuck ton of things and now I'll purge and rebuild

pseudo hazel
#

you usually extract code out into modules as soon as you want to put it ou separately or wanna reuse it somewhere

#

or for other reasons that arent "because I think I need this in the future"

#

unles you are very sure up front

#

which is quite rare imo

worthy yarrow
#

At least for what I have got implemented, all the stuff in these modules was in the original module, got it figured that some of these things should be interfaced / abstracted a bit so yeah

#

Just write out gameplay / mechanics and improve later, got it and thank you

rough drift
#

I wrote a "decent" item api and now I'll nuke it for a better one, but for now it does what I need

viscid carbon
#

@worthy yarrow did you really take a picture from your phone instead of print screen? xD

worthy yarrow
#

Yes, I’m not on the computer and I took those a couple days ago to show my father

viscid carbon
#

ah i see

humble tulip
#

How does your ij look like that?

viscid carbon
#

themes

worthy yarrow
#

Appearance settings mane

humble tulip
#

Oooo

viscid carbon
#

I like the dark look

worthy yarrow
#

It’s actually a background tho too not a theme iirc

worthy yarrow
remote swallow
#

download discord

worthy yarrow
#

Ty lol

eternal oxide
worthy yarrow
#

Why you wanna borrow it

rough drift
eternal oxide
#

I was just tempting everyone to click. I wonder how many did

worthy yarrow
#

Kek I assumed so

viscid carbon
#

Is it me or is this gross?

#

cant really think of a better way of doing it.

eternal oxide
#

a little

#

odd you'd have a value for allowedHomes which you decrease

viscid carbon
#

it doesn't?

worthy yarrow
#

Maybe he’s got timed homes

eternal oxide
#

Usually you'd have maxHomes

worthy yarrow
#

“You only get this many extra homes for this long” who knows

eternal oxide
#

then if currentHomes == maxHomes

#

your current text never tells them how many homes you currently have

viscid carbon
#

Its in the player data.

eternal oxide
#

My point is theres no point in telling them they have zero homes allowed

#

"You have no more available homes! Allowed homes: 0"

viscid carbon
#

oh, i see what you're saying. It tells them how many allowed homes they have

eternal oxide
#

its just the logic looks odd to me. perhaps its confusing me

viscid carbon
#

I guess having it named AllowedHomes is confusing

eternal oxide
#

I guess

viscid carbon
#
 if (currentHomes == maxHomes) {
                if (!playerDataManager.homeExists(p.getUniqueId(), input)) {
                    send(p, String.format("&cYou have no more available homes! &7Allowed homes: &a%s", maxHomes));
                    return true;
                }
                playerDataManager.setHome(p.getUniqueId(), input, p.getLocation());
                send(p, HOME_MODIFIED);
                return true;
            }```
#

yeah, that makes more sense

eternal oxide
#

much more understandable

viscid carbon
#

Idk why i did AllowedHomes 🤷‍♂️

#

well atleast its easy to change xD

eternal oxide
#

I've regretted making decisions like that a year later

#

reading back over my code and its made no sense to me at all

viscid carbon
#

Yeah i keep doing that to myself as i go along.

tardy delta
#

i love it when my code says it creates an unbound udp socket but its bound

worthy yarrow
#

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

Any suggestions for this invite service? I feel I should probably implement some way of accepting a particular invite, such as by player name for example, other than that have we got any syntax / design concerns?

chrome beacon
tardy delta
#

computeIfAbsent

#

and id think that youd remove it when expired

worthy yarrow
#

getting to that tbf

chrome beacon
#

also is there a reason why you can have more than one invite from the same person?

worthy yarrow
#

No, that's a design flaw

#

can fix

chrome beacon
#

Move to a Set instead of a list

#

InviteImpl can be a record btw

#

Not sure what Java version you're targeting but it's an option

worthy yarrow
#

mmm

#

Honestly not sure if I want to support anything prior to 1.19 so records are usable here for sure

chrome beacon
#

also do take care invites is concurrent but the list it's holding is not

worthy yarrow
#

j17 has records right?

chrome beacon
#

yes

worthy yarrow
#

Though it's only accessible through the concurrent map so is that a real issue?

chrome beacon
#

yes

worthy yarrow
#

Alrighty

viscid carbon
#

Yeah, how do you use ComputeIfAdsent?

#

playerData.computeIfAbsent(uuid, new PlayerData(uuid));

chrome beacon
#

playerData.computeIfAbsent(uuid, PlayerData::new);

tardy delta
eternal oxide
#

Only the best 😄

worthy yarrow
#

This project is fucking huge man jeez

tardy delta
#

😏

viscid carbon
chrome beacon
#

That's a method reference

viscid carbon
#

Whats wrong with using .put()?

#

or PutIfAbsent

chrome beacon
#

putIfAbsent has slightly different behaviour

#

it returns the value already in the map

#

and if no value is in the map that means null

worthy yarrow
chrome beacon
#

Any map can be converted in to a set

worthy yarrow
#

I mean basic set<>'s I've used just not sure how to also make it concurrent

viscid carbon
#

But if i do java playerData.computeIfAbsent(uuid, PlayerData::new);

It wont add the uuid correct?

chrome beacon
#

no

#

PlayerData::new is short for a lamda;
uuid -> new PlayerData(uuid)

#

whenever you have a method that matches the lambda input you can do a method reference instead

chrome beacon
worthy yarrow
#

Gotcha thanks

ivory sleet
#

No don’t

#

ConcurrentHashMap.newKeySet() please

worthy yarrow
#

Oh

robust vector
#

Hi, what's the error in this line?
p.sendMessage(ChatMessageType.ACTION_BAR, new BaseComponent[]{new TextComponent(ChatColor.translateAlternateColorCodes('&', "&7Quedan " + TiempoString + " de tormenta."))});

worthy yarrow
# ivory sleet ConcurrentHashMap.newKeySet() please
public void createInvite(UUID inviter, UUID invitee, Duration duration) {
        Instant expiryTime = Instant.now().plus(duration);
        InviteImpl inviteImpl = new InviteImpl(inviter, invitee, expiryTime);

        invites.computeIfAbsent(invitee, uuid ->
                ConcurrentHashMap.newKeySet()).add(inviteImpl);
    }```

Such as this?
ivory sleet
#

Uhm, sure

worthy yarrow
#

fourteen said use a computeIfAbsent just playing around with all the suggestions lol

#

If you see a way that I could improve this, please let me know

ivory sleet
#

Yea well, you got a github?

worthy yarrow
#

Yes lol

ivory sleet
#

Alr drop it in the review thread later then ^^

worthy yarrow
#

It's still not public

#

I want to at least get some part playable before a review

#

Eventually though, you'll see it pop up.... some day kek

sage raptor
#

hi, can i apply invisible effect to shulker? (shulker head(?) cannot be invisible..)

hushed spindle
#

what does this error mean again
java.lang.IncompatibleClassChangeError: Found class org.bukkit.inventory.InventoryView, but interface was expected

slender elbow
#

it means you're compiling for new api versions but running on an old/outdated version

hushed spindle
#

of java?

slender elbow
#

of spigot

#

InventoryView is an interface nowadays, but not too long ago it was a class

hushed spindle
#

ah gotcha gotcha

#

i should note these things down before i forget again

slender elbow
#

generally speaking just target the version of the spigot-api you intend to run the server on

#

or if you're making a public plugin, target the lowest version you intend to support

hushed spindle
#

yeah i updated my pom to 1.21 to see if it compiled against it but i forgot to change it back to 1.20

#

then a user reported it not working any more

dawn flower
#

does the original function wait for recursive functions to end in interpreted languages?

#

if the function has a delay

hybrid spoke
eternal oxide
#

stole it

hushed spindle
#

guilds

#

also theft

hybrid spoke
#

tf is a guild and how can i join an alliance

chrome beacon
#

but yeah newKeySet appears to be the newer way of doing things

slender elbow
#

wdym newer it's been a thing for like over a decade 💀

chrome beacon
#

yeah it was added in Java 8

#

newSetFromMap is older than that

tardy delta
#

thought he was gonna say newSetFromMap is older than me

chrome beacon
#

how old are you?

tardy delta
tardy delta
#

i meant "you" when i sent "me"

#

🤡

#

you get it

chrome beacon
#

newSetFromMap is from at least Java 6

#

can't find javadocs older than that

silver robin
#

Hi, how can I get this entity metadata value? There are methods like isSwimming() for other fields but i can't find this one, .isVisualFire() doesn't work it returns false even though i'm in fire and in survival mode, even tested with an alt account and listening to packets to make sure it's not clientside.

This works but i don't want to use this: net.minecraft.world.entity.Entity#getSharedFlag(0)

chrome beacon
#

Check get fire ticks and is visual fire

#

fire ticks for normal fire and visual fire for fake fire

silver robin
#

ah so similar to net.minecraft.world.entity.Entity#isOnFire method?

public boolean isOnFire() {
    boolean flag = this.level() != null && this.level().isClientSide;
    return !this.fireImmune() && (this.remainingFireTicks > 0 || flag && this.getSharedFlag(0));
}```i'll delete this code later
#

I've tried to find how the entity metadata packet is constructed but intellij doesn't let me "Find Usages" within decompiled nms code

chrome beacon
#

Using the Paperweight plugin for gradle does make that easy with the downside of depending on the Paper API

silver robin
chrome beacon
#

You need to add a BuildTools flag for sources jar

#

unclear if it includes the decompiled nms sources

#

I just use Paperweight since that's easier

kindred sentinel
#

How to create different scoreboard display for every player? Like on those servers where displays player's information for each player his own?

merry sapphire
#

Does anyone know what plugin that uses villager shop that supportsd items adder for custom items trade or sell/buy?

echo basalt
echo basalt
#

It's fairly trivial

silver robin
# chrome beacon I just use Paperweight since that's easier

unfortunately paper is gradle and i'm using maven with way too much going on to simply refactor everything now 😦
however these options should be correct, right? after buildtools done, i'll be able to find nms sources jar and then select it in intellij, right?

chrome beacon
merry sapphire
chrome beacon
#

I just have a different project for looking at nms source

kindred sentinel
echo basalt
#

It is

#

Create a scoreboard for each player and tick it accordingly

#

That's how we do it at work and it's pretty much the standard way of doing things thumbsup

kindred sentinel
#

. _ .

river oracle
#

Ticking isn't efficient it costs cpu cycles

#

My cpu only gets 1 cycle a minute

#

It's tough out here

echo basalt
#

get a better cpu then

#

The amount of engineering hours it takes doesn't outweigh the benefit of just getting a beefier machine or crying about it

river oracle
echo basalt
#

cry about it

river oracle
#

Not to mention the literal years it takes to save a file

#

You spoiled kids now adays

echo basalt
#

isn't the discord desktop app just a fancy browser wrapper

echo basalt
#

how are you messaging twice within the same day

river oracle
echo basalt
#

run your server on your phone then

silver robin
river oracle
echo basalt
#

then fuck off

river oracle
#

You fuck off or something

echo basalt
#

can I have nitro

#

month's coming up

river oracle
#

I don't have nitro

echo basalt
chrome beacon
river oracle
remote swallow
green spoke
#

Can I detect the moment when a new day begins?
Purpur or Paper solution will work for me.
Doing this through deferred code execution (For example, a timer) does not suit me...

silver robin
echo basalt
#

Doubt there's an event that gets fired

green spoke
#

:(

merry sapphire
#

do any of you know a good shop plugin that supports items adder?

echo basalt
silver robin
silver robin
merry sapphire
#

answers

hushed spindle
#

is there some better way to check if a player is allowed to build in a location outside a BlockPlaceEvent? right now im creating and calling a BlockPlaceEvent and checking if its cancelled after the fact, but I know you're not supposed to create and call events like this. is there a better way

#

worldguard is fine and all but there's so many plugins that can cancel events like this

hybrid trellis
#

Should I use a public permission manager plugin or try making my own?

hushed spindle
#

just use luckperms i guess

eternal night
#

reinventing the wheel for something that luck perms is going to end up doing better than you anyway, is kinda a waste of time

hushed spindle
#

its standard

hybrid trellis
#

Aight aight

#

And does luckperm have built in group management?

rough ibex
#

yes

hushed spindle
#

its one of the reasons everyone uses it

hybrid trellis
#

Bet

#

Is luckperms for gradle?

hazy parrot
#

?

hybrid trellis
#

Or how does it work

#

New to maven

analog matrix
#

Hey guys, I want to place a schematic via WE and as soon as a player removes a block from this schematic, the entire schematic should be destroyed. The question now is how do I get all the blocks off the schematic? I think/hope there is a better method than checking all blocks in the vicinity to see if they belong to the schematic

echo basalt
#

🤔 is there a way to convert kyori components into legacy strings while also converting hex colors to legacy colors

#

instead of the §x§a§a§b§b§c§c thing

tulip slate
#

I was trying to set up a command, but I keep getting
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.shushi.aSushiPlugin.ASushiPlugin.getCommand(String)" is null

seems to be some error in my command declaration
but in my command declaration it looks like this:
getCommand("god").setExecutor(new godCommand());

here is my yml if thats relevant to this error

version: '1.0-SNAPSHOT'
main: me.shushi.aSushiPlugin.ASushiPlugin
api-version: '1.20'
commands:
  god:
    description: Become Invincible
    usage: /<command>
#

my command is also imported so im a lil confused

eternal oxide
#

that error is impossible with what you have posted

#

check the actual plugin.yml inside your jar

river oracle
#

could be wrong

#

but when I made my parser I simply noticed that

#

its also possible Kyori simply converts named colors to hex colors for flexibility and ignores named colors as a concept

echo basalt
#

seems like building the serializer with the default builder instead of calling .legacyAmpersand works

river oracle
#

which in both cases would require you to do manual string processing after the fact

#

ahh

echo basalt
#

bedrock scoreboards are still hella short

#

and they just ... your ass instead of throwing an error

#

nvm my code no worky

tulip slate
eternal oxide
#

if you are on paper my bet is you included a default paper.yml due to using the minecraft plugin for InteliJ

chrome beacon
#

Contains a base project you can use

tulip slate
# eternal oxide if you are on paper my bet is you included a default paper.yml due to using the ...

idk how that would even happen considering im building my jar directly into my plugin folder fron inteliJ

anyhow here is my yml from jar:

version: '1.0-SNAPSHOT'
main: me.shushi.aSushiPlugin.ASushiPlugin
api-version: '1.20'
commands:
  god:
    description: Become Invincible
    usage: /<command>```

I am real confused rn 
I thought maybe maven was the problem so I took out <filtering>true</filtering> from my xml cuz it can mess with jars sometimes but nah
#

this is a certified skill issue

eternal oxide
#

check your jar for a paper yml

tardy delta
#

my eyes are dying

eternal oxide
#

dark reader plugin

tardy delta
#

i might, usually fucks up on other sites

eternal oxide
#

you can set which sites it enables/disables on

tulip slate
#

holy shit it was

#

what the heck

#

im sorry ElgarL I misunderstood what you were saying

umbral ridge
#

make your own essentials plugin and api

#

🤓

#

The best is if you make everything yourself

tulip slate
#

minestom ahhh mindset

onyx fjord
#

can i somehow give players temp fortune boost?

echo basalt
#

no

lost matrix
#

How temporary you want it to be?

giveBoost();
someOtherMethod();
takeBoost();

Or over several ticks.

onyx fjord
#

for currenctly mined block

#

i have a dirty hack in mind

#

where i change the fortune level when player is mining and revert to old meta afterwards

#

alternatively i would just wanna boost the drops

#

but do it like fortune does so no dupe can happened with normal blocks

#

only ores n shit

lost matrix
#

Wait i got an idea, let me start my IDE rq

#
  @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
  public void onBlockDropItem(BlockDropItemEvent event) {
    Player player = event.getPlayer();
    ItemStack itemStack = player.getInventory().getItemInMainHand();

    int fortuneLevel = itemStack.getEnchantmentLevel(Enchantment.FORTUNE);
    int boostedLevel = fortuneLevel + 3;

    ItemStack boostedItemStack = itemStack.clone();
    ItemMeta meta = boostedItemStack.getItemMeta();
    meta.addEnchant(Enchantment.FORTUNE, boostedLevel, true);
    boostedItemStack.setItemMeta(meta);

    Collection<ItemStack> newDrops = event.getBlock().getDrops(boostedItemStack, player);
    List<Item> drops = event.getItems();

    drops.clear();
    for (ItemStack drop : newDrops) {
      Item item = event.getBlock().getWorld().dropItem(event.getBlock().getLocation(), drop);
      item.setVelocity(item.getVelocity().multiply(0.5));
      drops.add(item);
    }
  }

This should boost every block drop by 3 fortune levels.

#

Hmm, lets hope event.getBlock() is not already AIR here

lost matrix
#

I feel like the getDrops method should be in BlockState after looking at the implementation...

echo basalt
#

legacy api bro

#

watch me 9x a chest's contents with fortune

zinc moat
#

is there a tutorial on how to use "case" in java because im writing something to check an arg and i keep having to do else if else if else if

lost matrix
zinc moat
lost matrix
#

Then build it yourself. Distributing the server jar is not allowed.

quiet ice
#

But I'd download a car (and also jars)

blazing ocean
#

my honest reaction ^

quiet ice
#

I'm le funni, yes.

torn shuttle
hybrid trellis
#

Is cancelling people's messages to change them and send them as server dumb?

quiet ice
#

Well, public transport around my area is good enough that I don't actually need to use a car

quiet ice
hybrid trellis
#

It does remove some functionaly like clicking to get the /tell

#

But it does look slightly better with the padding

quiet ice
#

Well you probably can fix that by using adventure components

hybrid trellis
#

Yeah but can I really add stuff into their chat?

#

I got what I wanted though sooo

lost matrix
echo basalt
#

prob just windows throttling it

gleaming grove
#

I'm having same issue. might be Windows related

blazing ocean
#

java 22 has a lotta issues

quiet ice
blazing ocean
#

java 22*

#

typo

quiet ice
#

Unfortunately recaf 4X depends on it :(

blazing ocean
#

just use the latest one

tardy delta
#

shit

robust parrot
#

What IS The default color for item names? Example: If i set a display name of The item to "Test" without any color explict declared what color it Will use?

tardy delta
#

gray

#

or was it white

robust parrot
#

I think It was white too

tardy delta
#

i mean depends on the item

robust parrot
#

But not sure

#

Totem of undyning

tardy delta
#

idfk man 😂

robust parrot
#

Totem of undyning

tardy delta
#

just go into the game

robust parrot
#

I need this imformation to get my plugin working

lost matrix
robust parrot
#

Because my plugin checks for a custom totem of undyning item

#

And because Minecraft changed default color If It

#

Of it

#

My plugin is not working

lost matrix
#

Alright, but you should never check custom items by name or lore.

robust parrot
#

It checks via method isSimilar

lost matrix
#

That is even worse, by far.

#

Add a PDC tag to your ItemStack and check if an ItemStack has this tag or not

#

?pdc

zinc moat
#

anyone have a clue
Lmk if you need code.

lost matrix
zinc moat
#

Dumb question but how.

lost matrix
# zinc moat Dumb question but how.

If you initialize a variable like this:

private final int x = 10;

Then it will be initialized before the constructor is called.
If you only declare them, but initialize them in the constructor, you are way better off in 99% of the cases:

private final int x;

public YourClass() {
  this.x = 10;
}
zinc moat
#

aahh i get it

lost matrix
#

Yeap looks good

zinc moat
#

i get it, Thanks for the help

#

yippieee no errors in console

fluid cypress
#

is EntityRemoveEvent a 1.21 thing? how can i know when an entity despawns, any entity, for whatever reason, in 1.20?

tall dragon
#

pretty sure u have to listen to all the events urself.

#

for all these different causes pretty much

lost matrix
tall dragon
pseudo hazel
#

and by downstream you mean paper right?

#

forbidden word

lost matrix
pseudo hazel
#

☠️

fluid cypress
tall dragon
#

that enum is part of EntityRemoveEvent. i show it so you see which reasons exist

fluid cypress
#

right, but EntityRemoveEvent doesnt exist on 1.20, apparently

#

its 1.21+ only

tall dragon
#

no. so you would have to find alternate events for those reasons

#

for example for the death reason -> EntityDeathEvent

fluid cypress
#

i see

tall dragon
#

which is a pain

#

;d

fluid cypress
#

but some of those dont have events, apparently

#

like despawn

#

there is no EntityDespawnEvent, at least on 1.20

#

and whats that thing 7smile7 mentioned? the EntityRemoveFromWorldEvent

lost matrix
#

Its a paper event

tall dragon
#

not sure though

young knoll
#

That’s for chunk unloading

#

Also isn’t the remove event like 1.20.4+

tall dragon
#

well not really

#

it says the provided chunk may or may not be loaded

young knoll
#

It’s still for chunk unloading

#

There’s a reason it extends ChunkEvent

tall dragon
#

i thought there was an event for stuff despawning though

#

guess im wrong

fluid cypress
#

is EntityRemoveFromWorldEvent from the paper api reliable? i mean

#

does it cover all cases?

young knoll
#

¯_(ツ)_/¯

#

Ask paper

fluid cypress
#

and btw, i need this bc i made a home/warps plugin, and i want to move those homes/warps when moving stuff around with world edit

#

so i thought of putting invisible entities in those homes/warps, but idk if thats reliable enough

lost matrix
#

🤨

fluid cypress
#

i know each entity has a uuid, right? if an entity goes from one world to another, it keeps the same id? can i get info about an entity, like its position, if the entity is currently on an unloaded chunk?

#

and can i store arbitrary data on an entity?

young knoll
#

If the entity is in an unloaded chunk you can’t get any info from it

pseudo hazel
#

probably in pdc for sure

fluid cypress
#

and what if i keep a reference to it

young knoll
#

Still no

fluid cypress
#

mmm

lost matrix
#

That might keep the entity, the chunk it is in and the world loaded through references.
At least in memory.

#

Which is a really good way of creating memory leaks.

fluid cypress
#

can i atleast load the chunk? or do i have to store the coordinates of the chunk that contains the entity myself

lost matrix
#

I would scrap the idea of using an entity to store data like that

young knoll
#

If you really want homes to move with worldedit (why?) use the worldedit api

fluid cypress
#

like, if i copy something, i dont want to "copy" the home/warp, but i do want to move it if i move something

#

or if i cut and paste it

#

so i gess i can add an extent and give it an entity that reprensents the home/warp?

#

and if i get two entities with the same home/warp location, it means it was a copy, and i ignore the newest one, and if the previous entity doesnt exist anymore, then the new one should be the new home/warp location

lost matrix
#

This means you need to add your home (or a reference like id) to the clipboard and move it accordingly.
If misuesed then this will lead to the home being moved to only the latest copy placed by WE.

fluid cypress
#

idk, maybe there is a better way, but im tired of manually moving warps

young knoll
#

How often do you move things on your server

fluid cypress
fluid cypress
#

pretty often

#

like, just by a few blocks

#

and its annoying having to run a script or something to update homes and warps

lost matrix
#

The last server i was on had similar problems. It was a citybuild and their customblock API and warp implementation was utter rubbish.
I ended up forbidding worldedit on the production server and wrote code to move plots around. Im guessing you have a similar problem.

fluid cypress
#

yea, last time i moved the entire city from y=10 to y=-50 or so, and i had to move plots, warps, homes, shops, holograms, and a lot of stuff, besides obviously the blocks

#

on the caves and cliffs update

lost matrix
#

Pain

fluid cypress
#

yea, idk, i think i will just add a command to check if there is a home or warp on the selected region, show where it is, check if it matters moving it or not, and do it manually if needed. doing it automatically will be hard and wont always work probably

zinc moat
#

how do i get <version>1.0</version> from my pom.xml to my code

delicate lynx
#

you can set it to your plugin.yml, and access it from there

viscid carbon
#

Why would this be returning null if not?

  public HashMap<String, Home> getHomes(UUID uuid) {
        return this.playerData.get(uuid).getHomes();
    }
#

Testing it with

    public boolean hasHomes(UUID uuid) {
        log(Bukkit.getPlayer(uuid).getName() + " size: " + this.getHomes(uuid).size());
        return this.getHomes(uuid).isEmpty();
    }```
#

nvm just stupid.

#

I was putting hasHomes() before i loaded the data into the map 💀

errant needle
#

how i make a killstreak

#

my dumb ahh cant even find out how

drowsy helm
#

listen to PlayerDEathEvent, get the killer and keep track of that killer's streak in a uuid

#

then set some sort of timeout to remove it after x seconds

errant needle
#

i wanna make a plugin like that for a server

wraith dragon
#

Guys, what event fires when a plugin adds an item to someone's inventory using player#inventory#addItem?

#

Been looking in java docs and other stuff but I can't seem to find it

errant needle
#

have you seen videos on it

eternal oxide
#

none

wraith dragon
quaint mantle
#

Any plugins for disabling particular plugin for particular area ???

#

Like that plugin doesnt affect on this area but affect on that area

echo basalt
#

it's quite simple

#

When an entity dies, reset their killstreak and award the killer with a kill

#

If the killer reaches a certain amount of kills certain "milestones" trigger

#

given you have the context of both who died and who killed them you can also impl buzz kills

#

~100 lines of code at most

halcyon hemlock
#

hello everyone

slate siren
#

Guys, I made a fake death mechanism, when the player's health drops to 0, the real death is prevented and instead the player goes into spectator mode, but during this process the player's items do not drop

Because there is no real death, how can we solve it?

#

I'm thinking of manually dropping the items in the inventory to the player's location, but will this cause any bugs?

#

Any lags

#

Or

#

Is there a better method you know of?

#

dropInventoryItems(Player player)

....

#

🤔 .

zinc moat
#

Then use player#dropItemNaturally

slate siren
slate siren
#

better

zinc moat
#

Alright

peak depot
#

What is the best way to save interactable structures like should I save changing blocks or the whole structure

#

And how like in yml or is there a better way

grim hound
#

I did String::replaceFirst

#

and got

zinc moat
#

it makes everyone's live so much easier

grim hound
#

I'll see if Matcher.quoteReplacement fixes it

#

it does not

#

it doesn't

grim hound
#

that I don't do )

#

fuck you java

grim hound
dark moth
#

is there any way to read keys like calling pressedA() method after pressing key A. It needs to be plugin, data pack or anything else

dark moth
grim hound
dark moth
#

yea

blazing ocean
#

not directly possible

dark moth
#

uh oh

grim hound
dark moth
grim hound
dark moth
#

nah lets take the hard shit

#

ima go with clientside mode

dark moth
#

but its too much for a nub

#

like me

#

i mean

#

i had a plan in mind that i could use macro modes to run a command that runs a method

#

but that looks yk

#

ewwww

dark moth
#

like a macro mode

#

didnt u heard of em

#

u set up macros to run a command

#

i used to use them to do some keybindings

grim hound
dark moth
#

oh f

#

i didnt test it on plugins

#

so i dont rvrn know if it works

#

and can u explain serverside and client blabla thing

dark moth
#

serverside and clientside

#

what are those

grim hound
#

clientside -> things that happen in the client process

dark moth
#

clientside.

#

k

#

@grim hound

#

do u know any ways to link it to my plugin

#

even if i create a client side mod that has custom keybind, how am i gonna run my method in the plugin

zinc moat
#

i dont think a mod can interract with a plugin

dark moth
#

yea

#

thas why i am asking

#

i think i can make it run a command that calls the method

#

do u think it would work

#

?

zinc moat
#

no

#

dont think that would work

#

like if you mean mod to plugin no

quaint mantle
zinc moat
#

but you can defently make a command that calls something in spigot

zinc moat
dark moth
#

i am trying to read a key

#

that calls method

zinc moat
#

what kind of key?

slate siren
#

Guys, I need help with something, I made a fake death event, and when you fake death, the items should fall to the ground, I added a code for this, but we have a problem,

For example, I created a kit with the plugin called ItemJoin and the kit features are as follows:

itemflags: inventory-modify, death-drops, self-drops

There is another feature that prevents the item from falling to the ground when you die, death-drops.

But in the system I have set up, items are falling to the ground. It is not blocked, how can I solve this?
Here is the code;

private void dropInventoryItems(Player player) {
    Inventory inventory = player.getInventory();
    ItemStack[] armorContents = player.getInventory().getArmorContents(); // Get armor contents directly from player
    ItemStack[] contents = inventory.getContents();

    // Drop items from the inventory
    for (ItemStack item : contents) {
        if (item != null && item.getAmount() > 0) {
            player.getWorld().dropItemNaturally(player.getLocation(), item);
        }
    }
    inventory.clear(); // Clear the inventory

    // Drop armor items
    for (ItemStack armorItem : armorContents) {
        if (armorItem != null && armorItem.getAmount() > 0) {
            player.getWorld().dropItemNaturally(player.getLocation(), armorItem);
        }
    }
    player.getInventory().setArmorContents(new ItemStack[4]); // Clear the armor
}
dark moth
#

i think

grim hound
zinc moat
grim hound
#

why would they not?

zinc moat
#

i never knew

grim hound
dark moth
#

Yeeesss

#

yaaayyy!!!

zinc moat
#

actually now think about it it can

#

lunar clients new api

dark moth
#

uh

zinc moat
#

works on the server and interracts with the client

dark moth
#

do yall know any way to link tho ?

grim hound
dark moth
#

huh

eternal oxide
#

pmc

grim hound
#

or custom payload, whatever you call it

eternal oxide
#

?pmc

grim hound
# eternal oxide ?pmc

this might actually confuse him a little, since they can be used differently on proxies

dark moth
eternal oxide
#

yeah, its client too though

eternal oxide
#

just have to listen for the correct channel/id

dark moth
#

i need a tutorial

#

fr

zinc moat
#

Maby check console?

dark moth
#

send*

slate siren
#

First of all, I installed the kits with the ItemJoin plugin.

#

And the fake death is a plugin I created myself

dark moth
#

wasnt there a player method called drop item

#

or inv method

#

idk

slate siren
# zinc moat Well whats the issue then?

The problem is, I added a feature to the kits so that the item does not fall to the ground, called death-drops.

Normally, when the player dies, the item does not drop on the ground, but the code I prepared to drop the item in the fake death code does not detect this and the item drops.

zinc moat
#

uhhhh

#

im confused asf

slate siren
#

ill recording video 1m xd

zinc moat
#

Sorry dont think i can help maby ask someone whos like better at java because i aint the greatest

slate siren
#

No problem, thanks

#

In the video, the fake death process was disabled before, the player dies normally and the kit items I prepared with the ItemJoin plugin do not drop.

#

But when I fake death, those items drop.

zinc moat
slate siren
zinc moat
#

thanks

slate siren
#

Hmm

#

Maybe if I integrate the ItemJoin API in my plugin, can I control the itemflags that way

#

🤔 .

tall dragon
#

ItemJoin is a different plugin?

#

you should try to read the item's nbt data. its pretty likely ItemJoin applies some kind of tag. which u could use to not drop the item

scarlet gate
#

Anyone have any suggestions/theories regarding this?

slate siren
#

Yea*

eternal oxide
#

?paste full error

undone axleBOT
rugged fern
#

Here's the code: ``` public static void spawnNPC(Player player, String name) {
CraftServer server = (CraftServer) Bukkit.getServer();
ServerLevel world = ((CraftWorld) player.getWorld()).getHandle();

    UUID uuid = UUID.randomUUID();
    ServerPlayer fakePlayer = new ServerPlayer(server.getServer(), world, new GameProfile(uuid, name), ClientInformation.createDefault());
    fakePlayer.setPos(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ());
    System.out.println("Creating and set position for fakeplayer");

    ServerPlayerConnection connection = ((CraftPlayer) player).getHandle().connection;

    ClientboundPlayerInfoUpdatePacket addPlayerInfoPacket = new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, fakePlayer);
    connection.send(addPlayerInfoPacket);
    System.out.println("AddPlayerInfoPacket");

    world.addFreshEntity(fakePlayer);
    System.out.println("Add Fresh Entity to world");

    Bukkit.getScheduler().runTaskLater(SaberMC.getInstance(), () -> {
        ClientboundPlayerInfoRemovePacket removePlayerInfoPacket = new ClientboundPlayerInfoRemovePacket(Collections.singletonList(uuid));
        connection.send(removePlayerInfoPacket);
        System.out.println("RemovePlayerInfoPacket");
    }, 20L);
}```
river path
#

Heya, I'm making a bungeecord plugin and I am struggling with waiting for a player to connect to a bungeecord instance.
I see there is ProxiedPlayer#connect(ServerInfo, Callback<Boolean>) but the callback is being called before my player is joining the backend server.
Is this a known bug, and is there a workaround?

topaz cape
#

I thought it could be rendered in real-time
but then it wont be inside the resourcepack..

dark moth
#

yk whats wroten there

#

it says kaktuslager

quaint mantle
#

they just update the item name accordingly

quaint mantle
topaz cape
#

they have an item for every possible %?

#

no way

dark moth
quaint mantle
dark moth
#

and yk what lager means

quaint mantle
dark moth
#

oh

#

i thoght it was lagger

quaint mantle
dark moth
#

dawg i cant tgpe

topaz cape
#

for every %? no wayy

quaint mantle
zealous osprey
quaint mantle
#

tbh play legends has a pretty large dev team so maybe they have their own ways of doing it

dark moth
wheat cedar
#

some players have slow internet

#

we need a callback of some sort

river path
#

Even without solving our issue, why does the callback run before the player is connected?

#

Is the callback run the moment the tcp connection is established? Or when the player finishes the configuration phase?

blazing ocean
#

that's in the inventory title

topaz cape
#

you cant change y axis in inv title

blazing ocean
#

yes you can

#

90% of that is in the inventory title

topaz cape
#

how can you? you can't like \n or smth

blazing ocean
#

fonts

topaz cape
#

fonts?

blazing ocean
#

fonts

topaz cape
#

fonts.

#

wait what

blazing ocean
#

with fonts you can change the vertical shift/ascent

#
  • with (negative) space fonts you can change the horizontal positioning
#

(or you could use shaders and do all of that)

torn badge
wheat cedar
#

they should be spawned in the world

river path
dark moth
#

@grim hound how do i send the message to the plugin by mod btw which loader should i use

grim hound
#

search up a mod making tutorial

#

and after than how to send custom packets to the server with mods

hybrid turret
#

ffs buildtools, i have git installed, why??

*** Please note that this is a beta feature, so if it does not work please also try a manual install of git from https://git-for-windows.github.io/ ***
Could not successfully run git. Please ensure it is installed and functioning. Error running command, return status !=0: [C:\WINDOWS\system32\cmd.exe, /D, /C, git, --version]
pure dagger
#

does anyone have this double arrow >> symbol? sorry for the poor resolution

tawdry echo
pure dagger
#

ohh

shy zinc
#

Does anyone know how to use the kyroi adventure API with triumph-gui framework?

pure dagger
#

thank you

worthy yarrow
hybrid turret
torn badge
hybrid turret
swift dew
#

are block breaking packets synced with position&rotation?

drowsy helm
#

Position and rot of what exactly?

grim hound
#

if I do Player::teleport and it returns false, does that mean that the PlayerTeleportEvent was cancelled?

swift dew
drowsy helm
#

Spigot has methods in the api for that now, you dont need packets

swift dew
#

so theres no good way to check cheats that break a block without looking at it?

drowsy helm
#

Anticheat is a whole other story, what does that have to do with block spoofing?

#

You could raycast and check the block, but that could probably be spoofed aswell

grim hound
#

anticheats do it all the time

swift dew
#

ive only seen ncp do it

#

in a very bad way

grim hound
#

what about grim?

swift dew
#

it doesnt do it

grim hound
#

raycast

#

but account for ping

swift dew
#

isnt blockiterator the same thing?

grim hound
#

not sure what that is

swift dew
#

because i use that

drowsy helm
#

Yeah it is

swift dew
#

yeah when i rotate too fast or i have high walking speed sometimes the block i break isnt included into the raycast

#

it isnt contained in the iterator

#

and ive tried alot of different stuff

#

if you can break a block at a clientside position that is not sent to the server tho theres no way to perfectly detect it

grim hound
swift dew
#

whats that

grim hound
#

also, just ignore blocks broken purely clientside if they ever get sent to the server

grim hound
#

if you detect any inconsistencies

swift dew
#

wdym spoof the blocks

#

idk what is that

#

also im trying to see if theres a simple or pefect way to detect it, i know that you can detect it with false flags using stuff like how far you have rotated as parameters of strictness

grim hound
drowsy helm
#

I doubt theres any simple ways of doing it

swift dew
#

there isnt if the break packet isnt syncronized with the postion ones

#

thats why i ask

slate siren
#

Friends, I encountered a problem while creating the kit plugin, now when we create the kit, the self-drops feature is added. And this prevents him from throwing the item to the ground, but while doing this I cannot throw items that do not belong to the kit.

How can I distinguish between these two kits?

#

A unique UUID for each item? Or a unique lore

drowsy helm
#

Lore isnt reliable

slate siren
#

I have no idea what exactly it is, but I'll try to do it

drowsy helm
#

?pdc

slate siren
drowsy helm
#

Dont tell me you’re using 1.8

slate siren
lapis dove
#

🤣 this is such a middlef*nger

#

Bro just.... just came out, standed in the line for hours and then pulled out the cursed 1.8

quiet ice
#

wha

slate siren
haughty pewter
#

is there people who could help whit makeing armor? I dont understand how to change armor texture, like iron armor could hvae 5 different variants

chrome beacon
#

You need to use leather armor and a shader

#

what you do is detect if the color isn't obtainable in vanilla and then replace the texture

tulip slate
#

A question about priorities:
If 2 things happen to have the same priority, like HIGHEST, what order will they be carried out?

eternal oxide
#

undefined

tulip slate
#

kk

#

I ask cuz yk highest means your plugin is getting last say on an event, so if 2 seperate plugins have that what would transpire seems maybe useful to know

lost matrix
#

If your plugin clashes with other plugins via their event priority, then those plugins are either not compatible or poorly designed.
Eg. having two plugins for block protection might lead to incompatability

scarlet gate
#

I'm having an issue where a textured player head's SkullMeta is returning getOwnerProfile as null, is it possible that the texture data is stored elsewhere in the item?
For context this is the head in question that doesn't appear to be returning an OwnerProfile https://minecraft-heads.com/custom-heads/head/98550-cat-in-bread
It also does not return a OwningPlayer

eternal oxide
#

No plugin shoudl un-cancel a cancelled event

chrome beacon
lost matrix
# scarlet gate I'm having an issue where a textured player head's SkullMeta is returning `getOw...
public ItemStack createSkull(URL skinUrl) {
    ItemStack skullItem = new ItemStack(Material.PLAYER_HEAD);
    ItemMeta meta = skullItem.getItemMeta();
    SkullMeta skullMeta = (SkullMeta) meta;

    PlayerProfile profile = Bukkit.createPlayerProfile("Mr Bob");
    PlayerTextures textures = profile.getTextures();
    textures.setSkin(skinUrl);
    profile.setTextures(textures);

    skullMeta.setOwnerProfile(profile);

    skullItem.setItemMeta(skullMeta);
    return skullItem;
  }

Where skinUrl is simply

scarlet gate
#

I'm trying to get the texture from a skull item which is the thing I am having issues with

chrome beacon
#

Show your code

lost matrix
chrome beacon
#

and yes get profile not player

scarlet gate
# lost matrix Get the PlayerProfile instead. May i ask what you need this for?

I am getting the profile currently but it is returning null as mentioned.
I have an editor in my plugin and I store a simplified version of the item as it's for display only

Here's the code itself: (I don't remember why it's so ugly)

@Nullable
public String getB64(ItemStack itemStack) {
    try {
        if (itemStack.hasItemMeta() && itemStack.getItemMeta() instanceof SkullMeta skullMeta && skullMeta.getOwnerProfile() != null) {
            URL skinUrl = skullMeta.getOwnerProfile().getTextures().getSkin();
            return skinUrl != null ? getBase64FromUrl(skinUrl) : null;
        }
        return null;
    } catch (Exception exception) {
        return null;
    }
}
lost matrix
#

So... its for persisting the texture?

scarlet gate
#

It saves the texture per pet to the user's config file in my current case but I use it in different plugins

lost matrix
# scarlet gate It saves the texture per pet to the user's config file in my current case but I ...
  @Contract("null -> null")
  public URL getTexture(ItemStack itemStack) {
    if (itemStack == null) {
      return null;
    }
    ItemMeta itemMeta = itemStack.getItemMeta();
    if (!(itemMeta instanceof SkullMeta skullMeta)) {
      return null;
    }
    PlayerProfile profile = skullMeta.getOwnerProfile();
    if (profile == null) {
      return null;
    }
    PlayerTextures textures = profile.getTextures();
    return textures.getSkin();
  }

I would separate this from directly converting it to Base64.

  public String encodeToBase64(URL url) {
    String urlString = url.toString();
    Base64.Encoder encoder = Base64.getEncoder();
    return encoder.encodeToString(urlString.getBytes(StandardCharsets.UTF_8));
  }

spoonfeed

scarlet gate
#

That code is not going to resolve the issue I outlined though

lost matrix
#

Hm?

scarlet gate
#

Actually that code is pretty much the same as what I currently have but just written differently

#

The issue I have is that the ItemStack's profile is null even though it has a texture

lost matrix
#

Ah i see, the returned profile is null in your case

lost matrix
#

Print out the ItemStack inside this method and make sure to remove shenanigans like

    } catch (Exception exception) {
        return null;
    }
#

Hiding exceptions like this is asking for a disaster to happen

scarlet gate
#

I do agree, I'm not sure why I wrote that initially

lost matrix
#

My prediction is that you pass something in here that isnt a proper skull ItemStack.

#

Or it throws an exception in there somehow.

#

Which results in a null value.

scarlet gate
#

I have tried using conditional break points to work out what the issue is and it successfully break points with the condition of itemStack.getItemMeta() instanceof SkullMeta skullMeta but doesn't break point when the condition is itemStack.getItemMeta() instanceof SkullMeta skullMeta && skullMeta.getOwnerProfile() != null

#

I'll print nonetheless

lost matrix
#

You could also separate your conditional statements like shown in my method. It will get you a better granularity for debugging and modifying your code in the future.

scarlet gate
#

Yeahh, I'll do that

slate siren
#

@lost matrix Sir i have a question

#

Is it possible to make a fake death look like a real death in the game?

humble tulip
#

?question

slate siren
#

🤔.

slate siren
#

But this prevents the player's items from dropping

#

I added an item drop system, this time death-drops in special kits are not taken into account.

#

So when you die, the items belonging to the kit drop, even though they shouldn't

chrome beacon
#

respawn the player in the tick after death

#

and put them in to spectator

lost matrix
chrome beacon
#

That would stop them from actually dying and dropping items

#

which I assume is what they wanted to fix

humble tulip
#

And the kit plugin listens to death event

chrome beacon
#

It will also mess with death statistics

humble tulip
#

You can call death event manually

#

Ah true

lost matrix
#

I think so, otherwise the death event with setKeepItems(true) and spawning a tick later is also nice because it supports other plugins which listen to the death event

#

And shows a death message

humble tulip
#

What's wrong with calling the death event?

lost matrix
#

But depends on what SinHa needs

chrome beacon
humble tulip
#

Other plugins get what they need

#

For all intents and purposes they are

lost matrix
#

You would generally not want to call Spigot events yourself as it might result in unexpected behavior.

chrome beacon
#

^^

#

Player is in the wrong state

humble tulip
#

Ah fine

slate siren
#

I set the statistics

#

Like deaths kills

#

Killstreak

#

Only the item drop event is problematic

#

I set up the kit with my own plugin

#

Like

#
- world
permission: kit.test
uuid: 7b8dcd14-8207-48a7-a057-ceba921c0089
triggers:
- first-join
- respawn
itemflags:
- death-drops
- self-drops
armor:
    helmet:
        id: DIAMOND_BOOTS
        name: §bSky
        slot: helmet
    chestplate:
        id: DIAMOND_LEGGINGS
        name: §bSky
        slot: chestplate
    leggings:
        id: DIAMOND_CHESTPLATE
        name: §bSky
        slot: leggings
    boots:
        id: DIAMOND_HELMET
        name: §bSky
        slot: boots
inventory:
    item_0:
        id: DIAMOND_SWORD
        name: §bSky
        slot: 0
    item_8:
        id: ARROW
        name: ''
        count: 64
        slot: 8```
#

Death-drops in the itemflags section here It should detect fake death instantly

#

In this way, I would find the kits in the .yml file in the kits folder and then add the itemflags control

#

In this way, if there are death-drops, to prevent the item from dropping

#

But it didn't work

scarlet gate
# lost matrix Print out the ItemStack inside this method and make sure to remove shenanigans l...

This was the result of the print:

ItemStack{PLAYER_HEAD x 1, SKULL_META:{meta-type=SKULL, display-name={"text":"Red Cube","italic":false,"underlined":true,"color":"gold","bold":true}, lore=[{"text":"Custom Head ID: 100854","italic":false,"color":"gray"}, {"text":"www.minecraft-heads.com","italic":false,"color":"blue"}], skull-owner=CraftPlayerProfile [uniqueId=8aefaa5f-153f-4c1e-8169-755adebc0c34, name=, properties={textures=[{name=textures, value=eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjc3YWNmZGE5ZjE4ZDVhNGEyNDdkMzBiMGVkNjMwNTY3YTU5Zjg3YTk5YjRiYzAxYWY2MGFkZmQ3YjlhZTNlZCJ9fX0=, signature=null}]}]}}
lost matrix
#

Looks like a head to me... Did you make sure no exception was thrown?

scarlet gate
#

Yeahh, no exception

lost matrix
scarlet gate
#

Not currently on latest, let me update

halcyon hemlock
#

can I get an applaud