#development
1 messages ยท Page 13 of 1
well
just note how it allows me to use the vertical bars in one if statement but not on the other
because you need to use if action == Action || action == Action and not just if action == Action || Action
whqt
ooh
xd
i used what wrong
โ๏ธ
OHHH
I see
rookie mistake
guys do I also put Action.RIGHT_CLICK_BLOCK
some blocks can be right clicked
and it would be annoying if you accidentally sounded the horn while trying to right click a block
can I just send the whole code here
so you guys can check it out?
just to make sure
if there are anything that could
you know, break the code idk
ah
I can't even send it
oh well
i'll just test it in game
dosnt work?
test it first
if it doesnt, feel free to ask, someone will reply
(eventually xd)
how do I solve this generics issue?
get rid of the <?>
I thought that there would be a way of keeping the <?>, seems like suppressing the "raw type" warning is the only solution then...
mhm
or can't you pass in a generic to newUpdater?
assuming that's your own class
or would that change too much stuff
it's jdk
ah
im using paper's AsyncChatEvent, and im not sure how to achieve the same thing i had with PlayerAsyncChatEvent with the setFormat and setMessage thing
paper said it was deprecated but i assume thats just paper being paper
is there a way to get rid of the deprecated warning?
pretty sure it is like that
if you open spigot docs, its not deprecated
they deprecated it in favour of his AsyncChatEvent
which supports audience and component i guess
i know, i'll never use those events as i support Spigot

