#help-development

1 messages · Page 139 of 1

green prism
#

I was hoping you'd say that so I could close this long chapter, I'm tired too. It's past 2 a.m. at my place hahaha

#

huh

#

thank you xd

vocal cloud
#

well test it and find out

green prism
#

humh

#

hm

#

Mike.jar has stopped working...

green prism
vocal cloud
#

How much is it supposed to increment it by?

ember estuary
#

Does HandlerList.unregisterAll(gameListener); unregister every event handler that was registered using Bukkit.getPluginManager().registerEvents(gameListener, this); ?

#

cuz it doesnt seem to work

ember estuary
#

Ok nvm, it works, my bad, ty

wary topaz
#

Is there any way to make this work?
All variables are set to something*

if ( usage.equals ( "creative",  "c" )) {

It errors and says, ''equals(java.lang.Object)' in 'java.lang.String' cannot be applied to '(java.lang.String, java.lang.String)''

#

When I remove the comma it says, "',' or ')' expected"

tender shard
#

you can ofc only have one argument in the equals() method

#

you'd have to do it like this:

#
if(usage.equals("creative") || usage.equals("c")) {
wary topaz
#

ah, thanks mate

tender shard
#

np

wary topaz
#

👍 no errors 😄

subtle folio
wary topaz
#

I wasn't using tts

#

How do you hear somethng

#

Something

tender shard
#

I'm so british, I drank a tea today

wary topaz
#

May I have a bottow o wata

subtle folio
#

I read words aloudin my head

tender shard
wary topaz
#

anybody want to help me with a easy project thing

#

with intellij code with me

subtle folio
#

Sure

wary topaz
#

dm me

worldly ingot
dusk flicker
#

lol

tender shard
#

I also never understood the purpose of this menu item

#

I mean it's even empty

#

nothing happens when you click on it

worldly ingot
#

Depends on which bots are installed on the server

hazy parrot
#

Because no discord bots in that server have context menu

worldly ingot
#

Some bots have app integrations

#

Here in my friends server we have a few more apps

#

Which none of us use, but uh... they're there!

tender shard
worldly ingot
#

No idea :D

tender shard
#

weird 😄

tender shard
#

I'll have to check whether JDA supports this

#

it probably does, JDA is awesome

hazy parrot
#

It does

tender shard
#

nice!

#

then I gotta check it out soon(TM)

wary topaz
#

Multiple occurrences of 'usage.equals("creative") |'| usage.equals("c") || usage.equals("1")'

upper vale
#

cool

worldly ingot
#

Probably wants you to use a Set instead

iron glade
#

do you have the same if anywhere else?

#

or what does that mean lol

wary topaz
#

Here, i'll send the whole file

#

ignore the command importing I have that under control

upper vale
#

you have duplicatews of the same line

wary topaz
#

Condition 'usage.equals("spectator") || usage.equals("sp") || usage.equals("4")' is always 'false'

#

Condition 'usage.equals("spectator") || usage.equals("sp") || usage.equals("4")' is always 'false'

upper vale
#

apart from that the code is still a bit questionable lol

wary topaz
#

@subtle folio was helping me but they had to go to bed

iron glade
#
 final Player other = Bukkit.getPlayer(args[1]);
sender.sendMessage ( translateColor ("&e&lYou set" + other + "&e&l's gamemode to &e&lADVENTURE " ) );```
#

you probably wanna use other.getName()

worldly ingot
#

Fun little thing people never seem to take advantage of, you can create multiple instances of your executors with varying constructor arguments to accomplish similar command logic. As an example, I have a local plugin because I dislike using Essentials on a testing server (it's overkill af and I hate the things that Essentials does), and I do this for my gamemode commands,

this.registerCommandSafely("gms", new CommandChangeGamemode(GameMode.SURVIVAL));
this.registerCommandSafely("gmc", new CommandChangeGamemode(GameMode.CREATIVE));
this.registerCommandSafely("gmsp", new CommandChangeGamemode(GameMode.SPECTATOR));
this.registerCommandSafely("gma", new CommandChangeGamemode(GameMode.ADVENTURE));
#

I have one executor that accepts a GameMode argument

#

Runs the same code, different depending on the passed arg

iron glade
#

that's smart

#

might use it sometime now that I know of it

worldly ingot
#
private final GameMode gamemode;

public CommandChangeGamemode(GameMode gamemode) {
    this.gamemode = gamemode;
}

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (!(sender instanceof Player player)) {
        sender.sendMessage("Only players may use this command");
        return true;
    }

    player.setGameMode(gamemode);
    player.sendMessage("Your gamemode has been set to " + ChatColor.YELLOW + gamemode.name().toLowerCase().replace('_', ' ') + ChatColor.RESET + ".");
    return true;
}```
#

My command is extremely simple as a result and reusable

#

Albeit not 100% applicable to your snippet above, Ethan, but you can add to that executor so that your code will support player args and whatnot :)

#

I just chose not to because it's my own plugin for my own test server, I really have no reason to do it

tawdry python
#

I saw that there is a way to have the plugin code in a separate backend and when the server turned on, it connected to that backend and the plugin worked normally, does anyone have any documentation on this? Basically it would serve to prevent leaks

tender shard
#

hello purple, my love

floral drum
#

if you know what I mean

#

hi mfnalex ❤️

#

ily

tender shard
#

❤️

floral drum
#

❤️

#

r u drunk

tender shard
#

only a bit

floral drum
#

ah

tender shard
#

I went out of bed at 1 am today

#

and I went to sleep at 6pm or so haha

floral drum
#

OOF

#

I could never sleep that early

tender shard
#

yeah and now my back hurts

floral drum
#

rippp

tender shard
#

story of my life

floral drum
#

ahahaha

#

did it have a lot of carbs?

tender shard
#

and then there's verano

floral drum
#

lmaooo

tender shard
floral drum
#

oh

#

what type of cheese

#

👀

#

now that's the real question

tender shard
#

gouda, IIRC?

floral drum
#

ooo

#

sounds nice

#

never had gouda personally

tender shard
#

it is ❤️ the dutch people know exactly how to do three things:

  1. weed
  2. cheese
  3. running over people with their bicycles
floral drum
#

LOL

#

netherlands is just the country of bikes

#

no cap

#

at least that's what I heard

tender shard
#

yeah it's true

#

my city is the same

floral drum
#

damn

tender shard
#

in my city, we have 300k people but over a million bicycles

floral drum
#

why so many bikes 😭

tender shard
#

idk haha

floral drum
#

#electricbikesftw

#

ignore that

tender shard
#

we even got a wikipedia article about bicycles in my town

#

but only in german

floral drum
#

omg

tender shard
#

1.05 million bikes for 300k people

floral drum
#

wtf

tender shard
#

yeah I also don't understand it

floral drum
#

3.5 bikes for each person!

tender shard
#

yeah something like this 😄

#

we have parking houses only for bikes

floral drum
#

What the fuck

tender shard
#

very weird

#

"from the top" it looks like this

floral drum
#

opinion on electric bikes?

tender shard
#

they are nice, but unfortunately they are considered "actual vehicles" so you must not be too drunk when driving them

floral drum
tender shard
#

the usual limit for riding a bike is 1.6‰ but for electric ones it's only 0.5 ‰ (same as for cars)

floral drum
#

ah

tender shard
#

0.5‰ is 0.05%

floral drum
#

I like that

#

0/00

tender shard
#

yeah it's "permille" and not "percent"

floral drum
#

ah

tender shard
#

we basically only use this to measure alcohol blood content

floral drum
#

oh?

tender shard
#

maybe some scientists also use it but no idea, I am not a scientist 😄

floral drum
#

but ur a nerd

tender shard
#

hm depends

#

I don't need glasses

#

I think being a nerd includes some huge glasses

floral drum
#

me neither! 😄

#

idk how people get offended by being called a "nerd"

#

just take it as a compliment lol

tender shard
#

yeah well it depends on how someone says it

floral drum
#

eh fairsd

tender shard
#

if someone says "you fucking nerd" then I guess they didnt mean it very friendly 😄

tender shard
#

see? you added the heart for clarification

#

because you noticed that otherwise it sounds unfriendly

#

lol

floral drum
#

L bozo

hasty prawn
#

you're* PepeLaugh

floral drum
#

LOL

hasty prawn
#

Purple

floral drum
#

hi dessie

hasty prawn
#

how dare you

#

ninja me

floral drum
#

L

hasty prawn
tender shard
#

your so stupid, I will tell you're mom about it

floral drum
#

sorry bae

river oracle
floral drum
#

fairs

tender shard
#

oh he left this discord

#

what a jerk

floral drum
#

LOL

#

RIP

tender shard
#

idk but that's just how it works on the internet

floral drum
#

lolll

#

marry me alex

river oracle
#

insulting someone your friends with is proof your friendship is amazing

floral drum
#

lemme find some dms with my friends

tender shard
#

that's actually how my mom proposed to my father

#

she was like "why don't we marry, it would save us so much taxes" or sth like that haha

#

and then they married

#

42 years ago

floral drum
#

nvm I only say owo or call my friends "lazy fuck"

tender shard
#

and now they got me, a weird gay son who codes minecraft plugins for a living and is drunk all the time. WAS THIS REALLY WORTH IT???

floral drum
#

YES

#

VERY

tender shard
#

TL;DR they think the same haha

#

I love my parents

#

but I guess most people do

#

OR DO YOU NOT LOVE MY FATHER?!

floral drum
tender shard
tender shard
#

good one

floral drum
#

wow shocker

#

I actually have frends 😭

tender shard
#

especially the "okay" part at the end is nice

#

but what does L mean

floral drum
#

L = loser

wary topaz
#

Can someone help me by using intellij code with me?

hazy parrot
#

what ?

wary topaz
#

The thing I'm trying to fix is to complicated to explain

hazy parrot
#

¯_(ツ)_/¯

river oracle
undone axleBOT
river oracle
#

There is no way it's too complicated just get good at java or asking questions

boreal python
#
    @EventHandler
    public void onGoldenAppleEat(PlayerItemConsumeEvent event) {
        if (event.getItem().getType() == Material.GOLDEN_APPLE) {
            getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
                @Override
                public void run() {
                    getServer().sendMessage(Component.text("Chest Opened GREEN"));
                }
            }, 20L);
        }
    }

