#help-development

1 messages · Page 44 of 1

glossy scroll
#

.

sterile token
#

So would be:

CompletableFuture<ResultSer> query(String query) {
  return CompletableFuture.runAsync(() -> {
    try {
      executing query
    } catch (bla bla) {
      priting
    }
  });
}```
tender shard
#

yeah kinda. but, and now the monkey dies:

You probaby will again simply do stuff like this in your code:

ResultSet myResult = MyClass.query("...").get();

and that breaks it again

golden kelp
#

for some reason, my plugin.yml isnt being packed into the jar

tardy delta
#

ah lol doing /reload invalidates my custom player object

tender shard
golden kelp
#

yes sir

tender shard
undone axleBOT
golden kelp
tender shard
#

henlo hannah

#

I missed you

buoyant viper
sterile token
tender shard
#

you fucked up your resources path

golden kelp
#

oh

#

just like my life

sterile token
tender shard
#
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
#

it should be like this ^

tardy delta
tender shard
#

you can also add fancy comments like

            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
<!-- mfnalex is the best, I truly love him, nohomo though -->
            </resource>
tardy delta
#

CompletableFuture::supplyAsync

tender shard
waxen plinth
#

@tender shard Your parser is ready

golden kelp
#

else i wouldve added it after everyline

tender shard
#

I am 100% sure that you will still query the results instantly, hence eliminating the adventages of futures

tender shard
golden kelp
#

parser for what

tender shard
#

csv files

sterile token
waxen plinth
#

Just call CSVParser.parse(String)

golden kelp
tender shard
#

thx ❤️ did you test whether it works with weird symbols etc too?

tender shard
#

lol

golden kelp
#

xd

golden kelp
#

redempt can u make a toe pic parser for me

tender shard
#

for example:

waxen plinth
#

Yes it handles quotes

golden kelp
waxen plinth
#

If you genuinely wanna make a custom format

#

Let me know

buoyant viper
#

make me a custom file configuration format ‼️

tender shard
#
# Name, Last name, Address
Alexander,Majka,"Junkerstraße 17, 48153 Münster"

the third value should be exactly Junkerstraße 17, 48153 Münster (including the comma, but excluding the quotes)

waxen plinth
#

Yep

tender shard
#

oki alrighty

#

i'll test it rn

tardy delta
#

hmm reloading server wipes my own cache :/

tender shard
#

yeah ofc

#

it unloads your plugin, then loads it again

waxen plinth
#

Sidenote though alex

tender shard
waxen plinth
#

This does assume that all rows have the same number of columns

tender shard
#

oh okay

#

that's fair enough though

waxen plinth
tender shard
#

I dont think that any normal csv file will have differences in length

waxen plinth
#

It makes it slightly faster

tender shard
#

I am pretty sure that it's basically required or a de facto standard to have the same amount of rows

#

erm

#

columns

#

hm I'm thinking about allowing comments

buoyant viper
#

is that even a spec in csv

waxen plinth
#

Must it

tender shard
#

either it would check every line, if it starts with #, or it only checks the first line whether it starts with #

buoyant viper
#

not that csv really has a spec but

tender shard
waxen plinth
#

The spec is usually that the first row is headers

tender shard
#

I just don't want people to be surprised

waxen plinth
#

Everything under the first row is data

tender shard
waxen plinth
#

So there's no real need for comments

tender shard
#

e.g. no header

waxen plinth
#

Make a guy a parser and he gets out a list of further demands

#

smh

tender shard
#

I think simply ignoring the first line if starts with # is good enough

tender shard
#

I'll just check if line 1 startsWith("#"), continue()

#

or sth

buoyant viper
#

well yeah but beyond the first line saying heres what ur data represents and anything after it being the data

#

csv is free space

tender shard
#

btw I havent checked yet

#

did 1.19.2 bring a new obc package name?

waxen plinth
#

Supports first line # comments now

tender shard
#

oh nice

#

I was already trying to figure out where I could add it myself lol

#

thanks

waxen plinth
#

Enjoy your tiny parser

tender shard
#

Thank you :3

#

W

#

T

#

F

waxen plinth
#

?

tender shard
#

what kind of weird error message is that

#

obviously the file is called CSVParser.java

waxen plinth
#

They're the same

#

Yeah

tender shard
#

yeah

#

wtf

waxen plinth
#

Click rename file I guess?

tender shard
#

the copy paste from the previous gist worked

#

lol

buoyant viper
#

is the package right

waxen plinth
#

Oh good point

#

It's redempt.test in the gist

tender shard
#

wtf

#

it gets even weirder

waxen plinth
#

lol?

buoyant viper
#

LOL

waxen plinth
#

Just delete the file and remake it

tender shard
#

guess it's time toooo... INVALIDATE CACHES again

#

lol

buoyant viper
#

intellij

#

truly an engineering marvel from every perspective

waxen plinth
#

who else needs a parser

tender shard
#

I need one to...

#

erm

#

shit

#

I don't need anything

buoyant viper
#

u know those file configs that r like

[Section]
Key=Value

#

?

tender shard
#

ini files

buoyant viper
#

sure

tender shard
#

or wait

#

systemd uses a similar thing

#

but what is it called again

buoyant viper
#

idk

#

but i actually need a reader And writer for it

tender shard
#

yeah systemd uses it

#

I wonder if it supports nested "headers"

#

or whatever its caled

#

oh wait, arent those toml files?

#

TOML is a file format for configuration files. It is intended to be easy to read and write due to obvious semantics which aim to be "minimal", and is designed to map unambiguously to a dictionary. Its specification is open-source, and receives community contributions. TOML is used in a number of software projects, and is implemented in many prog...

vocal cloud
#

Root

tender shard
#

do you allow users to edit systemd files? lol

vocal cloud
#

You make an admin account with your name or something usually

tender shard
#

isnt that kinda useless if you sudo everything anyway, then

peak depot
#

who can I get the ammount of letters before a specific symbol

tender shard
#

String#indexOf

quaint mantle
#

hello ?

#

oh

tender shard
#

hello ?

quaint mantle
#

Im trying to paste a screenshot but I cant

tender shard
#

because you are not verified

#

enter !verify

quaint mantle
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

quaint mantle
#

!verify William404

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

tender shard
#

it only takes a minute 🙂

quaint mantle
#

ah it works, trying to call class method inside my command check

tender shard
#

it's sorted by the number automatically

#

so you wanna use the highest number for the highest row, and 0 or 1 or similar for the lowest row

tender shard
#

whatever you prefer

#

I always go for the static getter

#

some people however claim it's bad, while giving weird arguments

#

some of those weird arguments are true though, but imho the disadvantages of the getter are less than the advantages

#

so yeah, fuck DI, it doesn't make code better testable at all, unless you're living in 2013 when mockbukkit didnt exist yet

#

al that DI does is make your code longer without gaining anything

#

that's my opinion lol

quaint mantle
ivory sleet
#

The issue with static mono state or singletons is partly testability, but also thread safety

eternal night
#

Once you ascend to the level where you understand DI frameworks are more more pain than good you can call yourself a spigot Dev

ivory sleet
#

Well not to mention, just because you use DI doesnt mean you did it correctly subsequently implying that you may not gain any significant advantage of it either

opal frigate
#

I usually use DI for registering events and commands and such

ivory sleet
#

Yes because you have to there more or less, at least for registration

#

But when it comes to the design in your hands you could go for the non DI options (although I’d avoid that unless you have justifiable reasons)

#

Additionally, when I mean DI, I dont mean just populating your main class with getters to all your managers/high level facades and then pass your main instance around everywhere, as thats a clear example of when DI is wrongly used

tender shard
quaint mantle
#

still struggling 😬

desert frigate
#
public static void sendBlockDamageToEveryone(@Nonnull final Block, final float progress) {
   for(final LivingEntity entity : block.getWorld().getNearbyEntities(block.getLocation(), 25,25,25)) {
  
}
}```