i just hope they dont remove them
they won't remove them as they keep spigot compatibility
otherwise people asking "its not workingggggggggggggg"
i hate adventure
its just too much
so is there anyway to get rid of the deprecated warnings?
what do you need setFormat and setMessage for?
since you can probably do what you want in AsyncChatEvent
paper api is based off of spigot api
unless you're trying to say spigot > paper
then um
AsyncChatEvent lets you get the final message, original message, and the player
If that requires paper, people using spigot will have errors
thats what i mean
not encouraging people to use spigot over paper
alr
but i wont tell them to switch to paper, even when its better
prefix, player, suffix, chat color, message
upon trying, it still showed the <srnyx> at the beginning
but its fine imma just use AsyncPlayerChatEvent again its not a huge deal
oh what does it not let you modify the whole message?
hmm
so i'm getting contents in prepareitemcraftevent
are those contents the same exact copy as the one placed?
well it was already weird cause u cant rly use replace with components (at least not efficiently/neatly)
cause rn this is what i have:
format = format.replace("%playerprefix%", new MetaManager(player).getPrefix());
format = format.replace("%player%", "%1$s");
format = format.replace("%playersuffix%", new MetaManager(player).getSuffix());
format = format.replace("%message%", "%2$s");```
wait for asyncchatevent
if you do event.message(Component.text("a")) for example
does it say <srnyx> a?
or a
sry gimme a sec ive gotta fix some other small bugs before i can build
alr
anyone know? I can't seem to find a way to test it
if you mean items from PrepareItemCraftEvent#getInventory, then I'm pretty sure it's the same exact item, yes
hmm will get inventory only get the items from the crafting part
not the whole inventory
theres no other way? cause it marks sendTitle, broadcastMessage, setLore, setDisplayName, AsyncPlayerChatEvent, etc... all as deprecated
basically anything that doesnt use components lmao
if you plan to support spigot api
- use spigot api
don't use paper api
one of my dependencies requires it
but since you're using paper api I'm assuming this is on a priv server or something
it is yeah
if you want you can create a method to convert legacy to components
or use static imports (which some kyori people recommend) ```java
text("hello").color(RED)
there's also Component.join (I think that's the name?) to combine multiple colors, etc
no point when bungee colors have been working fine tbh
bungee colors = ChatColor
although if you have a lot it might take a bit of time
Oh
still migrate to adventure ๐ or create a method to convert legacy to components
but like, no, ๐ค
unless you have like 50 it shouldn't take too long to create a method to convert legacy to components
with find & replace
I mean you'll still have to manually do a lot of work
ยฏ_(ใ)_/ยฏ
yea and theres not much benefit
(if any)
No deprecation ๐
I mean that's why I did it
๐คท
not required
paper won't remove it
or you can just write new code with adventure
:))
and then your project will be half adventure half legacy
lol
nO
and then for config you can use minimessage ๐
NOOOO
ok sorry
lol
minimessage ๐
no... nooo... NOOO
bad barry
haha
NOO!!
IT MUST HAPPEN_ _
PLEASE
omg i love github copilot
same
useful in things when I'm writing repetitive stuff
I don't really use it for what people think of it as
like commenting something and copilot doing that
for that I just use google ๐
yea repetitive stuff comes in handy https://cdn.venox.network/idea64_Pww0Ez4xMZ.png
๐
fr
okay copilot
its been thru some stuff
is there an event that checks for when a player is hitting a block?
playerinteractevent
playerinteractevent
aw
:)
interesting, alright thanks
use PlayerInteractEvent#getAction
left click im guessing?
i think there is left click block (and right click too)
please. help. ๐ญ https://img.venox.network/idea64_fCGteMlmtT.png
:)))
yes
public class ChatListener implements Listener {
@EventHandler
public void onChat2(AsyncChatEvent event) {
event.message(Component.text("a"));
}
}```
it's almost midnight for me ๐ฅฒ
same but do u see me sleeping?
true devs dont sleep
uhhhhhh
r u a fake dev?
here's the proof
zzz only happens when you're sleeping ๐คจ
hehehe
I must go to sleep now
๐๏ธ
๐
๐
๐
๐
๐
๐ฌ๐ด๐ด๐ฉ ๐ณ๐ฎ๐ฌ๐ญ๐น
??
๐ฌ ๐ด ๐ด ๐ฉ ๐ณ ๐ฎ ๐ฌ ๐ญ ๐น
spam spam ban ban
anyone familiar with mongodb api?
I think I kinda have 500+ connections after reloading the plugin that many times
Do I create a connection everytime I create a mongoclient 
yes
Why is it that when I try setting the display name of an item drop, those two [] square brackets appear?
Code
item.customName(stack.displayName());
@EventHandler(priority = EventPriority.LOWEST)
public void onItemDropSpawn(ItemSpawnEvent event) {
Item item = event.getEntity();
ItemStack stack = item.getItemStack();
item.customName(stack.displayName());``` more specifically
print out the values
But yeah, the stack doesnt have those brackets in the name
Does setting it add it?
Yeah that's what it seems to do
Huh what why is it intended
e.g. when you get killed, the item showed in chat has [] around + hover
Aah I see
will get the same result if you use ItemStack#displayName in a chat message
Yeah there we go
player was killed by player using [blah]
Another question: I noticed that when clicking twice in an inventory, the game thinks it's three clicks?
Ahhh there's a double_click click type
Can I set the color of a SPELL particle?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.html on here it doesn't look like I can
declaration: package: org.bukkit, enum: Particle
Hey, I want to make custom textured rank tags but I don't know the sizes. If anyone knows please help me ๐
and If there's a suggested font to use that would help as well
How is PlayerItemConsumeEvent#setReplacement supposed to work? Trying to prevent bottled honey from giving players a glass bottle after being consumed.
if (item.getType() == Material.HONEY_BOTTLE) {
event.setReplacement(new ItemStack(Material.AIR));```
What this seems to do though is, if the player has multiple honey bottles in a single stack, it sets the whole stack to air and gives the player an empty bottle
Does something exist where:
If I have two keys for one object in a map, for example a string and a integer. And if I get this object using 1 key, and change it and put it back in the "map". It will also be changed for the other key in the map?
Checking what the event.getReplacement() method returns, it's null? is that normal?
depends
if you wrap that with another object and keep the reference the same
then you can change the wrapped object inside the object you store it in
so you can edit the object, but cant change it and hope it stays the same on the other map
Ah I see
so i have a system where when you put on a certain block, you get a rainbow glass helmet. it constantly checks if the item on your head has certain nbt data, and if so, continues the loop. the issue, i want it so when you click on your helmet slot with the same item it stops the loop. although i do not know how to do this since they are same exact item. (clicking on rainbow glass helmet currently on head with glass would continue the loop as it would check for nbt data and obviously it would have that since same item).
keep a state variable
its on - off
click - put variable true - enable loop
click put variable false - end loop
the issue is it would have to be a player based variable since there could be multiple people wearing it
also, can i cancel a bukkitrunnable from outside the bukkitrunnable?
and this is an issue how?
yes, make a variable then check the variable inside the runnable
someone helped me organise and make my code more readable and less confusing
although its way more complex now
and I don't understand some parts of it
public void addHorn(String name, Horn horn) {
this.horns.putIfAbsent(name, horn);
}
@Nullable
public Horn getHorn(String hornMaterial){
return this.horns.get(hornMaterial);
}```
what is this part doing
I don't know much about HashMaps and I don't know what this 'putIfAbsent' method is about
it adds the horn to the map, but wont replace it if you try to add the same one again
anyone got any clue about SWM mem leaks on 1.8
SQLUtils.getTopByPoints(Integer.parseInt(params.split("_")[2])).getName();
return ordered.get(position - 1);
}```
This is literally all it is, and it works completely normal anywhere else, but with DeluxeMenus it takes way too long.
when is it executed?
do you have an event or smth?
does PAPI even have any events ๐
The first line is actually what is returned when a certain custom PAPI placeholder is called/requested.
ok. just to e sure, what is ordered? and what does the #get method do?
check here for the start of the discussion
#general-plugins message
yeah, forgot the context, sorry ๐
I saw SQLUtils and I thought maybe they're doing sql queries
in a placeholder request
which would definitely be the cause
ye exactly
Sadly, no, I'm not the one who has access to that, but the person who's testing it reports it (and I can see that in the logs) taking over 3s.
can you ask him to send it?
maybe he just have an update_interval of 3 in his menu
which would explain why
There are no SQL queries involved, it's just in that class cos I was testing something, but it is just an ArrayList.
I'm guessing faster refresh intervals
Alright, give me a second.
can you maybe try to replicate that yourself?
or get the menu
from them. yeah
Yeah, I will ask them for it now.
yes but, on a menu (on open at least) placeholder should just appear as normal
unless they are doing some io on the placeholder call
is it not appearing? ๐
thats what i am gathering from "slow"
aki, it's just slow to open the menu
from what I understood it's that is that the method is called when opened, and then every 3s instead of 1s or smth
since DeluxeMenus creates the items and the menu when the open command is executed
So, let me explain exactly what happens.
yes, so the interval is not the issue here
so the placeholder just blocks the thread so it takes a while for the menu to open.
exactly what i am saying as well
but that doesnt make sense
if its doing it on deluxe menus only
yeah.
it should happen every the placeholder is parsed
@next pivot how did you end up figuring out it's your placeholder that causes this? is there like a lag dump or whatever they're called?
2. There is a total of 18 placeholders to be called, but all of them are just a simple ArrayList#get methods, so it shouldn't take long at all.
3. A single get() method call takes a few seconds, it takes about 15-60 seconds for all of them to be executed.
4. The GUI opens.```
Yup...
Weirdly - you don't.
Oh, that's alright than.
ah, that makes more sense
But it still takes waaay to long.
just the menu will take long to open
ImDaMilan. Any chance you're actually loading a bunch of head- materials in the menu?
As I said, the placeholder runs just fine however I call it, just not on DeluxeMenus.
what if you remove every instance of the placeholder in the menu
and try to open it?
does it still take 60 seconds to open?
i feel like this is not a placeholder issue
yeah
yeah same.
We tested it using some other plugins as well as our own, the placeholder call was instant, but with DM it takes so long, we don't know why.
this. @next pivot
do you have anything else that needs to be loaded, beside that placeholder?
e.g. heads as blitz said
dont heads get cached after the first call?
I sent a message to the guy that's testing it, I'm waiting for him to respond exactly what is being loaded in the GUI.
ah
are you sure, blitz?
yeah
or only baseheads were cached?
He sent me the file, where can I send it?
ah ic
it was getting the offline player every time.
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
โข HelpChat Paste - How To Use
uh weird @ blitz
what's weird?
that they were not cached
leaderboards
there are a few heads
there's just so few of them tho.
yeah exactly
Funny enough - that's what the GUI is for.
please use a filler item instead of 30 separated glass panes
can you also get the version of deluxemenus the guy is using?
not their menu
someone that reported this
oh sorry
Alright, give me a sec.
semi unrelated, i got a method for pulling uuid out of mojang how long do you think is safe as a cache?
if you use another material does it load instantly?
for how long do you need it though?
its needed as its needed
used for anything done for offline players / not logged in before players
yeah. like gaby said, can you recommend them to temporarily change the material:s for the top items to something like dirt? see if that still takes seconds to load or not
He also said that all other menus load fine, but still, the placeholder also runs just fine on anything but DM, and it's literally just one return statement...
Alright, I'll tell him now.
im willing to bet its not the placeholder
but the head call using the placeholder
after
1.13.5
ok. so yeah I'm like 99% sure now. but please still ask them this.
I'll just write 1 long message explaining what I think happens lol.
Sending it to him now.
could try to update to latest version, or is the cache not new?
"the other menus are the same as this one and work perfectly"
"if that was the issue it would take forever for the other leaderboard menus"
-His messages.
For head- materials, DeluxeMenus used to make the Bukkit#getOfflinePlayer request every time the menu was opened and sometimes that ends up making a request to Mojang. This was fixed in version 1.13.6 (DeluxeMenus) by caching the heads so it will only make the requests to Mojang when the menu is first opened and then any time the menu is opened after it will open basically instantly until the server restarts.
He is still arguing that that is not the issue.
I mean you can test all of this yourself if you want to confirm. Just set up DeluxeMenus 1.13.5 and use their menu and see if you can replicate.
How do they know it is not?
yeah but you can still set up and test this yourself. and it would take them seconds to change the materials to dirt and back. it's just part of the debugging process
Whats different beside every item having update true?
since its just offlinePlayer call
the placeholder.
one uses ajlb, one uses airidalegangs.
again, unless they have the exact same heads
Ah, sorry
one menu opening fast
proves nothing
one could be doing an api call, other loading from file
just ask them to do this for debugging purposes. If it's not that we can move over to other steps.
As I said, the placeholder is just a return statement that gets an index from an ArrayList, I see no reason why that could be bad for performance.
yeah. and that's how we feel as well
that's why we want them to do that step. so we can prove or disprove our theory and move to other theories
All heads are loaded in the same way, Aki, so if both placeholders return a value instantly it should behave the same.
but we can't really do that if all they say is "no it's not it" with no proof
changed all the materials to dirt and it still takes forever to load
what if you remove the placeholders from the display name as well.
why not just run the new version

