#help-development
1 messages · Page 199 of 1
how i get the item renamed by the player and rename it in the case contains a word?
Hi guys i have a problem with HikariCP did anyone can help me?
When mine plugin do query for 6 times or less or more, stop doing the query what can be?
public void setup() throws java.sql.SQLException {
hikari = new HikariDataSource();
hikari.setJdbcUrl("jdbc:mysql://" + HOST + ":" + PORT + "/" + DATABASE);
hikari.setUsername(USER);
hikari.setPassword(PASSWORD);
hikari.setMaximumPoolSize(10);
hikari.setMaxLifetime(870000000);
hikari.setConnectionTimeout(870000000);
Logger.log(LogLevel.DEBUG, "Database connesso");
CreateClanTable();
}
this is the method
I mean, to be sure it would work, I even scheduled it in a Task 10s later, since this method is called after few ticks it's loaded
One of the methods may have different name
what do you think is better? Sorting a List to check if it contains some value or doing a Linear Search and then checking?
what context
wym?
wdym
You know what is sorting
right now for search I made a method which sorts a List if it contains the given value and after that does Binary Search
but I think the Binary Search is not needed
because the List is already sorted and the first indexes are the right ones
always
so I'll maybe do a short Linear Search so I got all the first indexes which contains the given value
how to detect if an item dies? (EntityDeathEvent doesnt work and EntityDamageEvent triggers multiple times sometimes)
ye
like every death cause
Yeah but EntityDeathEvent returns only LivingEntity
does someone know if I can do an abstraction for AsyncPlayerChatEvent?
like in GUIs
but I don't think this is possible in the ChatEvent
no I mean if I can do it so one class can implement or extend a class or an interface and no need to register each of them
well, i would also like to detect if an entity is destroyed in any way (fire, void, cactus etc.)
like the abstract GUI class for example?
which implements an InventoryHolder after that you can check if the inventory is instanceof your abstract class and then do the listener method
that will do all?
but I don't think this is possible with AsyncPlayerChatEvent because you cannot check it like that way in the InventoryClickEvent
because I need to get player input from the chat
the best way I can think this can be accomplished is to use HashMap
yeah that's right
Don't worry I have an access to the inventory
everytime
I have a GUI Manager so when you open custom GUI the GUI is added in a Map with the Player Name and also has all the history of the older GUIs too.
and when you close the inventory all the GUIs get removed
yeah I can also try with the UUID
because Player Names are not really safe
they can be changed via Reflection
Not sure what you want to do, but have you looked at the the Bukkit Conversation API?
I have looked at it but I don't know what it does
there's another map which contains the Player Object and it's for the opened GUIs counter
why do you think it's bad to use the Player Object?
I'll change it then
ow shesh
I'll rework it then but maybe tomorrow
also I can try to revamp the Player Counter and try without another HashMap
"The Conversations API is a new Bukkit API for creating an interactive dialog between your plugin and a player. For the duration of the conversation your plugin has exclusive access to the player's console, enabling a back and forth conversation to take place."
New in 2012.
yeah that's right
technically the Player should be always removed from the both Maps
on closing
I mainly made this system so I wouldn't gonna need to create everytime a new GUI on clicking the back Button
Haven't tested yet
I always forget I'll test right now
if that's the case I can implement a Quit Checker so if the player quits then remove them
yeah I'll change it that when I have more time haha
tomorrow is the last day which is gonna be for studying Friday will be Sport celebration (which is very cool I'll play) and then I'll have 4 free days so I'll try to do good progress on my Plugin Development
thanks :)
okay right now I kicked myself from the console while I opened one of the GUIs and the Closing system checked it
ALT + F4 also triggers the event/check
but still gonna implement a Quit Event just for more safety
no dont cross post
newbie:
delay:86400
item:
- 306 1
- 307 1
- 308 1
- 309 1
- 267 1
- 257 1
- 258 1
- 256 1
- 322 1
- 364 32
- 17 64
member:
delay: 172800
items:
- 7059 1
- 7060 1
- 7061 1
- 7062 1
- 7099 1
- 7097 1
- 7095 1
- 7098 1
- 364 32
- 10873 1
- 322 5
- 368 16
- 23813 1
- 23812 5
vip:
delay:86400
items:
- 7507 1
- 7508 1
- 7509 1
- 7510 1
- 7519 1
- 7518 1
- 7517 1
- 7515 1
- 10873 10
- 10862:2 1
- 10862:4 1
- 10862:6 1
- 384 64
- 23809 1
- 23808 10
- 322:1 10
why is this breaking my essentials/config.yml?
OH MY GOD I SEE WHY NOW
HAHAHAHA
Sorry thanks anyways
ye tho this is help development
wtf 💀 💀
nopee
nevermind didnt work still
very confused
every time i insert that section into the config it breaks the config
it doesnt make sense because my kits are an exact copy of the tools kit just with a different name
is there a way to get an item from ur inventory that is picked up by the cursor like this?
nvm it wont show the cursor but i think u get the point
I am working on a custom EntityFishingHook projectile, which is spawned into the world by using the following code:
val craftPlayer: CraftPlayer = player as CraftPlayer
val entityHuman: EntityHuman = craftPlayer.handle as EntityHuman
val world = entityHuman.world
val wireKunai = WireKunai(world, entityHuman)
val location = player.eyeLocation
wireKunai.setLocation(location.x, location.y, location.z, location.yaw, location.pitch)
world.addEntity(wireKunai)
This does spawn the entity, but only for a short amount of time (it despawns). I have overridden all methods from EntityFishingHook that use this.die() and commented out the line, but this does not work. How do I make it so the fish hook stays and acts like a regular fish hook? The above method works, but only when I am holding a fishing rod.
Hello! in authme, where can I set it not to ask again? I can't really find it in config
Just don't support cracked
man wtf
🤓
Man wtf
There are many people in Hungary who cannot afford to buy minecraft.
they use significantly cracked servers here
unfortunate
if you cant afford a $27 game maybe you have better things to be doing than playing said game
What kind of attitude is that?
what attitude is "some people are too broke, so it is okay to pirate" ?
My question would be who then funds those servers how would they gather funds to stay up genuinely curious I understand the sentiment
Surely hosting a vps would be expensive let alone supporting whole networks
Minecraft sure went up in price 😦
I have the regular game. However, keep in mind that there are families who cannot do this or whose parents do not trust them.
I asked a simple friendly question. You shouldn't attack the other :/
Don;t worry, with the cost of heating, food and Electricity going up you will shortly not be able to afford to live. No need for Minecraft.
You bet I'm excited for these upcoming economic issues
How do I create a command (/rank user group) from this?
NORMAL(""),
ADMIN(ChatColor.RED + "ADMIN");
private final String prefix;
Rank(String prefix) {
this.prefix = prefix;
}
}
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
If I set a falling block to the same velocity as a monster, the monster moves slightly less than the falling blocks
how would I fix that?
ig, or make a test command and do it there
ah true true
takes way less time
yeah
dragon eggs have different fall speed than sand iirc
java
nah its fine I just did some testing
and got a good number for the monster
Randomly, when someone chats, this error comes up on my AsyncPlayerChatEvent. The event just changes the format and some stuff. It works most of the time, but, randomly, it stops and gives this error... anyone know why?
java
File card = new File(getDataFolder(), "cards.yml");
FileConfiguration configuration = YamlConfiguration.loadConfiguration(file);
configuration.set("cards.Material", Material.STONE);
configuation.save(file);
why cards.yml nothing changed..?
show your code
ok
no errors?
yes
wtf
?
u cannot use +?
idk what delim is
the "%2$s" bit
declaration: package: org.bukkit.event.player, class: AsyncPlayerChatEvent
read that
I'm confused, can you change this line to it so I can understand?
event.setFormat(ChatColor.translateAlternateColorCodes('&', "§8[§4§lOWNER§8] §f" + event.getPlayer().getDisplayName() + ": " + event.getMessage()));
oh ok
omg I hate this website
lmao why
so hard to understand
and its very bright
burning my eyes
I still dont understand
so %2 is player name %s is message
the only thing I see that might mean something is that it wants String, Object...
I cant get the player's name in a string tho
wdym
wait will %2 return the player in a string?
it will be replaced with the player name, yes
oh
ok
I didnt know that
so this would work? event.setFormat(ChatColor.translateAlternateColorCodes('&', "§8[§4§lOWNER§8] §f%2: $s"));
Why would you use § if you are translating it.
its for the players msg
so like I could use &c in a message if im owner but others cant
Use &, with § i dont think you need the translation part
I could use & but I added translate after I had § so I just left it
Ah
https://pastes.dev/gMPZm9IEyR why the static method not working?
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
not get any errors
Instead of asking "why is x not working", ask yourself " How can I get x to work, and how does it differ to my current solution?"
normal method invoke it can be worked,but static call it not worked, i just want save my custom file after set values
Ehh I won't bother with this
Why are you loading before you save. You overwite anythign you have in memory
Just seeing static for the sake of being static just starts it off in the wrong direction
you also have code outside of a method. That will not even compile
okok
public void onExplode(EntityExplodeEvent event) {
if (event.getEntity() instanceof Creeper) event.blockList().clear();
}```
i'm too lazy
would it work
probably
oh
yeah it would
hey guys
weird design patterns time
ProjectileHitEvent has getEntity() which returns Projectile
but it doesn't override the getEntity() of EntityEvent i guess
cuz they return different objects
or i don't know something about overriding a method
does getEntity() in EntityEvent have default realization?
or that's some hacks which i don't know about
if it does, then why couldn't bukkit devs rename method to getProjectile()
Projectile extends Entity so it's fine to change the return type to Projectile
you can override it like that.
oh
Wanna test it right now
bruh...
Polymorphism goes brrt
well now since this is answered
would it be weird to have this thing?
it's just a waste of stack memory and one nanosecond but
this is kinda more detailed for API users
Stop pinging people
Probably unnecessary since getEntity's documentation already states it will return the Entity involved in the event. Adding a method like that might bring even more confusion since it would introduce some ambiguity.
the naming scheme/documentation is clear enough in my opinion.
https://pastes.dev/C0Y7R4tRgK what the problem?
Same as before. you load before you save overwriting any data
oh i will check it
thanks you. i get it well done...
Yes. If you are not doing anything different and just merely want to expose the api in your api. It is generally enough to just use an empty interface to extend.
Implementing the empty interface gives you access to the api methods above it while having a custom name
thanks for your answer
Np. Helping is what I like doing 
Is it possible to make a giant zombie fall through blocks?
(more in depth thread here to look at https://www.spigotmc.org/threads/allow-giant-to-fall-through-blocks.577300/)
is there a way to disable vex ai (or at least prevent it from flying upwards after I force its velocity downwards) but still be able to set its velocity?
Ok so is this some kind of Packet hacking that i need to do, or is there something in spigot that i can do to prevent the "placing" act of this block?
https://gfycat.com/ReflectingSeparateFieldmouse
You should use a builder like Grad/Mvn so you can do implementations
only way that i know to make the build jar smaller is with maven or gradle, you can build stuff to your maven local and use that in gradle and maven to make it easier
why you got paper and minimessages when its built into paper now
Im old school, and dont keep up with modern development schema/nuances
Is paperlib and kyori really in paper now?
Gradle moment
And also because im not sure what is upstream or downstream of spigot so its better to be safe than sorry, not hurting anyone anyway
dont know about paperlib but i know that minimessages is in paper
And i take it that this is a limitation in bukkit that i cant get around
is the jar your adding a local thing?
is it gradle or maven?
no pom.xml or build.gradle?
Probably using intelij file>project>build>executable jar file
Raw wraps it all
i dont get the point of that
Easy for starting, more headache later
link the github
I did it when i was new too, till someone showed me how to use gradle
i started on maven and ive swapped to gradle now
im gonna hope you have the entire project
its gradle
if you do press control twice and type gradlew publishToMavenLocal then use gradle or maven to get it from your maven local, its then possible to make the jar smaller as long as it even supports it
otherwise its probably best to go to their discord to ask https://discord.gg/Ekzcgs3DKZ
Imma just toss this here so it does not get lost:
Ok so is this some kind of Packet hacking that i need to do, or is there something in spigot that i can do to prevent the "placing" act of this block?
https://gfycat.com/ReflectingSeparateFieldmouse
im gonna guess the easiest way that i can think of is setting them to adventure mode
Oooo
Doubt thatll work but its an idea
Yea i cant do that, as soon as i check the event it seems like it was already placed on the client, id need to set it RIGHT BEFORE, but i cant
I am working on a custom EntityFishingHook projectile, which is spawned into the world by using the following code:
val craftPlayer: CraftPlayer = player as CraftPlayer
val entityHuman: EntityHuman = craftPlayer.handle as EntityHuman
val world = entityHuman.world
val wireKunai = WireKunai(world, entityHuman)
val location = player.eyeLocation
wireKunai.setLocation(location.x, location.y, location.z, location.yaw, location.pitch)
world.addEntity(wireKunai)
This does spawn the entity, but only for a short amount of time (it despawns). I have overridden all methods from EntityFishingHook that use this.die() and commented out the line, but this does not work. How do I make it so the fish hook stays and acts like a regular fish hook? The above method works, but only when I am holding a fishing rod.
you got their repository? (unless its not needed idrk this stuff)
Hello guys, what do you think is the best way to check if a player is using a custom item/consuming custom potion/ etc.?
Many people usually compare by displayname but I don't think it's the best solution since if a player has certain permissions he could change the displayname of an item.
nbt tags
dont use item name its a horrible way of doing it
I have never heard them, I will try to inform myself, ty
are you talking about this? https://www.spigotmc.org/threads/lore-tags-to-keep-track-of-a-custom-items-uses-help.498515/
?pdc
yeah pdc is the only valid answer for 1.14+
Dam never knew that
is it an issue if you send chunks in a void biome type?
why doesnt this work? (it should detect if the block u placed is a shulker with a dragon egg in it)
what do you nean with "doesnt work"? does it at least print the first msg?
btw you are getting the blockstate of the block that was there BEFORE the shulkerbox was placed
it should actually throw a ClassCastException in the ShulkerBox shulkerBox = ... line
getBlockReplacedState with be AIR in most cases (or another "replacable" block like GRASS etc)
that works
ye i did
i didnt really know what i was doing
you can btw also get the inventory of the shulkerbox directly from the ItemStack instead of from the block, by casting the ItemMeta to BlockStateMeta, then casting the BlockState to Container
ItemStack myItem = ...;
if(myItem.getType() != Material.SHULKER_BOX)) return; // better use tags
BlockStateMeta meta = (BlockStateMeta) myItem.getItemMeta();
Container container = (Container) meta.getBlockState();
Inventory inventory = container.getInventory();
You need to look for the itemstack version of it and not material
Inventory lets you grab itemstacks
as I already said - do not use getBlockReplacedState, but get the BlockState of event.getBlock()
the "replaced" block is the OLD block, mostly air
And as well as what alex is saying
wait whats the difference of .getBlock() and getBlockPlaced()?
it's the same
as described in the javadocs
You currently try to cast the old block to shulkerbox which will 100% throw errors so I wonder why you didnt see those
Had to create some shitty domotica system in Java class today
We have to code with 2 People on one laptop now ;/
oof
ye
can u plz help me? @tardy delta
What messages are bein printed?
only the first and it gave me a classcastexeption at the shulker cast part
Only blockstate can be cast to sheulkerbox ig
Check docs and see what shulkerbox implements
One of them must extend blockstate
no, why don't you just use event.getBlock().getState() ?
cast that to ShulkerBox or Container and that's all you need
those anyone know about java.lang.NoClassDefFoundError?
I actually defined the class but it always returns error 😦
it cannot find the class
what are you doing with the class?
show the full stacktrace
this is error all of error message
thats not the same error
oh
yeah
sorry
java.lang.NoClassDefFoundError: me/rukon0621/dialogquest/playerdata
at me.rukon0621.dialogquest.main.onDisable(main.java:104) ~[dialogquest-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:399) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:578) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:555) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.clearPlugins(SimplePluginManager.java:633) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.reload(CraftServer.java:978) ~[paper-1.18.2.jar:git-Paper-379]
at org.bukkit.Bukkit.reload(Bukkit.java:909) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:54) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.dispatchCommand(CraftServer.java:906) ~[paper-1.18.2.jar:git-Paper-379]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.dispatchServerCommand(CraftServer.java:869) ~[paper-1.18.2.jar:git-Paper-379]
at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:510) ~[paper-1.18.2.jar:git-Paper-379]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:484) ~[paper-1.18.2.jar:git-Paper-379]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1456) ~[paper-1.18.2.jar:git-Paper-379]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1226) ~[paper-1.18.2.jar:git-Paper-379]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-379]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: me.rukon0621.dialogquest.playerdata
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:151) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:103) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
you cannot load classes in onDisable
do Class.forName("me.rukon0621.dialogquest.playerdata") in onEnable
then the class is loaded at startup and you can use it in onDisable
So if i wanna load some class on Disable
it's too late to load a class in onDisable
yeah basically in onDisable you can only use classes that are already loaded
np
I'm here again to ask to you guys, what's the best method to create a custom item object? Can't find an answer that satisfies me
Most people instantiate it inside a method, but I wish it was more something independent, like a class, but I don't know whether to extend ItemStack or not
that's probably what they mean with custom items
hi, im stuck at detecting if the dragon egg got put inside a chest with a number key, also im using InventoryClickEvent
you shouldnt extend ItemStack
the docs say you should only do that for classes (or interfaces) that are clearly marked as such or obviously made for this
the code i wrote so far (it detects if any item entered)
just save your ItemStack in a field and return a clone() everytime you need a new one
so doing something like this is ok?
yeah but why don't you just save that ItemStack in a field?
public class MyClass {
private final ItemStack myItem;
{
myItem = new ItemStack(Material.DIAMOND_PICKAXE);
// set custom name
}
public ItemStack getMyItem() {
return myItem.clone();
}
}
this is the proper way
this always returns an undamaged version of your item
yeah sure it would work, but you're not supposed to do it
Yeah, but I should have a class that contains all these custom items?
if you want to, sure, just make an "Items" class or similar
for best practice
you could just create public static final fields like Items.MY_CUSTOM_PICKAXE, Items.MY_CUSTOM_DIRT_BLOCK, etc
or you could have a Map<String,ItemStack> in your main class if you have configurable items, then just do myMainInstance.getItem("my-custom-item-1") etc, whatever
there's a thousand ways to do this
Okay, thanks for your help @tender shard @last temple
you are checking if the player puts something that's not a dragon egg inside using a number key
and how to check if the thing u put inside is a dragon egg?
no
it also executes if i put in the egg
Is there a way to make that shorter?
Smth like getShopItemMaterial(shopItem.id) != null ? that : Material.FILLED_MAP
And the problem is that all the stream stuff going on in the getShopItemMaterial is also executed twice
?learnjava
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.
why not just sth like this?
Material myMat = Material.Filled_Map;
ItemStack myItem = getMyCustomItem();
if(myItem != null) myMat = myItem.getType();
in kotlin you could use the ? operator but not in normal java
or
ItemStack myItem = getMyCustomItem();
Material myMat = myItem == null ? Material.FILLED_MAP : myItem.getType();
I mean, both are longer code-wise but at least they don't call getMyCustomItem() twice
i'd probably use a method for this anyway
public static Material getMaterialOrDefault(ItemStack item, Material defMat) {
return item != null ? item.getType() : defMat;
}
{
Material myMat = getMaterialOrDefault(getMyCustomItem(), Material.FILLED_MAP);
}
also, sometimes the ItemStack will be AIR with an amount of 0 (e.g. in certain InventoryClickEvents), so MIGHT as well also check for that
yeah well, it doesnt call getCustomItem() twice
Idk why NBTAPI says that one of his methods isn't loaded
I mean, to be sure it would work, I even scheduled it in a Task 10s later, since this method is called after few ticks it's loaded
getCustomItem() might be expensive, constructing or cloning ItemMeta, etc
what's NBTReflectionUtil.java:611?
No I want it in 1 line xd
the method basically is one line
and you can reuse it everywhere else you might need it
doing things in one line is a stupid goal
Nonono
look at this: I wrote a whole death chest plugin in 5 lines using only 3 semicolons per line. It however isn't exactly readable, is it?
https://github.com/Luziferium/the-cipher-project/blob/master/src/main/java/we/are/project/cipher/AngelChestListener.java
hmm
in the NBTReflectionUtil class?
yeah, what does that line say?
Is better to storage playerdata in a SQLite database or in a yaml?
depends, I'd go for the player's PDC instead
that way you don't have to worry about I/O latency at all
otherwise, for both YAML and SQLite, you'd have to do stuff asyncs, using Futures or Callbacks or whatever
dont ask me wtf i was doing
Ok, thanks
I mean
if your data is large and does not need a lot of writes
SQlite is fine
you'd just load the data on player join
I'm using ds on phone, I can't check right now
and write like every 5 mins or so and on disconnect
should probably implement that in my plugin too
but what is "large"?
I mean, I'd move anything that isn't a few flags or settings into a DB
I wonder how much a written book is if you fill it with thousands of pages
too much
how do u get the item that a fox is holding in its mouth?
probably getEquipment().getItemInMainHand() ?
^
can mobs wear a dragon egg as armour?
idk
if no, i just have to do EquiptmentSlot.HAND and OFF_HAND
ofc they cannot do it naturally
only if a plugin makes them wear it but even then it's probably invisible except for when used as helmet
wtf

yoo wheres my fancy color
nitro
🙄
broke ass
nitro is such a rip off
yes
I only got it for longer text msgs and higher file limit
considering nitro basic cause all i use are the emojis
I mean nitro "normal" also gets a free server boost IIRC?
2
oh fr?
I think so?
i only have those 2
Yeah, I've been boosting this and another server for years. Mainly cause I'm lazy
emotes would be cool

You have nitro tho 
I got nitro basic
yeah i might downgrade at some point
It is but the emotes 
Stickers are great too
Same but at the same time
yknow what sucks. Bots used to have the same file limits as users until some users decided to ruin it for everyone by making file sharing bots 
Ew betterdiscord
plugin api, themes
but yeah, the plugins are the good thing
"somebody once told me" it was able to hide "3 messages hidden from blocker user" but I never found that option
It adds breach of TOS is what it adds lol
yeah it's not exactly worth it imho lol
i mean who cares about the theme of an app?
!verify
!verify
i dont have a spigot account lol
Not sure if its the right place to ask this since its mostly resource pack related but once i've made it in blockbench, obviously you can replace existing mobs but how do you go about adding it for the custom mob without making it name dependant (e.x Having to name a mob to spawn the custom mob).
Like if you have an NMS mob and want to add a texture for it.
i write my own plugins or get the core ones like luckperms and ncp from github
then you need to create one to get verified
You can't add new entities without mods
Resourcepacks can only overwrite existing models/textures
Afaik anyways
you cannot do that even with custom names
modelengine would beg to differ
a zombie will always have the zombie texture
no
They're not adding new entities
armor stands
it doesnt add new mobs, it only "simulates" them with armor stands etc
Yeah that's not a new entity 
yea but to the player it is the same result
True but that's not what they asked 
i think thats mostly what they meant?
they said they have "an nms mob" and want to add a texture for it
and that's not possible without making all the same mobs also change appereance
appearance
i never know how to write this word
yeah but you could reimplement the mob as armor stands
english spelling is fuuucked
if you really wanted to
Pterodactyl is spelled perfectly wdym
it doesn't really matter what happens in the backend as long as the player sees what you want
That is the workaround to their problem yes
We're all right
My end goal is to create a mob with its own texture that has its own patterns on how it behaves, I was planning to go the nms route but would going with amour stands make this easier? or possible then?
changing the behaviour and what not of an already existing mob would require nms and shit. armorstand would mean you can define your own behaviour with the api but have to start from scratch
Alright so armour stand would allow more freedom but would be harder to do?
yes
also consider server performance cost
you will not want many armor stand mobs
why not
all the animations have to be done on the server
what animations
he wants to apply a custom model
thats just changing an itemstack
yeah but any mob with functionality will be doing more than standing in place
What would be good resources to get started on learning armour stands?
modelengine docs idk
if I set a variable (plotCoords) like this:
public final class Housing extends JavaPlugin {
public static Housing inst;
public static int[][] plotCoords = new int[2147483647][3];
will it save past server reboot?
for player data ive been using persistent data container but that doenst have a container
alr i'll have a look
and I've used config.yml in the past, but it didnt save past reboot
oh god you absolutely don't know what you're doing, do you?
you have to save config after setting something
pretty sure I did that 🤔 idk this was a couple months ago
Hello! Does anyone know how to get rid of the question mark behind chat messages in 1.19.2? I'm currently using Freedomchat, but I'd like to fix it manually.
why would you want to create a 2 billion int array
I just need it to be big so I thought why not 32-bit integer limit
idk how big I would want it
I could use a class that changes size
thats not how oop works
List
yeah thats what its called
🤔
its literally list object
Yeah use that instead of an array of 2 billion ints
forgot the name for a second
2billion x 3
💀
cus the [3]
yeah dont
which represents a coordinate
dont do that 
lmao
List<Location> ez
fr
i actually seem to have forgotten but doing arr[i] on a new int[0] will return 0 right
like array prefilled with default primitives?
It'd say IndexOutOfBounds, no?
You're making an array with size 0 and tryna access index i
ah lets say new int[10] then
Yeah it'll return 0 I'm guessing
was just talking bout an array where stuff isnt being put in
new int[0] would return null
in case anyone was curious in what it would return
how would that return anything
because it still creates an object just one that doesn't have space
this is because the compiler detects it and changes it
there is a way though to get it to be really 0
ah
Does anyone know a solution?n
signed chat?
Probably
or whatever its called
Thing with chat moderation
I am assuming you don't use english?
Is there a way to check if a enderchest contains (any type of) a shulkerbox that contains the dragon egg?
still using 1.17 api
Yep, we mostly chat in Dutch
I'll remove the plugin gimme a sec
I am going to assume it has something to do with yaml and dutch
if not that, then you most likely are going to probably have to use the UTF escape code for the character that appears as a question mark
isnt a non recognized char just a rectangle box?
ah yeah bc why would it be consistent
if it is in the range, but the code isn't assigned a character its generally a question mark
Would it be hard to fix? 'Cause I'm gonna be honest: I'm pretty much not educated in all of this stuff
I have absolutely zero knowledge of what I'm doing
I don't know what the character is supposed to be, but you could try replacing that character with a utf escaped one instead
it should resolve the problem
Uh, well... I have no idea what that is
its in your config
tf was i doing like four months ago 💀
obviously find the position where such a character would be
messing with bitmasks
where can I find the yaml?
in the plugins folder?
How can i spawn an entity death particles?
spawnparticle?
I don' t know how to give it the effect of going up
give it velocity
Basic explanation: Primitives can't be null, instead they have a default value (0 / false). The array's length is 10 so you can't be out of bounds, yet all the values are unset so they're defaulted (object default value is null)
👀
havent been using arrays for ages
smh i rejoin my server after being 3 months idle
looks like copilot did smth stupid
how do I use the /fill function using spigot
for loop
I have the black square.
and I want to fill it with other squares ( orange )
for that I need to get positions of corner 1 ( yellow line intercepts it) and corner 2 ( green line intercepts it )
I know by how much I should change X and Z coordinates of rectangle, so they will fit in perfectly.
Also I know how many of those rectangles there will be.
The answer is to use FreedomChat (which you're already using).
Things will change in 1.19.3, so wait and see how that works before you spend extra effort on it.
All right, thank you!
java.lang.UnsupportedClassVersionError: net/cubepix/Cubepix has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at net.md_5.bungee.api.plugin.PluginClassloader.findClass(PluginClassloader.java:152)
at java.lang.ClassLoader.loadClass(Unknown Source)
at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:66)
at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:59)
at java.lang.ClassLoader.loadClass(Unknown Source)
at net.md_5.bungee.api.plugin.PluginManager.enablePlugin(PluginManager.java:340)
at net.md_5.bungee.api.plugin.PluginManager.loadPlugins(PluginManager.java:250)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:271)
at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)```
my java is out of date?
you compiled your plugin to a higher version as the one running the server
how can i fix this?
what spigot version are you using
There are only 497 lines of code in that class
recent BungeeCord
there is more than that
It includes imports
you either need to upgrade your java / or compile your plugin to a lower version
looks like ur running java 8, u need at least java 17 by the looks of it
or compile ur plugin to java 8
that's all the lines of code I can see from the library
From the error it looks like you are either not depending on nbtapi, you callled your config too early, before nbtapi was loaded, or your nbtapi is out of date
Config.java:99
As I said, I scheduled the task of 10s
Even cause I tried to use that method via command, and it still give me this error
And nbt isn't outdated
@tall dragonHow can I compile a plugin on an older version?
older Java not server
Ok
your Server looks to be running on Java 8
update the Java on your server or compile with a source/target of 8
what the
Its sensible as reflection is slow. Caching is optimal
i see..
im wondering if methodhandles can be used for the same purpose?
in terms of getting fields, getting and setting value etc
and those are assumed to be faster right?
yep
hmm i might want to use them then
I already know this, I can't explain me why
have you tried on a version other than 12?
The only other thing I can think (as I've not read anything other than your error), is this error happenign at a specific time? ie shutdown.
Do you mean the MC version?
I mean, that method it's used once the plugins gets enabled, I thought that since my plugin name starts with A, NBT is not loaded yet, but even scheduling a task, or calling it using "/test" command, returns the same error
How can i check an enderchest for special items if the player closes it (inventoryCloseEvent)? with any for loop or smth?
Player#getEnderChest().getContents().forEach(i -> {
});```
impact of Bukkit.createExplosion(40) go brr
is i the current item?
yes
okay
i mean it's item for current loop step
oh shit
it's array
forEach's not gonna work
how?
Which version are you using of nbt?
for (ItemStack i : Player#getEnderChest().getContents()) {
}```
thanks
1.12.2
what's the difference between inventory and inventory.getContents()
except one is Iterable and second is Array
NBTAPI works fine on 1.12.2, can't understand your error tho
uses an
I mean Google any weighted randomness in java
HashMap<Inventory, MenuGUI> guis = new HashMap<>();
@EventHandler
void click(InventoryClickEvent e) {
MenuGUI gui = guis.get(e.getClickedInventory());
if (gui == null) return; // didnt click an active GUI
MenuItem item = gui.getItemAt(e.getSlot());
if (item == null) return; // didnt click a menu item
}
smth like this
pass in the same itemstack then smh
Thats not how it works
If you require NBTAPI your plugin MUST add it as a depends in your plugin.yml
dont use pdc but use the above thing
the inventorycloseevent isn't called on esc key
idk why
ah it isnt working if i dont shift click it in
nvm i know why
it is not working with air
it is crashing with a nullpointerexception
cuz its null duh
i know
Dude I've already done that
can i remove the null stuff or at least continue the for loop? does the continue; statement work?
yes
looks fine. now show the code that is generating this error
@tall dragonI achieved 🥲
I see no reason for it to not find that method. The alternative is to set it as a string rather than a UUID object
uuid.toString() and UUID.fromString()
would like to create a group system for BungeeCord. Where should I start?
example: /group user set admin
should i use enum?
that code is run at earliest in your onEnable?
When depending on other plugins you should not assume they are actually up and running until after ALL onEnables are finished.
That code is a piece of a setup() method in the class Config, the Config.setup() it's called in the onEnable(), but it's in a scheduled task
But even testing through a command, so when all plugins are loaded, it doesn't work
(I'm his friend)
in a Task would be fine as that runs at earliest 1 tick later
I see nothign wrong in the snippets of code he has show and nothing wrong in his API useage
Bro, we tested in a 200 ticks (10s) task
Even through a command you get that error
which chat event can i use which is not deprecated?
makes no difference, 1 tick is all it needs to guarantee to be after all are enabled
Just to be sure
playerchatevent is deprecated, asyncplayerchatevent too
(still doesn't work tho 200 or 1 tick)
I'd suggest use uuid.toString() to set it and see if that works
as in setString("bomba", uuid.toString());
if that works, its some issue in NBTAPI
You may want to add an API version to your plugin yml, so spigot knows how to handle it
can i convert a component back?
to a String?
Send the component instead of turning it in to a string
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
im using bukkit.broadcast
Operator '+' cannot be applied to 'net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component', 'net.kyori.adventure.text.@org.jetbrains.annotations.NotNull
ill get an error
Wait are you using adventure text components
Bukkit.broadcast(e.getPlayer().displayName() + Component.text(" §7| §8 ") + Component.text(e.getMessage()));
i guess you need to
yes im using this but can you still tell me how to use it?
how can i get UUID player with BungeeCord?
thanks
Guys I can't cancel the event of moving an item in another inventory, if I try to move an item with numbers it works
That is for hoppers etc
Thanks 👍
@chrome beacon
public class Find extends Command{
public Find() {
super("find", "bungeecord.command.find", new String [0]);
}
@Override
public void execute(CommandSender sender, String[] args) {
if(args.length !=1) {
sender.sendMessage(new TextComponent(ChatColor.RED + "Digite /find <nickname>!"));
} else {
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(args[0]);
sender.sendMessage(new TextComponent(ChatColor.YELLOW + "Info"));
sender.sendMessage(new TextComponent(ChatColor.WHITE + " Nickname: " + ChatColor.GREEN + player.getName() ));
sender.sendMessage(new TextComponent(ChatColor.WHITE + " Rank: " + ChatColor.GREEN + player.getGroups() ));
sender.sendMessage(new TextComponent(ChatColor.WHITE + " UUID: " + ChatColor.GREEN + player.getUniqueId()));
sender.sendMessage(new TextComponent(ChatColor.WHITE + " First login: " + ChatColor.GREEN ));
sender.sendMessage(new TextComponent(ChatColor.WHITE + " Last login: " + ChatColor.GREEN ));
sender.sendMessage(new TextComponent(ChatColor.WHITE + " Servidor: " + ChatColor.GREEN + player.getServer().getInfo().getName()));
}
}
}
Yeah
sender.sendMessage(new TextComponent(ChatColor.WHITE + " Rank: " + ChatColor.GREEN + player.getGroups()));
Mixing legacy colour codes and components doesn't work
How can i get especific group?
Depends on what group you want
It just returns a Collection
How to get the first player message after entering a certain command
listen for chat event
ive searched EVERYTHERE and i didnt find an answer...
is there a way to detect if an item got destroyed in creative mode with the remove item slot?
Yeah, use getItemInMainHand function
BlockDestroyEvent, if player.Gamemode == GAMEMODE.CREATIVE
If Is true, getItemInMainHand === Material.BlockThere
I wrote it to you very superficially, then you see
why get the main hand?
Check if when you broke the block the item you are holding is the one that intersects you
Didn't you ask for this?
Then I don't have approx
what im asking is that is there a way to detect if u destroyed an item with the X button in the inventory
Oh
i didnt find
Wait a minute, I'm looking for it for you
well, i didnt find anything
any good tutorials for this?
Making Math into code
Automated ?
with java exemple?
Do you want to make a math parser?
I hate to make those
bruh that possible?
I mean, you want to generate source code from a math equation
Which, that is just transpilation
Time for crunch https://github.com/Redempt/Crunch
wanting to learn for algorithms
im in 1.8 and I need to set the armorstand item in hand. I tried this but it is not working
and yes, I spawned the entity

Go away 1.8
Why are you spawning it with nms
because i need it for individual players
should be workin on my expression parser tho
Not completing like this
more for tasks and loops
Try using nms methods instead of bukkit ones
didnt work
Since you're using packets have you sent the entity meta
Algorithms and Pseudo Code hmmmm
No idea then
I'm trying to spawn a chest in a random position in my player inventory, but sometimes it appears as equipment, any suggestion?
I do this:
bruh
I think it's because of the index
setInvisible :C
meow
but dont know what indexes are for equipment
declaration: package: org.bukkit.inventory, interface: PlayerInventory
olivo
?
ah
i need help :/
Creative mode players have full control over items
oh
Working with the creative mode inventory is a pain
Why do you want to detect if an item is deleted?
i wanted to detect if an item is removed from the inventory in creative mode
because u get special effects if u have it
When a player picks up the item to their cursor it is removed from the server
iirc
(Creative mode only)
but its kina optional...
Then check the players inventory for the item in the close event
The client doesn't send a close packet for the player inventory
It doesn't even send an open inventory packet
nah but its ok
thats a bunner
You can't detect if the player inventory is open
i have another question tho...
how do u detect if u put an item in a chest with the number key
InventoryClickEvent
i did but not very great thb!
ik its invclickevent but theres no good way of detecting it
since client can lie
How did you detect it?

event.getClick().equals(ClickType.NUMBER_KEY)
not any item
only dragon egg
check if the item is a dragon egg
lemme find the code
but it is very poor so dont judge me
but how?
on inventory click event:
getCick == Number key
getCurrentItem.getType == DRAGON_EGG
DO STUFF
event.getCurrentItem().getType().equals(Material.DRAGON_EGG)
could you paste your code?
&& is a thing
^
but also nothing happens if u put it in
only out
If you remove the first if it works?
@serene sigil
okay, so now it works but if its not air and u swap another item it doesnt work
but also it triggers if its not the egg
which makes sense
what does getCursor() return?
The item on the cursor
ye but theres no cursor in number key
Yeah so it's null or air
okay
also does the event trigger before or after the item is transferred?
You could be getting an item from an event before it's actually set to the netherite tool. It's hard to tell without any additional context.
Are you including api-version: 1.16 in your plugin.yml?
Maybe you could check if the number that you've pressed is the index where the dragon egg stays in hotbar, if yes then cancel the event (dont know if it's possible tbh)
@chrome beacon Store Clicked Inventory to memory
inventory open event check if it matchs the stored inventory?
I think you just use the major update version, so 1.16.5 might be invalid to your plugin.yml, but 1.16 might work
weird
jk it's not possible since people can change their keybinds in settings
That won't work at all though???
The InventoryOpenEvent doesn't fire for the player inventory
i gotta find the source
To the server, the player inventory is effectively "always open," so even if there isn't one open then that's what will be returned. There is no way to differentiate.
Unless you maybe listen to InventoryClickEvent, then you can make a "well-educated guess" that it's currently open if no other one is, lol.
I'm trying to save an inventory in mongodb but I can't create an array in a sub object. I would like to do this :
I tested several codes with "$set" except that "set" puts me "inventory" and "slot" in object and "addToSet" puts me "inventory" and "slot" in array I would like "slot" to be an array and "inventory" an object
the codes I tested :
first : dbCol.updateOne(playerData, new BasicDBObject("$set", new BasicDBObject("inventory", new BasicDBObject("slot", new BasicDBObject(String.valueOf(i), itype)))));
second: dbCol.updateOne(playerData, new BasicDBObject("$addToSet", new BasicDBObject("inventory", new BasicDBObject("slot", new BasicDBObject(String.valueOf(i), itype)))));
fr what im thinking
if it is not clear, I can make a schema of what I would like to do
Hi im trying to figure out how to check what part of a bed is right clicked in an event. How would i do this ?
you lookup bed under block.data.type
?jd-s
?paste
So far i got this https://paste.md-5.net/uzufamaviz.cs Is this what you meant ?
What version are you coding against?
No, the Part comes from teh BlockData not the Block
You can use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Tag.html#BEDS instead of checking the name
declaration: package: org.bukkit, interface: Tag
As above, use Tag to check its a bed, then cast BlockData to bed (which is also directional). Get teh head or foot, get facing and getRelative
that was spam mb
hmm that wasnt there when i was looking, anyways
Why the BlockData type? The Bed interface contains the enum Part
like so ? java public Bed.Part getBedPart(Location loc) { Bed bed; if (loc.getBlock().getType() = Tag.BEDS) { bed = (Bed) loc.getBlock().getBlockData(); return bed.getPart(); }
What about the BlockData part did that look fine ?
yes
Noice
I don't think its linked to the recent inquire i had but i keep getting this error message. It keeps spamming the server console and the server doesn't start
wrong version of packet events?
Well it didn't happen before, and i just removed the plugin with the code from above
So the only change is not in the files anymore and it still occurs
the code above has nothign to do with it
But nothing changed from then and now other than the code above
That error is being thrown by https://github.com/retrooper/packetevents
It would be impossible for the above code to cause that error
yea also the code is not active in the files anymore so it would deff not be possible
That error is common on 1.8
im on 1.17.1
Aight
I have viaversions tho
probably one of your plugins incorrectly shaded packetEvents
it uses teh same injection method as viaversion
would a plugin like https://www.spigotmc.org/resources/oldcombatmechanics-disable-1-9-hit-cooldown.19510/ be able to cause this error?
No idea I don;t use any of those plugins
Its just a tad wierd because it didn't occur earlier this evening
And nothing was changed as in nothing
Anyone know a nice way to get the persistentdatacontainer for an OfflinePlayer?
Have you tried restarting the server and see if that fixes it
just use a persistent storage which is not pdc at that point ig
Try replacing the plugin jars. That error can be caused by a corrupt jar file
Replace all plugins?
I just based my new persistence all around PDC and I forgot Offline Players dont have access to the PDC lmao
Fourteen do you have any clue towards my issue? Replacing all plugins seems a bit... much idk
Might be what is needed
check what plugin causes it first
Hmm, it's very useful performance wise to store things directly against the Player/Chunk/Block tbf. I guess I can go down a custom PDC route
Thats the thing no plugins seems to cause the problem
Well it happens right after the placeholderapi
performance shouldnt be the main reason to prefer using pdc over another kind of persistent storage
I assume RewardArmorStand extends EntityArmorStand