Would this work for only players within 25 blocks?
lavish folio
#

how i can modify player velocity to make practice servers knockback

desert frigate
#

how would I use entity as a player tho?

tender shard
#

whut?

#

a player always is an entity

#

you can just do somePlayer.setVelocity(someVector)

lavish folio
tender shard
#

what values?

#

you just set the velocity to whatever you want it to be

desert frigate
#
if(entity instanceof Player) {
entity.sendBlockDamage(block.getLocation(), progress)
}```
#

this?

#

wait

#

that's wrong

#

ok that

tender shard
#

you cannot send block damage to entities

#

you can only send it to players

#

so cast your entity to Player

desert frigate
#

u just said players r entoty

#

wha

#

oh

tender shard
#

yes

desert frigate
#

So (Player) entity

lavish folio
tender shard
#

I said "Players are always Entities" but I didnt say that "Entities are always players"

tender shard
ivory sleet
#

👀

tender shard
severe turret
#

Any seasoned veteran can teach me how to convert value from json file to a String using Jackson

#

sadge

ivory sleet
#

A scalar value?

desert frigate
#
public static void sendBlockDamageToEveryone(@Nonnull final Block, final float progress) {
   for(final LivingEntity entity : block.getWorld().getNearbyEntities(block.getLocation(), 25,25,25)) {
if(entity instanceof Player) {
((Player) entity).sendBlockDamage(block.getLocation(), progress)
}
}
}```
tender shard
#

that sounds like some vietnamese dish

ivory sleet
#

Or like an entire structure?

desert frigate
quaint mantle
severe turret
#

let's say I have like "name": "Alex"

tender shard
severe turret
#

i want to get the value and put it into a string

ivory sleet
#

Oh

#

You’d have to parse the entire json tree tho iirc

#

And then grab what you actually want

tender shard
#

in gson it's like this IIRC myWeirdJsonObject.get("name").getAsString()

severe turret
#

ajeiaoaknfskkakdn

tender shard
#

no idea about jackson

desert frigate
severe turret
#

Gson it is

#

i guess

ivory sleet
#

Lmao

ivory sleet
#

Gson is a bit more sophisticated, not a bad choice

lavish folio
# tender shard Y is up/down

Vector v = event.getDamager().getLocation().getDirection();
v.setY(-0.3);
event.getEntity().setVelocity(v);
player who been hited get extreme left/right knockback

desert frigate
#

I only did that so it wouldn't make lag

severe turret
#

This api already uses Jackson so I didn't want to import another dependency

tender shard
severe turret
#

sadge

ivory sleet
#

You have multiple ones

tender shard
#

you cannot

#

that's like asking "how can I turn 5 chairs into one". well you could throw away 4 chairs

ivory sleet
#

There is no clear notion of how to transform one to the other and vice versa

tender shard
#

you probably want to loop over your collection

severe turret
#

Wait why is he using Collection 🤔