removed placeholder from display name and it loads instantly
Blitz, what is the fallback value for update_interval ?
Hm, ok
ok. now we can move to other debugging. that's all we needed. thank you
If it is an issue with our plugin, I'm more than willing to fix it, but I just can't see any reason at all why a single get() method could cause any issues, especially only when ran trough DeluxeMenus.
@next pivot mind showing us your entire Placeholder class?
Is the data cached?
Well, the data can also be loaded from a db as a list
Yeah, sure, I can paste the whole class if you want.
It does, but only at the onEnable().
Okay
I wont pretend I know anything about plugin coding, but it seems to be if 9 menus with the exact same material as a head, and placeholder in the displayname work perfectly, and this one specific menu take 5-15 seconds to load. its not an issue with the menu, its an issue with the plugins placeholders somehow.
@vapid tangle update to latest version of DM just in case
sure
Is not worth to test bugs on older versions
yes. we can tell that now. but debugging is not just as simple as a yes or no. We need to take every step from the start and debug each one of them. when we can tell for sure this step is not it, we move to the other and so on (which we just did after you confirmed).
I understand
except that its not true
my apologies if I came across as being rude
if all heads are the exact same name, then its true
Hahaha, I just pasted the class!
Hmm
still would be nice to know what the issue actually was
Caching
this @vapid tangle
the simplest explanation I Could give
Make sure you test the original config, with heads and placeholder as display name
basically deluxemenus wasn't actually caching heads and that would sometimes lead to requests made to mojang
which can take time
yeah, but weird that it didnt do it with any of the other menus that use heads
I mean it could very well be that maybe ajlb already does some caching or something
could be
well thanks for your help and sorry, I should have updated the plugin before coming here
how can i accurately simulate setting an armor stand's velocity using teleportation?
Thank you all guys!
is there a donation link somewhere? lol
Deluxemenus still loads the heads though, hmm
no need.
yeah but maybe ajlb does some offline player requests and I believe spigot caches those offline players for a period of time
velocity = distance / time
go from there
yeah. idk either man
that doesnt rly help :/
how would i get all the different locations between point A and point B?
divide by period
lets say you want to move 1 block per second
then you gotta move the armor stand 1/20th of a block
each tick
so you can just do speed in blocks / 20
and move that much each tick
but how do i make sure its going in the right direction
wha
speed has 3 dimensions
you set the speed accordingly
you might want to check some basic geometry
ok so what would go in stand.teleport(Location)
lmao
if you got a speed already then you just add speed / 20 as offset
to last location
but teleport wont work with what you want to do afaik
you need to do packetwise move packet
not teleport
entitydamagebyentityevent
if (!(event.getAttacker() instanceof Player)) return;
k
if you want to move from location a to location b
you get direction vector by doing b - a / length
then you multiply that by a speed to get your speed vector
a custom one?
yeah
I wanted to make so that when you play a horn, it makes every damage you do to someone or to some mob
summon a lightning
it needs to be a potion effect
because you will only summon lightnings on hit for a short period of time
it does not have to be a potion effect no
you can do temporary stuff without them being potions
oh
record the time it starts
record how long
check when someone hits if it expired
??
profit
i think a potion effect is easier though idk
no
no
dont rely on other systems
idk how ill do that
this exactly
System.currentTimeMillis
get the system.currentTimeMilis
can also use game ticks if you want the effect to persist between restarts without progressing
i think before i try to continue developing this plugin i have to understand it
some dude just helped me make it more safe and readable
but it also made it a lot more complex and confusing for me to understand
some parts of it i just can't understand
send code
I just discovered a new way of spawning particles using ParticleBuilder, since when does this exist? Did you guys used it already?
d;paper ParticleBuilder
public class ParticleBuilder
extends Object```
ParticleBuilder has 1 extensions, and 17 methods.
Helps prepare a particle to be sent to players. Usage of the builder is preferred over the super long World.spawnParticle(Particle, Location, int, double, double, double, double, Object) API
public class ParticleBuilder
extends Object```
ParticleBuilder has 1 extensions, and 17 methods.
Helps prepare a particle to be sent to players. Usage of the builder is preferred over the super long World.spawnParticle(Particle, Location, int, double, double, double, double, Object) API
me?
yes
i can just stream it to you
on intellij
it's easier
too many classes
it will get confusing if i just post everything here
Three dots - VCS - Github - create repository
Or smth like that
I don't even have a GitHub account
very horny method call you have there
๐ณ
im basically becoming the horn master
no one i've talked to so far understand how horns work
or knew very little about it
so far you've shared the class responsible for tracking what horns exist
seems pretty easy to decipher so far, it just gives you a horn of a certain name when you ask for it
what is hashmap and put if absent doing
although its weird that in the one snippet it calls the string key an instrument but the other class calls it the material
a hashmap is like a python dictionary if you know what that is
it lets you use one object (a name) to retrieve a different object (a horn)
put if absent essentially only adds a new entry into that hashmap if no horn by that name exists yet
preventing the user from overriding a horn with a name that was already taken
i wonder why this is important
because the plugin is basically modifying the goat horns
not creating new items
Oh lol
no response ๐
here it is
@dusky harness
I told u above
I'm on phone rn
Can't look
Here
Although u have to login to github in intellij
what do you not understand
these two parts
specifically
but
I'd like a better understanding of the whole thing
so you got a horn manager
that holds different types of horns
idea is that you can get the horn you want (each of these hold different logics in them)
this.hornspawn.getHorns.getHorn
just gets you the logic
mhm
the logic
is the thing inside each horn class right?
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class SingGoatHorn implements Horn{
@Override
public void action(Player player) {
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 400, 1));
}
}```
like this
yes
so SingGoatHorn
when you call .action on it
applies potioneffect
each horn has to have an action
since its implementing Horn interface
for the map
imagine it as a variable of sorts
but instead of having to define them one by one, you can define as many as you want
then you can pull it as needed dynamically
kinda like an arraylist?
Do you understand inheritance
1 -> obj2
Extending classes
yeah
he doesnt no
but no need its not his code
with maps
instead of numbers
you can put anything as the left side
in your case its these texts
yeah aki describes it well
so when you ask a map
a map is like an array / list but instead of using a numerical index you can use an object as the index
hey give me "minecraft:ponder_goat_horn"
it will give you the instance holding the logic
for ponder goat horn
putifabsent
thing
is basically telling it
hey, does "minecraft:blabla" exist already?
if yes do nothing
if not put the one i give you there
as its defined in the name itself
put IF ABSENT
its kinda useless in your use case, you could use just put as well
but it avoids overriding the old value
if an old value exists
i would personally make an enum instead of using raw texts
as the left side on the map
but its up to you
well, i didnt came up with most of this stuff
a guy just helped me making the plugin better
before I just did everything in the same class
with switch statements
yes, thats the main advantage of a map
instead of a switch case that will get longer and longer
you get to seperate the logic
into separate classes
so its easier to understand
i think it even makes the code run faster
switches are likely a little faster but not in a way that matters
just because there's less objects to unbox and jump through
this, you dont optimize on stuff like this
if you have performance issues, chances are you are doing something way worse somewhere else
hell yes, imma write all io operations on main thread

now
I need to find a way to make all attacks summon lightnings everytime you damage someone or a mob
this after you sound a horn
you need to do some time calculations then
System.currentTimeMillis()
gives you the amount of milliseconds passed since epoch
so, it allows you do this:
get time when horn is used
then get time when someone hits something
if you do time 2 - time 1
it tells you how many milliseconds passed
you divide that by 1000 to see how many seconds passed
lets say you want the buff to last 10 seconds, you just check if the difference is less than 10 * 1000
if yes, apply lightning on that hit
if not, return out of the event
public void onHitEvent (final EntityDamageByEntityEvent event){
World world = event.getEntity().getWorld();
if (!(event.getDamager() instanceof Player)){
}```
is this a good start?
(no)
right
I was about to say
I could barely understand that if statement
given the amount of parenthesis
so @merry knoll
this event will trigger only when I sound the goat horn?
how do I make it so that it will only trigger when the horn is sounded?
another hint, you want to have player uuid on the left
so you can be like
hey does this player have buff
what is player uuid to be exact
its unique id of the player
this aint gonna be easy
but if programming was easy
then everyone would be a nasa engineer
nasa engineers dont code
but anyways
new HashMap<>();
new HashMap<Type1, Type2>()
I feel like this one will be the hardest one to do
the other one just summons goats that attack mobs
Hey guys how, can i fix it
yaml menu_title: '&7Previewing: ' open_command: potionkit size: 9 open_requirement: requirements: permission: type: has permission permission: deluxemenus.admin deny_commands: - '[message] &cYou don''t have permission to do that!' items: '1': material: POTION potion_effects: - SPEED;10;1 amount: 1 slot: 0
So I'm back, and it is still regex time 
I have done some improvements to the system I'm working on, but I'm still dancing in my ass because the regex doesnt work, and thats something that doesnt surprise me.
Right now the regex is this:
(๏ ก๊ก๏ |๏ ก๊๏ |๏ ก๊๏ |๏ ก๊
๏ |๏ ก๊๏ ) ([a-zA-Z0-9]+): ([a-zA-Z 0-9\W]+)
It matches 3 groups:
- The rank, which is a 3 unicode character thing
- The Username,
- And the Message
The part I'm having problems with is the fucking rank part, although it should work, according to my brain and google, it doesnt.
For example, this is a message that it is supposed to be able to parse:
๏ ก๊๏ StarL0stGaming: imagine suffering to a fricking set of characters called string that supposed to make my life easier
But, it throws this error:
https://paste.helpch.at/ewasucuped.apache
The method that uses the regex is this one:
https://paste.helpch.at/kicimitotu.js
I'm in pain
i imagine there's a unicode problem somewhere, of something not supporting it
also of note, a valid minecraft username can have _ in it lol
i mean yeah, my guess is unicode
pretty much
according to google java should support that
IJ parse the first and third unicodes into the number thing
the mid one or the second is not parsed into that
should I try changing it to the number code?
To match a specific Unicode code point, use \uFFFF where FFFF is the hexadecimal number of the code point you want to match. You must always specify 4 hexadecimal digits E.g. \u00E0 matches ร , but only when encoded as a single code point U+00E0
In Java, the regex token \uFFFF only matches the specified code point, even when you turned on canonical equivalence. However, the same syntax \uFFFF is also used to insert Unicode characters into literal strings in the Java source code. Pattern.compile("\u00E0") will match both the single-code-point and double-code-point encodings of ร , while Pattern.compile("\\u00E0") matches only the single-code-point version. Remember that when writing a regex as a Java string literal, backslashes must be escaped. The former Java code compiles the regex ร , while the latter compiles \u00E0. Depending on what youโre doing, the difference may be significant.
I'm confused
and apparently dots as well
what no?
idk man. I think gaby posted a link to a paper regex where they also match dots
in player names
like inside a paper patch
probably for like Geyser or something
yeah but those prefixes are customizable tho
I guess the default one is indeed dot.
yeah. I know
maybe old usernames?
I Know they used to allow 3 char names
2*
not 3
but very long time ago
how do you extend an entity
i thought of like 6 different jokes to that question and none of them were funny
but also this sounds like an xy problem, unless you're making a mod?
what about the middle thing
wait
found it @dusty frost. took me 8 minutes lmao. It was in a reply to a DeluxeMenu PR. https://github.com/PaperMC/Paper/blob/master/patches/server/0821-Validate-usernames.patch#L32
no
I'm going to assume you're trolling now? XD
I dont even know either lmao
can't find any comments about it.
cause I want to create a custom entity