Anyone know why this won't work?
It isn't returning any errors
plugin is justSumowars plugin;

#

actually

#

nevermind

#

plugin is null

river oracle
#

Add debugs at the first if statement if it still isn't hit likely not registered as a listener

boreal python
#

💀

wary topaz
#

https://paste.md-5.net/tiqewacavo.cs
What i'm trying to do is for the following commands:
/gamemode || gm <gamemode>
I dont want console to be able to do it BUT if console specifies a player I want it to be able to

river oracle
#

Just check if sender is console for the arg containing a player using instanceof.

hazy parrot
#

Also don't just blind cast ¯_(ツ)_/¯

river oracle
#

Tbf to him that question was hyper complex 😂

echo basalt
#

I guess I actually came up to their expectations slightly

floral drum
echo basalt
#

plugin dev

floral drum
#

oh

#

my parents think I'm a genius 😭

echo basalt
#

First it was: Nah he isn't making money, it must come from drugs
Then it was: He's using drugs, and hacking into banks at night
Then it was: He's a useless piece of shit, but he isn't doing drugs
and now it just is: Dude's playing games all day, his money must come from somewhere else

floral drum
#

LOL

echo basalt
#

I used to skip class because I'd stay up all night coding

vocal cloud
#

Just give your job a cooler title.

echo basalt
#

and teachers thought I was a thug

floral drum
#

my parents actually understand the process of how I make my money because they asked how I do it and whatever

#

it's like they're interested in how it all works

echo basalt
#

nowadays if anyone asks I just say "I'm a game developer - I make content and events for videogames and youtubers"

floral drum
#

I'm doing games dev in college, so I can actually say that 😭

echo basalt
#

I mean

#

I'm currently making a mix of Google Classroom and Discord within minecraft

#

so idk how to describe it

#

fuck I start school in 4 hours

vocal cloud
#

I write bots to collect data for cryptocurrencies

Software and Data analyst with a specialization in blockchain technology
KEKLEO

floral drum
#

WOO UK CITIZEN

echo basalt
#

no

#

same timezone but not uk

floral drum
#

fuck me

#

france?

echo basalt
#

how dare you disrespect me like that

#

france is an hour ahead

floral drum
#

spain?

echo basalt
#

still an hour ahead

floral drum
#

what the fuck?

#

portugal?

echo basalt
#

ye

floral drum
#

damn

#

how the Fuck is spain an hour ahead LOL

#

timezones make no sense

echo basalt
#

different timezones or some shit idk I'm not international

#

well in theory I am

#

It's hot as shit in my room but if I open my window, I'll let noise out

#

turning on the AC will also make noise

#

grr

floral drum
#

do u have a fan

vocal cloud
#

12 degrees outside rn 🤤

echo basalt
floral drum
#