tender shard
#
for(ItemStack myItem : myCollection) {
  // Now you can access "myItem". It runs once for every itemstack
quaint mantle
ivory sleet
#

Ugh sure

#

Whats the actual problem?

tender shard
ivory sleet
#

Oh yeah chexk the link out btw

#

It does help

tender shard
#

you just said it's "not helpful" without explaining what you need help with

eternal night
#

no! conclure help only

tender shard
#

?conclurehelponly

quaint mantle
#

it was completly ignored

tender shard
#

because you didnt ask any question

#

?ask

undone axleBOT
#

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

quaint mantle
tender shard
#

no, all you said was "ah it works, trying to call class method inside my command check "

#

and your next message was "not helpful"

#

and now you start asking why people don't answer to you

tender shard
#

I've seen that. and what is your question?

quaint mantle
#

are you joking ?

tender shard
#

I think that you are joking lol

#

You keep saying that you wanna call a method and deny explaining what your problem is

quaint mantle
#

i dont have time to go into an argument with ya

desert frigate
tender shard
#

at first I thought you just need the reference to that class in the other class

#

but you just said "not helpful" so I really have no clue what your fk problem is

#

anyway, I wish you a nice day, I'm out

quaint mantle
#

all gae people are the same

#

all toxic

#

oups

vocal cloud
#

Yeah bye

tender shard
#

this gets you banned very quickly here

desert frigate
#

ban him

vocal cloud
#

I'd be just as toxic and I'm straight as an arrow lmfao

lavish folio
tender shard
#

i was just trying to help bro

quaint mantle
#

you ignored me

vocal cloud
#

No he tried to help

tender shard
#

can we get this dude banned now pls

quaint mantle
#

when i posted a screenshot

tender shard
#

I think I was realy patient

desert frigate
quaint mantle
quaint mantle
ivory sleet
#
class BootlegClass {
   
  void callMe(){
    sout("Conclure is NOOOB");
  }
}

class NoobCommand implements CmdExecutor{
  private final BootlegClass cluzz;

  public NoobCommand(BootlegClass cluzz){
    this.cluzz = cluzz;
  }

  void onCommand(…){
    cluzz.callMe();
  }
}```

Here this should be clear enough
vocal cloud
quaint mantle
desert frigate
ivory sleet
#

Ayo, lets calm down now shall we, william have a look at my dodo example and see if it might help

quaint mantle
ivory sleet
#

I said stop

quaint mantle
#

this guy was simply toxic

#

🤷‍♂️

tender shard
#

I was toxic?

vocal cloud
#

Alright ask your question with code in a pastebin

tender shard
#

I wasn't toxic at all, I simply asked you what your question is

ivory sleet
#

Alex, u as well

#

Just drop it

vocal cloud
#

So that we can see it. Don't leave anything out of your question be as specific as possible

#

yes you

ivory sleet
#

?kick @quaint mantle stop already

undone axleBOT
#

Done. That felt good.

tender shard
#

thank you

#

wait whut

#

where did lynx question go lol

eternal night
#

Well it was just there to move the convo xD

ivory sleet
#

Just disappeared:(

eternal night
#

now that it is done

ivory sleet
#

Ahhh

eternal night
#

I figured, I'll just remove it xD

ivory sleet
tender shard
#

but now I wonder too

eternal night
#

its block data

tender shard
#

how can I turn a grass block to a snowy one

#

is it a separate block / material?

eternal night
#

nah

#

its on the block data

quaint mantle
#

this comunity needs to chill

tender shard
#

huh weird

#

I don't see any grass blockdata

visual tide
ivory sleet
#

No, I told u to drop the circle jerk

#

You didnt

eternal night
#

Snowable alex

tender shard
#

aah

#

thanks

desert frigate
#

Does Block#breakNaturally make the item drop?

ivory sleet
#

I’m fully interested in helping you william, but dont continue a dead debate

eternal night
#

the only time you get specific block interface names

#

is if you are combining two sub interfaces

quaint mantle
tender shard
#

what itemstack?

#

the tool that broke the block?

tender shard
#

or the drop the block is about to drop?

ivory sleet
#

Did u look at that at least 😅

tender shard
#

you can't

#

it's not "calculated" any drops yet

#

listen to BlockDropItemEvent

quaint mantle
quaint mantle
tender shard
#

yo uwant to call a method from somewhere else

#

so you need an instance of the other class

vocal cloud
visual tide
#

you can pass an instance of the class via the constructor, like in the example conclure posted

waxen plinth
#

In which case you need an instance

vocal cloud
#

What class is it? Is it your main class?

vocal cloud
#

When asking a question please format it with as much detail and provide code examples

waxen plinth
#

But as everyone will tell you and none have ever heeded, you should learn and understand basic OOP before attempting to write plugins

vocal cloud
#

that's what you do ^

waxen plinth
#

No it's not

tender shard
#

and then I'd send ?notworking

waxen plinth
#

You don't say "it's not working" you elaborate

#

Yeah lol

vocal cloud
#

Yeah yeah well you add more detail

#

I'm not typing an essay today YanSigh I write it too often

tender shard
#

redempt what flag is that in your profile banner

#

is that the trans flag?

waxen plinth
#

Asexual spectrum flag

tender shard
#

ah ok

eternal oxide
#
YourCommand command = new YourCommand(this);
Bukkit.blah.blah.setExecutor( command );
// to access a method in yoru command class.
command.method();```
tender shard
#

there's so many flags, I cant remember them all lol

waxen plinth
#

Aspec flag is niche but it's really aesthetic

#

I love purple which definitely helped

quaint mantle
#

is there private channels ?

waxen plinth
#

Make a thread

vocal cloud
quaint mantle
#

spigot help

waxen plinth
#

ImageIO can do that I think

visual tide
#

you can do ImageIO.read on the stream

river zealot
#
while(block.getDrops().iterator().hasNext() ) {
                    System.out.println("Item dropped in slot " + i + " " + block.getDrops().iterator().next());
                    i++;
                }``` 
why does that create an infinite loop and doesn't reach the end of the item stack?
eternal night
#

you need to store the iter somewhere

#

iterator() creates a new one

river zealot
#

how to I iterate the list then without creating a new one?

tender shard
#

you don't really

#

you need to get it signed by mojang to get a signature

eternal night
glossy scroll
#

?di

undone axleBOT
twilit roost
#

How can I make some entities bigger?
just scale them up
NMS

eternal night
#

final var iterator = blocks.getDrops().iterator(); while(iterator.hasNext()) ....

river zealot
#

thanks

twilit roost
#

great site

#

u only need Texture Value

#

i meant link

#

why buffered img?

#

r u requesting textures runtime?

#

yeee idk
never used their api

glossy scroll
#

a texture value is {"textures":{"SKIN":{"url":"http://textures.minecraft.net/texture/ae58d8bc5f6a5b1a9ab28cf939eec51e2b4945294eae45d544cbb853d29e"}}}

#

oh by the way

#

that is converted to base64

#

so it will look like this

#

eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWU1OGQ4YmM1ZjZhNWIxYTlhYjI4Y2Y5MzllZWM1MWUyYjQ5NDUyOTRlYWU0NWQ1NDRjYmI4NTNkMjllIn19fQ==

#

yes

twilit roost
#

yep

#

don't they have discord?

#

or docs

glossy scroll
#

yea then you need to go use their resources

#

we cant really help with that

eternal oxide
#

I can give you a web request method

desert frigate
#

Would it be possible to make players not be able to take armor/stuff from the armor stands?

glossy scroll
#

@small peak this was literally on mineskin's website

eternal oxide
#

?paste

undone axleBOT
glossy scroll
#

so was this

#

you didnt really do much digging didy ou

slender mulch
#

hello, i need do something when player activate end portal. I can't find what event to use for this. I tried PortalCreateEvent but it doesn't work. What event can I check it

glossy scroll
#

google would be your best option there

#

are you sure you need to upload a file?

eternal oxide
glossy scroll
#

this is the specification

#

(for a url)

#

for a file:

ebon stratus
#

I'm using the mojang mappings and i get this error java.lang.NoClassDefFoundError: net/minecraft/server/level/ServerPlayer, how do i fix?

chrome beacon
#

Did you compile with maven?

#

If so send your pom

#

?paste

undone axleBOT
ebon stratus
#

yeah, ill send now

glossy scroll
#

you need to use SpecialSource

ebon stratus
#

i think i am, as the ItemStack class didn't give any error

glossy scroll
#

well you definitely arent

#

because ServerPlayer is not in spigot mappings

ebon stratus
#

is net.minecraft.world.item.Itemstack in spigot mappings?

glossy scroll
#

are you copying the correct jar from your target folder?

ebon stratus
#

yes

#

i g

glossy scroll
#

are you sure?

ebon stratus
#

idk

#

i didn't make any plugins in a while, so..

#

no im not sure

glossy scroll
#

well what are the jars that are outputted

ebon stratus
#

from shade

glossy scroll
#

ook yea thats not gonna work

ebon stratus
#

so.. in remap?

river zealot
#

Why does storing the getDrops() in an Itemstack type variable doesn't work ?

glossy scroll
#

you should use <outputDirectory>...</outputDirectory> in the remap-spigot configuration

ebon stratus
#

ok

twilit roost
#

could I turn this:
into this? :

glossy scroll
#

no

#

you cant

#

ive told you this lol

buoyant viper
#

big squid

twilit roost
#

ye ikr
but as u can see
someone smhw made it

glossy scroll
#

they likely used a clientside mod

#

or a custom model and texture pack

twilit roost
#

texture pack isnt problem for me
since I depend on it

glossy scroll
#

ok so just... use a model then?

twilit roost
#

ig

glossy scroll
#

but to answer your question for the second time

#

you cannot just "scale up" an entity

#

without a mod or texture pack

#

you can only do so for slimes

eternal needle
#

Hi i don’t know how to Get hashtags in config files but i need it how pls help tag me

buoyant viper
#

like comments?

quaint mantle
#

?nms

river zealot
#

I have a BlockBreakEvent listener where I got the block, when I add items to the .getDrops() they don't drop

#

why's that ?

eternal needle
kind hatch
river zealot
#

Gotcha, any method to give an item directly to a player?

glossy scroll
#

addItem

#

this is all in the api and google

river zealot
#

doesn't seem to work on a player time

#

type*

glossy scroll
#

getInventory

river zealot
#

thanks, I'll test its bhavior

desert frigate
#

Would it be possible to make players not be able to take armor/stuff from the armor stands?

worthy yarrow
#
        at me.nuclearkat.main.privatemessaging.messageCommand.onCommand(messageCommand.java:23) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        ... 15 more``` 

```private HashMap<UUID, UUID> messageMap = new HashMap<>();

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player p = (Player) sender;

        if (sender instanceof Player){

            if (Bukkit.getPlayer(args[0]) != null){
                Player msgTarget = Bukkit.getPlayer(args[0]);
                messageMap.put(p.getUniqueId(), msgTarget.getUniqueId());

                if (args[1] != null){

                    StringBuilder messageString = new StringBuilder();
                    for (int i = 1; i < args.length; i++){
                        messageString.append(args[i]).append(" ");
                    }

                    msgTarget.sendMessage(ChatColor.YELLOW + p.getDisplayName() + " <- " + messageString);
                    p.sendMessage(ChatColor.YELLOW + msgTarget.getDisplayName() + " -> " + messageString);
                    messageMap.remove(p.getUniqueId(), msgTarget.getUniqueId());

                } else p.sendMessage(ChatColor.DARK_RED + "Usage: /msg <player> <message>");

            } else p.sendMessage(ChatColor.DARK_RED + "That player may not exist or is offline /msg <player> <message> ");
        }
        return true;
    }```
#

Problem in console says its this line "if (Bukkit.getPlayer(args[0]) != null){"

glossy scroll
#

args.length is 0

desert frigate
#

Would it be possible to make players not be able to take armor/stuff from the armor stands?

worthy yarrow
#

Works thank you @glossy scroll

#

If there's an event in spigot api where a player takes something from an armor stand then yes

#

@desert frigate

#
            e.setCancelled(true);
        }``` @desert frigate something like this I believe
desert frigate
#

e.setCancelled basically puts it back?

buoyant viper
#

my god

desert frigate
#

Lol

worthy yarrow
#

ikr

#

spigot api is amazing

desert frigate
#

But idk how to use nbt tags

worthy yarrow
#

I mean that method above should work fine, although it looks like it cancels everything

desert frigate
#

Wdym?

worthy yarrow
#

As in you nor any other player can add armor or take it off

#

that method is really bad but it was the only one I saw

desert frigate
#

well yeah as the plugin puts armor on the stand and I don't want anyone to change it no matter admin or not

#

but I was wondering how to put nbt tags on armor stands

winter scarab
#

why do invulnerable entities via Entity.setInvulnerable() still take damage from players in creative?

worthy yarrow
#

I would recommend writing it out so that it's a permissions based thing so it doesn't effect every single player, could do something like if (!p.hasPermission("<permission>"){ e.setCancelled(True); }

#

@desert frigate

#

so if the player doesnt have a permission then it wont let them do anything to armor stands

#

Also I dont know anything nbt tags

quaint mantle
winter scarab
#

true i just didnt wanna have to check for another event

#

welp all good

desert frigate
winter scarab
#

does the EntityDamageByEntityEvent trigger even if no damage is done to the target?

#

ex player punching invulnerable entity

twilit ermine
#

I have a quick question about slash commands on my server. I have a few plugins running (like essentialsx, luckperms, all the other basics) but whenever I type "/" it induces severe lag while it indexes the commands available (I'm assuming, there are about 1000 available for general use). Is there a way to disable indexing of commands? Look at mineplex, for example. There are commands available to use, but they aren't shown when the user types "/", reducing lag. I've observed this on bedrock PC and mobile.

delicate lynx
#

when you say lag, is it server, ping, or FPS?

civic wind
#

I'm pretty sure you can turn this off in settings

#

As in, your client settings

delicate lynx
#

oh, geyser has command-suggestions in it's config

#

turn that off

solid cargo
#

ok why doesnt this event trigger?

dusk flicker
#

If you have that many commands, you might have an issue

solid cargo
#

its registered and everything

delicate lynx
#

the if statement is not satisfied then

solid cargo
#

ima remove the gamestate thinguy

#

okay now it works

delicate lynx
#

output some messages to the chat maybe to see which if statement isn't satisfied

solid cargo
#

gamestate thingy didnt work

dim bronze
#

is the config saved / reloaded when you check?

#

if the gamestate is changing whilst the server is running then it might not be best to use it from the config. By all means save to the config if that's what you want, but it should probably be it's own object if you need to access it

solid cargo
#

i save it every time gamestate changes

delicate lynx
#

oh

dim bronze
#

that has an underscore

delicate lynx
#

theres the problem

dim bronze
#

the game state you are checking doesn't

solid cargo
#

ok i tweaked it a bit

#

now it works

delicate lynx
#

yeah you can checking gamestate and game_state

patent fox
#

I think i would use presistant data container instead of config

solid cargo
#

?pdc

solid cargo
#

i mean i could

#

reason why i use config till this day is that i had beef with declaring variables in the code itself (i think its a thread problem)

patent fox
#

Wdym

solid cargo
#

so i went "fuck it" and started using configs as data storage

#

when i would declare a variable

#

and try accessing it again

#

it would return it to its default value that java assigns

patent fox
#

no idea

solid cargo
#

pretty much soemthing to do with atomic variables

vestal matrix
#

how long does it take for a premium resource to get accepted? all forums ive found are 4 yrs old

solid cargo
#

lets say i wanted to access this int again

#

it would tell me its 0

winter scarab
#

How can I detect when a player punches an entity when the target is invulnerable? The EntityDamageByEntityEvent does not fire if damage is not actually done

dim bronze
#

The most I'll ever tend to use static access is for my plugin instance, everything else is an instance specific to my plugin. Since your plugin can only be running once it doesn't really change anything, but maybe you could try not using static variables?

solid cargo
#

i.e getters

winter scarab
patent fox
#

No

cold tartan
#

I'm trying to register this EntityDamageEvent

registerEvent(EntityDamageEvent.class, (listener, ev) -> {
    EntityDamageEvent event = (EntityDamageEvent) ev;
    System.out.println(event.getCause());
    if (event.getCause().equals(EntityDamageEvent.DamageCause.SUICIDE)) return;
    if (!(event.getEntity() instanceof Player)) return;

    Player player = (Player) event.getEntity();
    event.setCancelled(true);
    player.damage(event.getDamage());
    EntityDamageEvent dmg = new EntityDamageEvent(
            player, EntityDamageEvent.DamageCause.SUICIDE, player.getHealth()
    );
    player.setLastDamageCause(dmg);
    Bukkit.getServer().getPluginManager().callEvent(event);
});
```and to prevent recursion im setting the damage cause to be SUICIDE then I try to filter out that damage cause, but the event still causes itself. i can't figure out why because I am doing (pretty much) the same thing as https://www.spigotmc.org/threads/how-do-i-set-the-last-damage-cause-of-an-entity.509421/ and it just doesn't work
winter scarab
patent fox
dim bronze
winter scarab
dim bronze
#