btw starlost. maybe instead of throwing errors check if there 's a match first? XD and just log it
don't you also have to do matcher.find?
oh
let me get the shotgun rq
then why does it throw an error then 
the it must be that I'm using matcher.group()
show your code. lol
what's at ChatHandler line 66
nothing lmao
oh noes.
changed the code
yeah. when the error was being thrown, what was there?
this was the old method
should I compile it at the constructor?
you can just make it static
it was line 69 iirc
hehe funny number
you're still not checking if it matches
you must check either matcher.matches/.find before using group and other stuff
the one here is the old one.
yeah okay and it works
yeah
really
well here's your answer
read the javadoc for pattern
as long as you use Matcher#matches first
aight
also what exact group does that method return
bc it doesnt return an array
just a single string
so I'm guessing it returns only one group
the next one
there is a group method
that takes in an integer parameter
that is to specify the group you want to get by index
group() (or group(0)) will return the matched string, if your pattern has capturing groups you pass in the group indexes (obviously starting from 1, because 0 is the whole match)
aight
from 0 to however many groups there are
wait 1?
no no star. read what emily said
aight
I Did not know that
yeah
let me try then
d;jdk Matcher#group-int
String group()
throws IllegalStateException```
Returns the input subsequence matched by the previous match.
For a matcher m with input sequence s , the expressions m. group() and s. substring(m. start(),
m. end()) are equivalent.
Note that some patterns, for example a*, match the empty string. This method will return the empty string when the pattern successfully matches the empty string in the input.
The (possibly empty) subsequence matched by the previous match, in string form
IllegalStateException - If no match has yet been attempted, or if the previous match operation failed

why is bukkit the default
anyways. I Was going to say, reading the docs will help lol. They seem to be pretty well documented
d;jdk Matcher#group(int)
String group(int group)
throws IndexOutOfBoundsException, IllegalStateException```
Returns the input subsequence captured by the given group during the previous match operation.
For a matcher m , input sequence s , and group index g , the expressions m. group(g ) and s. substring(m. start(g ),
m. end(g )) are equivalent.
Capturing groups are indexed from left to right, starting at one. Group zero denotes the entire pattern, so the expression m.group(0) is equivalent to m.group().
If the match was successful but the group specified failed to match any part of the input sequence, then null is returned. Note that some groups, for example (a*), match the empty string. This method will return the empty string when such a group successfully matches the empty string in the input.
The (possibly empty) subsequence captured by the group during the previous match, or null if the group failed to match part of the input
group - The index of a capturing group in this matcher's pattern
IndexOutOfBoundsException - If there is no capturing group in the pattern with the given index
IllegalStateException - If no match has yet been attempted, or if the previous match operation failed
someone tell that bot that I'm not in bukkit or spigot lol
yeah
still
tysm
absolutely true
surprisingly, reading the things you're using helps
imagine reading
tbh
why do that when you can debug for 6 hours and also make other lose brain cells in a discord server with you?
yes
but not for 6 hours
change it for a week or two lmfao
it isnt returning the first group 
and also turns out that it is also able to parse the character
wdym?
code maybe?
why do i even bother
I mean you have a fair reason
to not bother
so
will anyone help me creating a custom entity?
wanted to create a custom goat that targets hostile mobs
they havent been that helpful
How can i make something that when a player joins for the first time the players uuid gets loads into a yml file like this:
Players:
uuidofplayer1:
SomeValue: ""
when a other player joins for the first time it needs to be looking like this:
Players:
uuidofplayer1:
SomeValue: ""
uuidofplayer2:
SomeValue: ""
i cant extend entitygoat
i cant extend any entities
why
why is goat a fucking interface
i cant understand
trying to make a custom entity too lmao
im following this tutorial: https://www.spigotmc.org/threads/nms-tutorials-2-custom-nms-entities-1-11.205192/
im using the same "special constructor" that they made but i get this:
Cannot resolve method 'setPosition' in 'Stand'
along with other things, is it cause im using 1.19.2 and the tutorial was made for a earlier version?

