#help-development
1 messages Β· Page 839 of 1
is it a big query?
No matter how the query size, dbs must be done async
Why? Well the explantion is not big when you querying something your doing your thread to await until the query result, but what happen if you dont get a result? Well the main thread will be awaiting until its complete
yes, but it could explain why the server is freezing in this instance
if its not a big query there could be other issues
in my world protected with worldguard, animals will not spawn is it possible that mob-spawning deny also prohibits animals from spawning?I used worldguard api to create a region that protects my mini game map
the mob spawning gamerule pertains to all mobs
hey,
it's not possible to sprint if your flying is disabled?
but idk about worldguard
how to allow a sheep to spawn, I need it for the mini-game sheepfreenzy
I would suggest asking in the world guard support, they help better than us
Because their discord is specialized to world guard i hope its help you, have a nice day!!
I'm calling using summon and code but it doesn't work
why is it not possible to sprint when flying is disabled for a player
oh no, definitly not good doing that. If you are coding you should work everything via code and skip running commands thru the plugin to do actions
if that what you mean via summon
you have no food
maybe try eating first xD
OH shit lol
I deleted the region and the sheep started spawning
hahah, dont worry man
then is a flag thing, as we told before better to contact their support they can help better than most of us
also are you that creator of MPDT?
but can you tell me how to disable spawn mobs in a world without worldguard, namely mobs and not animals
that is, from the side of the spigot api
whats mpdt
Listen to the entity spawn event
morepersistantdatatypes
ah
After moving to gradle it keeps giving NoDefClassFound stacktraces
yeah alex made that
you arent shading probably
^^
dk what that is, my friend moved it to gralde
He did mention shading yes
Is that bad?
add the shadow plugin
what is the shadow plugin? Shadow dependency you mean?
something like this? ```@org.bukkit.event.EventHandler
public void onCreatureSpawn(CreatureSpawnEvent event) {
if (event.getEntityType().isAlive() && !isAllowedAnimal(event.getEntityType())) {
event.setCancelled(true);
}
}
private boolean isAllowedAnimal(EntityType entityType) {
return Objects.requireNonNull(entityType) == EntityType.SHEEP;
}```
Yeah I figured #get blocks the main thread, the queries I've worked with before were very very small (like this one actually), so I was running them on the main thread, which I'm trying to avoid now for the first time by using dbs async.
I guess I got this completely wrong then π€¦ββοΈ, CF should be used on the actual actions that use the databases rather than the methods that simply return values from the db. Like the isEventRunning() method being in a CF is completely useless, it's rather in the GUIClick class (where I need the value from the db) where I should use CF, right? thanks for the help either way
What do you mean by CF? Sorry for not understanding
CompletableFuture
CompletableFuture
oh right, thanks
Have you written js before?
I fiddled around with node before but no real projects
Basically there's no point in creating an async function and then forcing it to run on the main thread
What you want to do is create a basic loading state while it fetches the information from the database
also you really shouldn't query the database on every inventory click
You should have some sort of catching because then you will over resource on every inventory click
No t sure if i made understand i will try to write it better
Yeah I see I completely took the wrong approach there, the CF needs to be put where I'm asking for the value, idk what I was thinking π€¦π»ββοΈ
What we mean with Olivo is that is not a great idea calling the db all the time when each click is done
Oh no it's on a very specific item being clicked in the GUI, not every single time an inventory is being clicked π
yeah I mean that item
Oh? Even then? Because the value it's fetching always changes so I'd need to make sure it checks it
Basically the full code is that a player executes a command, a GUI opens, and then if the player clicks on a specific slot in the GUI, that's when I would use the CF to ask for the value from the database
Would that still cause issues?
And then depending on the value from the database the action is different
you need to ask for the value and act upon it whenever it's received, don't actively wait for it
Could you explain what the database call is for?
is seems to be checking if an event is running
but why are you checking it on click
Yeah the click on a specific item in the GUI attempts to host an event. That's when the plugin checks if an event is running or not. If it's running, GUI closes & server tells the player that they can't host an event, cause there's already one running.
If database returns that event is not running, plugin sets the eventRunning boolean in that database to true & then I just use spigot methods to run an event
The reason I use a database & not anything simple (internal) is because they're inter-server events on the network
I explored using other solutions like Redis, but I just built the entire thing around DBs months ago & it worked great. They're very very small queries
if you want to keep the current approach just run your code when the query completes instead of waiting for the query
use thenAccept
Can I use spigot code in the thenAccept?
Depends on what you're doing
but if you're not sure use the scheduler to jump back to the main spigot thread
Just regular spigot methods, sending a message etc
?scheduling
Ah yep
Perfect I understand. I'll have a go at it tonight & report back, thank you so much for your help π it means a lot!
As long as you don't run thenAcceptAsync all of those calls are synced
Likewise whenCompleteAsync runs it asynchronously instead of synchronously
I see I see! Thank u π
Reminder you can't cancel events in in thenAccept or WhenComplete
Even of its synced it'll occur after the event has already outlived the ability to be cancelled
Yep no need π the event is cancelled at the beginning
if you're going to close the GUI do check that it's still open
and that it's the right inventory
Ahh true! Will do. But the queries don't take that long do they? It's just one boolean
It could
Also, for setting database values (instead of getting), I also use CF right?
It can be unpredicatable which is why I/O shouldn't be done sync
Yep
Yeah
Yep perfect! Thank u π
I'm curious how the plugin running sync only crashed one server running a specific plugin but not another one π
Why is "BlockPopulator" called twice in the same chunk?
I register my populators like that
@Override
public @NotNull List<BlockPopulator> getDefaultPopulators(@NotNull World world) {
List<BlockPopulator> blockPopulators = world.getPopulators();
blockPopulators.add(new MoonGrassGenerator());
blockPopulators.add(new MoonOreGenerator());
blockPopulators.add(new MoonStructureGenerator());
return blockPopulators;
}
How do you know it's being called twice
because it does the same action twice
?paste
Here is "MoonStructureGenerator" as an example
it somehow spawns the structure twice ontop of eachother, and i know that its not a problem of the function
because the same problem is also in grass generator
grass gen:
https://paste.md-5.net/misihulolu.java
import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
public class MenuListener implements Listener {
@EventHandler
public void onMenuClick(InventoryClickEvent e) {
if (e.getView().getTitle().equalsIgnoreCase(ChatColor.GRAY + "Land Shop")) {
// Check if the clicked slot is empty
if (e.getCurrentItem() == null || e.getCurrentItem().getType().isAir()) {
return;
}
// Cancel the event to prevent item movement
e.setCancelled(true);
}
}
}```
can someone please help as this wont work for some reason and idk why
Ok i know the problem, world.getPopulators is the problem
this is the Land Shop menu code
doesnt say that anywhere
its not about your problem
its about my problem
Is it possible to give player effect with custom name?
did you even register it
No, but you can use a resourcepack to rename an existing one
I see name checking, from what I can remember name checking is a bad idea
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
public class Menu extends CommandExecutor {
// The Inventory Its Self
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender;
Inventory inventory = Bukkit.createInventory(player, 9, ChatColor.GRAY + "Land Shop");
ItemStack item = new ItemStack(Material.GRAY_STAINED_GLASS_PANE, 1);
inventory.addItem(item);
// Nothing
ItemStack Nothing = new ItemStack(Material.GRAY_STAINED_GLASS_PANE, 1);
ItemMeta NothingMeta = Nothing.getItemMeta();
NothingMeta.setDisplayName(" ");
NothingMeta.addEnchant(Enchantment.DURABILITY, 1, true);
Nothing.setItemMeta(NothingMeta);
// Land Plot 1
ItemStack LandPlot1 = new ItemStack(Material.GRASS_BLOCK, 1);
ItemMeta LandPlot1Meta = LandPlot1.getItemMeta();
LandPlot1Meta.setDisplayName(ChatColor.RED + "Plot 1");
LandPlot1Meta.addEnchant(Enchantment.DURABILITY, 3, true);
LandPlot1.setItemMeta(LandPlot1Meta);
// Land Plot 2
ItemStack LandPlot2 = new ItemStack(Material.GRASS_BLOCK, 1);
ItemMeta LandPlot2Meta = LandPlot2.getItemMeta();
LandPlot2Meta.setDisplayName(ChatColor.RED + "Plot 2");
LandPlot2Meta.addEnchant(Enchantment.DURABILITY, 3, true);
LandPlot2.setItemMeta(LandPlot2Meta);
ItemStack LandPlot3 = new ItemStack(Material.GRASS_BLOCK, 1);
ItemMeta LandPlot3Meta = LandPlot3.getItemMeta();
LandPlot3Meta.setDisplayName(ChatColor.RED + "Plot 3");
LandPlot3Meta.addEnchant(Enchantment.DURABILITY, 3, true);
LandPlot3.setItemMeta(LandPlot3Meta);
// Back
ItemStack Back = new ItemStack(Material.GRASS_BLOCK, 1);
ItemMeta BackMeta = Back.getItemMeta();
BackMeta.setDisplayName(ChatColor.GRAY + "Back");
BackMeta.addEnchant(Enchantment.DURABILITY, 3, true);
Back.setItemMeta(BackMeta);
// rest of the slots
inventory.setItem(0, Nothing);
inventory.setItem(1, Nothing);
inventory.setItem(2, LandPlot1);
inventory.setItem(3, Nothing);
inventory.setItem(4, LandPlot2);
inventory.setItem(5, Nothing);
inventory.setItem(6, LandPlot3);
inventory.setItem(7, Nothing);
inventory.setItem(8, Back);
player.openInventory(inventory);
return true;
}
}```
ok, thanks
Don't detect inventories by their name
how would u do it?
Literally what I said seconds ago, name checking is bad
idk how to do that
you implement InventoryHolder
then in Bukkit.createInventory change player with "this"
InventoryHolder is also kinda meh
its better than checking name tbh
Detect it by their instance
yeah the issue is that you implement an interface not exactly meant to be implemented, moreover iirc it does end up yielding a ton of instance creations underhood thus it doesnβt exactly scale well
unless that was fixed ^^
is that about inventoryholders?
ok yea
does anyone have a exponation on how to do it tho
save the instance in a list or smth
Keep a HashSet
or a weak one if you want it GCd
idk what any of that is, im learning all of this for the first time
DracoCookie I agree its a bit dumb because on the surface it looks too good to be true
i wish they would fix it tho
Like its so object oriented and looks to work well :^)
yeah well soon Y2K might get his pr pushed n merged