Yes ;)

patent fox
#

Then check if it's an entity

dim bronze
#

yes, kotlin is completely interoperable with java and compiles to the JVM so it provides a jar. The set up is slightly different to get things working with spigot because you'll need to provide the server with the kotlin library somehow (be it with plugin.yml libraries or shading kotlin into your jar making it quite big). But I personally think it speeds up the development process and leads to you writing safer code that is less likely to break

winter scarab
patent fox
#

No

#

Get Target Entity

#

Or something like that

winter scarab
#

you're mixing the two events

patent fox
#

What?

winter scarab
#

playerinteractentityevent has a method for getting the target entity but only checks for right lickcs

#

playerinteractevent has a method for which action but not the targetted entity

#

i was either A thinking of doing that or B since im using paper actually i do have the getinteractionpoint method which i could use to find the nearby entity

peak depot
#

how can I get an item var on crafting event and I mean Item not Itemstack

cold tartan
dim bronze
#

haven't used the event before so I'm not sure if it's called when the player attacks an invulnerable entity but you could check

dim bronze
#

you might have to upcast the custom event to the parent when calling it, though I'm not sure

#

not something I've done before

dim bronze
crisp forum
#

I'm trying to send packet's to update the gui's texture.
I was doing:

PacketContainer packet = new PacketContainer(PacketType.Play.Server.OPEN_WINDOW);
packet.getModifier().writeDefaults();
packet.getModifier().write(0, invId);
packet.getModifier().write(1, invSize);
packet.getChatComponents().write(0, WrappedChatComponent.fromText(title));
// Send the packet to player