if I have an hierarchy of Listeners aka one abstract class implementing Listener and a concrete implementation, and both concrete class and parent class got methods annotated with @EventHandler, will PluginManager register the methods on parent class(es) too?
what are you creating
armor stand that doesnt have gravity but can still have velocity
but everything is outdated 
i'm just trying to create a goat that attacks hostile mobs
i hate nms
but I can't extend entitygoat because it literally doesnt exist
i cant extend anything
the closest thing i found was "goat"
did u import spigot (not spigot-api)?
yes
and its an interface
does CraftGoat exist
1.19 for me
what is craftgoat
craftbukkit goat
yes
ah i think i got it
public Stand(Location loc) {
super((CraftServer) Bukkit.getServer(), new EntityArmorStand(EntityTypes.d, ((CraftWorld) loc.getWorld()).getHandle()));
this.b(loc.getX(), loc.getY(), loc.getZ());
}```
but b doesnt exist sooo
yeah not really
why is the tutorial different
when was it made?
i think a lot of stuff is version-dependent
literally 2017
jesus fucking christ why is firefox lagging my computer
w h a t
'addEntity(net.minecraft.world.entity.Entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason)' has private access in 'net.minecraft.server.level.WorldServer'
final Stand entity = ((CraftWorld) location.getWorld()).getHandle().addEntity(new Stand(location), CreatureSpawnEvent.SpawnReason.CUSTOM);```
compiled against a different version than the one being executed, probably
What does the error say
that entity goat simply does not exist
i cant extend any entity
Where is EntityGoat from?
it's from spigot, idk why it isn't working
im extending a class that comes with spigot or something like that
it's not what im looking for
public interface Entity
extends Nameable, CommandSender, PersistentDataHolder, Metadatable```
Entity has 4 extensions, 6 super interfaces, 154 sub interfaces, and 66 methods.
Represents a base entity in the world
prob an NMS class
Oh maybe
what does that mean
The package you're looking for isn't in spigot, which begs the question as to where you got the name from to begin with
public class CustomPig extends EntityPig {
Okay yeah that's NMS
I've never touched NMS, so no clue, good luck
i cant believe no one in this server knows how to create a custom entity