anyways
we still dont know if the listener is registered
and that was my question
@sterile sapphire is your listener registered
Am i braindead or smth, i keep typing verified instead of registered
import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
public class MenuListener implements Listener {
@EventHandler
public void onMenuClick(InventoryClickEvent e) {
if (e.getView().getTitle().equalsIgnoreCase(ChatColor.GRAY + "Land Shop")) {
// Check if the clicked slot is empty
if (e.getCurrentItem() == null || e.getCurrentItem().getType().isAir()) {
return;
}
// Cancel the event to prevent item movement
e.setCancelled(true);
}
}
}```
i think was it
Did you verify your listener man?
stop bullying me
All your listeners shall be verified
hey so, i'm trying to use a custom image for my scoreboard, using a special charactere. But its reaally small, how can i change that in the plugin?
yall confusing me π¦
did you do getServer().getPluginManager().registerEvents ?
in main class or somewhere else
no i dont think so
increase the icon image size
then its obvious that it wont work
:(
i was waching a tutoial and trying to learn of that for the bit
how? the thing is 256/256px do i just make it like 1000/1000px?
wont i just give a better resolution?
?events
NO I DID WRONG CMD AGAIN
ik what events r
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
In hallowed halls where murmurs gently tread,
A proclamation echoes, widely spread.
All listeners, aye, shall be verified,
Their hearts laid bare, no secrets to hide.
With solemn oath, they pledge their troth,
In words and deeds, the measure of both.
No guise or shadow shall obscure the way,
To truth and candor, they must obey.
A dance of whispers in the air,
Yet only those of honesty shall dare.
For falsehood's cloak, a frail disguise,
In scrutiny's gaze, it swiftly unties.
Let scrutiny reign, let honesty shine,
In every listener, a pledge divine.
For in the realm where words hold sway,
Verified hearts shall guide the day.
still read it
Only 1% of the poam has to do with listeners and verification π
poem*
who knows maybe the listener is a hacker
Make it bigger in the resourcepack
public class MenuListener implements Listener {
he needs to be verified man
You might want a second character that's bigger
i told you to read the document
You really shouldn't do title checks under any circumstance
you are making it hard for us if you dont listen
whether it is inventory names or items
In the realm where Bukkit reigns with might,
Verily, listeners, a task to sight.
To be verified, a decree profound,
In the coding's script, their trust is found.
Oh, Bukkit listeners, with code entwined,
In verification's embrace, assurance bind.
Through realms of digital, their presence true,
Verified they stand, with duty to pursue.
It's a dumb approach
ivebeen told so many times
but i havnt been told y
So why do you insist
just that u shouldnt
Well
For item names, anvils exist
An exploit I've personally abused was just renaming items with a /rename plugin on servers and tricking plugins like Slimefun that they're the real deal
For inventory checks, it's just dumb
Relying on an implementation detail
If you want to change the inventory title due to a config or something you'd need to change your listener too
but u can make the item colord and u carnt do that on a anvil
What if you could just give your inventory a tag or something saying "hey look this is my custom inventory"
many plugins/servers allow that
THat server had a /rename plugin that allowed color codes
You're still abusing an implementation detail rather than just doing things the proper way
caugh Essentials caugh
(inventory pdc when)
inventory pdc??!? wth
just store it in variables inventories dont last forever
(I know it was sarcasm)
You can store data in containers but only integers
For items what if you could just give them a tag saying "yeah this is my custom item" in a way where players wouldn't ever possibly be able to modify it
Reminds me of when I wrote a whole I18n class just to add language support to my plugin
That's PDC
As for inventories you can just put them in a map
and tie that instance to the inventoryview's lifecycle
When the inv opens, you put it in the map and when it closes you remove it
yep and remember kids the Hashcode doesn't change ;)
What's the purpose of the hashcode
Map<InventoryView, MyCustomInventory>
You understand hashing right?
Kind of
Can someone explain what hashing is
you essentially are just reducing a classes data into a finite range of numbers
It's just a way to irreversibly convert data to a single number
because under the hood many HashMap implementations are an array of LinkedLists
So a hashcode of a number is just itself
I never got too deep into hashing, just that it's using maths to turn things into a number that you can't turn back into those things or something
A hashcode of an object is just a weird combination of all its objects' hashcodes
Now, you can use the hashcodes to see if 2 objects are(n't) equal
If its turned into a number, how would hashmap.get work then
Hashmaps store objects in "buckets"
What bucket it's stored in depends on the hashcode
First thing I thought of
Working of HashMap in Java | How HashMap works in Java with HashSet, LinkedHashSet, TreeSet, HashMap, TreeMap, ArrayList, LinkedList, Queue, PriorityQueue, ArrayDeque etc.
this one's a bit better
Basically get the hashcode and get the bucket for it
int bucketIndex = hashcode & (bucketCount - 1)
That's your "bucket"
The bucket acts as a sort of linkedlist
does java use separate linking?
I am illustrating it in my head with water buckets π€
I've never looked at the implementation
it changes in java8
But once the object count crosses a certain threshold it doubles the bucket count and re-hashes the entire hashmap
It also changes it from a linkedlist approach to a tree approach
additionally, which is partly because it uses the underlying size array to determine where elements are gonna go, if im not mistaken as well
yea
Something like this
Once it crosses the load factor it switches bucket impls
I'll make Bucket an interface and switch it from a LinkedBucket to a TreeBucket :)
Source bin, you in TSC a lot? :o
Tho the serializable java api is⦠well⦠you know⦠could be better
Hi, so I wanna get the player by uuid, but it always returns null, anyone knows why that could be?
here's my code:
Bukkit.getPlayer(UUID.fromString(CreateBoard.gamePlayerUUIDs.get(i)))
gamePlayerUUIDs being a ArrayList containing the UUIDs of the players, and the index is existing, so the UUID is being read correctly
Yeah more abstractly thats not wrong
Tho practically in Java its used to determine whether X and Y is the same, thus you also need to override equals just in case of collisions which⦠happen more than what u think at times.
Why dont you directly store the UUID in the list
Have you tried printing the uuid?
And is it the uuid of an online player?
Returns:
a player object if one was found, null otherwise
Since its null, the player is probably offline
Not just probably
getOfflinePlayer exists I think
It is null draco
It does
But if you create an offline player with just the uuid, there is no guarantee that it will have a name
Well, I am the player
And I am certainly not offline when it triggers
that's why it wonders me
._. unexpected
With player names it works fine
But that wouldn't work with name changes unfortunately
Have you tried storing UUID objects instead of Strings with UUIDs
Yea
fr
Also just realized I have to completely change like every piece of code i have bc of that .-.
I was solving an issue for 2 months to find out it was because I wrote byte instead of int
How th did you do that
bruh
Sat 7 hours there and realized I didn't clear one value which was why it didn't function
I also recently had an issue, where the whole issue was that I used the wrong player object and it took me 2 days to realize
Yes yes we cant english too
my english is not englishing
What problem?
Man, I know that feeling
Do you have issues we string to material
π
Ah yes
storing it with uuid worked haha
Maybe I'm just dumb after all..
lmao
Hello does anyone can explain me how i can make this code to work
@EventHandler
public void onPlayerLogin(AsyncPlayerPreLoginEvent event) {
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
try {
System.out.println(event.getAddress().toString());
String response = plugin.getApiBase().user().isWhitelisted(event.getAddress());
System.out.println(response);
Gson gson = new Gson();
BasicRequestResponse responseResult = gson.fromJson(response, BasicRequestResponse.class);
if (responseResult.status != 200) {
System.out.println("here");
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "You are not whitelisted on this server.");
}
} catch (Exception e) {
plugin.getLogger().info("Error checking whitelist status: " + e.getMessage());
}
});
}
Now the issue is that the player not being kicked from the server in server console I can see System.out.println("here"); but player is still online
Remove the run async
Yea
I see it worked, can I know the reason why it's so ? Does it's bzoc AsyncPlayerPreLoginEvent is already async ?
yes
yes
what about that catch exception is that good practice
Nah not rly
im reading effective java rn cause i got no idea what to do with my library
Lol
catching all exceptions is kinda useless anyways
Yea I was just testing
In general you should always try to do something with exceptions as well as making messages in what it relates to.
And you should only catch the exceptions that are thrown not generic ones
yeah and the docs should tell you which ones it throws
Or just peek into the code
i mean for his case I think he should disallow the user from joining if there's an exception
Near the function it should have "throws"
Good point
As long as you do something. If you dont want to let players connect because of one you can do that however sometimes exceptions are unavoidable depending which one it is
and i failed
now i can english
so im making a rewards system, and its configurabl, like this:
my problem is
how can i add custom items, that dont have special ID
like this item
its not just a normal player head, it does stuff
give it a tag and do stuff according to events and its tag
sorry, what do u mean?
use pdc and do stuff according to the stuff you add to the pdc
Juste a question, for colors, i use chatcolor like CHatColor.BLUE, but how can i use colors from codes like #763297
you don't
bungeecord chat color exposes a way to do RGB
idk if that properly translates to the somewhat cursed RGB format however
it does I'm like 27% sure
There is some code in ChatColor.of() that does it
perfect 
xD funnily enough since I don't need the weird legacy shit in my MiniMessage clone I just invoke the constructor directly
:/ my parser is cursed as fuck though
atleast its not slow and cursed xD
Am I just stupid or is Category not a part of java or bukkit?
what
look at the package
None of the deps are what I need it for, old stupid code π€¦ββοΈ
Hi, trying to implement vault in my plugin but getting this error on local server, its working on remote server with same vault.
Error:
java.lang.NullPointerException: Cannot invoke "org.bukkit.plugin.RegisteredServiceProvider.getProvider()" because "rsp" is null
at me.marek2810.rpjobs.RPJobs.setupChat(RPJobs.java:58) ~[RPJobs-1.0.jar:?]
at me.marek2810.rpjobs.RPJobs.onEnable(RPJobs.java:32) ~[RPJobs-1.0.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[purpur-api-1.19.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[purpur-1.19.4.jar:git-Purpur-1985]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[purpur-1.19.4.jar:git-Purpur-1985]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[purpur-api-1.19.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:577) ~[purpur-1.19.4.jar:git-Purpur-1985]
at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:488) ~[purpur-1.19.4.jar:git-Purpur-1985]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:643) ~[purpur-1.19.4.jar:git-Purpur-1985]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:442) ~[purpur-1.19.4.jar:git-Purpur-1985]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:345) ~[purpur-1.19.4.jar:git-Purpur-1985]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1120) ~[purpur-1.19.4.jar:git-Purpur-1985]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:325) ~[purpur-1.19.4.jar:git-Purpur-1985]
at java.lang.Thread.run(Thread.java:833) ~[?:?]```
code:
private boolean setupChat() {
RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class);
chat = rsp.getProvider();
return chat != null;
}
either way you should probably avoid CreativeCategory as its not synced to the server
Oh wait I figured it out, custom class..
seems like you don't have a chat provider
you should install one or your plugin won't work
what database u using?
@trim lake you can find a list of common chat providers on Vault's resource page
others may also exist as well
Use VaultChatFormatter i use it on my network, works like a charm and doesnt bother Essentials
Hmm, I dont have any (even Essentials chat, I have only essentials) on remote server and its working fine
But, thanks I know the issiue now.
yes
What is MPDT?
MorePersistentDataTypes
oh, yes ofc
Reduced by half its types when I finally survive family visiting me and fix the last couple comments on PDC lists π
;prayge;
Just imagine an emote there, discord mobile loads all 173 guilds with emojis eagerly
everytime I press the dumb emoji button
skill issue 
;-;
Time travel and pr to 1.16