haha ur fucked

echo basalt
#

I know

echo basalt
vocal cloud
#

31 inside? Sheeeeesh

floral drum
#

now THAT is hot inside and outside

#

at this time

echo basalt
#

at mf 4am

#

I'm hotboxing myself without the smoke

floral drum
#

haha L equator

#

imagine the people in central africa

echo basalt
#

doesn't help that I live in a tropical city like 2km away from the beach

floral drum
#

DIRECTLY in the equator

#

lol

vocal cloud
#

Canada FTW

echo basalt
#

I wanna move to canada to experience real cold for the first time

#

mf we got 15C winters and 40C summers here

#

where's the fun in that

#

mfs dont even buy coats here

vocal cloud
#

-40C I'll trade you for the 15C winters tbh

echo basalt
#

people here are doing excursions to see snow

#

with cold you can always add more layers

#

but you can't take your skin off during the summer

river oracle
echo basalt
#

at least experience it once yk

#

life is mundane if the only difference between winter and summer

#

is that during winter, the sun sets at 5pm

#

and during summer, the sun sets at 9:30pm

#

you're still dying of heat

river oracle
#

I guess

echo basalt
#

there's an ice shortage across the country

river oracle
#

Tf ice shortage

echo basalt
#

yeah we had one of those

#

bars, supermarkets and gas stations had no ice

tender shard
river oracle
#

Idk where you from but we make our own ice wt my house

echo basalt
#

I mean yeah but good luck cooling yourself down with 8 cubes / day

river oracle
echo basalt
#

quick design question

river oracle
echo basalt
#

how tf should I make an influxdb wrapper

#

I want to make an easy metrics api that I can just push stuff instead of pull every <x> time

tender shard
echo basalt
#

I could make a metrics object, maybe a metrics.push("online-players", 10) ?

river oracle
echo basalt
#

bruh moment

#

fuck I should've pushed code from my desktop pc

tender shard
#

boolean isPlayer = sender instanceof Player;

#

lol

echo basalt
#

I'm too lazy to get up, take a single step and click 5 times

#

ehh imma risk it

urban forum
#

Guys can anyone help me?

I wanted an item to sell at chestshop
however this item is a feather enchanted with an enchantment that does not exist.

Basically I enchanted her to make the Players fly.
and I want them to sell automatically.

craggy egret
#

Is there a way to have 1.16.5 Forge with Bungee? Any fork I can use?

urban forum
fringe hemlock
urban forum
#

This is the item, it's a feather
only it was enchanted to send commands when the player presses it
however despite her being enchanted she is not a registered item with enchantment, she is still just a feather.

Then my question would be if it is possible to register this item the way it is somehow

boreal seal
#

i cant understand a shit

#

make the item like in use

#

or afteruse?

#

and change item data

urban forum
boreal seal
#

lol wait

#

i understand

#

u want on use

#

item > Bye

#

just set item to air on player hand

#

on interact using the item

#

thats it

#

and add him to an map for 10 min of fly

#

and afterwards it remove

urban forum
boreal seal
#

u cant really change the self item

#

just replace it

#

user wont notice even

#

i would suggest you either to learn some enlgish basics

#

english*

#

like i have no idea how you code something

#

coding isnt in spanish

urban forum
#

kkkkkkk

#

i will learn

#

one day

#

the modification of the id

#

is made with plugin

#

or with normal command?

urban forum
urban forum
spare jackal
#

Hi a question how can I create a global variable, I mean for example {player} that use that in the config.yml and that is replaced by the name of the player that if I know how to do it but is there a way to not have to write all the lines in each command? I don't know if you understand me, sorry I'm just starting in this

echo basalt
#

that's... called a placeholder

#

and you need to write code for that unfortunately

#

easiest way I do it is just to have a placeholder registry

#

or just hook into papi and parse placeholders on the moment

spare jackal
#

Emm thanks ig

spare jackal
echo basalt
#

it will

#

I have my own placeholder code

#

Just go the easy way and make a basic message system

#

that's like

#
public void sendMessage(CommandSender sender, String idInConfig, Function<String, String>... args)
#

or something

#

or have a set of placeholders idk

#

then you'd just

#

sendMessage(player, "no-permission", (text) -> text.replace("%permission%", "123.456.something"));

spare jackal
#

Ohh ok thanks uwu

echo basalt
#

That's what I have, at least

boreal seal
#

how do i cancel this shit again

floral drum
#

insert

boreal seal
#

that it rewrites on existing text

#

thanks alot

torn oyster
#

how do I use mvn deploy to upload to an SFTP server?
i mean, I managed to set it up but it says Algorithm negotiation fail

boreal seal
#

instead

#

during testing

#

or do it manually

#

i always put my plugins manually

#

no issues

torn oyster
#

i know but i just want to try it lol

#

it is my own server also

boreal seal
#

i dont see a reason using sftp

#

run test server from your own computer

#

not from 3rd party virtual box

#

or what ever you consider a server

drowsy helm
#

or use jenkins or some other ci server

quasi flint
#

jankins

feral pike
#

Can some someone explain this to me ?

#

It happend when I send a text component to someone

warm light
#

is this true? if 2 plugin use same command

boreal seal
#

hi guys so use entity uuid

#

to modify it

#

in general

#

the question is

#

how to check if its dead or alive?

boreal seal
#

there will be still /plugin1:command /plugin2:command

#

but lasted plugin will overide all of them

#

so

#

because it was last registered >

nova cypress
#

i need help

#

im making a plugin for custom mobs

#

how do i equip a mob with armour?

boreal seal
#

there many ways

torn oyster
#

what does ChatColor.of(String)

#

parse

boreal seal
#

u can use entity#set

torn oyster
#

is it like translatealternatecolorcodes

#

or is it for parsing hex

boreal seal
#

read docs

#

please

torn oyster
#

i'm trying to

#

it just says of(String string)

#

that doesn't help

boreal seal
#

go for trial and error

#

you ask really stupid questions

torn oyster
#

._.

nova cypress
pseudo hazel
#

its mainly used for hex

boreal seal
#

Entity#SetChesplate

#

Entity#SetHelmet

#

Entity#SetLeggings

pseudo hazel
#

"#ff0000" will give bleeding red

boreal seal
#

Entity#SetBoots

#

...

nova cypress
#

didnt work

boreal seal
#

setType

#

change the itemstack

#

its for zombie

#

it works 100%

#

i just tested rn

#

Entity#getEquipment#get%PART%.setType(itemstack)