it was working on other versions than 1.19. Now on 1.19 it throws an error on

packet.getModifier().write(1, invSize);

line. Does anyone know what can I do about it?

Error:

Caused by: java.lang.IllegalStateException: Unable to set value of field private final net.minecraft.world.inventory.Containers net.minecraft.network.protocol.game.PacketPlayOutOpenWindow.b

Caused by: java.lang.ClassCastException: Cannot cast java.lang.Integer to net.minecraft.world.inventory.Containers
dim bronze
#

the second field of the open window packet is now the window type

peak depot
dim bronze
dim bronze
dim bronze
peak depot
vocal cloud
#

How long before someone buys my premium resource KEKWholdup

echo basalt
#

been 2 months, no downloads

dim bronze
#

you shouldn't need the Item class for that

vocal cloud
river oracle
#

lol

crisp forum
dim bronze
#

Yes I realised that might not have been correct

peak depot
dim bronze
#

haven't got access to an IDE at the moment so I can't check NMS. Maybe the second property of the packet is now a Containers enum rather than an integer ID?

#

that's what the error leads me to believe

crisp forum
#

you mean "1" with "second" right?

dim bronze
#

yes, sorry

#

when speaking english I tend to use the human convention of starting at 1

crisp forum
#

lol :p

vivid cave
#

I have a set of float/double coordinates x,y,z (e.g the coordinates of an entity but not necessarily)
How do I get the coordinates of the block? Do I have to round, ceil, floor, do any other kind of translation?

crisp forum
#

I've set it packet.getModifier().write(1, Containers.GENERIC_9X3); but still throws error :/

dim bronze
#

same error?

rough drift
#

kotlin is basically a way to make your code worse

#

and make it worse faster

dim bronze
#

🤮

compact haven
#

stfu

rough drift
#

dude

compact haven
#

stop spreading nonsense

rough drift
#

I used both

#

scala is superior

dim bronze
#

No to be fair I can't judge scala I haven't used it

compact haven
#

Not talking about scala

crisp forum
#

oh no not the same error now the error is Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_16_R3.Containers

dim bronze
#

do you understand what the error is telling you?

crisp forum
#

yes

#

and thanks

rough drift
#

kotlin is basically a way to make your

vivid cave
#

Is there a straighter forward way than doing
Location loc=new Location(x,y,z);
int blockX = loc.getBlockX();
int blockY=...
...
?

