#help-development
1 messages · Page 131 of 1
What type of block?
looks like a packet job
I'd prefer if there wasn't a need for packets, though if it is strictly necessary fine
Use the Material.LIGHT block to create light
I kind of need people to be able to place blocks though
I guess just send it client side?
how to prevent player from editing armorstand ?
I would cancel clickjng event at specified block
But idk if its applying before i click
How can I get name of this item?
I've tried item#getType()#name() but it returns RECORD_7
Pretty sure you have to make your own mapping for it
I wanna ask why I cant build on unclaim lands
Go to #help-server and be more dpecific
Hi, I have an error in the console, and I know it has something to do with the scoreboard class instance in the Main class. here is the code: https://pastebin.com/6ExQ1FCu
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
maybe itemMeta name(just to try)
You called repairMethod before initializing the scoreboard itself
That too lol
❤️
ItemStack stack = player.getInventory().getItemInMainHand();
ItemMeta meta = stack.getItemMeta();
meta.getLore().get(0);
thx you guys
found
Now run this while holding nothing
how can I calculate the exact position (x, y, z) a player clicked a block with PlayerInteractEvent?
is there alr. given code for this math?
??
yes
Event#getClickedBlock()#getLocation()
or you mean location of which part of block is interacted
yea, but will this give me just int coordinates? I want the exact location of the block the player clicked
I was fairly sure there was, sec
just a vector from player eye location
to block at direction
and loop until location is not the block
Wasn't it like getClickedBlockFace or smth
yea, I tried it with getEyeLocation.toVector and direction but couldn't get the math to work
yea, but that only says NORTH, SOUTH etc
iirc
No you can only get teh BlockFace. Nothing more detailed than that. I believe paper has teh actual clicked spot
Face returns SOUTH,WEST UP DOWN
And so on
not coordinates
yes it has a getter for that
Ah I see they need the exact coords
skipped school
or university
no im still in school and we didn't learnt vectors yet
how do you detect if a player puts an item in a chest/any gui?
Inventory related event
I wanted to say there is a method for the exact interaction point
on the player interact event
on paper only
but that is paper only 😅
Wow you guys really suck at helping people
alr
didn't ask
hate to break it to you but that's your job
if you want to help someone, that is