nova cypress
#
    @Override
    public boolean onCommand (CommandSender sender, Command command, String label, String[] args) {

        if (command.getName().equalsIgnoreCase("skeletonb")) {

            if (sender instanceof Player) {

                Player p = (Player) sender;
                p.sendMessage(ChatColor.GREEN + "This command works, " + p.getDisplayName() + "!");
                Location targetlocation = p.getLocation();
                Entity boss = p.getWorld().spawnEntity(targetlocation, EntityType.SKELETON);

                boss.setCustomName("Hello");
                boss.getEquipment.getBoots().setType(itemstack);

            }

        }

        return true;

    }
#

thats my code

#

@boreal seal

feral pike
boreal seal
#

i would suggest you try mythicmobs

boreal seal
#

a min ago

#

itemstack should bean item

#

and customname should be an armorstand

#

so it will always display

feral pike
#

That is what he did "boss.getEquipment.getBoots().setType(itemstack);"

nova cypress
#

getequipment doesnt even work

boreal seal
#

try MythicMobs

warm light
#

How can I get EnderChest from PlayerInteractEvent?

boreal seal
#

u r new to coding

feral pike
#

boss.getEquipment.getBoots().setType(itemstack); can result in NPE

boreal seal
#

check wether entity is dead or alive

#

using entity uuid?

feral pike
#

get the entity from Bukkit ig

boreal seal
#

i went thru docs

feral pike
#

and check if it's dead

warm light
boreal seal
#

nah doesnt work

#

i tried everything

feral pike
#

It should work.

nova cypress
#

"boss.getEquipment.setBoots(ItemStack item);" getEquipment wont do the thing

feral pike
#

Why ?

nova cypress
#

idk

feral pike
#

Did u test it ?

nova cypress
#

no image perms

feral pike
#

have u checked if item is null ?

quaint mantle
#

@lean sandal hello

lean sandal
#

dwnfjhesfbh

nova cypress
#

fixed my code, changed:

  • Entity boss = p.getWorld().spawnEntity(targetlocation, EntityType.SKELETON);
    to:
  • Skeleton boss = p.getWorld().spawn(targetlocation, Skeleton.class);
feral pike
primal wave
primal wave
feral pike
#

i'm using the old constructor

primal wave
#

Well it is deprecated, might be the issue, might not

boreal seal
#

hm

#

wondering

primal wave
#

No thread issues could happen?

boreal seal
#

if i sent packet

#

all players achieve it right

#

like particle paccket

#

so i need to target only players near the location true?

#

to sent the packet

#

to not flow their net

feral pike
#

I didn't find any thread talking about this issue

primal wave
#

What if increments and decrements are both empty?

kindred valley
#

What should i do

feral pike
primal wave
#

or empty

kindred valley
#

its a plugin called PlayTime

feral pike
#

btw a hover event can be empty ?

primal wave
#

well you would need to look at the code for the sender then

#

maybe it assumes the passed thing has a length > 0

feral pike
#

alright i'll check if they are empty

eternal oxide
#

looks like spigotmc is down

#

database error

primal wave
#

yep

devout tiger
#

guys

#

is spigot down

earnest forum
#

go up literally 2 lines

lost matrix
devout tiger
#

hehe

earnest forum
#

why is ur profile so bright wtf

warm light
#

Is it possible to get Enderchest from PlayerInteractEvent?

warm light
#

how?

lost matrix
#

You listen to the PlayerInteractEvent and check if an enderchest was clicked...

warm light
#

Not that

#

something like this

lost matrix
#

EnderChest is the BlockState of that block

lost matrix
warm light
#

BlockState

earnest forum
#

isnt it tile state?

lost matrix
#
EnderChest chest = (EnderChest) event.getClickedBlock().getState();
warm light
#

Thanks

mental nymph
#

what is libraries in plugin.yml and how to use it?

green prism
#

Could you help me guys with my cooldown?

                    ```java

if(System.currentTimeMillis() - cooldown.getOrDefault(player.getUniqueId(), System.currentTimeMillis()-50) > 50) {
if (actualAge.get() - 1 >= minAge) {
actualAge.getAndDecrement();
furnaceGui.setActualAge(actualAge.get());
cooldown.put(player.getUniqueId(), System.currentTimeMillis());```

It doesn't work...

warm light
mental nymph
chrome beacon
chrome beacon
warm light
#

Last time I checked it was in beta :/

lost matrix
green prism
#

a what?

lost matrix
#

Whats up with your 50ms offset?

green prism
lost matrix
#

Ah this explains it. sarcastic voice

green prism
#