agile knot
#

Remember What block the player interacted with

dim bronze
#

looks like your trying to use 1.16NMS with 1.19

#

if I had an IDE it would be easier to help but you need a net.minecraft.world.inventory.Container

crisp forum
dim bronze
#

the most recent error says you are trying to use this class: net.minecraft.server.v1_16_R3.Containers

#

which is because you are working with 1.16 spigot in the code

lunar mica
#

Hello. Can someone told me flag for armorstand if I dont want player put armor on it? I need this for holograms.. I thought of making InteractEvent on cancel if the armorstand is invisible but it seems complicated...

worthy yarrow
#

@lunar mica public void onTake(PlayerArmorStandManipulateEvent e){ e.setCancelled(true); }

#

I would recommend writing it out so that it's a permissions based thing so it doesn't effect every single player, could do something like

                                   e.setCancelled(True);
}```
lunar mica
#

Okay, ty ^^

slate delta
#

How to get a localized enchantment name, the name of enchantment but in lang of player

worthy yarrow
#

looks like it could be bugging because its a depreciated thing

dry forum
#

why am i getting this error org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event com.jere.xkits.api.BoardUpdateEvent. Static getHandlerList method required! from ``` private String name;
private static final HandlerList HANDLERS_LIST = new HandlerList();
private boolean isCancelled;

public BoardUpdateEvent(String name,){
    this.name = name;
    this.isCancelled = false;
}

@Override
public boolean isCancelled() {
    return isCancelled;
}

@Override
public void setCancelled(boolean cancelled) {
    this.isCancelled = cancelled;
}

@Override
public HandlerList getHandlers() {
    return HANDLERS_LIST;
}