I am not helper
declaration: package: org.bukkit.event.inventory, class: InventoryEvent
and i provided link
omg
check if the clicked inventory is a chest
wow
and if the item clicked is not null
they provided a link :OOO
only if ur not using paper btw
There are not only chests
im using spigot
but enchantments
and trades and crafting tables
and so on
if you need all, you probably should use more events
you found smth?
what is the event where u detect if a player opens a gui?
ah found it
InventoryOpenEvent?
read it's description
if doesn't suit you create own event and listen to it
found it
its this
and is there a way to detect which inventory u opened?
like a Material?
or
sth
idk
Check the title
player.getOpenInventory().getTitle() or sum like that
the title could be renamed tho
i tried player.getOpenInventory().getType().equals(InventoryType.ANVIL)but it didnt work
?
inventory.getHolder()
oh
nvm
player.getInventory().getHolder().getOpenInventory().getType().equals(InventoryType.CHEST)
like this?
nop
doesnt work @fluid river
brooooo what the fuck is this
lol
When are you trying to see what type the inventory is? In what event?
event.getInventory().getHolder().equals(InventoryType.CHEST)?
what type of inv it is
Which Event?
InventoryOpenEvent
then don;t be silly. The event has the inventory
?
event.getInventory()
its always a player opening the inventory in the event
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
this will help
Check the block clicked
if (event.getInventory().getType() == InventoryType.CHEST)
that's no good
many plugins use chest inventories as GUI's
He only asked if it was a chest
lol bro staight up said he
aight, well they said detect if player opens a chest
he*
InventoryOpenEvent only triggers when a Player opens an inventory
dowsnt work
you need to learn about the source code of spigot java, if you dont viewing it, it might confuse about the functions...
of course it works
Operator '==' cannot be applied to 'org.bukkit.inventory.Inventory', 'org.bukkit.event.inventory.InventoryType
Yes it can its an Enum
you forgot the getType()?
yea
use teh actual code I gave you
== for comparing enums
not recommended
but the above also works
ty, now it works
¯_(ツ)_/¯
Hey, i Want to do a xp system... Its better to use MySQL for save the level and the XP of Each player in Each server or i need to use other things ?
is the same data to be used across different servers?
the only thing you're saving yourself is a null check
I'd focus on getting a feature working before making it persistent. But to answer your question, I'd personally only store the xp amount
level should be calculated from the xp
Elgar
Different for Each server
Okay thanks i will check this
it can
database has TABLES
just seperate the tables ¯_(ツ)_/¯
that or you can just store it in a simple .txt file
PDC all the way
No point in either PDC is the answer
olivo
how if theres many people are playing together
His data is relevant only to each player on that server
no its not reason
to re-iterate he said Different for Each server
so PDC or txt doesn't matter
txt is easier to access and read
it's convenient
PDC is much easier to use and easier to store
Do you just like arguing? He already stated that hsi data is server specific. Not used on other servers so not needed outside that server
Pdc is big piece of dogshit
It's not
Its direct player data. Store it ON the player itself (PDC)
I know what PDC is...
PDC = NBT wrapper
thanks for the patronising tone though
how if there's playing together in the first server, how many file could create the plugin? how if you have players above 20k like hypixel?
It just signs directly the game
No reading
What? PDC puts the data directly into the Players dat file.
also one tiny tiny question: how to make it so if u open a chest inv and theres an ender dragon egg on the floor, u cant pick it up until u closed the inv?
PDC is pretty epic
Gl with corruption
Change for the situation as i said
????
Pdc is better at this place
it can increase storage, that why we disable in that option ¯_(ツ)_/¯
we use mysql or sqlite
implying pdc can't get corrupted?
to store player things
it can
because it can be currupted
i thought this was #help-development ...
They are talking about another topic
Now you are just wasting my time. He stated he wants to store Level and exp. It takes LESS storage to simply put that in the PDC than to create a whole file system or save to SQL.
lol
this
Yes pdc is original
pdc can create more enough
ok troll
if you teleport player on 0.01 and then 0.02 and 0.03 will it be smooth walking? :D
What
yes
intresting
wdym
Wdym by floor
no, it will not play any animation
animation?
like and item on the ground u can pick up
mysql not sqlite¯_(ツ)_/¯
yes it will...
Walking animation
hmmm
teleport every tick will simply slide the player to each new location
try it for yourself
wrong
How is it different?
Stop arguing things you clearly know nothing about
xD
talk about stubborn
There is a walking animation
because that's how walking works
Teleport triggers NO animations. It simply moves teh player to a new location
I've done this before
teleporting an entity really small distances causes them to appear as if they walk
Basically you write two queries with the same interface, Same set of parameters, same result format
however mysql doesnt
?
No, it causes them to slide to the new location. The client extrapolates teh movement and slides them. Zero animation
can any 1 help me plz, im a cute egrill
❤️
I mean listen for inventory event and check if the player is in inventory, make a boolean like
boolean isPlayerinInv;
And in listen for 'isPlayerinInv` at item pick-up event and if the situation is true set event cancelled.
E Grill
There is movement
@serene sigil
ty
Cute e grill lol
thats me 😏
Undertale is a great game and I really do highly recommend it, you can get a copy at http://store.steampowered.com/app/391540/
Get the Soundtrack on Steam or at http://tobyfox.bandcamp.com/
lol
what does redirect do?
count of people clicking??
Me and Elgar are both correct
The player getting moved will not see a walk animation but other players on the server will see a walk animation
Same goes with entities
hm
So depends on if you care about the player themselves seeing the animation
what are all reasons why a block disappears/despawns/breaks etc
or will BlockBreakEvent handle all of them?
sry i was afk for a sec
wdym by that?
player.playSound(Location location, Sound sound, float volume, float pitch)
This line play sounds for all players ?
player.playSound is a non static call, so it seems its only for that player
BlockBreakEvent will handle any player interactions, You'll need to do something about pistons moving blocks and explosions
then I think you're all set
Oh and a rare case of enderman picking up and moving blocks
ok and what about commands etc
commands that change blocks?
cant you somehow remove/replace a block via commands?
yes
how do you think worldedit does it lol
through /setblock, /fill,/ clone
world edit does it very differently
how can I handle that / catch that
but not the same way vanilla commands do
Maybe you can catch it in the command preprocess event
I don't think I ever used vanilla commands in my life ngl
You'd have to have a listener for the command being sent
Maybe summon over 7 years
check if it's one of those commands and then parse the command yourself to figure out what block is being changed
execute do be a dope command tho
What the fuck may i would mean
if it's not many blocks you could just have a continuous clock that pulses every second or so to check the type of a block
doesn't consume much in terms of resources
Chill a bit with the attitude
I explained him thewhole situation
I tried execute when I was trying to exploit something but it wasn the type of execute i expected lol
how about /gamemode creative
everyone does that
I'm talking sp
neither do I, but for testing
You probably have used op, deop and whitelist
^
ye
another one
/plugins
:p
or /p
I don't think pl is vanilla
naw it's servers
Idek what /p does
hm maybe I change smth instead of listening to everything etc,
how can I give a block custom data which dont need to be persistent?
I currently save it in the pdc of the chunk, but I have problems when breaking block etc
cause the pos -> custom data, stays when block breaks gets removed etc.
so should I listen to all these events and then reset the specific key myself or
should I try to use smth else which only stores information (an instance of a class)
to a block and not the position of the block
Lmao
You can't give a block custom data to my knowledge unless it's something that can have data like chest, furance, smithing table etc. I have a mechanic where I need a similar solution. I've only made sure vanilla behaviours can't screw up the block type (like breaking, explosions, pistons etc.) as for commands that can modify blocks I don't bother supporting, I don't expect regular players to have access to those commands. Though I don't know what your mechanic is for.
Adding support for any unknown plugin that can modify block type in it's own convoluted way is a nightmare to support for
if i build my plugin in java 8, it will run for servers using 17 right?
should do
ok then I just use chunk pdc and check vanilla breaking explosion pistons
you can't do it the other way around though
Java 17 plugin on a Java 8 server is a no no
tho can explosion/pistons affect barrier blocks?
iirc you can only break it in creative right?
barrier blocks nah
they can't be moved or exploded
they have the same blast resistance as bedrock
ok ty
yea i know that
hm I get an error when trying to remove a chunk pdc's while disabling a plugin:
PersistentDataContainer pdc = new CustomBlockData(block, plugin);
pdc.remove(blockKey);
jeff_media's CustomBlockData
Can't do that when it's disabling
is pdc it self trying to register a task or is it customblockdata
I'd check the method and see
yea true
There's your issue
why is he adding it and then removing it
Good question
also why is he removing it in a task
Is dirty blocks just a list?
I feel like theres some obscure reason for that
Maybe an unfinished method
he will maybe explain it
Ping wasnt really necessary
ik, but its his "plugin" and yesterday he said I can ask if there are still questions about it
then I will just remove it myself
Just register commands? That'll give you the ability to tab complete them
Thats the command map
Don't need to
register commands then Player#updateCommands()
You assign permisions to each command
the player will only see teh commands they have permissions for from the command map
not if they don;t have that permission
hi, basically i wrote this code that detects if a dragon egg is in a players inventory and gives the player +100 levels, but if the egg is picked up by the cursor and its not in the inventory, then you loose those 100 levels, so the problem now is that if you spam left click in the inventory you start duping levels......
how do i fix this?
code:
@EventHandler
public void inventoryClick(InventoryClickEvent event) {
if (event.getCurrentItem().getType().equals(Material.DRAGON_EGG) && event.getClickedInventory().getType().equals(InventoryType.PLAYER)) {
Player player = (Player) event.getClickedInventory().getHolder();
player.giveExpLevels(-100);
}
if (event.getCursor().getType().equals(Material.DRAGON_EGG) && event.getClickedInventory().getType().equals(InventoryType.PLAYER)) {
Player player = (Player) event.getClickedInventory().getHolder();
player.giveExpLevels(100);
}
}```
Disable pickup to cursor maybe? Why are you checking enums with equals btw?
yea
no, pickup isnt the problem
ill show u
@iron glade
you could add a cooldown or whatever
or check if a click was made twice at the same time
and cancel the other one
wdym?
you could check the interval between the clicks and if its <5ms or whatever cancel it
and what do i have to cancel?
the second click á la inventory click event
how do i compare it?
hey! i have a MC server with plugins and need some help, is anyone able to help?
I have a plugin that allows /back and /home, but it only works if a player is OPd, any way to change it so it works for anyone?
look up permissions
google spigot permissions how
ty!
Is it possible to cancel a block break event but make it still drop the items?
drop the items yourself
Yeah I could do that. Is there a method that gives me a list of the drops it was gonna drop?
I wanna say there is but I cannot remember
not sure if cancelling and still setting event.setDropsItems(true) will work
event wont execute so no
Moterius is correct here. I already tried that lol
I am gonna see if e.getBlock.getDrops(); does what I need since I see thats a thing
loop over it and drop them yourself
would this work?
if (event.getCursor().getType().equals(Material.DRAGON_EGG) && event.getClickedInventory().getType().equals(InventoryType.PLAYER)) {
Player player = (Player) event.getClickedInventory().getHolder();
player.giveExpLevels(100);
event.setCancelled(true);
Bukkit.getScheduler().runTaskLater(Main.getInstance(), new Runnable() {
@Override
public void run() {
event.setCancelled(false);
}
}, 5);
}```
you cant cast an invholder to a player?
so no
?di might be smth to use for your plugin instance too
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
u can
that part works completely fine
lol
guys someone knows why Hex Code doesnt works in NameTags ?
how are you formatting it?
bruh just call event.getPlayer()
yes you can
bruh u cant
public static String translateColorCodes(String message){
if(message == null) return null;
String startTag = "&#";
String endTag = "";
char COLOR_CHAR = ChatColor.COLOR_CHAR;
final Pattern hexPattern = Pattern.compile(startTag + "([A-Fa-f0-9]{6})" + endTag);
Matcher matcher = hexPattern.matcher(message);
StringBuffer buffer = new StringBuffer(message.length() + 4 * 8);
while (matcher.find())
{
String group = matcher.group(1);
matcher.appendReplacement(buffer, COLOR_CHAR + "x"
+ COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1)
+ COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3)
+ COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5)
);
}
String sr = matcher.appendTail(buffer).toString();
String aux = null;
try{
aux = me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(null,sr);
}catch (Exception ignored){}
if(aux != null){
sr = aux;
}
return ChatColor.translateAlternateColorCodes('&', sr);
}
tf
its InventoryClickEvent
i'm setting the name of the ArmorStand with setCustomName and sending a PacketMetaData
just use ChatColor.of("#123456")
depends, there is a couple of events if I recall that works off inventoryholder where you need to check if its a player or block
it doesnt works to me :(
that method works in Chat
but no in NameTag
x.x
give me a moment and I will do some testing
ty :(
real quick. Are you trying to do nametags as in above the player or nametags like the item.
just use this instead of that long ass method lol
nametags of armorstand
and private static final Pattern HEX_PATTERN = Pattern.compile("#[a-fA-F\\d]{6}");
const when
ty, i just copy a resource method
u cant use while in a plugin
it breaks the server
use Bukkit.getScheduler
depends how long the while loops
it will loop a while
i mean, display name of an ArmoStand
Update: this worked thanks <3
still its good practice to do this
doesnt matter if it only runs half a ms or whatever lol
i think i'm going to jail by using lombok
wow copilot what are we doing
How can I store a list of objects in YAML & then get them in code.
YAML syntax confuses me alottt
you could serialize it
uhm i would not like serialization at this point
i just need to know how do u define a list of objects in yaml
What objects?
like yaml objects
a ConfigSection with keys and values and stuff
a list of ConfigurationSections basically
there is somethign here but I can;t remember the command
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
ayy it was ?configs
configurationsection.getKeys(false).forEach(key -> {}); u could do that
Hi, i want to display particles on a raytrace path, how can I?
do you have the configsections ?
and do you want to get the list ??
yes
well now i m kinda stuck, how do i serialize an ItemStack into a YAML object
- does it store alllll of the data? like enchants as well?
how do u do it
wait me
ty fam
public static String encode(ItemStack item){
if(item == null) return null;
String encodedObject = null;
try{
ByteArrayOutputStream io = new ByteArrayOutputStream();
BukkitObjectOutputStream os = new BukkitObjectOutputStream(io);
os.writeObject(item);
os.flush();
byte[] serializedObject = io.toByteArray();
encodedObject = Base64.getEncoder().encodeToString(serializedObject);
io.close();
os.close();
}catch(IOException ex){
ex.printStackTrace();
}
return encodedObject;
}
public static ItemStack decode(String encode){
if(encode == null || encode.isEmpty()) return null;
ItemStack item = null;
try {
ByteArrayInputStream in = new ByteArrayInputStream(Base64.getDecoder().decode(encode));
BukkitObjectInputStream is = new BukkitObjectInputStream(in);
item = (ItemStack) is.readObject();
in.close();
is.close();
}catch (IOException | ClassNotFoundException ex){
ex.printStackTrace();
}
return item;
}
^^
i think you mean
Config:
smth:
key: asdf
ket2: aw3
``` right?
noup
key: <b64 your code generates>
How can I fix the fact that the inventory opens on onjoin but closes due to resourcepack loading? Can I make it open after the resource?
plugin.getConfig().set();
plugin.getConfig().getItemStack()
oh damn
declaration: package: org.bukkit.event.player, class: PlayerResourcePackStatusEvent
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerResourcePackStatusEvent.html
https://hub.spigotmc.org/javadocs/s...yer/PlayerResourcePackStatusEvent.Status.html
PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED
declaration: package: org.bukkit.event.player, class: PlayerResourcePackStatusEvent
Don't worry guys, I appreciate the response, but I've seen these two things before. I have no idea how to implement them other than with a whilecycle....
completablefuture ?
literally will let you do what you are wanting
you wanted the inventory to open after the resource pack, that event will give you the status
all you have to do is check for the appropriate status and then open the inventory
Okay, we have a serious problem.
I am blind.
declaration: package: org.bukkit.event.player, class: PlayerResourcePackStatusEvent, enum: Status
the statuses you can get
like, making special areas of the map that need a different pack
You're right, thank you!
sure it would flicker a bit
But how can I check if there is no texture and then open the inv?
.SUCCESS? even if there isnt any texture?
well if the server is setup to where it asks them to download, then if there is no texture they would have to have declined
otherwise they have accepted
once accepted, it will either be quick or take a few seconds for the status to be successful
man wants to check if it has been accepted prior to sending the request
this is technically possible
Honestly, I didn't understand what I want to do.
I noticed that when the texture is installed, (If there is in the server), the inventory gets closed
so I assume I have to check to see if the process is failed or success and if so open?
I understood my problem, I was going around it.
How can I know if the server has a resourcepack that will be installed to the player? I think I need to do this check at onJoin.
declaration: package: org.bukkit, class: Bukkit
Thank you! You gave me 2 hours of peace of mind 🙂
well you are lucky you were here when I got off work 😛
otherwise you might not have known these things for a while XD
🙂
@chrome beacon taught me what I never understood about this
Does anyone know any GUI/Inventory APIs that make your life more sane
Phoenix616 InventoryGui
PlayerTextures textures = playerProfile.getTextures();
textures.setSkin(url);
playerProfile.setTextures(textures);
ItemStack head = new ItemStack(Material.PLAYER_HEAD);
SkullMeta meta = (SkullMeta) head.getItemMeta();
meta.setOwnerProfile(playerProfile);
head.setItemMeta(meta);
yeah
well one thing would be to cache the reflective look up
final Field profileField = skullMeta.getClass().getDeclaredField("profile");
cache it constantly
since every time you call that method, getDeclaredField will be invoked
which is, to say the very least not the lightest call
Personally, I am comfortable putting STATIC inventories with heads into a hashmap initialized at startup.
In the end, you don't feel the weight as much
oh I wasnt talking about that, but Ig
I'm sorry, I didn't mean to reply ahhaa
fair :>
WOW! HE'S RESPAWNED!
who? your dad?
Make your own
I wish he would die, he deserves it
damn so ez
it is easy
man do you want to get banned
Sounds like a #help-server problem, and since you're using Paper you'll probably have to go there.
I am godly at java
after those pings I don't think you deserve help

Where would be the best place to store data about the player for a quest plugin
you can use a relational database such as MySQL
I prefer saving it on the server
What version are you on?
PDC probably then
Or JSON if you want a file
💀
update your server software
Why JSON and not YML for example? Is one better than the other?
Generally YML is better for configuration and JSON for data storage IMO
do you have to?
You can definitely use YML for data storage, it's up to you.
Then keep going with the reflection you were working on earlier
(or read the last part of the blog post) nvm that was 1.16
you can use SQLite if you know your way around the SQL language, otherwise JSON would be alright to use
Yeah that works too I suppose
I'll use JSON then
JSON was never designed for data storage
but it's faster
^^ though it's just too convenient 😆
if your quest plugin is super simple and can work with a simple map of data then you can use the PDC though I still highly recommend just using SQLite
i got scammed then
Well neither was YML lol
compared to yaml
well I said faster, not fast
yaml is basically people making JSON a data storage medium
How can I make it so that if the server is sending a resourcepack and if it does it will open an inventory after success/download failed. Or if there is no resource to download/accept/decline..., open another inventory at join?
There is no isResourcepackRequired value in 1.16.5
careful where you are sourcing your info from. I don't believe that. there are so many factors to consider
yaml is built on top of JSON
this is the downsides of using outdated stuff
declaration: package: org.bukkit.event.player, class: PlayerResourcePackStatusEvent
If I use 1.19, with this method, will it work in 1.16 as well?
How can I add players randomly to teams to have the same number in each team? Specifically, I have made an onJoin() method and in that method I join players to teams. I thought of int team = random.nextInt(1,3); and then if (team == number) {team.addEntry(e.getPlayer().getName())} and that works, but I can't think of any way to split the players evenly.
not entirely sure what you asking
use modulo to split the players evenly
this lets you get the remainder and decide where they should be put
ok I will try it
If I change the spigotversion to 1.19 and use isResourcePackRequired. If I then put the plugin in a 1.16 server, does it give me a stacktrace of 1203 lines or not?
probably will
not sure how that would be a counter to what I said though. That is the downsides of using outdated software
the 1.16 server does not have the method so it will not work regardless of however much you increase the spigot version
I don't worry about outdated stuff
if you are using outdated stuff, then I am of no help
Well, it's hard to get so many people to use a plug-in just for 1.19
if you use outdated stuff then you should be ready for any consequences :P
its not
what
I have a plugin with over 80k downloads I think it is
and not once have I ever supported outdated versions
Well, leaving that aside, do you guys have any ideas for replacing isResourcepackRequired?
LevelledMobs has been out since the 1.15 days and the vast majority of servers running it are 1.19.x, despite the latest version being compatible with 1.16.x onwards
what it does take, is patience as well dedication to providing a quality plugin
there really is none because before that method the client never reported back a response if I remember right
the only way would be to force the player to accept the texture pack
don't accept a decline as being valid XD
I mean, PlayerResourcePackStatusEvent exists in 1.16.1
Do u guys know any Inventory prototypes tools? like u can design a prototype gui/inventory for referenace
ah, well I don't always keep perfect account of when methods appeared
or disappeared
aaaarhugasdgfad.
I just need to make sure that the inventory doesn't close if some useless plugin sends a resourcepack
you can use deluxe menus. thats what I do
Well if you're not memorizing the entire javadocs for every version why are you here 
it was only like yesterday I remember armor stands not existing
and having to use invisible entities for holograms 😛
ArmorStands were 1.8 weren't they?
yes
because of holograms
so, how the holograms used to work actually relied on a bug
a bug that Mojang publicly stated they were going to patch in 1.8
What really
so u telling me there are people who havent memorized every single java bytecode file and the java docs and the whole jvm code and how every single OS in the world runs?
Yes. Said bug was the horse age bug
Yep, lazy people... 
well i meant out of the game, like a web site or smth
if you set a horses age to a negative value, it turned it invisible all except its name tag
noobs
this is how Holograms came about
Lmao wtf
I know because I helped develop the first Hologram plugin 😛
Now, we don't take credit for discovering Holograms
Thanks for the story. I didn't know people even attempted holograms back in the day
just the making of the first plugin for it
Now we have HolographicDisplays 
Some person discovered this bug and it was a youtube video. Anyways me and few other bukkit dev staff at the time turned that into a plugin to provider it to serve owners as a feature
frostalf is the master oogway of spigot ngl
i get sage vibes from u
like the wise wise sages
HolographicDisplays was the second plugin to provide holograms. They were 3 months behind HoloAPI
I know the developer for that plugin 😛
Is filoghost still around?
I mean HolographicDisplays is still updated afaik
Mar 12 2022 was last update
On Bukkit atleast
Oh, yeah filoghost committed to the repo 4 days ago, he's still around.
Anyways
So one day some couple months before 1.8
Mojang states they are going to patch that horse bug and everyone got upset
because this meant that Holograms were going to go away
So Mojang was now forced to implement Holograms as a feature, hence armor stands are entities that can be invisible
Can thank HoloAPI and HolographicDisplays for making Holograms back then very popular 🙂
Hey thanks! :D
That is one of the biggest parts of history I enjoy having being part of
even if people don't know about HoloAPI anymore or that I helped XD
HoloAPI has 2 other developers that are not active in the MC scene as far as I am aware
DSH105 and CaptainBern
I am like the Historian of MC XD
Hey im aware this is not the place however i have a question about mongoDB, (if you dont know about mongo you can skip this q)
anyway ive got a "points" system which uses mongoDB for storage however i want a leader board command.
how would i filter through the database to get the top 10 members with most points
db.foo.find().sort({points:1}).limit(10);
db.foo.find().sort({points:-1}).limit(10);
wait whats the difference -1 the lowest 10?
i took a look in my books for college and i saw mongodb :(
1 is ascending order, -1 is descending order
so if you want the person with the top points at the top it will be -1
and limit(10) will grab the first 10 results from that
do you know why its red?
is points:-1 even a valid construction in Java?
?
actually just hover the mouse on it
and it will give you a reason why it's red
Lewi, are you writing in Java or MDB shell script?
java
Right, so frostalf's example was a shell script ;p
What are you using for libraries?
not your fault lol its fine haha
Morphia?
this is it, its for jda
I meant for Mongo. How do you connect to Mongo ;p
I don't spoonfeed, but knowing the shell way though should help you understand how to possibly achieve it in java depending on the lib you are using
4.7.0 👀
Ye. Depends on your lib
i cant lie i dont use mongo lol i just learnt most from some videos
and this is it
but that driver looks old
The concepts should be pretty interchangeable between frostalf's shell script and Java though
is there a need for mongo in your use case tho?
probably not, but that is beside the point. They wanted help with this, help has been provided 🙂
Doesn't try with resources close the connection and thus the collection
hehe
try (resource){} is the proper way for try with resources to auto close something
yeah but probably pointing him towards the right path instead of helping him in this case would be better, cause mongo has really a small amount of use cases
it isn't for us to decide what they should or should not use
its for a mate he wants mongodb so idk
i tend to use sql
MongoDatabase database = client.getDatabase("whatever");
database.getCollection("whatever").find().sort(new BasicDBObject("points", 1)).limit(10);
i might have found a solution tho
I guess
In theory, that should work
At least given frostalf's example
Also not at all resource safe, handling closed connections, etc.
would this work the same?
Mongo in German can be literally used as an insult lol
Not sure what ascending is
I should remember this when MiniDigger is on
what exactly does it translate to?
in italian too
Can be in English too if you add more to the word
Some genetic defect iirc
Could also be speech issues, idk. At least it isn't something that nice
now that you said that, I am very much curious
I should know it given that I am german myself, but just knowing that it is an insult is enough for me
discord on its best
lol i use that word daily, its basically standard in uk haha
same for italian and I'm guessing all close relative languages
It's used quite often by teenagers in Germany as insult
hehe
that is just lazy
you should compute it
even if it takes a million years to do so
BigDecimal moment
mye
If you have the memory BigDecimal has the number
so one of the insults with that word, is old fish
the other is down syndrome
hehe youre an old fish 🤓
guess being called that in Germany is a big deal
I am going to use it on Minidigger
just to see how they react
lol
Well it's racial because of its relation to the Mongols
Germans don't like the Mongols or something?
It's an insult in English too so I assume it's a European insult
I myself am not familiar with that part at all
it isn't an insult that I am aware of in English
I'd send the link but I can't. It's not a racist term it's just that it originally was used as a reference to a group of people and then eventually became used as a word for mentally slow
I need to get my hands on a VR headset >>
so I can tinker with it
I need to progress the use of VR headsets in public
there is so many awesome things that become possible with them. Like how cool it would be to just get statues in your headset while walking around
or telling you how fast something is coming towards you
etc etc
would be neat to have a vr headset for driving XD
tbh most here use it as substitution for "idiot"
I love foreign textbooks that teach programming having English. It's so awkward
at least it is just a single page
is there any furnacegui api?
(for a clickable furnace)
got 300 pages of sql stuff
hehe smth to read
lol, both operands and result are doubles and still im not getting Infinity for the * one ;/
It gets better when you are using it in courses
geol help me
Although older teachers refrain from using english
What do you need there?
English is the best for programming
had to code in dutch in highschool :(
is there any furnacegui api?
(for a clickable furnace)
hated it
Does not compute.
Try being more specific
bsdfgasgkadetg
Tip: While using the correct keywords helps, using the wrong keywords is very bad - try to use proper english words
I want to the left bar an up and down arrow and on the right the selection in the result
Im going to sell you
?jd-s
I mean setting those properties isn't that much of a deal
they are going to sell you
so I think now we need to determine the price the opening bids should start at
While yes, apis probably exist - I have never fumbled with it
I am not a boy!
And certainly not yours
fixed
:c
Anyways, invoking https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/InventoryView.html#setProperty(org.bukkit.inventory.InventoryView.Property,int) with the proper property and value should be really easy, what exactly should the API abstract away there?
Does the client always end the title if a subtitle with shorter duration is sent, or is there a solution?
Do you want the furnace GUI to be fundementally different or is there something different you want
Hello, I am trying to spawn armor stand with packets in 1.19.2 but no matter the entityType it always spawns alloy. Can anyone help? ```java
int entityID = new Random().nextInt();
final PacketContainer packetContainer = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY);
final int entityType = Integer.parseInt(args[1]);
final int extraData = 1;
packetContainer.getIntegers().write(0, entityID);
packetContainer.getIntegers().write(1, entityType);
packetContainer.getIntegers().write(2, extraData);
packetContainer.getUUIDs().write(0, UUID.randomUUID());
Location location = player.getLocation();
packetContainer.getDoubles().write(0, location.getX());
packetContainer.getDoubles().write(1, location.getY());
packetContainer.getDoubles().write(2, location.getZ());
ProtocolLibrary.getProtocolManager().sendServerPacket(player, packetContainer);
I wanted to make a single method to get a FurnaceGUI element and open it to the player, without using 10 different listener classes
Good question - I'd assume it does
youre right! as always 🙂
ok, I should stop
no more gayism
Myes - easily doable with just a simple https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/HumanEntity.html#openInventory(org.bukkit.inventory.Inventory) and then setting the properties. If you need to do something peridoically just add an appropriate scheduler
Although as you correctly identified managing/protecting the inventory is another question
I see, it sounds smart from the way you explained it, thank you
However you could just use your traditional GUI library (assuming it supports custom inventory types) and use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/HumanEntity.html#setWindowProperty(org.bukkit.inventory.InventoryView.Property,int) instead
Only issue is that the properties are reset when the view is closed/reopened
||damn she hot|| 
Hello guys, i need help with something :(
i'm trying to translate the color of string with hex code,
but i'm getting the wrong color or just its not printing any color
its happens only with display names, in chat its working
code:
|| ```java
public static String translateColorCodes(String message){
if(message == null) return null;
String startTag = "&#";
String endTag = "";
char COLOR_CHAR = ChatColor.COLOR_CHAR;
final Pattern hexPattern = Pattern.compile(startTag + "([A-Fa-f0-9]{6})" + endTag);
Matcher matcher = hexPattern.matcher(message);
StringBuffer buffer = new StringBuffer(message.length() + 4 * 8);
while (matcher.find())
{
String group = matcher.group(1);
matcher.appendReplacement(buffer, COLOR_CHAR + "x"
+ COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1)
+ COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3)
+ COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5)
);
}
String sr = matcher.appendTail(buffer).toString();
return ChatColor.translateAlternateColorCodes('&', sr);
}
why didnt you use the damn thing i sent
also why tf use a stringbuffer, those are threadsafe and slow
hehe
all fun and games until you test
imagine giving useful answers
imagine being useful
about this ???
its still without works
lol wanna use a five line method or a hundred lines one
i dont care the method, i dont asking for a method more short in lines :/
ok im out then
also ChatColor.of is not avalaible in 1.14 i think so
Does anyone know if the ${osgi.platform} substitution has any specially defined value in maven?
Possible to create totem animation?
ugh i hate databases, anyone know why this doesnt update the db?
https://paste.md-5.net/gafihiniko.cpp
no
shit i had my args in the wrong order
yep
statement.closeOnCompletion(); has no effect
it doesn't work on non-result producing statements
yea, i was just trying everything i saw on stackoverflow lul
you should use execute() when using preparedstatements
again, see previous comment
Hey, do you have the link to the topic about using getInstance in plugins ?
what error do you get?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
oh didn't see that message
Ty my dude
that works with mainclass as well as just using a static with main class
but it generally isn't the main class where the problem arises
Hello everyone! I wanted to ask a question: "But how do you publish your skript on SpigotMC" ?
like 5 lines of code
Wdym ?
https://www.spigotmc.org/resources/ Click "Add Resource" and set the category to "Skript"
basically 3 lines of getter, one line of field declaration, on line in onEnable() of initialisation
And one line to use when you need
actually you can do it with 2 lines without getter, but only if java supports static imports
Why are you telling me this ?
I don't understand
Learnjava
private static YourMainClass instance; // 1
public void onEnable() {
instance = this; // 2
}
public static YourMainClass getInstance() { // 3
return instance; // 4
} // 5```
to use in other class
just use YourMainClass.getInstance() when needed
I know what getInstance is, why are you explaining me this ?
can I use java 17 plugins in 1.16?
I made one Util Plugin
and I want to use it in my other plugin
I have depends: set to Util
also I have shaded version of 2nd plugin in /plugins/ and Util plugin also included in /plugins/
but it still doesn't
work
by that I mean, utility plugin doesn't start?
Got a question, I'm making a plugin to select 2 positions. Upon demand, it will remove all the blocks (like WE) between those points and upon demand also restore. Now the question is, how bad would be it to actually store every individual block location and it's data so that in case of a server crash, you can still restore the cuboid zone. Everything is stored in a custom config so it would mean that the entire file is loaded into the memory
.
thought you need help with it
cuz it's #help-development
you never set the instance field to anything
yes I did
the Utility plugin works fine seperately
but doesn't work in other plugins
well but you only do it in onEnable, why do you wait so long
set it in the init block
static getter 🤦
private static MyThing instance;
{
instance = this;
}
private static Pelican instance;
{
instance = this;
}
public static Pelican getInstance(){
return instance;
}
so like this?
yes
Nothing wrong with this ey
still same error
should I set scope to provided?
oh yeah ofc you must not shade it into some othe rplugin