Simply, it stops there
if(System.currentTimeMillis() - cooldown.getOrDefault(player.getUniqueId(), System.currentTimeMillis()-50) > 50) {

#

The system works, put the cooldown, it doesn't get to add or remove

lost matrix
#
long now = System.currentTimeMillis();
long coolDownEnd = cooldown.getOrDefault(player.getUniqueId(), now);
if(now >= cooldownEnd) {
  // Cooldown has ended
}
#

Then for setting a cooldown:

long now = System.currentTimeMillis();
long cooldownMs = 500;
cooldown.set(playerId, now + cooldownMs);
green prism
#

ouh! Thank you

lost matrix
#

Take it slow and create a lot of variables with descriptive names. Makes logic easier to untangle.

mental nymph
# mental nymph thanks

works good!

[15:24:56 INFO]: Downloading https://repo.maven.apache.org/maven2/commons-io/commons-io/2.11.0/commons-io-2.11.0.pom
[15:24:57 INFO]: Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/52/commons-parent-52.pom
[15:24:57 INFO]: Downloading https://repo.maven.apache.org/maven2/org/apache/apache/23/apache-23.pom
[15:24:58 INFO]: Downloading https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.7.2/junit-bom-5.7.2.pom
[15:24:58 INFO]: [BlockPortals] Loaded library D:\servers\testfarms_1.18\libraries\commons-io\commons-io\2.11.0\commons-io-2.11.0.jar
pulsar path
#

how can I equip an armorstand head slot via protocollib?

pulsar path
#

I know its PacketType.Play.Server.ENTITY_EQUIPMENT, but how to use it?

drowsy helm
#

ew protocol lib

#

ClientboundSetEquipmentPacket(entity id, List<Pair<EquipmentSlot, ItemStack>>)
if you chose to use moj mappings

lost matrix
# pulsar path I know its `PacketType.Play.Server.ENTITY_EQUIPMENT`, but how to use it?
    PacketContainer container = new PacketContainer(PacketType.Play.Server.ENTITY_EQUIPMENT);
    
    StructureModifier<List<Pair<EnumWrappers.ItemSlot, ItemStack>>> equipmentMod = container.getSlotStackPairLists();
    List<Pair<EnumWrappers.ItemSlot, ItemStack>> equipment = new ArrayList<>();
    // Fill list here
    equipmentMod.write(0, equipment);
    
    StructureModifier<Integer> idMod = container.getIntegers();
    int armorStandId = ...;
    idMod.write(0, idMod);
    
    ProtocolLibrary.getProtocolManager().sendServerPacket(player, container);
#

*Didnt test

#

Taking a look at the nms packet is often helpful

sleek moon
#

Guys, i'm a little bit stuck/fried.
I have this method in another class file
public static void equip(PlayerInventory inventory)
And i'm trying to use it in another command file like so
t.getInventory().addItem(kit.equip());
However there is an error - The method equip(PlayerInventory) in the type KingKit is not applicable for the arguments ()

Would you mind giving me some help because I can't figure it out.

drowsy helm
#

What are you trying to do

lost matrix
#

?learnjava

undone axleBOT
drowsy helm
#

You are pssing a method as a value

lost matrix
# drowsy helm You are pssing a method as a value

Also its a static method call on an instanced object + the method has parameter requirements but he is not
passing any. This is a clear case of not learning the very very basics of the language.

feral pike
#

Does anyone know how to fix this ?

lost matrix
feral pike
#

nah just this

lost matrix
#

What version are you using?

feral pike
#

1.8.8

lost matrix
#

XD

#

Well then whatever

feral pike
#

When I send a text component to a player this happend

lost matrix
#

Update

#

1.8 support was dropped years ago

feral pike
#

ikr

kindred valley
#

man

#

how can i check if the block is the block i want for

lost matrix
#

code

kindred valley
#
block.getState.equals(Material.BLABLA)```
#

right?

lost matrix
#

Nope

kindred valley
#

no getType*

lost matrix
#

block.getType() == Material.SOMETHING

kindred valley
#

whats the difference between .equals(9;

lost matrix
#

You can use == because Material is an enum

kindred valley
#

ah ok thanks

lost matrix
outer river
#

hello, do you know a way to stock data on a player without any file or database pls ? (like persistentDataContainer but for 1.8 mc)

#

like an api or something like this ?

lost matrix
#

pdc

#

1.8 support was dropped years ago. Leave that ancient version to die already.

#

That being said: There is NBTAPI which should suit you.

pulsar path
#

how to set the yaw on an protocollib tp packet? I got it working without yaw, but it seems like you cant set the yaw vector

PacketContainer teleport = new PacketContainer(PacketType.Play.Server.ENTITY_TELEPORT);
        teleport.getIntegers().write(0, entityID);
        teleport.getDoubles().write(0, entityLocation.getX());
        teleport.getDoubles().write(1, entityLocation.getY());
        teleport.getDoubles().write(2, entityLocation.getZ());
        teleport.getVectors().write(0, yawVector);

// SENDING PACKET HERE
lost matrix
#

Yaw is not a vector. Its a horizontal rotation. A single float number representing the angle.

pulsar path
#

oh ok thx

outer river
#

okokthx

meager trout
#

Hey!
how can i check Critical Damage on event ?

tender shard
#

no

#

no

drowsy helm
#

so a single use event?

tender shard
#

why would you? to save yourself a few characters of typing?

flint coyote
#

make a macro xD

drowsy helm
#

you gotta be kidding hahaha

distant wave
#

anyone know how should i make clock?
basically: 1 day = 20 minuted(24k ticks?)
31 days = 1 month
12 months = 1 year
should i use runTaskTimer? or what

tender shard
#

no, you should take the current world's time and just divide it through 20000 or whatever it is

distant wave
#

well thats smart

tender shard
#

a timer seems a bit overkill for this imho

kindred valley
#

?paste

undone axleBOT
tender shard
kindred valley
tender shard
kindred valley
#

Yes, i am creating items

tender shard
#

show your code pls

kindred valley
#

wait lemme

tender shard
#

it looks like you try to access ItemsAdder before it got enabled or sth

#

did you add ItemsAdder as "depend" in your plugin.yml?

kindred valley
#

i am using api

tender shard
#

try to do it like this in plugin.yml

depend:
 - ItemsAdder
kindred valley
#

i have 16gb ram. 8 in using it should use %50 of ram but

#

it uses %83 and i cant do anything

tender shard
#

disk caches

#

as long as you don't reach 100%, everything's fine

eternal oxide
tender shard
eternal oxide
#

ah ok

tender shard
#

at least I think that it means this

#

I might be wrong

eternal oxide
#

I use Win7 so it's a very different display

kindred valley
#

konsolunu atar mısın?

tender shard
#

you should really use english variable and method names, otherwise it's extremely hard for us to understand D:

tender shard
tender shard
#

I know a bit of turkish but not enough to understand those method names 😄

#

you always want to keep code in english

kindred valley
#

i gave minecraft 1024 mb and waiting it for 15 minutes to open

tender shard
#

anyway, do you actually ever call the init() method?

kindred valley
#

have you called the constructor somewhere?

tender shard
#

your constructor definitely does NOT call init()

#

"hiz" is probably always null

#

tamam

#

haha

#

as said, I know A FEW words

#

oh you should maybe also just add some System.out.println() to each method so you can see whether they actually got called

#

then add debug messages to every method call

#

and then see what methods get called

#

pls show the code where you open the inventory

#

I see, you open the same inventory every time

#

you should always create a fresh inventory

#

otherwise it will be empty after it was opened the first time, if someone takes out all the items

#

sure

#

usually you have a method like createGui() which creates a totally new inventory from scratch and returns it

#

reusing the same inv all the time will cause problems

icy beacon
#

why does this happen?

runes:
  '1663592935853':
    statistics.1:

it is supposed to be:

runes:
  '1663592935853':
    statistics:
      1:

code:

    @NotNull
    @Override
    public Map<String, Object> serialize() {
        Map<String, Object> map = new HashMap<>();

        for (RuneStatistic statistic : statistics) {
            map.put("statistics." + statistic.getId(), statistic);
        }

        // some other stuff

        return map;
    }
#

i thought of turning id into a string, but i didn't need to do it at the '1663592935853' part

torn shuttle
#

What's up ⬆️ gamers 🎮 It's me 🧑‍🦲 it's ya boy magmaguy 😎 back with another fire 🔥 question ❓
What's the first 🥇 Minecraft ⛏️ version that supported java ☕ 16?

icy beacon
#

;-;

torn shuttle
#

I'm hip and cool and definitely not balding

icy beacon
#

oh boy

torn shuttle
#

ballers not balders amirite

torn shuttle
hollow pelican
#

This isn't the right channel.

river oracle
#

Shut up

#

That's a valid dev question clown

hollow pelican
#

Didn't Ask + Cope

river oracle
#

Lol 10 yo spotted

icy beacon
torn shuttle
hollow pelican
#

Google exists too.

boreal seal
hollow pelican
#

It's not hard to google "which minecraft version supported Java 16 first?"

grizzled oasis
river oracle
boreal seal
#

i love you too

#

it was

#

the best

hollow pelican
#

I'm trying to figure out how to get if the player is blocking with a shield and if the player attacking them isn't in the direction where the shield can block damage.

boreal seal
#

What's up ⬆️ gamers 🎮 It's me 🧑‍🦲 it's ya boy tony magma the boy 😎 back with another fire 🔥 question ❓
What's the first 🥇 Minecraft ⛏️ version that supported java ☕ 4?

torn shuttle
#

hey now

#

that's copyright infringement

boreal seal
#

no its tottaly legal

torn shuttle
#

you'll be hearing from my lawyers

river oracle
#

I tho8ght you were magma

boreal seal
#

i changed a part of my string

#

fool

#

piss on u

torn shuttle
#

oh so that's why it's yellow

boreal seal
#

i hope coco dont read it

torn shuttle
#

I always wondered

river oracle
boreal seal
#

idk maybe spigot meant to be made out 24k gold

#

who knows

grizzled oasis
river oracle
#

Whatever your fetching it from doesn't contain that element your looking for

#

Thus the exception

torn shuttle
#

so that's interesting

river oracle
#

Your interesting

torn shuttle
#

1.16.5 was still on java 8 which seems to be congruent with my preliminary testing but papermc seems to run just fine with java 16 on 1.16.5? Does anyone remember the ancient lore and if paper was supporting a broader range of java versions?

river oracle
#

Paper lore

torn shuttle
#

I must consult the ancient scrolls

hollow pelican
#

Is it possible to detect if the player is blocking with a shield and is facing towards the attacker?

hollow pelican
#

How would I go about doing so?

torn shuttle
#

but hey, google exists!

hollow pelican
#

I already tried looking it up smh

flint coyote
torn shuttle
flint coyote
#

I see

hollow pelican
#
MagmaGuy — Today at 14:19
What's up ⬆️   gamers 🎮  It's me 🧑‍🦲 it's ya boy magmaguy 😎  back with another fire 🔥  question ❓ 
What's the first 🥇  Minecraft ⛏️  version that supported java ☕  16?

ZBLL — Today at 14:19
;-;

MagmaGuy — Today at 14:19
I'm hip and cool and definitely not balding

ZBLL — Today at 14:20
oh boy

MagmaGuy — Today at 14:20
ballers not balders amirite

Y2K_ — Today at 14:21
1.16 iirc 

MagmaGuy — Today at 14:22
lit 🔥  fam 🤝 thanks 💾

SomeoneOnDlscord — Today at 14:23
This isn't the right channel.

Y2K_ — Today at 14:23
Shut up
That's a valid dev question clown

SomeoneOnDlscord — Today at 14:24
Didn't Ask + Cope

Y2K_ — Today at 14:24
Lol 10 yo spotted

ZBLL — Today at 14:24
it really isn't```
#

I'd send a screenshot but it won't let me, probably because I'm not verified.

#

I just came here to ask about properly detecting shield blocking so that if the player is hit from behind while blocking, they will take damage.

flint coyote
#

Yes you need to be verified in order to send images.
However, I'm not here to judge anyone since that's not what this channel was made for.
If he didn't like how you responded it's up to him whether he wants to help you or not.

hollow pelican
#

True.

#

bye

torn shuttle
#

man could've used the player#isBlocking() combined with either a damage event or a repeating task and then scanned the world for players and used some basic vector math to figure out if they were within a certain amplitude but instead he just had to tell me I was misusing the room and then ragequit from the karma

#

smh

grim ice
#

uh

#

scheduleWithFixedDelay in scheduled executor service

#

runs off thread right?

#

is there a way to make it run on the main thread

boreal seal
#

why

#

U want to do that

#

It doesn’t make any sense

grim ice
#

i have to schedule something to happen every few moments but

flint coyote
#

Not with a fixed delay I guess. Since fixed delay might be inbetween ticks

grim ice
#

its not thread safe

#

probably

eternal oxide
#

implement some kind of lock to make it safe

grim ice
#

i mean i think it should be safe

#

since what it does is to send packets

#

to a server

#

thats all

eternal oxide
#

you can send packets any time you like. they are queued

kindred valley
#

@tender shard i handled the error

pulsar path
eternal night
#

its not a float, its a byte iirc

pulsar path
#

lemme try

#

working, thx

reef lagoon
#

Why is my pom.xml red (file name)

#

What does it mean when it happens

eternal oxide
#

error

reef lagoon
#

[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\user\Desktop\plugins\horses). Please verify you invoked Maven from the correct directory. -> [Help 1] But it is in the folder so I really don't get it

hazy parrot
pulsar path
#

how can I calculate the yaw for an protocollib armorstand to look at an location?

fresh timber
#

how do I change the chat format?

kindred valley
#

?paste

undone axleBOT
tender shard
fresh timber
#

ok thx

tender shard
#

it expects a string like in String.format

#

first %s is the username, second %s is the message

weak bear
#

Hello How can I add getConfig() in another class

hasty prawn
#

?di

undone axleBOT
hasty prawn
#

Like that

weak bear
#

Ok thx

weak bear
#

I have this error ...

#
 org.bukkit.command.CommandException: Unhandled exception executing command 'maintenance' in plugin ShinobiCraftPlugin v1.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[PluginCommand.class:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:156) ~[SimpleCommandMap.class:?]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:752) ~[CraftServer.class:?]
        at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:1590) ~[pa.class:?]
        at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:1429) ~[pa.class:?]
        at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(CPacketChatMessage.java:46) ~[la.class:?]
        at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(CPacketChatMessage.java:9) ~[la.class:?]
        at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:16) ~[hv.class:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_202]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_202]
        at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:840) [MinecraftServer.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:461) [nz.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:778) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:624) [MinecraftServer.class:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_202]
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at fr.spectr2155e.shinobicraft.commands.Maintenance.onCommand(Maintenance.java:23) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:43) ~[PluginCommand.class:?]```
hasty prawn
eternal night
#

cannot wait for the args[0]

tender shard
#

?learnjava

undone axleBOT
tender shard
#

sorry but

#

ArrayOutOfBounds?

#

you should know what this means

weak bear
#

ok

tender shard
#

you probably do if(args[0].equalsIgnoreCase("something")) without checking if args even has at least 1 element

hasty prawn
#

^

icy monolith
#
    public void onDeath(PlayerDeathEvent player) {
        if (player.getEntity().getMaxHealth() > 1) {
            player.getEntity().getKiller().getMaxHealth() += 1;
            }
        }
    }```