public String getName() {
    return name;
}``` when trying to use the api? i have 3 other events like this 1 that work perfectly fine and dont give errors
slate delta
#

how can convert in lang of player, like this

worthy yarrow
#

I'm not sure how you would check for the player's client language setting

worldly ingot
#

Ideally you'd just make it a translatable component, but Spigot doesn't expose lore as a BaseComponent yet

worldly ingot
#

Modern Minecraft text makes use of components. Y'know the whole {"text":"Hello world!", "color":"red"}. Yeah, that thing. That's called a text component (or a literal component). There are also translation components which lets you do something like {"translate":"enchantment.minecraft.sharpness"} which would then translate that key into "Sharpness" on the client in the client's language

#

Spigot has an API around that called BungeeChat, which includes a class for TranslatableComponent (or TranslationComponent, I can't remember), but what Spigot doesn't have, is an API to set an item's lore using that API

#

You could in theory do player.spigot().sendMessage(new TranslatableComponent("enchantment.minecraft.sharpness")); and you would get in chat Sharpness (or whatever equivalent verbage would be used for your selected language)

slate delta
#

like this?

worldly ingot
#

No, because that would force it to call toString() which won't look at all like you expect it to

#

You're wanting to add this onto an item, right?

slate delta
#

here

worldly ingot
#

Yeah, Spigot doesn't have API for that

slate delta
#

😐

worldly ingot
#

It has the TranslatableComponent API from BungeeChat, but it does not have a way to set an item's lore to said component

#

I keep telling myself to get to implementing that shit but I keep getting distracted

slate delta
#

So I have to make an enum file for example to define an enchantment and its name?

worldly ingot
#

Pretty much, yeah, you're limited to that. If you care all that much, the most you can do is make it a configuration file so users can change what language to use for themselves

#

Though you won't be able to change that per-user

#

English users might use either en_us, en_ca, or en_uk, in which case you would use an English translation. Alternatively, fr_fr for France French

slate delta
#

thanks for your help!

worldly ingot
#

o/

crisp forum
#

@dim bronze is it normal :p

dim bronze
#

yup, that's NMS for you, all obfuscated

#

I believe you can map them to logical names now with mojangs mappings, but never done it so not sure how

crisp forum
#

but I was able to use sth like
entityPlayer.playerConnection
when using 1.16

eternal oxide
#

--remapped

dim bronze
#

yeah playerConnection shoudn't be obfuscated

eternal oxide
#

fixes everything

dim bronze
#

you need it's handle for playerConnection

#

entityPlayer.getHandle().playerConnection

worldly quest
#

im getting Illegal Entity Teleport with java.lang.Throwable: null when trying to teleport a mob on the entity unload event. does anyone know what could be null here? is the entity somehow null? my code is pretty much just entity.teleport(location)

crisp forum
#

there is no getHandle :p

dim bronze
#

what type is nms

crisp forum
#

EntityPlayer

eternal oxide
#

getHandle() is on CraftPlayer

dim bronze
#

handle is on CraftPlayer

crisp forum
#

nms.playerConnection.sendPacket is now nms.b.a lol

dim bronze
#

the obfuscation has always existed

eternal oxide
#

?paste

undone axleBOT
eternal oxide
dim bronze
#

shame there's no nice way to do it with gradle, just have to use a plugin for it

echo basalt
#

wdym

#

I use gradle

#

groovy dsl

#

it's not that hard

crisp forum
echo basalt
#

but still a lil annoying

dim bronze
#

you using a plugin for it?

crisp forum
#

It's a dependency

echo basalt
eternal oxide
echo basalt
#

can't really use spigot directly

#

but

#

you also gotta add some lines to your settings.gradle

crisp forum
#

I think using buildtool is easier

echo basalt
#
pluginManagement {
    repositories {
        gradlePluginPortal()
        maven { url = "https://repo.papermc.io/repository/maven-public/" }
    }
}
dim bronze
#

yeah, but like I said, uses a plugin

#

behind the scenes a lot more complicated

#

but, yeah, if you're using a plugin, its fine

echo basalt
#

it's easy for the end user to just copypaste the build.gradle and move on with their lives

dim bronze
#

yeah and I have no problem using a plugin

#

just saying for the person who had to write it, its a lot trickier

crisp forum
mint mesa
#

how can I make an item in a bungee plugin_

#

?*

worldly quest
eternal oxide
undone axleBOT
dim bronze
mint mesa
#

as in like an itemstack

eternal oxide
#

You don't

mint mesa
#

then how do other bungee plugins have them?

#

they also have sound n everything

eternal oxide
#

Bungee doesn't have any understanding of ItemStacks

dim bronze
sterile token
#

Any good callback recommendations? Because i need to create a database callback which i pass a query argument and then be able to get the result

eternal oxide
sterile token
mint mesa
#

this adds itemstacks too?

eternal oxide
#

Spigot Itemstacks do not exist on the bungee proxy

mint mesa
#

in the example on the readme it shows itemstacks tho. Thats why I asked whether that also adds it

#

somehow

eternal oxide
#

That plugin simply tells the spigot plugin to create an inventory and open it for the player

#

example?

mint mesa
eternal oxide
#

Those are not Spigot ItemStacks. Read teh code

dim bronze
#

the plugin needs to be added to spigot as well so the bungee server can tell the spigot server what to do

buoyant viper
#

i mean

#

strategic packet modification could uh

#

do something

crisp forum
sinful rapids
#
package me.gabryosas.fiftyinfo.listeners;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;

public class Info implements Listener, CommandExecutor {
    private Inventory gui;
 public void openNewGui(Player p){
     gui = Bukkit.createInventory(null, 45);
     ItemStack vetro = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 7);
     gui.setItem(0, vetro);
     p.openInventory(gui);
 }
    @EventHandler
    public void guiClick(InventoryClickEvent e){
     if (!e.getInventory().equals(gui)){
         return;
     }
     e.setCancelled(true);
     Player p = (Player) e.getWhoClicked();
     switch (e.getSlot()) {
         case 0 : {
          p.closeInventory();
          p.sendMessage("ciao");
          break;
         }
     }
    }
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player player = (Player) sender;
        if(sender instanceof Player){
            openNewGui(player.getPlayer());
            player.sendMessage("§7[§9FiftyRP§7] §7Imparerai le nozioni base...");
        }else {
            sender.sendMessage(ChatColor.RED + "Non sei un giocatore!");
        }
        return true;
    }
}

With the command opens the gui, but when I click on it it does not delete the event .. why?

eternal oxide
#

do not close nor open inventories in the InventoryClickEvent

eternal oxide
#

read teh javadoc on it

dim bronze
#

oh wow, I have never noticed that

#

thank you

dim bronze
sinful rapids
#

ok

shadow gazelle
#

Is it possible to list every config section under a section?

river oracle
#

Yes

#

ConfiguartionSection#getKeys

shadow gazelle
#

thanks

worldly quest
crisp forum
#
  public int determineOpenedInventoryId(Player player) {
    CraftPlayer craftPlayer = (CraftPlayer) player;
    return craftPlayer.getHandle().inventoryMenu.containerId;
  }
  
  public void updateCurrentInventory(Player player, Inventory inventory, String title) {
    CraftPlayer nms = getNativePlayer(player);

    MenuType nativeType = CraftContainer.getNotchInventoryType(inventory);
    nms.getHandle().connection.connection.send((Packet)new PacketPlayOutOpenWindow(determineOpenedInventoryId(player), nativeType, (IChatBaseComponent)new ChatComponentText(title)));
  }

  public static CraftPlayer getNativePlayer(Player player) {
    return ((CraftPlayer)player);
  }

when I use org.spigotmc:spigot:1.19-R0.1-SNAPSHOT the craftPlayer.getHandle().inventoryMenu.containerId part gets broken and when don't use it I can't import PacketPlayOutOpenWindow, IChatBaseComponent, ChatComponentText

dim bronze
echo basalt
#

if you import spigot directly, you gotta look at all the fields to determine the container id

worldly quest
gleaming grove
#

why am I getting this exception?

vocal cloud
#

What is that console 🤮

worldly ingot
#

You're using shape() incorrectly, yeah

#

Only one call to shape, 3 expected strings

#

In your case, recipe.shape("XX1", "32X", "33X")

#

You didn't have you delete your messages KEKW You were right too

dim bronze
#

your explanation was more clear

#

why confuse things

gleaming grove
desert frigate
#

when a entity gets killed, does the persistentDataContainer get deleted?

#

also why is there no PersistentDataType#BOOLEAN

gleaming grove
desert frigate
#

;o

#

skull.setOwner(player.getName()); what do i use instead cause its deprecated

gleaming grove
#

anyway you can make your own PersistentDataType type for example new PrimitivePersistentDataType<>(Boolean.class)

gleaming grove
#

well you can't since PrimitivePersistentDataType has packet private constructor, my bad

desert frigate
#

yeah i just saw lol

#

guess ill use 0 and 1 for boolean

gleaming grove
#

or with String, 'true', 'false' but that would be less optimalized

desert frigate
#

more hard

upper vale
#

setOwningPlayer

desert frigate
#

ty

#

it says OfflinePlayer

#

does it have to be offline

upper vale
#

no, can be online or offline

desert frigate
#

so confusing smh

upper vale
#

all online players are also “offline”

desert frigate
#

what-

upper vale
#

Players are also OfflinePlayers

desert frigate
#

oh alr

main girder
#

is there a way to check when the player died

balmy valve
#

Anyone know about this ?
Tried using these item flags but hasnt made any difference: itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_DYE, ItemFlag.HIDE_ENCHANTS);

#

nvm got it

main girder
#

is there a way to check when a player dies and get the killer as a variable

young knoll
#

PlayerDeathEvent

main girder
#

it says it dosent work

young knoll
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

lost wolf
#

Someone knows if there is a ProtocolLib development discord comunity?
I'm trying to develop a plugin that modifies chat messages when a player receives them from another player. But I'm having trouble understanding ProtocolLib

crisp forum
#

Why did they obfuscate nms?

main girder
#

getPlayer() dosent work it has red underline on it and says getPlayer() dosent associate with PlayerDeathEvent

young knoll
#

I believe it’s getEntity

quaint mantle
#

How would I make it so the entire time an egg is alive after throwing, it spawns anvils underneath it?

My code rn

@EventHandler
public void EggThrow(ProjectileLaunchEvent e) {
  Entity egg = e.getEntity();

}
young knoll
#

?scheduling

undone axleBOT
main girder
#

so Player player = event.getEntity();?

young knoll
#

I believe it returns a player, yes

#

Check the javadocs

main girder
#

how do u get the killer as a var

young knoll
#

Player should have a #getKiller

main girder
#

how do u get the killer and then set the killers max health to + 1 heart and the player who got killed loses a heart

young knoll
#

Lifesteal plugin #636?

main girder
#

yea

#

im making a lifesteal

#

whats #636

river oracle
#

I'd get a trillion downloads

main girder
river oracle
#

uhm lol they are super easy to make it'd prob take like 10 minutes max to make one

main girder
#

geez

#

i've spent like 2days trying to do it

river oracle
#

well then again idk what life steal entails its just you kill ap layer you get there heart right

#

then once they have 0 hearts they are eliminated or whatever

dusk flicker
#

you can probably find the other 635 on the spigot website or on github

main girder
#

yea easier said then done

river oracle
#

Unfortunatly my standards are too high for my first plugin on spigot to be lifesteal

main girder
#

what do u use to make it

dusk flicker
#

probably java

main girder
#

im trying to develop one but for me its super hard

river oracle
#

I code in java, skript is icky

#

oh also there are people that use KOTlin

dusk flicker
#

please put a comma in that sentence

#

lmao

#

i read it as, I code in javaskript is icky

main girder
river oracle
#

its basically a young kid in there rebellious phase version of java, but there isn't any maven

main girder
#

yea lol

river oracle
#

anyways all you gotta do is edit the players max health attribute

#

player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(aDouble);

main girder
#

how do u get the killer as a variable and

river oracle
#

in your case its setAttribute

young knoll
#

Yeah there are a ton of lifesteal plugins

#

Idk why people are still making them

river oracle
#

I'm sorry to ruin this for you but I'm about to make 90% of a life steal plugin right now

main girder
river oracle
#
Player player = e.getEntity();
if(player.getKiller() == null){
  return;
}
// set health attribute I'm way to lazy
// remove health from killed player way to lazy to type
desert frigate
#

in BlockPlaceEvent how can i get the item persistent container?

main girder
#

is this an event?

river oracle
#

than just set the attributes properly

river oracle
main girder
#

why is e not defined

river oracle
#

I always use e

dusk flicker
#

?learnspigot

#

need that command

river oracle
#

bakka

main girder
#

whats adouble

dusk flicker
#

okay time for the lovely command to step in

#

?learnjava

undone axleBOT
desert frigate
main girder
#

its not defined

main girder
young knoll
#

Most events run before the actual action, hence why they can be cancelled

river oracle
#

learn java primitive types

main girder
#

ik but whats should i set it as

wise mesa
#

is there a way to list resources in spigot?

river oracle
river oracle
wise mesa
#

i want to make my plugin extract a folder from inside my jar

river oracle
wise mesa
#

and i don't want to manually program each file

worldly ingot
#

I've gotcha. 1 sec, Temmie

young knoll
#

Does saveResource handle folders?

main girder
#

cant i just do +1?

young knoll
#

Yes

river oracle
young knoll
#

^

river oracle
#

also don't forget to subtract the other palyers health

wise mesa
#

thanks choco, ill take a look

worldly ingot
#

That one is obviously a save method that will recursively save a directory's files, but if you want it to do something else, you've got the base of it there

main girder
#

and then how do i get the player who got killed

young knoll
#

Good Ol JarFile

wise mesa
#

alright awesome

worldly ingot
#

Just replace the saveResource() call is all

wise mesa
#

this is super helpful

worldly ingot
#

That method's a classic lol. Any time someone asks a similar question I just pull that one up KEKW

wise mesa
#

lol makes sense

young knoll
#

I’ve used JarFile to auto register annotated classes too

#

Good times

wise mesa
#

part of my plugin involves automatically creating and hosting a resource pack

#

so i want the plugin to extract the assets folder from resources

#

this will help a lot

#

the assets folder has part of the resource pack but the rest has to be built at runtime

river oracle
#

ahhh nice resourcepack generating at run time is a pain though because you need to upload it to some form of cdn

young knoll
#

Just hosting it at runtime sounds pretty cool

main girder
#

just "player.setMaxHealth(-2);"?

river oracle
#

also make sure it doesn't go under 0

young knoll
#

Which sounds

#

Painful at the least

river oracle
#

I wonder what would happen

young knoll
#

Last time I checked

#

You are fine, but any damage will kill you

river oracle
#

spooky

young knoll
#

Even if it deals 0 actual damage

main girder
#

so like 8?

young knoll
#

18

#

Players have 20 health by default

river oracle
#

20 health 10 hearts
1 heart = 2 health

main girder
#

or "player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(+2);"?

river oracle
#

player#setAttribute probably

young knoll
#

Nope

#

That is correct, minus the +2

river oracle
#

oh nvm

main girder
#

so -2?

young knoll
#

Still no

#

You need to actual add or subtract from their current max

#

Not just set it to a flat +/-2

river oracle
#

think through how you would subtract there current by 2 :)

main girder
#

maxhealth -2?

#

bru

#

how do i get the players max health

shadow gazelle
#

you sent it like fifteen minutes ago

main girder
#

what

sharp flare
#

#getBaseValue

real spear
#

Is there a way for me to change the rate of natural regeneration for players only?

twilit wharf
#

I have some simple code, and it gets a list of blocks and then loops through and breaks them naturally with the users pick. It isnt breaking the blocks. block.breakNaturally() is just returning as false. Here is the code: https://paste.helpch.at/duqayeguxo.java

young knoll
#

Then it’s failing

lost wolf
#

Does the method Player.sendMessage call the AsyncPlayerChatEvent?

echo basalt
#

no

#

That event only triggers when a player sends a message

#

not when it receives one

twilit wharf
young knoll
#

Something else is probably cancelling the event

balmy valve
#

Anyone know good utilities/libraries for making custom mobs?

solid jungle
#
package aioplugin.aioplugin.events;

import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import org.bson.Document;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.jetbrains.annotations.NotNull;

import java.util.UUID;

public class PlayerJoinEvent implements Listener {

    MongoCollection<Document> NewJoins;

    @EventHandler
    void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event){

        if(event.getPlayer().hasPlayedBefore()){

            @NotNull String PlayerName = event.getPlayer().getName();

            UUID uuid = event.getPlayer().getUniqueId();

            Document document = new Document();
            document.append("Name", PlayerName);
            document.append("UUID", uuid);

            NewJoins.insertOne(document);

        } else {
            System.out.println("User has Played Before.");
        }

    }

}
``` Im trying to make it so whenever a user has joined for the first time, it saves their info like their name and UUID. but whenever a user logs in for the first time it doesnt log their name and uuid in mongodb
balmy valve
gleaming grove
#

this plugin has API

balmy valve
#

for addons to the plugin

#

not for general usage or atleast that's not what it says

winter scarab
#

what would be best the way of going about detecting a left click on an invincible entity?
the entitydamagebyentity event does not fire because it is invincible.
playerinteractentity event only detects right clicks
playerinteractevent only detects the location