Your a wizard lynx
Yea he got a wizard hat
where can i find documentations and tutorials to create bungeecord plugins?
i wanna make something that runs a command like /check user evertime a user joins, if the output matches a website from a file, it will kick them
We have wiki pages on bungeecord plugins, https://www.spigotmc.org/wiki/bungeecord-plugin-development/
Bungee's API is relatively simple because you're working at proxy level and really there's not a whole lot you usually have to do there, so the documentation is also pretty simple
would it be possible to run 2 click events?
TextComponent acceptButton = new TextComponent(ChatColor.GREEN + "[Accept]");
acceptButton.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tp " + playerName));
Not in the same component, no. You would have to make some sort of temporary hidden command (e.g. a /<uuid> command or something) and have that command run the two commands you want them to run
A bit hacky, but there's not really another option with components
I guess technically you could supply a data pack as well and run a function but :p
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>bunkeykord</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>bunkeykord</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<type>javadoc</type>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
is this correct
package org.example;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;
public class events implements Listener {
@EventHandler
public void onPostLogin(PostLoginEvent event) {
for (ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) {
player.sendMessage(new TextComponent(event.getPlayer().getName() + " has joined the network."));
}
}
}
how can i make the plugin execute a command everytime a player joins?
Which commands?
Proxy?
@quaint mantle I finished my parser I was talking about π it's beautiful
It's so awesome to see something you've poured so much blood into to make work finally do something properly
Any nerds online wanna make a quick buck? I need help and am so confused on what im trying to do i need a good helping hand with this. I just want to buy your time to share my screen and walk me through until we solve this issue. I am working with Mongo and Inventory Menu to save kits for Player.
Budget: $10-20
I literally cant figure this out
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Just share your screen in general.
I'll be there in a few to help. Don't need to ask for money lol
Here's the thing
Alright
I've already given him pointers on how to re-structure his data to not have weird concurrency issues
I just want to know why this thing keeps happening,
side effect of wrong use of CF i assume.
I mean this will all-due-respect but please don't be that guy.
I am asking in general not you specifically
Don't worry I'm a super critical dev 
I'll clean it up π§Ή just gotta brush this cat first irl
Okie dokie
Just saying we already went through problem areas
Nothing wrong with asking for help, I'll do what I do
Okay bc from your remark earlier, I got the sense it was a crime to ask for help around here.
Nah that's not the reality
We cool