Need help, im trying to make it so it removes 1 max health from player taht dies and add 1 to player that kills
#

I get an error

#

unexpected type: get.maxhealth()

hasty prawn
#

You can't add to a method return like that

vast raven
hasty prawn
#

You need to use Attributes ^

vast raven
#

There is a method for that

kindred valley
#

?paste

undone axleBOT
vast raven
#

.setMaxHealth() I think

kindred valley
hasty prawn
hasty prawn
icy monolith
#

No idea im new to this

vast raven
icy monolith
#
method setMaxHealth in interface org.bukkit.entity.Damageable cannot be applied to given types;```
vast raven
hasty prawn
#

Oh maybe in 1.12.2 PeepoShrug I use latest

icy monolith
hasty prawn
#

Yeah use Attributes then

vast raven
kindred valley
# hasty prawn That is a lovely NPE yes
public static CustomStack setMeta(String displayName, CustomStack custom_stack, ItemMeta meta, int pdcValue, String name){
       custom_stack = CustomStack.getInstance(name);
       meta = custom_stack.getItemStack().getItemMeta();
       meta.getPersistentDataContainer().set(Keys.smithingItems, PersistentDataType.INTEGER, pdcValue);
       custom_stack.getItemStack().setItemMeta(meta);
       meta.setDisplayName(displayName);
       return custom_stack;
    }```I am using this to save itemstacks but it says custom_stack is null
