#help-development
1 messages · Page 522 of 1
Who know write mods?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
next time catch throwable
github doesnt quite like me
can i create a new enchantment?
Yes
like a create an object?
how do you get a component from legacy text with spigot
There is a component builder
nvm
I advise you to have a look at this page https://www.spigotmc.org/wiki/the-chat-component-api/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thanks
well, i told you the error
i have this problem: "java: cannot access com.mojang.authlib.GameProfile
bad class file: /C:/Users/feder/.m2/repository/com/mojang/authlib/3.3.39/authlib-3.3.39.jar!/com/mojang/authlib/GameProfile.class
class file has wrong version 60.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath."
how i resolve this?
Install a java 17 jdk and compile with that one
But you compile it with a java 8 JDK at the moment
i am using intellij how do i edit the jdk?
You are talking to the wrong person mate
i resolve
is there a way to make it so when a player joins the server the join message is only sent to set players?
yo u italian?
yes
yoo me too
gg
dm?
ti dico come fare
bet
Alright it's about time you learn about epochs
save a long
You shortened the error too much
An epoch is just a long that defines the amount of seconds that have passed since a pre-defined date
Yes there is
that's like january 1st 1960 iirc
The actual exception is not shown
probably cannot serialize an instant
And it's basically a representation of a given time and date
You get the epoch of yesterday at 6pm
Always LocalDateTime
and you get the epoch of today
ah its a get, i read that as set 💀
compare
Can I add weapons from the MmoItems to the ItemsAdder?
Instant is absolute garbage because it does NOT keep track of time zones
me who is just happy that i dont have to care about timezones :)
knowing my code will horribly fail
Well the issue is that you can't convert things to other people without a timezone
yah
play with it
An epoch is not a long. It's an epoch
it's represented as a long
basically System.currentTimeMillis()
There is the unix epoch, the AD & BC epoch and other stuff
Correct
LocalDateTime
Always LocalDateTime
If someone can answer my question I would appreciate it because I don't have enough budget to buy other plugins until next month.
Touching Unix timestamps (THOSE ARE NOT EPOCHS OML) will be pain
#help-server or their dedicated support servers, we aren't specialists in every single one of the hundreds of thousands of spigot plugins out there
Won't work anyways due to all the leap seconds and leap years
Well it would work, but it would have some inaccuracy
ah sorry
uhh
6ish years
I started in late 2016
but I did some coding back in like
2011ish
uhh
no
I'm only 18
closest thing to a real job was like
making plugins for a network part-time
for 15$/hr
But just as a tip if you want to work with date and time stuff in java without worrying about timezones always use LocalDateTime.
If you need to worry about timezones use DateTime.
If you want to work like you would in C world use Instant
If you like to see the world burn in the year 2038 use int
hmm what should I name this class
Basically each bedwars generator has tiers and each tier has a list of like
generation tasks
where lik
Is there a way to know which of these 2 the server will send?
offset, what items to drop and how often
OfflinePlayer#hasPlayedBefore
actually no
uhh
bukkit has a players.json iirc
that had like names
and if the names dont match
you think that'll do it?
what is it
Well for cooldowns you can be lazy and just use System#currentTimeMillis - but what is the fun in that?
and that's contained in the player's nbt tag
Anyone know how to move a piece of code that uses bookAPI to a universal config.yml or something similar to make it easily accessible?
will provide code that i want to move if needed, i just cant find an optimal way to do it
damn minecraft login code is ugly
why would you cast to an instant if you're storing an epoch long
Instant.now().plus(duration).EPOCH shouldn't your IDE complain about that? Because that is basically the equivalent of Instant.EPOCH
how do i pass a string from a listener to a commandExecutor?
You probably want
LocalDateTime cooldown = LocalDateTime.parse("2007-12-03T10:15:30");
if (cooldown.plus(24, ChronoUnit.HOURS).isBefore(LocalDateTime.now())) {
}
though
i have to pass the name of the object that clicked for a thing
And to get it back to a string you do LocalDateTime.now().toString()
that's one of the 4 oop principles - Encapsulation
what is that code for?
Java Encapsulation - This Java tutorial covers basic to advanced concepts related to Java Programming including What is Java, Java Environment Setup, Java Objects and Classes, Datatypes, Variable Types, Modifiers, Operators, Loops, Decision Making Statements, Date, Time, Regular Expressions, Files, I/O, Exceptions, Inheritance, Overriding, Polym...
nms join messages
dude asked about where the join message when you change your username is sent
Hey I want to save an Players inventory to a file called kits.yml how can I do that I can later get it from the fiel
either set / getItemStack or just converting it to base64
hello, i know this is a spigot server, but can i ask something about mail forwarding with postfix here ?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
wtf you can acually save the whole inventory?
Don't ask to ask
i used to loop through the inventory
I've only played with mail with mailchimp
so
yo so inventory is base64?
okay so am trying to setup mail forwarding from my domain to my gmail account
https://www.youtube.com/watch?v=Zqg-t3iJKKU&ab_channel=TheGrokShop
i followed this tutorial, got no errors but now i just dont get the mails on my gmail
and there are no errors on my log
Yeah you need to loop it
I tried this https://paste.md-5.net/jogaroqago.js
here is my cloudflare dns setup
friken java magic
😯
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
🤯
everyday on this discord it blows my mind
proxy it with CF
It's not behind proxy anyway
wouldnt that break my nginx setup ?
i might be saying something stupid am so clueless about this
i used thefoundrs.co in the nginx setup
yeah so not the IP
How do I get a player using UUID?
Bukkit.getPlayer
If you using NodeJS and Apache, you don't need to use vhosts in nginx. You can use Express-VHosts for NodeJS and Virtual Hosts for Apache
Thanks
Its just used for load balancing and for multiple web servers you need to route like for a examplewww.mrnategeek.gz -> 192.168.1.5 forum.mrnategeek.gz -> 192.168.1.8 router.mrnategeek.gz -> 192.168.1.1You can even do this with MySQL but only for reading. You should never include your router's interface for many reasons but just giving a example
o man
i tried to understand but i dont lol
other stuff is working well i just need postfix to work
Can you show a example? https://paste.md-5.net/zezivonexe.md
look at the javadocs
toLocalTime().toString
theres a format method
To format a LocalDateTime object to display only the hour, minute, and second in the format HH:MM:SS, you can use the DateTimeFormatter class from the java.time.format package. Here's an example:
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
String formattedDateTime = now.format(formatter);
Hello, i have a problem, the after text provide me a idea for edit this list recipients, but, how??
getRecipients
@NotNull
public Set<Player> getRecipients()
Gets a set of recipients that this chat message will be displayed to.
The set returned is not guaranteed to be mutable and may auto-populate on access. Any listener accessing the returned set should be aware that it may reduce performance for a lazy set implementation.
Listeners should be aware that modifying the list may throw UnsupportedOperationException if the event caller provides an unmodifiable set.
Returns:
All Players who will see this chat message
thank you chatgpt?
I'll pass the message
When questions are obvious, I prefer copy pasting the message in it than typing "?google"
thanks
Still having this issue, I tried everything
I trying to get the player from Player valueworld:202:64:-123: Player: 0b605717-d3a0-4cd4-8b67-3af1eb6449ca Location: World: world X: 202 Y: 64 Z: -123 Options: BlockBreak: false AutoSell: false
Now it shows getOfflinePlayer is deprecated
yea you're not supposed to get offline player by name
UUID
so convert it to a uuid
you're passing in a string if it says its deprecated
declaration: module: java.base, package: java.util, class: UUID
[13:15:42] [Server thread/ERROR]: Error occurred while enabling MGN_Hopper v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "String.length()" because "name" is null
at java.util.UUID.fromString(UUID.java:237) ~[?:?]
at com.mrnategeek.hopper.Main.onEnable(Main.java:58) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:539) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugins(CraftServer.java:453) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.reload(CraftServer.java:938) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at org.bukkit.Bukkit.reload(Bukkit.java:802) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.dispatchCommand(CraftServer.java:847) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.dispatchServerCommand(CraftServer.java:832) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.dedicated.DedicatedServer.bg(DedicatedServer.java:413) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:389) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1201) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1017) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:301) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
read the error please
its like right at the top too
java.lang.NullPointerException: Cannot invoke "String.length()" because "name" is null
at java.util.UUID.fromString(UUID.java:237) ~[?:?]
at com.mrnategeek.hopper.Main.onEnable(Main.java:58) ~[?:?]
You got my data.yml, where did it get "name" from?
name is the parameter to UUID.fromString
can you please look at the line its complaining about
Main.java:58
that's what name is
its whatever you pass in
Player player = Bukkit.getPlayer(UUID.fromString(this.data.getString("Player")));
i think its this line
@slim wigeon
That is the line, I was thinking I was converting the UUID to the right type
well its complaining that you're passing in null
which means whatever you're passing in is returning null
So that UUID.fromString is not what I think it was?
this.data.getString("Player") could be null
Player value
the line of code
if this is what it is then this is returning null
and then null is being passed into uuid.fromstring
UUID uuid = UUID. randomUUID();
String uuidAsString = uuid. toString();
UUID sameUuid = UUID. fromString(uuidAsString);
assert sameUuid. equals(uuid);```It was, let me check something
is it possible to create plugin in nodejs?
no
You right, I cannot think right now. It was getting from the root of the data.yml which does not exist. Thanks
Java and JavaScript langs are not the same
something like this might work https://github.com/walterhiggins/ScriptCraft
but it looks like it hasn't been updated in 3 years
and its also something you dont wanna do
How do I convert Player to OfflinePlayer?
They are considered an OfflinePlayer already
I got the player is null after I did that change then on changing getPlayer to getOfflinePlayer, I get a error because in my lib. OfflinePlayer does not exist in the contractor. That is why I need to convert Player to OfflinePlayer
im trying to figure out why some items i made wont stack
this is the code for creating it and any items made with this method will stack with eachother but if i call the method again to create them a second time the 2 groups of items wont stack with eachother
i thought it would be something with the persistant data but its giving them the same namespacekey and the same value so it should be the same
that looks like some misuse of an interface
but isnt it because of the pdc tag that items dont stack anymore?
LocalDateTime represents a point in time. You should not represent is a HH:MM:SS unless you want to write a message "The cooldown expires tomorrow, at 12:02:48". You probably want to represent a Duration this could be done via:
LocalDateTime from = LocalDateTime.now();
LocalDateTime now = LocalDateTime.now();
Duration duration = Duration.between(from, now);
System.out.println(duration.toHours() + ":" + (duration.toMinutes() % 60) + ":" + (duration.getSeconds() % 60));
That is a post-Java 8 thing then
package fr.program.events;
import fr.program.Main;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
public class ModtEvents {
public static void execute(Main plugin, PlayerInteractEvent event) {
Player player = event.getPlayer();
Action action = event.getAction();
ItemStack item = event.getItem();
ItemMeta meta = item.getItemMeta();
FileConfiguration config = plugin.getConfig();
if (item.getType() == Material.IRON_HOE && meta.getDisplayName() == "§l§9Vanish") {
vanish(plugin, player, action, item, config);
}
}
private static void vanish(Main plugin, Player player, Action action, ItemStack item, FileConfiguration config) {
String mode = config.getString("modt." + player.getUniqueId());
if (action == Action.RIGHT_CLICK_AIR) {
if (mode == "on") {
player.hidePlayer(plugin, player);
player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
+ "Vous êtes maintenant invisible.");
player.sendMessage(String.valueOf(plugin.getServer().getHideOnlinePlayers()));
} else {
player.showPlayer(plugin, player);
player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
+ "Vous êtes maintenant visible.");
}
}
}
}
``` Why it does not executing the function vanish?
ItemCustom vanish = new ItemCustom("§l§9Vanish", Material.IRON_HOE, 1, true);
ItemCustom class: https://sourceb.in/UbDeR1ENOg
It does not matter.
It's the same thing.
It's.
"==" -> to compare.
"equals" -> to compare.
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
guys why this not working it not take from 13 letter to the last letter it just do nothing ;/ java String lineweeneed = readefileofplayerlol.readLine(); lineweeneed.substring(13);
It does not matter, why are you saying something, it's useless.
The problem come not from a condition bro.
These are not the same thing
i see
== is referential equality - checking if the objects are at the same memory address. .equals() is an overridable method that checks the contents of a String
Ok and? It's a just a way to compare.
Strings will never be at the same memory address unless they're from the internalized string pool
And the goal is to make it readable.
Which they won't be
You can make your code readable if you want, but if you want it to work, you need to use .equals() to compare
== will not work for Strings in 99.999999% of scenarios
It works always for me but ok and I have still the problem lol :>.
That's literally not possible 😛
You can verify this rather easily by doing System.out.println("Hello" == "Hello");
EDIT: Not true, same string pool
bruh
public class ModtEvents {
public static void execute(Main plugin, PlayerInteractEvent event) {
Player player = event.getPlayer();
Action action = event.getAction();
ItemStack item = event.getItem();
FileConfiguration config = plugin.getConfig();
if (item != null && item.getType() == Material.IRON_HOE && item.getItemMeta() != null && item.getItemMeta().getDisplayName().equals("§l§9Vanish")) {
vanish(plugin, player, action, item, config);
}
}
private static void vanish(Main plugin, Player player, Action action, ItemStack item, FileConfiguration config) {
System.out.println("cc");
String mode = config.getString("modt." + player.getUniqueId());
if (action == Action.RIGHT_CLICK_AIR && mode != null && mode.equals("on")) {
player.hidePlayer(plugin, player);
player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
+ "Vous êtes maintenant invisible.");
player.sendMessage(String.valueOf(plugin.getServer().getHideOnlinePlayers()));
} else {
player.showPlayer(plugin, player);
player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
+ "Vous êtes maintenant visible.");
}
}
}
this destorying my 2 last brian cells
What error?
I promise you, that will output false
No error.
(actually technically it will return true lol - same string pool)
Then Why Send?
Because I sent the new code to show that it did not fix?
Just Asking lol Good Job!
So I have still the same prob, the function vanish -> not working.
Nothing in my output.
what does break; do
It works but it's the name I gave to my item.
1.19.3
Ah ok.
I used it before but I did not know it was necessary.
Alr thx.
public class EventsListeners implements Listener {
private final Main plugin;
public EventsListeners(Main main) {
this.plugin = main;
}
@EventHandler
public void onInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
Action action = event.getAction();
ItemStack item = event.getItem();
FileConfiguration config = this.plugin.getConfig();
if (item != null && item.getItemMeta() != null) {
ItemMeta meta = item.getItemMeta();
PersistentDataContainer container = meta.getPersistentDataContainer();
NamespacedKey key = new NamespacedKey(this.plugin, meta.getDisplayName());
if (item.getType() == Material.IRON_HOE && container.has(key, PersistentDataType.DOUBLE)) {
vanish(this.plugin, player, action, config);
}
}
}
private static void vanish(Main plugin, Player player, Action action, FileConfiguration config) {
String mode = config.getString("modt." + player.getUniqueId());
if (action == Action.RIGHT_CLICK_AIR && mode != null) {
if (mode.equals("on")) {
player.hidePlayer(plugin, player);
player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
+ "Vous êtes maintenant invisible.");
} else {
player.showPlayer(plugin, player);
player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
+ "Vous êtes maintenant visible.");
}
}
}
}
Why I have this error :
someone tell me why this doesnt work
ur second constructor must take in a Plugin also
1 - naming conventions
2 - your second constructor doesn't initialize the var
ItemCustom vanish = new ItemCustom("§l§9Vanish", Material.IRON_HOE, 1, true);
vanish.addKey(this.plugin);
public ItemCustom(String name, Material mat, int amount, boolean hideAtttributes) {
super(mat, amount);
setDisplayName(name);
if (hideAtttributes) {
disableAttributes();
} else {
enableAttributes();
}
}
public void addKey(Main plugin) {
ItemMeta meta = this.getItemMeta();
if (meta != null) {
NamespacedKey key = new NamespacedKey(plugin, meta.getDisplayName());
meta.getPersistentDataContainer().set(key, PersistentDataType.DOUBLE, Math.PI);
this.setItemMeta(meta);
}
}
public void setDisplayName(String name) {
ItemMeta meta = this.getItemMeta();
meta.setDisplayName(name);
this.setItemMeta(meta);
}
public void disableAttributes() {
ItemMeta meta = this.getItemMeta();
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
this.setItemMeta(meta);
}
Uh what, why ?
With Capital letters ? Or it's useless?
public ItemCustom(String name, Material mat, int amount, boolean hideAtttributes) {
super(mat, amount);
ItemMeta meta = this.getItemMeta();
You're not extending ItemStack are you?
I am.
That won't work either
Most types in Bukkit, unless explicitly stated otherwise, are not extendable
can we just make the ItemStack class final or something?
curse u, server side implementation!
PR it and let us have a backwards incompatible change
I think we've got enough backwards incompatible changes for 1.20 
Not an option because we don't want to add getNameComponent() or some stupid bullshit like that
simple, remove strings 
precisely, take them out of the JRE
use asm to finalize all strings upon creation
I added this to the "key" in the tool and in the condition but it did not fix :(.
public void addKey(Main plugin, String keyName) {
ItemMeta meta = this.getItemMeta();
if (meta != null) {
NamespacedKey key = new NamespacedKey(plugin, keyName);
meta.getPersistentDataContainer().set(key, PersistentDataType.DOUBLE, Math.PI);
this.setItemMeta(meta);
}
}
ItemCustom vanish = new ItemCustom("§l§9Vanish", Material.IRON_HOE, 1, true);
vanish.addKey(this.plugin, "vanish");
```https://sourceb.in/gnijb8NGWW
or javassist or some bytecode manipulation trickery
Javassist is just ASM under the hood iirc
where do i have to add it
Event : https://paste.md-5.net/eyopoteket.java
Class ItemCustom : https://paste.md-5.net/iciqavojiz.java
Generation of items : https://paste.md-5.net/eyudubobon.java
i was about to ask if its really still necessary to check command name, forgetting how the executors actually work, lol
static is a java thing and not plugin specific
it is correct to check the command name, where most go wrong is when they try to use label instead lol
you can use label, but label isn't the same as command name is all
i just have a separate executor for each command lol
And what method are you talking about?
EventListeners.vanish
its been there for a long time lol
Did you find something :(?
you should also avoid naming your main class as Main
Uh, that shouldn't be the case
why are you extending ItemStack?
Like
LocalDateTime from = LocalDateTime.now().plus(28, ChronoUnit.HOURS);
LocalDateTime now = LocalDateTime.now();
Duration duration = Duration.between(from, now);
System.out.println(duration.toHours() + ":" + (duration.toMinutes() % 60) + ":" + (duration.getSeconds() % 60));
prints -28:0:0. Which would be just about correct
public class EventsListeners implements Listener {
private final Main plugin;
public EventsListeners(Main main) {
this.plugin = main;
}
@EventHandler
public void onInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
Action action = event.getAction();
ItemStack item = event.getItem();
FileConfiguration config = this.plugin.getConfig();
if (item != null && item.getItemMeta() != null) {
System.out.println(1);
ItemMeta meta = item.getItemMeta();
PersistentDataContainer container = meta.getPersistentDataContainer();
NamespacedKey key = new NamespacedKey(this.plugin, "vanish");
System.out.println(2);
if (item.getType() == Material.IRON_HOE && container.has(key, PersistentDataType.DOUBLE)) {
System.out.println(3);
vanish(this.plugin, player, action, config);
}
}
}
private void vanish(Main plugin, Player player, Action action, FileConfiguration config) {
System.out.println(4);
String mode = config.getString("modt." + player.getUniqueId());
if (action == Action.RIGHT_CLICK_AIR && mode != null) {
System.out.println(5);
if (mode.equals("on")) {
System.out.println(6);
player.hidePlayer(plugin, player);
player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
+ "Vous êtes maintenant invisible.");
} else {
System.out.println(7);
player.showPlayer(plugin, player);
player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
+ "Vous êtes maintenant visible.");
}
}
}
}
[21:37:14] [Server thread/INFO]: 1
[21:37:14] [Server thread/INFO]: 2
To have a custom class with ItemStack.
Make sure it's java.time.Duration and not some other Duration class
I told him earlier that it wouldn't work but he ignored me lol
you can omit the Main plugin, argument as it's already defined
Items are working.
I swear the code I'm seeing over the days is more and more exotic
Add it to an inventory, take it back out, and you will not get an instance of your CustomItem back
You're far better off making some static utility methods or something
Or an ItemBuilder - there are hundreds of those on the forums
just don't extend ItemStack, but make the class require ItemStack as a parameter
We love a good item builder
makes sense why they are back with issues
since they chose to ignore you
pdc bad
Man is upset he has to specify the type
it's so annoying having to go through the meta and all of that
then just don't use it
I just want to abstract away the process of having to get the meta, modify and re-save
but I want to ensure bukkit compatibility with no external deps
so I just
?
you know what parameters are right?
just make a custom binary save file
ItemStack item = ...;
PDCWrapper pdc = new PDCWrapper(plugin, item);
pdc.setBoolean("unobtainable", true);
item = pdc.getModifiedItem();
[21:44:57] [Server thread/INFO]: 1
[21:44:57] [Server thread/INFO]: EVENT: org.bukkit.craftbukkit.v1_19_R2.persistence.CraftPersistentDataContainer@3
[21:44:57] [Server thread/INFO]: IRON_HOE
[21:44:57] [Server thread/INFO]: 2
and then use some memory mapping
Yes?
then, make your constructor for the class require itemstack
make a method that spits out your itemstack with stuff added to it
make the rest of the methods modify said itemstack
and then you are good
or I can just do this
Not only does extending not work, but you are also not really doing anything custom either
Isn’t this basically the same as doing it the normal way
yeah but I don't need to call getPersistentDataContainer 13 times
You only need to call it once
So I create a item and I use my class to modify this ItemStack created before use my class?
I'll make a modifyPDC utility method that just does stuff
private final ItemStack item;
public ItemCustom(ItemStack i) {
this.item = i;
}
That?
👋
?
can Block#getBlockData be casted to Openable?
ItemStack item = ...;
PDCWrapper.modifyItem(plugin, item, pdc -> {
pdc.setString("joe", "mama");
pdc.setBoolean("disappointment", true)
});
ther
I fixed my code and I think now it works :).
https://paste.md-5.net/pabavituro.java
[21:51:57] [Server thread/INFO]: 1
[21:51:57] [Server thread/INFO]: EVENT: org.bukkit.craftbukkit.v1_19_R2.persistence.CraftPersistentDataContainer@9886fd88
[21:51:57] [Server thread/INFO]: IRON_HOE
[21:51:57] [Server thread/INFO]: 2
[21:51:57] [Server thread/INFO]: 3
[21:51:57] [Server thread/INFO]: 4
[21:51:57] [Server thread/INFO]: 5
[21:51:57] [Server thread/INFO]: 6
[21:51:57] [Server thread/INFO]: 1
[21:51:57] [Server thread/INFO]: EVENT: org.bukkit.craftbukkit.v1_19_R2.persistence.CraftPersistentDataContainer@9886fd88
[21:51:57] [Server thread/INFO]: IRON_HOE
[21:51:57] [Server thread/INFO]: 2
[21:51:57] [Server thread/INFO]: 3
[21:51:57] [Server thread/INFO]: 4
[21:51:57] [Server thread/INFO]: 5
[21:51:57] [Server thread/INFO]: 6
Thanks :).
Trying to check if it is a door or a trapdoor, and then use .setOpen to open or close it
Check if state is instance of Openable, if yes cast it and use setOpen
?jd-s
That's right
TrapDoor and Door implements Openable
So you'll have to :
manually check if it's wether a door or trapdoor and act,
or (bad way) use reflection to determine if the class implements Openable x)
And it does not work?
It's both
Well, no, it's just a BlockData lol. The other one is MaterialData but we don't talk about those

so there's more of a challenge
is there a way to sort tablist by placeholders?
“No the other other one”
for example for a prison rank
how can i get 1.19.4 nms mojang remapped
?nms
You can do that or create the itemstack in that class. The former is going to be easier though
?paste
I did :). https://paste.md-5.net/aqujaqotom.java
Ik its a really dumb question, but cant i divide the classes as TabLoad on different files? as its soo messy my code : https://paste.md-5.net/ilusabiroc.java
line 29 does not work?
https://paste.md-5.net/bepuficufi.java
define not working
i tried getting the mojang remap for 1.19.4 nms and im getting this error when i try to reload maven with the mojang-remapped classifier:
Could not find artifact org.spigotmc:spigot🫙remapped-mojang:1.19.4-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Try to run Maven import with -U flag (force update snapshots)
I did run buildtools with the -remapped ending
Hey guys. How should I make my plugin handle a situation where 20+ SQL queries need to be ran at once. Will implementing HikariCP fix this? OR do I need to make a job/queue system
hikariCP is recommended for connection pooling
second, it is recommended to either use async tasks or what is better is to implement your own thread for running queries so its not done on the main thread
how can you do this where it displays a text when i hover it
components
Player.Spigot#sendMessage(BaseComponent...)
thanks u
and if it says sendMessage is deprecated -- ur using Paper API >:( , but Adventure has its equivalents
?jd-bcc
spigot components example
player.spigot().sendMessage(new ComponentBuilder("This is gold text")
.color(ChatColor.GOLD)
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(new ComponentBuilder("This is green hover text")
.color(ChatColor.GREEN)
.create()))
.create());```
that should work at least, im on my phone lol @quaint mantle
Is there an example anywhere to using BungeeCord's dependency downloader?
I swear Bungee got added too
i have to use the bungeecord api right?
cause im on 1.8
the bungeecord chat api is bundled with spigot api
also i have no clue about legacy versions
i develop for latest
cause this doesnt exists in my version of spigot
yeah idk what the legacy version of that stuff is
aight still thx tho
Hey I get Operation not allowed after ResultSet closed error on this method
private ResultSet executeQuery(String SQL) {
try (Connection connection = dataSource.getConnection();
Statement statement = connection.createStatement()) {
return statement.executeQuery(SQL);
} catch (SQLException e) {
e.printStackTrace();
}
return null;
}```
Not sure how to fix it
You shouldn't be returning ResultSets
Check out CachedRowSet
Or make your own container class
(Your try with resources closes the connection, which also closes the ResultSet
Oh I see thanks for the help
what
this
You want to put a link in a component?
.event with a ClickEvent
^ and use ClickEvent.Action.OPEN_URL
Hey whats the best way to make sure an arrow isnt in a specific location? Idk how to check it efficiently as it would check a lot of times and prob cause lag
So I know the adventure API is pretty much a done deal for paper, but what about using it in spigot?
You can use it with their bukkit platform
But it only has stuff for sending messages to players
@tranquil prairie
I.e. world.getNearbyEntities(arrowLocation, 1, 1, 1).stream().anyMatch(type -> type instanceof Arrow)
declaration: package: org.bukkit, interface: World
God what a crappy trade off.
Cause essentially me and my team are building our core libraries. And on the one hand paper makes things so much easier. On the other hand selling premium plugins for paper is more difficult (we are building big ass libraries, unfortunatly money does come into it lol) along with the fact quotes from customers might be more limited if our libraries only fully function in paper :S
i'm hooked
i need to know this stuff too
blocking entity movement without making check every 1 sec
World related right?
what
I think he is talking about this
1sec is way too much
You may check every tick in most cases
too little*
yeah just an example for bad practice
well
I guess I can’t even correct you since neither are really sensible (I hate too much vs too little grammatically in this case)
there must be some legit spigot / bukkit way
I don't think so
turn off their AI
Then you check every tick
I mean maybe you can override their path finder and prevent them from moving into a “blocked zone”
That's what minecraft does
or yeah just check every tick, honestly not that bad
They want an easier Bukkity way to check without looping every tick
Which does not exist I think
i thought what if someone dropped an item entity into unwanted area
there’s an event for that
You don't wanna know how much bukkit schedulers I have every tick
Its a really heavy mess
lmfao
Shoutout to load balancing
Well couldn't I just use TickEvents?
i have so much to learn about minecraft and spigot
Lets recontextulise the problem. Forgetting about "check it isnt in this position" what would the end user see / experience if you got this working
The arrow would despawn
how do i combat this?
Use the drop item event
I mean isn't it more performant to use async every-tick schedulers instead of tickevents
My question is why exactly
Tf is tick events
Because I need to prevent players from shooting arrows that land outside a wg region
Isn't there an event for ticks? Idk?
no
nah lmao
I always use schedulers anyways
nop
in Forge there’s a game tick event pretty sure
but without disabling drop
Ohh then thats what I just confused it with
I just had a slight memory of some kind of tickevent in my had
that’s like asking how you drive a car without a steering wheel and pedals
Something like PostTickEvent or something
Event and ticks?
you don’t just get to remove parts of your toolkit because your example is bad
How do you expect to prevent them from dropping an item in an area without cancelling the event?
I mean you can just kill the item, but I don't think they would be happy about that
yes
Good question
i mean cancel the item movement
???
Set item velocity to make it bounce away magically
just thought of plotme function
I mean, you gotta do a bukkit scheduler for() all entities right?
Is it really that fine to do it often
ok tick and vector
I mean patching the server to call your code on entity movement is more performant than that, but no one is going to do that
i see
Hold my beer
Mixins uwu?
Well I guess they could with a bunch of ASM
You are wrong
But I’ll pass on that
wait you can get item movement?
sounds hacky
Can’t run mixins without a bootstrapper
You can.
Which means more things people have to install
can you even reload the class definition since it was loaded already?
like I don’t know how rewriting it with ASM live would work
Not easily
Yes with a JavaAgent
But yes you can use an agent
gotcha
I think Optic would flag my program as a virus though if k started patching the server software with a plug-in
And with some REALLY hacky stuff you can set up your JavaAgent in mid-runtime, mixin into the class and then trigger reload
I’ve done it with bytebuddy
But not mixins
Mixins require a bunch of extra stuff to load
what is bytebuddy
Something like mixins
It’s an ASM wrapper library
ClassVisiter moment
So yeah, TL;DR time
I don’t know how ASM is wrapped though ngl
I’ve thought about some kind of api for hooking into the ticking methods of entities
I could ASM my shit into the server at mid-runtime and save some performance
seems like the goal is to be low level and that’s what it achieves
Idk if it would really fit spigot though
Same I think I will do that for my system
this stuff is beyond my understanding
But maybe I'll just cba and just make custom nms entities with changed ticking
entity tick handlers? 🤔
😱
Something simple like Entity.addTickConsumer(Consumer<Entity>)
could be implemented easily, probably
that won’t be merged xd
they’ll want an interface like Listener I bet
I have never understood consumers
I mean sure
Do it with mixins then :)
Could do an interface too
if it’s an interface I believe you can still invoke it with an anonymous lambda like it was a Consumer as well which is a bonus
Isn't that the only way to modify player ticking? To ASM the living shit out of the player ticking method in mid-runtime plugin?
I mean
You could just use the scheduler if you want to add something
If you want to remove stuff then probably
the API probably has to be more powerful ngl
Well but you could save a lot of performance if you do not need some logic
That’s when you make a fork
it would probably need the ability to cancel and invoke miscellaneous ticking things
No.
Or use minestorm
That means rip compatibility
The ability to remove or manually invoke existing stuff is certainly possible
But that would make a lot of painfully large diffs
Tell me, what are consumers
A way to hold a method that takes a single parameter as an object
There’s also suppliers, which hold a method that returns a single object
And Functions, which take a single parameter and return a single object
I register my consumer to a listener, and the listener calls my consumer which is basicly just calling a method from a listener with an arg
Pretty much
Bukkit uses them a bit, like in World#spawn
But most of bukkits api was made before they existed
So in this case, I would make a consumer for lets say I wanna run heal entity every tick. I register my consumer to the Listener, which then has something like run(Entity entity)
And then can just run what I want in the run method?
does the PlayerLevelChange event also take in account experient point changes or just whole levels
So consumers are basicly like listening to an event, but with another object that replaces the lets say PlayerJoinEvent
Only level
Try PlayerExpChangeEvent
So, that would be:
public void entityTickEvent(Entity entity) { }
Thats how they work?
Yes that is a valid consumer
no all good only level was exactly what i was looking for
So, TL;DR:
Registering a Consumer is just like telling some other Object to call my method when xy happens
And give me some Object to it
this msg good or should i change it
That is accurate?
Alright thank you, I know understand what a Consumer is lol. I kinda feel dumb that I had not known that one before
Nerd 
Hiya, i have set my items MetaData to 1 but when trying to use a resource pack with that it just becomes this:
this is my netherite_sword.json file:
{
"parent": "item/generated",
"textures": {
"layer0": "item/netherite_sword"
},
"overrides": [
{ "predicate": { "custom_model_data": 1 }, "model": "item/calioknifesmall" }
]
}
And this is what im using to create the item:
ItemStack T1item = new ItemStack(Material.NETHERITE_SWORD);
ItemMeta T1itemMeta = T1item.getItemMeta();
List<String> lore = new ArrayList<String>();
lore.add(ChatColor.WHITE + "Use this item in a");
lore.add(ChatColor.RED + "Smithing Table " + ChatColor.WHITE + "to");
lore.add(ChatColor.WHITE + "upgrade your weapon.");
T1itemMeta.setCustomModelData(1);
T1itemMeta.setLore(lore);
T1itemMeta.setDisplayName(ChatColor.WHITE + "Tier 1 Upgrade");
T1item.setItemMeta(T1itemMeta);
anyone got a nice arrow i can use in minecraft
Your resource pack isn’t set up properly
Is the model json in the right spot
And does said model json point to the correct texture
File Structure:
models
item
-netherite_sword.json
textures
item
-calioknifesmall.png
Oh wow this is one of those rare incidents where ya'll gonna be glad the aerospace engineer decided to learn java for his side hobby xD
define the region in terms of its corners (E.g: x1,z1, x2 and z2)
Calculate the time it'd take to hit one of those edges by utilising the velocity property
x1 - startPosX /Vx
y1 - startPosY/Vy
x2 - startPosX /Vx
y2 - startPosY/Vy
You will get 4 time values. Whichever is the lowest that isnt below 0, start counting your ticks as a scheduled task with a delay of around 85% of the way to that minimum time. Boom, you've just saved ur self a hell of a lot of ticked loops.
Bonus points if you guestimate when it'll hit the ground and, if its like half the time before ur lowest t, you can just fob the loop off all together
Where is calioknifesmall.json
does that need to be a file?
Yes
You are pointing to it here
Then that file points to the png
To clarify you are:
- Figuring out how long , hypothetically, gravity and players and obstacles withstanding, how long it'd take to get to each of the 4 walls of the region with little arrow boy.
-Only start your loop (as a delayed task) around 85% (to account for errors due to minecraft physics voodoo) of the way through the shortest length of time
i.e. "Why in the ever living Newton would you check if an arrow has left the boundaries, if you know that, in an ideal world, it isnt even gonna reach the boundary till 4 seconds in?!?"
Lets say you had an arrow that was 6 seconds away from the closest edge based on the qwik math.
Thats 100 ticks worth of loops saved :L
ish
xD
Only downfall is if the velocity ever changes mid flight
Nope. Think about it.
The goal isnt to be accurate
its to save ticks
name a way the x or z velocity INCREASES during flight :L
Cause thats the only way this gonna fuck up
Get a nice, quick and cheap guestimate of how long, then start the loops 10-20% of the time before the guestimate calculated best case scenario
TnT
You will never over estimate the time taken unless ur already doing some wacky minecraft physics
Hmmm... scan the average velocity for the first second of flight, then do funni calc and delayed task
And even then TnT is a hecka edge case :L
plus isnt an arrow an entity so gets an "onHit" event from tnt or something? (never really looked into entity based events withTnT damage"
This sounds like the making of a useful library ngl xD
"The TRazjectory Library"
Arrows don’t have health so they don’t trigger damage events
Can TnT deflect already in flight arrows?
Afaik anyway
Yes
Huh... itd be some weird as hell edge case for the arrow to fly PAST the TnT and speed up from the explosion ngl.
This could make for an interesting side project.
Though ngl, im torn between creating an anti duping inventory cache library and creating an archiving file format for CoreProtect logs that'd take the size of the logs down by 10x
factions players make cannons like that all the time i think
why doesnt this permission thingy work i used it a million times before and not it doesnt work
nvm.
Erm sanity check...
New file format for storing player logs like you do in core protect's SQL
-Set it up all the way down from region, Chunk, Chunk Section.
Each chunk section has a "time section" of 1 hour per time section.
Each time section has:
-A timestamp of when it started
-A "player pallete" (palette of player ID's (based on a typical Id table like SQL) of what order the players popped up in terms of actions
-An "action pallete" (Same as player palette but for actions)
each log is reduced to a 64 bit log.
player id (localised to the player packet, i.e. an id of 1 is the first player in the player palette for this time section)
timestampdifferential (the difference between the timestamp of this log, and that of the previous log in this time section (0 if there isnt one))
action id (same as player id)
coordinates (the cordinates within the 16,16,16 grid of the action).
Boom. We've just managed to squeeze a single log into a 64 bit long :L
The quick math says that if you can fit 1 log into 8 bytes (lets make it 12 bytes for good measure due to the palletes) ...
thats over 80 million logs in a gigabyte...
The current number is around 8 million...
So we'd be taking 10GB files and turning em into like 1GB files...
And thats the Conservative estimate
best case scenario> you are looking at like 0.7GB
It sounds too good to be true...
Have i missed something?
Bitmask new format 
Nope.
There would be ur typical global pallete that contains the big boi numbers.
and each chunk section would just have a ref to the specific long value in that palette, within its own paltte
I guese my question is, why the ever living shit has noone done this?
We've got most log databases working on like 10GB after 2 months
Ngl I may be a rare in this, but the idea of making this is exciting to me
the time it would take to fix ChatGPTs inherent errors would make up for standard development time
Is this it? The solution is "Lets get ChatGPT to make the bastard and fix the bugs"
Is this how the intelligence explosion happens?
xD
idk, i havent used chatgpt yet
InventoryClickEvent#getCurrentItem() gets the ItemStack currently in the clicked slot but is that before the click or after
Ive used it mainly for sanity checks and essentially crap i'd of googled.
E.g: "What is a good practice when making an abstract for a button in Java"
"Is there anything in this package structure i've missed?"
"My general format for this package is this, this and this. Is there anything in here that seems like extra chaff thats not needed"
Never get it to write ur code (bad fucking ju ju unless its simple stupid)
sadly i have some kinda complex (stubbornness) that makes me rawdog life and not look for help
just me, my mind, and JetBrains' IntelliJ IDEA
my phone is on 3% pls type fast
Just use power slower
Weirdest one i gave it was "Imagine there was a medium to light and michelson and morley got it wrong" and its response was basically "The medium would have to get denser near an object of mass, the medium would have to move rotationally and linearly with the bodies of mass like the earth and it must cause light to bend around stars" and i was like "A TO THE FUCKING YO, THATS GRAVITY".
Tl;dr: It can do some of the most compicated genius level plays, but only because its a language model designed to get better as it fucks up.
Which, to be blunt, is exactly what the human race does for science. Takes the simple shit and runs with it in stupid ways.
Take mohrs circle for example. This absoloute chad MAD LAD decided "Hey you know thsoe really complicated equations for stress elements around a material? It sorta kinda maybe looks like a circle... LETS FORCE IT INTO ONE!"
And now we have a method to do the most complicated stress related math... with a protractor and compass...
Smh
ChatGPT and AI in general bumbles around with the collective assembled masses of knowledge and pisses around with it in hopes of finding the answer you want.
Which is beautiful... and I can explain why in a single quote I found a few days ago which, as of now, is my all time faviroute.
"In the cascade of cherished wisdom, we find our place..."
Which is even more beautiful when i tell you, no lie, ChatGPT came up with that when we were discussing art concepts, and ive scoured the internet, it is not a quote from literally anywhere ❤️
Its why I sorta have fallen in love with the concept of AI.
It doesnt need to be some genius god-tier thinking machine.
Its just we finally did the impossible. We took the purest form of the scientific philosophy (let alone method) and objectified it for a machine to do.
Like to deromantisise science a bit here.
Calculus = Newton literally spent a year pissing around with the straight line equation until something worked
Mohrs Circle = What I described above
Archemidies Screw = Took humans 2000 frigging years to think "huh... lets try spinning the cyliner and keeping the screw still"...
Everything we do, everything we've made, from Java to the first Fire, all came about from a slightly above average Ape banging rocks together or something else equally stupid.
ChatGPT is just that... but erm... automated?
I mean case and point.
Completely idiotic idea.
Anti Dupes to prevent duping are not the play
Do the stupid thing
Scan player inventories after / during certain actions and compare the current state to the previous state.
I.e. dont prevent the dupe, look for its aftermath.
Its stupid, brute force and comes with its own sway of problems to solve.
But ngl the more I think about it, the more it seems like a legit good idea
That’s what hypixel skyblock does
It just looks for items with the same unique id when you change servers
Yeah but, perhaps using redis, go one step further
Every inventory open, every trade , every dc . If you have been scanned for X reason, you'll be god damn scanned again xD
Would it work? Would it be a process powerhouse?
Probably
Still , gonna be funny to try it and see
Is there a way i can test if the bstats is working, as it seems to work but it isnt showing on the page, i am self hosting
does it take some time to load?
it's not updated instantly
Oh okay i guess i will wait so i can confirm, thanks
how can i have one of my other plugins communicate with another?
Make one depend on the other and call a function of the other plugin by adding it as a dependency
You can get fancy and make a nice public api
Or you can just grab an instance of it with PluginManager.getPlugin(name)
Definitly the first option
what do you think is the most usefull in my case? Im making a custom achievement plugin that is supposed to get triggert from all kinds of things from many other plugins
all of those are mine
The other option doesnt exist.
Do everything in your power to have people make great APIs xD
Please
for the love of christ xD
We need more APIs
I mean
It still hurts my soul that CoreProtect doesnt have lookups for commands in tis API xD
Depends if it’s even a public plugin
well im strongly disbelieve anyone would like to use my api
its just for my server
Sometimes its about the practice
Then again i am an IRL lectuerr
so im a bit biased
xD
Nah... this one command in coreprotect proves folk seriously need to get practice in making public friendly code xD https://github.com/PlayPro/CoreProtect/blob/master/src/main/java/net/coreprotect/command/LookupCommand.java
I don’t think that’s even a case of public friendly code
More of a case of just good code full stop
XD
Dont know what u mean
totally exemplary code
utterly fantastic
10/10
god I hope intelli doesnt see this 🙏
Not to pick it apart ong, but to point out the smallest insignifcant pet gripe i have with this :
Its not the barage of if statements
its not the roughly same stuff happening with different checks....
Its that motherfuckin Color.DARK_AQUA
I quite like dark aqua
I do too
Too bad...
THAT ISNT FUCKING DARK AQUA!
The mad lad (or one of the many who worked on CP) OVERRODE THE COLOR
And replaced it with a damn hex color
As they should
Oh yeah that’s not ChatColor
The fact you had to say "oh yeah" proves it was a poor name choice
xD
See its the small stuff that grinds my gears
Like Offline Player and Player are moronic names
It should be :
Player and OnlinePlayer
As you can get an exception if you try to get an offline player with Player...
But can get an Online player with OfflinePlayer
Has anyone suggested changing the name?
LIKE HELL HAVE THEY
xD
Changing that will break all plugins for no real benefit. Not gonna happen
I just want to know, how is the spigot forms area coded? Is it public ?
I am aware lol
its just xenforo plugin iirc not sure exactly
Im just saying, whoever initially coded it needs a solid slap in the face
alr ty
I would like to think anyone who has had an exception gbecause they added a "get player" method into their plugins but forgot offline players can happen
can relate to my pain lol
damn thats expensive
im starting to hate spigot
Everyone congratulate our newest graduated developer ❤️
event.getAction() == InventoryAction.SWAP_WITH_CURSOR is false
🥳
Main.getInstance().getConfig().getString("config.binding.style").toLowerCase() == "drag-drop") is false
gn
?main
shhhh
obligatory
its easy
FINE ill change it
what about event.getAction() == InventoryAction.SWAP_WITH_CURSOR
Well
wack
Is InventoryAction an enum
and
that's fine
Designing an API and keeping it up2date without breaking changes ain't an easy thing. A lot of things to consider - yet still people will complain. Can't be right for everyone 😅
Ima teach you the best leson you can ever done get from a developer
Be a thundering, idiotic, simple brained muppet
just before your check: Bukkit.getlogger.info(event.getAction()
And read what it says xD
in the console
brute force the fucker
lfmaooo
tru
Swap only works if the cursor already has an item
Like with utterly 0 shame i'll be honest. I do this with so many of my plugins xD
If the cursor is empty it’s probably PickupAll
every time I start up a server I get that stupid nagging thing about telling the authors to use the logger cause I never do lol
exception.printshittrace
too much work
i sympathize with the consumers who must bug test your product
Wait does System.out.println actually work with the console? I suppose there wouldnt be a reason why it wouldnt...
bro its PLACE_ALL
idk lol
BHAHAHAHA
Yeah sysout works fine
im gonna die
Paper will yell at you though
its always place all
ILoveSpiggotILoveSpigotILoveSpiggotILoveSpigotILoveSpiggotILoveSpigotILoveSpiggotILoveSpigotILoveSpiggotILoveSpigot
i right click with a stack and its PLACE_ALL
hat event u callin?>
GUYS gUESS WHAT!!! ||chicken butt||
InventoryClickEvent
Place all means the cursor has items and the clicked slot is empty
All of the items on the cursor are moved to the clicked slot.
and im only moving 1
Oh wow it triggers a place all even when u right click wit ha full inv
Thats fuckin funny
yes
sad im only at 33k
That sounds like a solid spiggot L
]
im gonna die
tru
it took me 3 minutes to read that
declaration: package: org.bukkit.event.inventory, enum: InventoryAction
EVERYTHING IS PLACE_ALL
even if i pickup
;-;
?jd
o
only options
?jd-s
?jd-bc
?jd-bcc
it needed its own docs it was so big
ohh
well i know that
also what is the difference between a humanentity and a player?
Well you see
get ready to do a thunderous slow clap
uh oh
ig
Player and HumanEntity are basically the same atm
damn
LFMAOOOPO
***I predict you are in C R E A T I V E M O D E ***
oh my god why didnt we think that
this is where is die
The abstraction exists only because it exists in mojangs code too
🤦♂️
not InventoryClickEvent
In older events it’s still HumanEntity
i dont like seeing this in my code
also I have an advanced question, yall know the plugin protolize?
bungeecoord
it can make inventorys from bungeecoord
without any other plugins on the spigot
Probably
not a new thing
But this one required the personal touch
why on earth would you want to do that
It’s all packet based
what kind of packets?
all of them
is there like a list of packets somewhere? 🤓
which sub catagory?
Protocol
Protocol specification iirc
ty
creative inventory specifically, lol
majority of it is handled client-side so the server just has to do what it can
When we have a really stupid fucking problem, googling it or all in all being a moron is not shameful, but actively encouraged as it usually gets you an answer qucker is the correct answer