Can you share in general? Or do you need to be verified
prob need to be verified
Hmm i dont know how to answer, verify thru here? If so how can i do it quickly?
basically just ?verify <forum name>
ohhhhhhh i just did smth like this
?verify
Any command
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;
public class Events implements Listener {
@EventHandler
public void onPostLogin(PostLoginEvent event) {
ProxiedPlayer player = event.getPlayer();
ProxyServer.getInstance().getPlayers().forEach(p -> {
p.sendMessage(new TextComponent(player.getName() + " has joined the network."));
});
ProxyServer.getInstance().getPluginManager().dispatchCommand(ProxyServer.getInstance().getConsole(), "your_command_here");
}
}
Command noot found..
it's a slash command /verify
Word
I tried it's not working. "Command not found."
you need a forums acc
I have one
this?
If you need reactions because you want to post premium stuff just answer ppl's questions like a maniac
May I add you as a friend on here?
im joking...
premium stuff?
I suppose temporarily. It'd be better to verify for future help/reference
dawg im new
:)
Yes of course, ill remove you after no worries.
Added you
do you even know how to revert a binary tree
Step 1: Open chat.openai.com
I've been doing java for 7 years
step 2 gamble your house away
Only today did I decide to learn how hashmaps work
how do they work
public class Node<K, V> implements Map.Entry<K, V> {
private final int hash;
private final K key;
private V value;
private Node<K, V> next;
}
type deal
Once the map has achieved a certain "load factor" it changes from a linked approach to a tree approach
The amount of buckets doubles
And all the nodes are recomputed
To get the "bucket index" AKA what bucket an object goes to
It just grabs the hashcode and does a % operation
Hi guys, does anyone know why I am unable to reference certain new things like the cherry blossom biome? I am using IntelliJ and I just added spigot-1.20.4.jar to my libraries as an upgrade from 1.20.1 in an attempt to fix it, but that didn't seem to work (neither did invalidating caches)
show me your entitychecker class
π₯²
mein got
public void onCreatureSpawn(SpawnEntityEvent event) {```could it be that the player will also enter this event
Oh no is that 1.8
Anyways yes it should fire for players. You'd want CreatureSpawnEvent otherwise
declaration: package: org.bukkit.event.entity, class: EntitySpawnEvent
It's telling u to use .runTaskTimer(plugin this, long delay, long period) at the end, I don't see where you're doing that
I want to disallow all mobs except sheep in my minigame world
public void onCreatureSpawn(SpawnEntityEvent event) {
if (!isAllowedAnimal(Objects.requireNonNull(event.getEntity()).getType()) && event.getWorld().equals(Map.party) && !(event.getEntity() instanceof Player)) {
event.setCancelled(true);
}
}```
return Objects.requireNonNull(entityType) == EntityType.SHEEP;
}```
this is the right way to do it?
here
Hmm maybe that works, I've always done .runTaskTimer on the implementation of the runnable like new BukkitRunnable(){ // code }.runTaskTimer(....);
well isnt that what im doing? on there?
Do you have other runnables like this that work?
i dont use any other runnables
I'm surprised you didn't say something like "we don't provide support for this ancient version. just like yesterday, someone helped me with the gui 1.8"
Yeah it looks like it should work but you never know lol
it works now for some reason
You shouldn't use 1.8 but you can. Just like using a spoon to dig a hole. You can do it. Doesn't mean it's what's best.
so can I change to CreatureSpawnEvent and remove the player check?
ok
Yes.
thanks
Are you only checking for sheep on just that world?
yes. minigame world
Objects.requiresnonnull
you have no idea what that actually does do you
Haha it's the autocomplete
well, the ide recommends it to me
Yes, it's super dangerous and it's a noob trap
I literally saw the NPE stack trace associated with Objects.requireNonNull right now
...
@sterile flicker if it's a spawn entity event your entity is not going to be null
yes
I'd read what the code actually does 
Do a if(event.getEntity() instanceof EntityType.SHEEP)
idk how to write code in discord lol
unknown class
EntityType.SHEEP
is not possible
There you go
You're using 1.8 that's irrational enough 
well, I only made 4 plugins for 1.16 and 1.20
that sounds like an excuse
I just joined the 1.8 server project
?1.8
Too old! (Click the link to get the exact time)
8 years
I'm still a believe in the idea that 99.9% of new 1.8 servers fail.
and the 0.1% is hypixel
If you use 1.20 or a newer version you gain access to new features that can create content that can actually compete with Hypixel
public void onCreatureSpawn(CreatureSpawnEvent event) {
if (!(event.getEntity() instanceof Sheep) && event.getEntity().getWorld() == Map.party) {
event.setCancelled(true);
}
}``` not working should i add event.getEntity().remove();?
yikes world hard reference
.equals()?
public void onCreatureSpawn(CreatureSpawnEvent event) {
if (!(event.getEntity() instanceof Sheep) && event.getEntity().getWorld().equals(Map.party)) {
event.getEntity().remove();
event.setCancelled(true);
}
}```
mobs continue to spawn
just a json config file
how can i place blocks in air
like on the placing of the block i can place It looking in the air too
static BukkitTask countdown;
public static void startCountdown(int seconds, long delayBetweenCounts, int minigame_id) {
count2 = seconds;
final BukkitTask task2 = Bukkit.getScheduler().runTaskTimer(SumeruParty.plugin, () -> {
if (count2 > 0) {
count2--;
}
if (count2 == 0) {
// Countdown has reached 0, cancel the task
Bukkit.broadcastMessage(ChatColor.DARK_RED+"[SumeruParty] Game ended.");
if (minigame_id == 1) {
SheepFreenzy.finish();
}
countdown.cancel();
}
}, 0L, delayBetweenCounts);
countdown = task2;
}```
Why when I call startCountdown(60, 20, 1); The inscription game ended is repeated several times
Is there a better way to cancel this?
I completely forgot about bukkitrunnable
Does talking in chat abide by minecraft's tick system?
can someone tell me what the double args in getNearbyEntities say? i dont really understand the docs
anyone got an example of a scoreboard/
public class MainScoreboard {
public MainScoreboard(Player player) {
Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
Objective objective = scoreboard.registerNewObjective("scoreboard", Criteria.DUMMY, "scoreboard");
PersistentDataContainer pdc = player.getPersistentDataContainer();
String area = pdc.get(new NamespacedKey(Nebula.getInstance(), "area"), PersistentDataType.STRING);
objective.setDisplayName(" Custom Scoreboard");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
Score first = objective.getScore(" " + area);
Score second = objective.getScore(" Second Line");
Score third = objective.getScore(" Third Line");
first.setScore(2);
second.setScore(1);
third.setScore(0);
player.setScoreboard(scoreboard);
}
}```
i have a scoreboard here, how do i make it keep updating, this only gets rendered in when the player joins, whats the best way to make sure its always updated
it's just the radius along the axes from the center location
.
@old sphinx
You can then have a Map<UUID, SimpleBoard> scoreboards
and tick those
one more thing, is there any reason why .getLocation().distance(entity.getLocation()) <= 1 wouldnt work? i want to check if entity is max 1 block from the location
tried flooring/rounding the distance beforehand?
since, what if it's 1.1 or something like that
now im not the brightest and this is some complex code, but wouldnt a runnable in the scoreboard class work fine or will that cause some sort of issue
It wouldn't be right
how so?
basically it should check if the entity in cobweb, maybe theres better method for it?
You could make it work
I would just check the adjacent blocks with getRelative
good idea
I'd grab the player's boundingbox and do checks with it
that's a better idea
but how can i get all the blcoks it collides with?
get the bounding box, add it by the player's location and loop through minX to maxX
and just floor the vals
for (String pl : SumeruParty.players) {
Player p = Bukkit.getPlayerExact(pl);
String kills = "Β§bKillsΒ§8: Β§7" + p.getStatistic(Statistic.PLAYER_KILLS);
String deaths = "Β§bDeathsΒ§8: Β§7" + p.getStatistic(Statistic.DEATHS);
String spacer = "Β§7Β§m-------------------";
Objective objective = p.getScoreboard().getObjective("Party");
objective.getScore(spacer).setScore(15);
objective.getScore(kills).setScore(14);
objective.getScore(deaths).setScore(13);
objective.getScore(spacer).setScore(12);
int balance = Vault.getPlayerBalance(p.getName());
Score money = objective.getScore(ChatColor.GOLD + "Money: "+balance+"$");
money.setScore(7);
objective.setDisplayName("[" + (SumeruParty.current_minigame) + "/" + 12 + "] [" + Minigame.count2 + "]");
}
}``` please hep. When a player dies, the deaths field will split in his scoreboard instead of updating it.
can i use Scoreboard board = p.getScoreboard(); board.resetScores(p); before setScores
@vagrant stratus@austere cove@tender forge@smoky yoke
i want my resources to be immediatly deleted
so report it on the forums, be patient, and don't tag random staff for no reason
i reported it pls delete them asap
Demanding to have it deleted won't make it be deleted any faster.
just need the resources to be deleted now thats why
and my other resource reported it too if u can delete it too π
i have
how can i add premium resource?
?premium
3 free resource LoL
Doesnβt have to be anything big
how can i set argument 0 of my command to string so i can do smthn like this: /command "string"
try 1
arguments are already strings or are you asking something else?
i wanted spaces in my argument but i figured it out with for loop and string builder
nice
It can throw an exception if both locations are in a different world
Why is the clickedblock I get in the PlayerInteractEvent always air?
when clicking trapdoors
v1.17.1
idk
actually it considers the block as Openable
I printed the class name of the object and it seems fine
but the material it's air ever
which api-version did you set in plugin.yml?
1.17
then idk
:sad:
What happens if u rigtclick them like on ghe ridge
So it opens but ur still looking at it
@vast ravenwatch dm
@austere covecan u also delete my other resource pls π
Show some code
For me its
Now let's compare π
Benchmark comparision
Functionality
Error testing
His will be faster, its already faster than actual minimessage
@austere covepls broo
Hello! If I want to create a temporary BoundingBox to be used to check if a player can fit at a certain position, how do I do that? Should I clone the player's BoundingBox and try to move its position
does the teleport method teleports in some randomness? player.teleport(basket.add(0, -2, 0)); just teleports the player like ~1 block away from the actual area
it should not no
that is weird hm
is the velocity kept?
well remember that for instance 0,0 would be on the edge of a block
also what would be a good approach to check if certain entity(not player) left an area?
didnt think about that!
I wanna say the move event, but its called quite often, no?
Oh nvm
If its an entity
Then presumably you might have to run a bukkit task every tick
well yeah but then i have to check for differences in a list full of entities inside the areas etc. is there really not a better approach
Well I think thats the easiest one
how to create a tnt explosion, not an ordinary explosion, namely tnt, so that worlguard allows the explosion to damage blocks with the tnt and other_explosion flag enabled
get center of ur region and run getentitiesnearby
how aobout this approach:
if (entity.getBoundingBox().contains(field.getBasketA().toVector()) || entity.getBoundingBox().overlaps(BoundingBox.of(field.getBasketA().getBlock()))) {...}
it theoretically should work but it doesnt, is there something i missed?
Spawn a primed tnt and then explode it
thanks. already TNTPrimed tnt = (TNTPrimed) event.getEntity().getLocation().getWorld().spawnEntity(event.getEntity().getLocation(), EntityType.PRIMED_TNT); tnt.setYield(2.5F);
i have another problem
public static void generate() {
party = Bukkit.getWorld("party");
if (party == null) {
SumeruParty.plugin.getLogger().warning("ΠΠΈΡ 'party' Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½. Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Π½ΠΎΠ²ΡΠΉ.");
party = Bukkit.createWorld(new WorldCreator("party"));
}
party.setAutoSave(false);
}
public static void unload() {
Bukkit.unloadWorld(party, true);
Bukkit.getServer().reload();
}```
and Map.unload(); Map.generate();
I want the world not to be preserved.
Well, it's a mini-game world, and I need to regen it.
just recreate the world
just remove the world directory
yea
and make like a template_world directory
which you duplicate and load
can't i make this one with the code I showed you?
unloading the world is not removing it from the filesystem
I can create a copy of the world, but how do I load it to my main minigame world
you use the copy as the main world
and delete the old one
or any other method for deleting a directory recursively yes
but before deleting make sure that you are unloading the world
Bukkit#?
thanks
so you should probably do
Bukkit.unloadWorld(world, false);
world.getWorldFolder().delete();
and that would delete the world
no, that won't work
why not
the directory needs to be empty for File#delete to work
so they should use the mentioned commons-io method
alr
Bukkit.unloadWorld(party, false);
FileUtils.deleteDirectory(new File(party.getWorldFolder().getAbsolutePath()));
Bukkit.getServer().reload();
}```
?
Ohno please don't reload the server
getWorldFolder is already a file
π
you are turning a file into a file
why are you reloading the server? You already unloaded the world
also reloading the server is like using the reload command. Not recommended
Any idea why this does not work since 1.20.2? Skulls are only rendered if the player is currently online. Players list contains UUID's of different players, can be online/offline.
@young knoll sorry for pinging but shouldnt it be called "calling this function" and not "calling this plugin"?
probobaly :p
gasps a javadoc mistake ?!
@kind hatch get to work π
declaration: package: org.bukkit.inventory.meta, interface: SkullMeta
If I use SkullMeta#setOwnerProfile to set the profile of OfflinePlayer#getPlayerProfile() something weird happens.
The first time I open the gui the first skull has a texture, others are empty. On the second time every skull is missing their textures.
Hello, im tryna code plugin which detects when someone joins worldguardregion.(PlayerMoveEvent) But it sends same 3 messages, instand of 1..
May someone help me?
?paste
show code
save the uuid as string
wdym?
Use WorldGuardRegionEventsAPI theirs multiple forks out their
I use it exclusively for my Capture the flag minigame in my Games plugin.
where can i find the api?
^^ anyone?
Look it up, their is a version for 1.7-1.8, and 1.9-1.20.4
Find which one works for you
Okay
Their is documentation all their for you, just pay attention and youll be okay. If i figured it out trust me you can figure it out haha
I found only the 1.9 version
i cant see 1.19 anywhere
:/
https://github.com/Webbeh/WorldGuard-Events maybe this?
AAAah still hapens that when i enter the region(moving in game) it sends 3 messages
public void onAsyncPlayerPreLogin(AsyncPlayerPreLoginEvent event) {
OfflinePlayer player = Bukkit.getOfflinePlayer(event.getName());
if(player.isBanned()) {
BanList banList = Bukkit.getBanList(BanList.Type.PROFILE);
BanEntry banEntry = banList.getBanEntry(event.getName());
String banReason = banEntry.getReason();
String message = "Β§cYou are permanently banned from this server for: \n"+banReason;
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, message);
}
}```
any1 know why it still shows the vanilla ban message?
nvm i forgor to register event
tf im supposed to spawn there under one of the cobwebs, but now im just spawning completely randomly on y ~15
its caused by the .teleport method
but im just doiung player.teleport(basket.add(0.5, -2, 0.5));
are there common ways/setup of using database in plugins?
is it recommended to use jooq? best practices?
so i need Map.unload(); Map.generate(); to regenmap?
And then what? i have ```public static World party;
public static void generate() {
party = Bukkit.getWorld("party");
if (party == null) {
SumeruParty.plugin.getLogger().warning("ΠΠΈΡ 'party' Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½. Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Π½ΠΎΠ²ΡΠΉ.");
party = Bukkit.createWorld(new WorldCreator("party"));
}
party.setAutoSave(false);
}
public static void unload() throws IOException {
Bukkit.unloadWorld(party, false);
FileUtils.deleteDirectory(party.getWorldFolder());
}```
do you have the world as a template?
I only have 3 standard worlds and a world called "party"
Can you duplicate the world directory and call it "party-template"
okey
next?
hold on
what should I do when I want to load the world into OnEnable, for example, and when the server stops and the game is started in OnDisable unload the world
can I use my own ChannelPromise to recognize my own packets at the channel handler?
As long as you make the client know that packet (mods)
Otherwise not
You could try a hacky method, by splitting your packet in blocks, and send it as a CustomPayload packet
the packet will me a mojang one
File worldFolder = party.getWorldFolder();
Bukkit.unloadWorld(party, false);
FileUtils.deleteDirectory(party.getWorldFolder());
FileUtils.copyDirectory(worldFolder.getParentFile().getAbsolutePath() + "/party-template", worldFolder.getAbsolutePath());
Then you would use world creator to load the world
Wdym with mojang packet? Do you mean a minecraft one?
that's what it's also called
mojang packet is more commonly used
Anyway, as long as the packet is supported by the client, yes, you should be able to
I wouldn't recommend messing that much with packets btw, I had bad experience by doing it so
π
You just need to manage it correctly. No biggie
Can help you with any trouble, im decent with packet listeners
Use Packet-Events & ProtocolLIB
Well I mean, yes as long as you know what you are doing, packets are a bit dangerous to play with, similar to NMS or OCB
Not dangerous, but might end up with unexpected things to happen
What is OCB?
Hmm show me your code in a a hastebin please
lol
Yeah I mean if there exists api to achieve whatever u wna do then def go with that before resorting to packets :>
Basically
And spigot latetly has been implementing API to do almost everything you would need to
If we still were on 1.8 things might be different
Im on 1.7 HAHAH@
Sue me
yeah, but 1.7 spigot software is not rly supported
Ik but i know it very well
i mean if u have ur own fork and so on⦠great for u :)
1.7 don't have titles nor actionbars πΏ
Yep and a certain other popular fork of spigot
Those forks forces you to use their API (nothing bad about it), breaking spigot compatibility, but yes
Ik, but i made my own actionbars with item display names
I made them with holograms (kinda the same)
WHAT??? Smart asf
Stealing ur idea
https://youtu.be/ZVRj0VKt9qw
You are free to
Do whatever you want with it
I wouldn't recommend doing it anyway
As said before, 1.7 not longer supported
@quaint mantle I tried making jmh for your components but it wasn't even running xD I got json malformed errors
cries*
It doesn't use minecraft json format
Eh not what i was expecting tbh. Im sure you can make better than that haha
It uses a custom one
It doesnt feel right
Go ahead
π₯²
The actionbars(legacy) would be better with item name
how does that even work
And titles can be hologram
You don't build components to send them using minecraft methods, you use my own parser and sender to send it π
Yeah, I didn't think it very well
Anyway, @river oracle
I did some benchmarks and...
Not what I expected
Did u suck?
Mine were taking 0.009 ms
almost
Anyway, I don't really know how should I benchmark?
I still think that, for a parser, is too much time
you should probably benchmark in microseconds
Aight, I'll do it
https://github.com/Y2K-Media-Creations/Pineapple/blob/dev/pineapple-chat/src/jmh/java/sh/miles/pineapple/chat/PineappleChatBenchmark.java also if you want a decent comparrisson you should probably run mine on your PC too
GameTestHarnessTestCommand.register(this.dispatcher);
ResetChunksCommand.register(this.dispatcher);
RaidCommand.register(this.dispatcher);
DebugPathCommand.register(this.dispatcher);
DebugMobSpawningCommand.register(this.dispatcher);
WardenSpawnTrackerCommand.register(this.dispatcher);
SpawnArmorTrimsCommand.register(this.dispatcher);
ServerPackCommand.register(this.dispatcher);
if (commanddispatcher_servertype.includeDedicated) {
DebugConfigCommand.register(this.dispatcher);
}
}```
this is interesting
i never knew minecraft have such hidden commands
yeha its pretty neat
Out of context, I love your parser name, Pineapple
mcp decompiles minecraft too
the version craftbukkit is using at least
Think these modding envs take advantage of it
that's the library name :P and the org name PineappleDevelopment
it's spigot mappins i guess
Love it
awful
I mean regardless of mappings, its still quite nice
public static boolean IS_RUNNING_IN_IDE;
it's a public thing...
oh, wait, commands are registered before any plugin
yes
why don't you just copy the minecraft code into your plugin or something
don't even need to if the classes are public
you can register commands at runtime
and then update the player's command list
you just need some NMS and reflection
sounds easy
hell with reflection they don't even need to be public I suppose
they just need to exist
i was just looking on how command dispatcher works when handing custom argument types
the command dispatcher is annoying to me
funny thing is... they are stuck to the client
yet, the server have them too.
at least the "translatable component"
I see why bukkit doesn't have an API for those yet
we blame choco
Player#spigot
Player#components when
Why
you can't create your own custom argument type.
are many items packets sent to the client
when there is only one entity
well you need a resource pack for that
the server doesn't understand custom argument types.
you can't send custom "translations" you have to rely on the vanilla ones
nope, you can't even do that.
oh
yes, read too fast
e.g. if I send "container.beacon" in a translation component
it'll translate, but not "container.custom"
you can't even send simple components
yes you can
not that way...
Player#spigot.sendMessage(new TextComponent())
i mean a custom error message with custom argument types
idk what you're talking about
or you can't change existing error messages on existing argument types.
IntegerArgumentType for example
it have INTEGER_TOO_LOW and INTEGER_TOO_HIGH errors
well Brig doesn't have Bukkit API yet sure, but you can still kinda use it with Commodore
hmm
guys, is it better to make a plugin using kotlin or java?
let me try something. If it works, I'm e genius
whatever you're more comfortable with
learn both
if you don't know either language use java it'll allow you to get more support
I like kotlin, but they say it has incompatibility problems with other plugins
you should be fine as long as you use kotlin's stdlib
and whatever other things you need to make that weird ass language work
could be wrong, but pretty sure NMS is horrid with kotlin too afaik so if that's something you need you'll need to write your compatability layer in java than do whatever magic kotlin needs
kkkk, so I can code using kotlin without worrying about the other plugins? because some people were saying that if you have different versions of kotlin on a server it might not work
There is no default constructor available in 'com.mojang.brigadier.arguments.IntegerArgumentType'
it's great to use it on android
i'm an idiot.
i'll use java then, safer
you are incorrect
i hate you :))
Do you know both languages?
yes
Java if u want to
Kotlin requires the stdlib
So even though kotlin makes everything easier
People still choose java
But for me personally java is easier
then it's best to opt for what's safest
they are both identically safe
kotlin is much easier
and what do you even mean by safe?
Indeed
Null Safety π€
Kotlin got le sugar babiesss
kotlin supremacy
don't worry guys I use Java Optional it makes everything better
He said above, compatibility with other plugins that are written in java
FileUtils.copyDirectory(new File(worldFolder.getParentFile().getAbsolutePath() + "/party-template"), new File(worldFolder.getAbsolutePath())); cannot find "/home/container/./party-template" path
eco is written in java. Stfu
eco is written in kotlin with a java frontend API
that is from his younger ignorant days
its about 50% java 50% kotlin
Does anyone know what packet I could wait for to receive from the client to ensure that the entity potion effect packet can be sent and applied?
safe I mean, to run my plugin with others without worrying about incompatibility, as I said before, some people told me that 2 kotlin plugins on 1 server may not work if their version is different
Then that's no kotlin supremacy
thats because it's a java api, not a kotlin api
Just shade propwrly
it's got 25000 lines of java and 20000 lines of kotlin
because if sent to early the client will for some reason just ignore it
but all my other plugins are in kotlin
how big is kotlin standard lib xD
libreforge for example is 100% kotlin
6mb ish i think
You do you mean front end when the logic is built on java????
the API is written in java, the backend is written in kotlin
Want some examples?
how tf can you have any of your plugins premium isn't the size limit like around that much?
Ok @river oracle I'm running the benchmarks (had to convert your code to java 1.8 πΏ)
Look at those utility classes written in java
You can minimize it tho
cause kotlin is included in eco, which isn't on spigot
Not because of you, but because of me
if its slower I'm blaming it on that
Anyway, yours will probably be faster than mine
jmh takes so long xD poor soul
guess why
without a new File(), it violates the rules of the language(java 8)
if you're saying it won't make any difference, then I'll do it in kotlin, that's it
<?>>
thats not what im saying
guess what you can do to fix it
without getAbsolutePath()?
Tbh kotlin std should be included in spigot just for the sake of those that write plugins in kotlin, and use different versions of the std
i see /./
why not just use new File(Bukkit.getWorldContainer(), "party-template")
ye better way
Ime I feel like shading the std lib is a bit annoying, else both are nice :)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: Source './party-template' does not exist
its strange
i told you to create it
but I can see this folder right now.
how can I make it so on my bungeenetwork it doesnt need to always reload the texture pack on every server switch if its the same texturepack?
I have /root/ on my hosting instead of /home and the hosting name instead of /container