hasty prawn
icy monolith
#

How would i do atributes then? 🙂

icy monolith
#

the line where i check if player has more than 1 health gets the same error btw

hasty prawn
#

You should probably learn java before trying to do this

#

?learnjava

undone axleBOT
kindred valley
#

i just forgot to define those

private static CustomStack itemSadderSwordGui;
    private static  ItemMeta itemSadderSwordGuiMeta;

    private static  CustomStack itemSadderPickaxeGui;
    private static  ItemMeta itemSadderPickaxeGuiMeta;

    private  static CustomStack itemSadderAxeGui;
    private  static ItemMeta itemSadderAxeGuiMeta;```
hasty prawn
#

Well that seems like an extreme response to an NPE peepoScared

#

Ah yeah that'll do it lol

quaint mantle
#
if(e.getClickedInventory().getHolder() instanceof bmUi){
        e.setCancelled(true);

        switch (e.getSlot()){
            case 2: {
                p.closeInventory();
                ItemStack item = e.getCurrentItem();
                ItemMeta meta = item.getItemMeta();
                String itemlore = meta.getLore().get(0).split("$")[1];
                getLogger().info("[clans] the price selected is: " + itemlore);
                int price = Integer.parseInt(itemlore);
                EconomyResponse response =  economy.withdrawPlayer(p, price);
                if(!response.transactionSuccess()){
                    p.sendMessage(ChatColor.BOLD + "" + ChatColor.RED + "you cannot purchase this item");
                } else {
                    p.sendMessage("you bought this item !");
                    item.setItemMeta(null);
                    p.getInventory().addItem(item);
                }

error: Could not pass event InventoryClickEvent to Clans v1.0 java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 at net.polarlabs.events.clickEvent.onClick(clickEvent.java:37) ~[?:?]
gui presented in the screenshot

quaint mantle
#
String itemlore = meta.getLore().get(0).split("$")[1];
hasty prawn
quaint mantle
kindred valley
#

i dont need to define them

#
NEWGUI.smithChooseGUI.setItem(21, setMeta(ChatColor.RED + "Kılıçlar", itemSadderSwordGui, itemSadderSwordGuiMeta, 501, "itemsadder:ruby_sword").getItemStack());
hasty prawn
#

itemSadderSwordGui has to be defined

#

Same with the meta too, actually.

kindred valley
#
public static CustomStack setMeta(String displayName, CustomStack custom_stack, ItemMeta meta, int pdcValue, String name) {
       custom_stack = CustomStack.getInstance(name);
       meta = custom_stack.getItemStack().getItemMeta();
       meta.getPersistentDataContainer().set(Keys.smithingItems, PersistentDataType.INTEGER, pdcValue);
       custom_stack.getItemStack().setItemMeta(meta);
       meta.setDisplayName(displayName);
       return custom_stack;
    }```
hasty prawn
#

What does CustomStack.getInstance() return?

hazy parrot
#

Btw why are you passing custom_stack in args, then immediately give it new value

kindred valley
hasty prawn
#

Okay so custom_stack isn't ever getting set to anything

#

Which means it's still the null value you passed in

hazy parrot
kindred valley
#

Its an API

#

ItemSadder API

hazy parrot
#

Oh

vast raven
#

Who in the world made it

kindred valley
kindred valley
hasty prawn
#

Nah you're probably doing it wrong

#

Send the API

#

That method is weird though

fluid river
#

um back

#

where are noobs

#

show me

hasty prawn
#

modCheck noobs where

fluid river
#

where is every

vast raven
#

I still don't get the sense of a static method called "getInstance" that throws an exception

fluid river
#

every where

kindred valley
#

it shouldnt be like that

fluid river
#

maybe throws nullpointer cuz dev forgot to initialize instance field

kindred valley
vast raven
vast raven
fluid river
kindred valley
#

I am asking them for help

#

and their fucking discord server has full of plugins i am trying to deal with

fluid river
#

my younger brother has internet lesson in another room

#

and i'm stuck in a toilet with no toilet paper

#

can't ask him to bring me a roll

#

ez

tardy delta
#

you shouldnt be on your phone while on toilet

#

lol

fluid river
#

phone is the only reason i'm not currently dying

#

waiting for his lesson to end

tardy delta
#

tf am i lookign at

fluid river
#

trashcode?

tardy delta
#

bruh where the fuck is impl

#

i only see stuff throwing ex

fluid river
#

oh i see

worn scaffold
#

BungeeCord Question:

Does ServerConnectedEvent called only once when their login (and verification which they are signed in) was completed? (docs are kinda confused)

fluid river
#

he just hid it

tardy delta
#

then make it an interface lol

fluid river
#

then he has to hide a class with realization

#

like it doesn't exist completely

tardy delta
#

¯_(ツ)_/¯

fluid river
#

a lot of plugins and apps written on java have this thing

#

with hidden implementation

#

on github

serene egret
#

how can i cancel a bukkitrunnable outside the runnable?

fluid river
#

umm

#

store it's id, get it by id when needed

#

or store the runnable object to a variable

#

and call .cancel() when needed

serene egret
#

k thx

fluid river
#

he brought me a roll

#

easy

tardy delta
kindred valley
tardy delta
#

some shitty plugin that i saved in my bookmarks for whatever reason

iron glade
#

Error 404: naming conventions not fond

vast raven
mighty bane
#

Anyone know how to cancel a players death event?

chrome beacon
mighty bane
#

player.getHealth() <= event.getFinalDamage()

Something like this?

chrome beacon
#

Yeah

mighty bane
#

Okay so why isn't it working?

last swift
#

How do I calculate an arrow's damage based on it's velocity? I'm recoding the entirety of damage, knockback, etc. I'm curious as to what the equation for arrow damage is. I know it's based on velocity/how much the bow was pulled back, but without using event.getFinalDamage() or event.getDamage() in EntityDamageEvent.

fluid river
#

hey guys

#

how is this thing called

#

String...

#

like a dynamic array or smth

chrome beacon
fluid river
#

what is it's name

fluid river
#

who knows

tardy delta
#

varargs

fluid river
chrome beacon
#

or look at nms code

fluid river
#

Which is gonna do 6 damage

#

and then if the velocity is lower, divide

last swift
mighty bane
# fluid river cuz you didn't show full code
    public void Death(EntityDamageEvent event) {

        Player player;
        String playerName;
        List<String> names = plugin.getConfig().getStringList("immortals");

        if(event.getEntity() instanceof Player) {
            player = (Player) event.getEntity();
            playerName = player.getName();

            for (String name : names) {
                if (name == playerName && player.getHealth() <= event.getFinalDamage()) {
                    if (player.getBedSpawnLocation() != null) {
                        player.teleport(player.getBedSpawnLocation());
                        player.setHealth(player.getMaxHealth());
                        player.setFoodLevel(player.getFoodLevel());
                        event.setCancelled(true);
                    }else {
                        player.teleport(player.getLocation().getWorld().getSpawnLocation());
                    }

                    player.sendMessage("Death shall not come for you yet, my friend.");
                }
                player.sendMessage("Goodbye");
            }
        }

    }```
last swift
#

i found a basic equation for knockback luckily:

t.setVelocity(arrow.getVelocity().setY(0).normalize().multiply(0.47 + new Random().nextDouble() / 70 + arrow.getKnockbackStrength() / 1.42).setY(0.400023));
fluid river
#

that's the problem

#

not the final damage part

mighty bane
echo basalt
fluid river
#

cuz you didn't cancel the event when it is

mighty bane
#

Oh lol

fluid river
#

you can make your code like 2 times smaller

serene egret
#

i have a problem. when i issue a command it works but im getting this message: An internal error occurred while attempting to perform this command

fluid river
#

umm

serene egret
#

i mean all works how it should but i become this

fluid river
#

basically you have an error in console

#

send it

serene egret
#

no lol

mighty bane
fluid river
#

then you might have two plugins do the same command

fluid river
#

that's why

#

FREE JAVA LESSONS

#

(checkmybio)

mighty bane
#

No

serene egret
#

ah now it works

#

strange

fluid river
#

umm feels bad

fluid river
mighty bane
#

1.19, and it works now. Thanks

fluid river
#

umm

#

you probably code on java 17 and don't use any feature added since 1.8)

tardy delta
#

myes naming conventions gone

fluid river
#

ye

quaint mantle
echo basalt
#

oh hi fourteen

tardy delta
#

hi

fluid river
tardy delta
#

teacher stopped lesson hour earlier lol

fluid river
#
@EventHandler
public void onLethalDamage(EntityDamageEvent event) {
        if(!(event.getEntity() instanceof Player player)) return;
        if (player.getHealth() > event.getFinalDamage()) return;
        if (!plugin.getConfig().getStringList("immortals").contains(player.getName())) {
            player.sendMessage("Goodbye");
            return;
        }
        Location bed = player.getBedSpawnLocation();
        player.teleport(bed == null ? player.getLocation().getWorld().getSpawnLocation() : bed);
        player.setHealth(player.getMaxHealth());
        player.setFoodLevel(player.getFoodLevel());
        event.setCancelled(true);
        player.sendMessage("Death shall not come for you yet, my friend.");
    }
modern maple
#
if(p.getInventory().getItemInOffHand().getType().equals(Material.TOTEM_OF_UNDYING)) {
        //Delete Item in offhand
            }else if(p.getInventory().getItemInMainHand().getType().equals(Material.TOTEM_OF_UNDYING)) {
            //Delete Item in mainhand
        }```

Trying to make it delete the totem in the offhand (dont ask why)
Not sure what the line of code would be to remove an item tbh.
eternal night
#

just setItemInOffHand to air or null

modern maple
#

oh just set to air

#

oh ty

fluid river
modern maple
#

ty ❤️

fluid river
#
ItemStack main = p.getInventory().getItemInMainHand(), off = p.getInventory().getItemInOffHand();
if(main != null && main.getType().equals(Material.TOTEM_OF_UNDYING)) {

} else if(off != null && off.getType().equals(Material.TOTEM_OF_UNDYING)) {

}```
vocal pine
#

Is there any way to not network a PDC so clients with mods like NBTToolTip cant see it? I dont see why it’s networked

mighty bane
#

Anyone know how many particles I need to spawn to make it look like someone just used an enderpearl?

vocal pine
#

Yeah I wanted to be able to differentiate things serverside completely invisibly to client

eternal night
#

Well

vocal pine
#

Pretty much what it boils down to

#

Lol

eternal night
#

you can always just only add a uuid

#

and then resolve all data server side

#

you will never be able to do stuff completely invisible

vocal pine
#

thats a great idea

#

Thank you

eternal night
#

else the client would believe item stack a is item stack b

#

eventho they have different PDC

#

and shit explodes

#

its technicallyyyyy possible (maybe)

#

but not really for a plugin

#

would be spigots job somewhere in the future

vocal pine
#

Yeah it was unstackables at least so won’t be a huge issue

eternal night
#

Yea

#

until creative mode comes along

#

and completely trashes the inventory system

vocal pine
#

Won’t stick out if they did or did not which is one issue

fluid river
#

other way you have to leave PDC's and do something trashy

#

slowing down your plugin by 9999%