#help-development
1 messages · Page 632 of 1
Is there a way I can get the type of tool a block needs to be mined with, efficiently?
You just need a plugin instance
i dont know, maybe a switch(material) and you set it up for every block in the game
I only knew of sleep from when I messed w vanilla multithreading when I was in school
im assuming they mean efficient to write, not efficient for the computer
There are tags which tell you which tool to use on a block
didnt know Bukkit had such weird stuff going on when you use traditional multithreading
blame mc
There’s also isPrefferedTool in the block class
Dude thank you so much
switch case is nice too :D
🤡
@echo basalt
now that's what I call code
I'm ready to be paid by the character
Paid by the byte
okay.. so now im running into the issue of being able to pass in a plugin into the runTaskLaterAsynchronously function
since my handler is in its own class
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
anyone knows, how i can set the port on theholywaffel ts dependency?
config.setHost("000.00.000.00:0000"); (hiding mine)
config.setQueryPort(10011);
config.setFloodRate(TS3Query.FloodRate.UNLIMITED);
this doesnt work
I am trying to code a plugin that makes the last player to get hit or spleefed to get kill credit(I do not know where to start )
Why don't you just call the nested class EventCaller? 
ru u making a web api?
where u use java for backend?
ah
s u're making a java wrapper lib
there are many ways to do this
well basically u wrap rest/graphql calls
make java representational classes of REST json objects
have u used jda?
yeah well u probably wna do sth similar to what they do
I used the runTaskLaterAsynchronously function with a delay of 1
now its still occasionally happening, but it seems that on the occasions that it would ORIGINALLY function properly now throws an error
java.lang.IllegalStateException: Asynchronous block remove!
at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:14) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3836-Spigot-3374045-08ec344]```
and the line of code from me that this is triggering on is the only one in this function
void replantCrop(Block blockBroken, Ageable targetCrop) {
blockBroken.setBlockData(targetCrop);
}
@EventHandler(priority = EventPriority.HIGHEST)
public void BlockBreakHandler(BlockBreakEvent event) {
//TODO: Add permissions for who can use the plugin
Player actor = event.getPlayer();
//get permissions
//if not allowed, ignore
//Allow user to ignore when pressing shift
if (actor.isSneaking()) { util.debugMessage("Player sneaking, handler ignored"); return; }
//If block is not a crop, ignore
Block blockBroken = event.getBlock();
BlockData blockData = blockBroken.getBlockData();
if (!(blockData instanceof Ageable)) { util.debugMessage("Block is not a crop type"); return; }
//Complete the final checks of when this handler will control the event
Ageable targetCrop = (Ageable) blockData;
int currentAge = targetCrop.getAge();
int maxAge = targetCrop.getMaximumAge();
if (currentAge < maxAge) { util.debugMessage("Crop was too young " + currentAge + "/" + maxAge); return; }
//https://bukkit.org/threads/asynchronous-block-remove.202491/
//SET PRIORITY TO LAST????
//Cancel event as to prevent the block breaking after replanting
event.setCancelled(true);
//Drop the items that would normally drop
dropAllItems(blockBroken.getDrops(), blockBroken.getLocation(), blockBroken.getWorld());
//"Replant" the crop, really just setting the age back to 0 to look like
targetCrop.setAge(0);
//Need to wait a tick or two before replanting to let any break event misfires to pass
Runnable replantSequence = () -> replantCrop(blockBroken, targetCrop);
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLaterAsynchronously(plugin, replantSequence, 1);
}
void dropAllItems(Collection<ItemStack> AllItems,Location location, World world) {
for (ItemStack item : AllItems) {
world.dropItemNaturally(location, item);
}
}
void replantCrop(Block blockBroken, Ageable targetCrop) {
blockBroken.setBlockData(targetCrop);
}
sorry for big code block, adding the async stuff is giving me even more grief than not delaying the replant
whats so confusing
u fetch from the rest api
u get a json object
and then u turn that into a java object
Hi , is good idea for make file scanner for making a simple anticheat ? a file scanner for cheat files !
Does someone know why this isn't properly saving to config.yml?
@young knoll @sullen marlin any thoughts?
Line 51
sure
yes in simple terms
but then for instance jda is complex
because it provides caching alternatives
custom executors etc
i dont like jedis
its just good as a quick jedis java test setup
but i think server spoofer can stop this so Can i make a file scanner without stopping by server spoofer ?
lettuce is better
23.07 02:18:38 [Server] Server thread/WARN Task #15 for GooberPlugin v1.0.0 generated an exception
23.07 02:18:38 [Server] INFO java.lang.NoClassDefFoundError: Could not initialize class com.comphenix.protocol.wrappers.WrappedChatComponent
23.07 02:18:38 [Server] INFO at me.emerald.gooberplugin.Tab.lambda$runTab$0(Tab.java:25) ~[?:?]
23.07 02:18:38 [Server] INFO at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:82) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3810-Spigot-c62f4bd-b6b514b]
23.07 02:18:38 [Server] INFO at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:415) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3810-Spigot-c62f4bd-b6b514b]
23.07 02:18:38 [Server] INFO at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1257) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3810-Spigot-c62f4bd-b6b514b]
23.07 02:18:38 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:388) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3810-Spigot-c62f4bd-b6b514b]
23.07 02:18:38 [Server] INFO at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1198) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3810-Spigot-c62f4bd-b6b514b]
23.07 02:18:38 [Server] INFO at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1015) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3810-Spigot-c62f4bd-b6b514b]
23.07 02:18:38 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3810-Spigot-c62f4bd-b6b514b]
23.07 02:18:38 [Server] INFO at java.lang.Thread.run(Thread.java:833) ~[?:?]
So, tryna make a tablist gui.
Not working.
Im using ProtocolLib, and everything ive tried wotn let it actually function, or show.
MC Version 1.20.1
is there answer for me ?
public void runTab(){
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Setup.instance, () -> {
ArrayList<Player> pList = new ArrayList<>();
for(Player p: Bukkit.getOnlinePlayers()){
pList.add(p);
}
for(Player p: Bukkit.getOnlinePlayers()){
int[] time = Handlers.getHMS(Instant.now().getEpochSecond() - Setup.uptime);
PacketContainer packet = new PacketContainer(PacketType.Play.Server.PLAYER_LIST_HEADER_FOOTER);
packet.getChatComponents().write(0, WrappedChatComponent.fromText(ChatColor.RED + "" + ChatColor.BOLD + "Goober SMP"));
packet.getChatComponents().write(1, WrappedChatComponent.fromText(ChatColor.RED + "Online Players: " + pList.size() + "\nPing: " + p.getPing() + "\nUptime: " + String.format("%02d:%02d:%02d",time[0],time[1],time[2])));
try {
ProtocolLibrary.getProtocolManager().sendServerPacket(p, packet);}
catch (InvocationTargetException ignored) {}
}
}, 0L, (5));
}
heres the code im using for said tab
define poor performance
hmm
ttl isnt time based tho
its just to avoid endless circularity
no?
You need a syncronous task
Do you really need redis caching
Unless your API is slow and you have multiple servers it's pointless
Redis is just a complicated map
Honestly I don't you're at the scale where you need any caching
how to code spleef kill credit plugin
I want to check if a player is standing on a block that is broken by another player
You probably don't need caching
Do your thing without caching
If you need it add it later
Why
How many is a lot
What does the API do
So 0.5/second
Your API can't handle 1 request every 2 seconds?
Sure
Or Guava cache
I remember it was place not break that undoes.
Someone able to explain why this isn't working? It creates the config file but doesn't set the data
relevant main class:
public void onEnable() {
ConfigUtil config = new ConfigUtil(this, "syndicate-data.yml");
getConfig().set("hello", "world");
config.save();
}```
relevant ConfigUtil class:
```public class ConfigUtil {
private File file;
private FileConfiguration config;
public ConfigUtil(Plugin plugin, String path) {
this(plugin.getDataFolder().getAbsolutePath() + "/" + path);
}
public ConfigUtil(String path) {
this.file = new File(path);
this.config = YamlConfiguration.loadConfiguration(this.file);
}
public boolean save() {
try {
this.config.save(this.file);
return true;
} catch(Exception e) {
return false;
}
}
}```
think u might have to create the file also
on disk
unsure how exactly save() worked
CHM works just fine, no?
I'll give that a go, but the plugin generates the config properly upon running it
Just doesn't add the hello: world
what click event
inventory click or player interact
but pretty sure you will receive all 25
how do i add dependencies into my project (apis)
are you using maven or gradle
maven
the api should give you a maven dependency just copy paste it into your pom xml
show it
<dependency>
<groupId>com.lkeehl</groupId>
<artifactId>tagapi</artifactId>
<version>1.2.3</version>
</dependency>
errors
red :(
idk thats why im here
synchronous instead of async is what you mean right?
we cant mind read lmao
how are you getting an error but dont know what the error is
the id version groupid is red
it just is not a depency of the project
show your full pom xml
have you relaod maven
`@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
Location playerLocation = player.getLocation();
// Check if the player is standing on a broken block
if (brokenBlocks.containsKey(playerLocation.getBlock().getLocation())) {
UUID breakerUUID = UUID.fromString(brokenBlocks.get(playerLocation.getBlock().getLocation()));
// Perform actions on detection, e.g., sending a message
Player breaker = Bukkit.getPlayer(breakerUUID);
if (breaker != null) {
Bukkit.broadcastMessage(player.getName() + " is standing on a block broken by " + breaker.getName());
lastHitMap.put(player.getUniqueId(), breaker.getUniqueId());
}
}
}`
I am trying to detect if a player go through an area that has been destroyed by another player
what bit isnt working
I converted it into UUID and it is not longer detecting the players going through the area
show your full code
public void onBlockBreak(BlockBreakEvent event) {
Player player = event.getPlayer();
Location blockLocation = event.getBlock().getLocation();
brokenBlocks.put(blockLocation, player.getName());
}
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
Location playerLocation = player.getLocation();
// Check if the player is standing on a broken block
if (brokenBlocks.containsKey(playerLocation.getBlock().getLocation())) {
UUID breakerUUID = UUID.fromString(brokenBlocks.get(playerLocation.getBlock().getLocation()));
// Perform actions on detection, e.g., sending a message
Player breaker = Bukkit.getPlayer(breakerUUID);
if (breaker != null) {
Bukkit.broadcastMessage(player.getName() + " is standing on a block broken by " + breaker.getName());
lastHitMap.put(player.getUniqueId(), breaker.getUniqueId());
}
}
}```
how can a player stand on something that isnt there
and you are using player name
and then trying to convert it to a uuid
yes
Ex.
My username is: Adelemphii
but my UUID is: 501b25af-98c7-4807-8f4f-7d257a75d55d
Yes
I decided that when the event triggers and that the replant should be done, it adds the location to a list of locations, then if that event is triggered again, it checks if the location is in the list and cancels the second event and returns if that is the case
so in short, I mutex the location
and I call a function to unlock it 2 ticks later
BRO
HOW DIFFICULT IT IS TO MAKE A CONSOLE APP WITH JAVA
WHY IT IS SO DIFFICUKT
ive been 2 days and i cant make the jar open a terminal
what
How do I add a value to a dummy scoreboard?(from the /scoreboard Command)
I am trying to make a plugin that works with a data pack I have and I am using a score board for the points

Hello, i want do a confirmation gui. How to do? When my player click on a button, Open the confirmation gui with callback ?
hey yall can someone tell me how i can decrease the minimum height for fall damage using spigot api?
u can probably? start setting their fall distance based off of ur own calculation @gritty cradle
like Player#setFallDistance or w/e iirc
Hello. I want to make the building system where constructions is made out of multiply blocks, and contains various variables such as material and durability.
For example, when player places certain block, there will appear new construction, and when any of its block damaged, durability of entire construction will decrease.
Also i need it so player can upgrade the construction and demolish it.
How can i make it, with taking into account that there will be many of constructions, and they needs to be saved even on server restart?
i can provide an youtube video with example
well I want it to make it so that the player gets fall damage regardless of how high they fall
like for example just falling from 1-2 block height will give fall damage
you would need to save them somewhere and either provide them or provide a constructiom creator
thats the point, where i can save them?
Whats a good website to find chars to use for font files in resource pakcs
thanks for response anyway
wherever you want. on the server as files f.e.
show your code lol
Lmao
List.add(...) returns true if the list was changed
instead get the list, add something, then set the list back
List<String> list = config.getStringList("Path");
list.add("new entry");
config.set("Path", list);
fast question - do you know something about obfuscation?
i'm using allatori, why?
one of my plugins lol
allatori can be deobfuscated though
everything can be deobcusfacted though
yeah, but some are very hard to
e.g ZKM costs 250$, no one has ever deobfuscated it yet
currently
im not looking for the standard way of obfuscation
im trying to come up with a new method
something about linking the code to a user's device
in which the code wouldnt run if its in another person's device or something like that
what do you mean, on the MAC adress or somethin?

string encryptoin is completely pointless
and then how do you want to sell this to hundreds of people?
by giving everyone a unique .jar or what lol
Yes
i can make a jar generating mechanism or something like that
still, im very lost currently
Again this convo 
it's useless
i just happened to have bought allatori anyway, so I use it, but it's literally pointless to invest any more time than just using whatever you already got
even thinking about your weird custom encryption is already a total waste of time you could better spend on adding some new features
the people in my commuity
are the most annoying humans ever
Then dont sell anything to them?
you ever had a dedicated group of 200+ people just trying to make a copy of your work and give it away for free
out of spite
they would bribe my customers to give them a version of it
💀
Your plugin must be the best plugin ever made
if you are going to deal with that group, your self made obfuscation or keylike checks are not going to stop them lol
it isnt a plugin
yeah it gives me such an ego boost
but still, this is reality
well its a mod
I doubt that you can think of any better obfuscation than the people at allatori or other available obfuscators
and its by far the biggest mod on the certain community im in
True
but the thing is
what allatori and the other obfuscators did
just obfuscated the code
is there no possible way of like
ughh nevermind thats impossible
you cant have code being ran without the client seeing it
damn it
Packet analysis as a Service?
I wouldn’t invest time into it
so in short, its meaningless to pursue obfuscation any further?
it doesn'T hurt to run allatori or similar on it if you have bought it already anyway
especially since you can tax deduct the cost of any available obfsucator
i dont have allatori but there are so many free deobfuscators for it
Plugins as a service is doable but it is just about as easily reverse-engineerable in java space
what even is that
try to run this through a deobfuscator and see if you can get any useful code, and see what it produces. 100% it won't be even close to the source code on github
aight
if you want code noone can see you shouldnt make minecraft addons
how can I set sound on skull with setNoteBlockSound?
anyone can give me an example code?
You need a block then check if block.getState() is instanceof Skull
If it is cast state to Skull
sounds use namespaced keys, e.g. minecraft:ambient.crimson_forest.mood
that'd be ```java
NamespacedKey.minecraft("ambient.crimson_forest.mood")
if you got sounds from a resourcepack, e.g. "mypack:some_sound" you'd do NamespacedKey.fromString("mypack:some_sound")
I just use /playsound and search through with tab completion
thanks again ;)
the name is usually the same as in the Sounds javadocs, except that for example ENTITY_ARMOR_STAND_HIT becomes e.g. entity.armor_stand.hit
got it :)
hello, if I have a player open an inventory when one is already open, will it call the closing vent?
Yes
ambient is the sound that the mob made normally right?
yeah randomly while living i think
In what situation could this produce null pointer exception?
Only if the UUID doesn't correspond to a valid player?
Bukkit.getPlayer returns null if the player isn't online
Oh, okay
the .isOnline method on Player is somewhat useless as it's inherited from OfflinePlayer
I misunderstood it, I thought it would return offlineplayers for any valid uuid
That's getOfflinePlayer
Ok cool ty
lol i thought i was the only one who are this lazy and does this 😄
Not verified? Upload screenshots here: https://prnt.sc/
have you built the project
Yeah so you're running your project instead of actually building it
why are the logs a jda bot
also are you using a build system? if not i recommend you use one (maven or gradle probably)
you have to try-catch that
I mean, only really required around the .sleep call
It's not recommended to throw exceptions within the try-catch block and it's not a good practice
What in the name of?
if it doesn't work the first time
do it the second time
wallah wtf
not sure what that is for, but it seems just like an easy way to skip the first element
This is JDA's javadoc bot parsing code.
Ohhh, that would make sense now.
They have some weird element in their docs that they use to mark something. They must be skipping that one specifically.
first setting, would be first element, the second one would move it to the next, and the loop would just advance it from there
yeah was about to say, maybe the first element is just always some garbage thing
this is a common thing especially from the web develpment side of stuff
you would commonly skip the first elements lol
Don't know why they didn't just use :nth-child() instead.
Pretty sure JSoup supports those kinds of selectors.
because that requires different method calls and would actually be slower
this is just one of those things where its a nice trick to skip the first one
its easy, doesn't hurt performance etc
Well my retrofitting hacks were working up till this point. :p
Guess I'm gonna have to rewrite this method since there is no weird elements in the spigot javadocs.
That and the structure is different between JDA & Spigot.
can someone explain why bukkit configuration api loads the file into deserialized string type
and then parses it through snakeyaml?
snakeyaml Yaml object allows you to read from input stream via Yaml.load()?
Probably because spigot was using a really old version of SnakeYAML for the longest time. They only recently updated it to something relatively newer.
i've noticed it too, they added comments 😄
@Override
public void onEnable() {
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
manager.addPacketListener(new PacketAdapter(this, PacketType.Play.Server.NAMED_ENTITY_SPAWN) {
@Override
public void onPacketSending(PacketEvent event) {
PacketContainer spawnEntity = manager.createPacket(PacketType.Play.Server.SPAWN_ENTITY);
WrapperPlayServerNamedEntitySpawn playerPacket = new WrapperPlayServerNamedEntitySpawn(event.getPacket());
WrapperPlayServerSpawnEntity spawnPacket = new WrapperPlayServerSpawnEntity(spawnEntity);
spawnPacket.setUuid(playerPacket.getPlayerId());
spawnPacket.setX(playerPacket.getX());
spawnPacket.setY(playerPacket.getY());
spawnPacket.setZ(playerPacket.getZ());
spawnPacket.setType(EntityType.SPIDER);
spawnPacket.setId(playerPacket.getEntityId());
event.setPacket(spawnEntity);
}
});
}
it gives me java.lang.NoClassDefFoundError: error
The packet wrappers aren't included in protocollib and you'd need to shade them
Fat jar
You need to use the maven shade plugin
Failed to create shaded artifact, project main artifact does not exist.
add to your pom.xml maven shade plugin and execute goal maven package
@near mason packetevents has wrappers built in
paste your pom.xml
mvn clean package should work fine
but why did you disable the dependency-reduced-pom?
also you gotta shade PacketWrapper
i think
Remove provided scope from com.comphenix.packetwrapper
I'd also update maven-compiler-plugin to 3.11.0 and maven-shade-plugin to 3.5.1
from what i know, yes
it is outdated so i recommend packetevents instead
or making your own wrappers
but thats meh
or just use NMS
okay so mojank are fuckin dicks and have 3 sounds to one namespace, how can i guarantee its always the 2nd sound
3 to 1? explain
you have to specify the same seed for the sounds
how to send image 💀
a sound that has 3 different sound files
maps
shitty to maintain
You would need a resource pack to do anything more fancy than noteblocks
i hate using nms
ClientboundSoundEntityPacket. the last field is a long, where e.g. 0 should always be the first defined sound, etc
packets
pain
actually all you gotta do is change the version in pom.xml and recompile
i know everyone loves having 10 modules
normally packets wouldnt be an issue except this plugin is for 1.18 upwards and has configurable sounds so i would need to have a field for it
so fun
you can only have one if you stop supporting outdated versions
Do we not have api for the sound index
but with a library you dont need to give up on older versions
is there even a protocollib version for 1.20?
also who cares about older versions
yes ofc lmao
why does the uk own this tiny part of land
Dev build
The Falklands Isles
thats for release
not builds
where is that from? on github the latest is also 1.19.4
CI
Using abstract classes and the "strategy" pattern, I'm trying to find a way to effectively manage textures that distract the player from teleporting in the game. These classes have similar logic, but in some ways they are different. I have created an abstract rtp class and an rtpManager class which contains all the classes that inherit the abstract rtp class. However, one of the rtp variants has its own unique check, and the manager does not know which class it is working with. I need advice on how to solve this efficient problem.
It's like asking why does the USA own Hawaii
took them over a month for 1.20 0o
and it's nowhere to be found "officially", the jenkins also says "latest is 1.19"
thats somewhat near them
i'd just use NMS, it's like one line
not down by brazil
The UK occupied 2/3 of the world at one point
that commit was for 1.20.1 not 1.20
british empire was great
build for 1.20 is cleared i think
can we get it back
it says "recommended versions 1.19.4" and you only find out that a 1.20 version is available if you manually go through the latest builds until you find the one that has "1.20.1 support" in its changelog
And USA has Alaska
so how does one find out that it supports 1.20? by going to the jenmkins page, then manually click on build 661, read it, go back, read build 660, go back, etc, until you find the build that mentions 1.20?
You could just download the latest one and try it
You could probably just Google 1.20.1 protcollib and Google will direct you there
why even bother to use protocollib
yeah but why would I even try to download something that mentions both on the jenkins page and on the spigot page that the recommended version does not support latest
this ^
seems like people have no issues finding it
i use packetevents because i can shade it
spend 30 more minutes and you have a decent library
idc about a megabyte bigger jar
a bit more lol
but you dont even need nms
you can do it purely with netty
this is just netty
i mean i dont say i use netty whatsoever
at the end a server is just a ping pong machine
finally 1.8.8 is being defeated
1.8 was defeated long ago on bStats
Meh
https://minestom.net/ looks ideal for minigames
Just use old PvP in new version
i wonder how much time it takes to develop a working stable server on it
most people doesnt gone through that much effort
minestom is not plugnplay
if there is one then most of the functionalites are missing
and exploit vary from one to another implementation
It's quite obvious that time is not with 1.8.8's side lol. but it's still the most famous version pre-1.19
and 1.13+ scaling is absolute horrible
most performant server still relies on 1.8 or even a heavily modified version of 1.7 (hypixel)
so whats the point of continue using it
budget gamers still play on 1.12-
Good for them
1.12 imo is the best non 1.8 version
the best non 1.8 version is 1.20.1
I personally dislike 1.8 pvp and 1.20 crystal pvp
You can just remove crystal PvP
what even is crystal pvp lol
1.8 pvp is legit just buying a good mouse and developing Arthritis
or a macro
End crystals do a lot of damage
Nah it's 1.19.4 because registry api hasn't been merged yet 
It's where you place down an obsidan block, and end crystal on top of it and then break it.
All within the span of .5 seconds.
1.20 crystal pvp is disgusting, simply put, you most definitely are obese or stinking, or a child molester if not all of the above if youre main goal in life is 1.20 crystal pvp
hypixel uses 1.7.2 and never left for a reason
1.7.10
because newer version is a bloat
Yeah
BIG bloat
And that reason is they have too many patches to update
It's impossible to fucking upgrade a monolithic system
No
They would have no trouble removing any bloat
They patched so fucking much upgrading is impossible
LMAO
they DONT
they just add support for it
💀 if thats what u wanna hear
imagine playing an 8 year old version that's missing all the new features
They have talked about moving skyblock to newer versions
they can add custom protocol
But only skyblock
I love when people point out hypixe like they wanna be on 1.7.2
Yeah
barely anyone plays anything other than skyblock except bedwars
you see, the entire minecraft server and client is just a ping pong machine
the server send a packet
so its basically 50% of the playerbase moving to 1.20
Yes that’s how multiplayer games work
💀
they add 1.20 support by explicitly disallowing older version
and add packets corresponding to 1.20 client
the reason hypixel didnt move completely to 1.20 isnt because they love 1.8 lmao
you cannot merge a huge codebase to a newer version without breaking the entire system
its because they have already built so much in 1.8
and its gonna take a long time to move to 1.20
they never use 1.8
idk why people praise velocity so much
hypixel IS 1.7
Im losing braincells
most major servers use bungeecord with not issues
Same thing, outdated, somehow famous software
wynncraft, hypixel
na bro not true
proof?
they have migrated over time to newer software
Can someone please provide proof as to where someone on the hypixel team said what version they are based on?
hypixel smp is a joke
maybe
instead of paying for rank just buy some cheap hosting
Hypizel smp iS funny
at least you wont have 100+ ping
I love it xD it makes 0 sense and that's why it sso good
there is proof in the paper disc iirc
agentk did bring it up at some point
here
Difference is you only need to pay once to use hypixel smp
this is the proof
this is from hypixel discord server
you can search it too
they would do the same thing to support 1.20
disallow older version
and stuff newer stuff in
well thats not what ive heard nor read
They day they do that is the day 1.8 finally dies.
look it up in hypixel discord
cecer used to be a hypixel admin
because they protocol hack
They updated to 1.8 long ago
their base is 1.7, they simply emulates 1.8 features
The misconception that Hypixel is built on 1.7.10 may have come from the fact that the server was originally released in 2013, when 1.7.10 was the latest version of mc
im p sure this message is not 8 yearsold
that doesnt mention at all which version they actually use
as i said
They must go through hell to support the newer versions if they are based off of 1.7.
look it up on hypixel official discord server
Not really
but who cares which version they run anyway? what difference does it make whether they use 1.7.4 or 1.8.8 or 1.12 or whatever lol
they can do everything at this point
armorstand and custom skull textures dont exist on 1.7
they still managed to add them in and use them frequently
on all minigames across the platform
As long as it's old it's an argument for 1.8 users and etc it's a bad thing if they ever update those versions will likely die
if you are a skywars veteran
you will remember once there is a specific NCP 1.7.x bug
that kills you for fall damage on slime blocks
they're a company
merging a 6 figure codebase to a completely different platform without knowing if it will blow up or not is not something a company would do
they never used any standard bukkit API
That part is false
keyword "standard"
Even if they heavily modify the server they do still use the api for some things
im sure as shit that there're 2 things they have ditched completely: entities and blocks
who know russ help pls
russ?
russian
ian
Hey i've question on Hypixel Server the custom heads are big how did they do it? the heads I put on my armorstands are small
thats just the armorstand head
try to put your character head near it
it will fit roughly
ArmorStands are dead.
Long live Display Entities.
What can I do?
If you use display entities, you can apply a transformation that scales the block to whatever size you need it to be.
If you use armorstands, you could try ArmorStand#setSmall()
public void onJoin(PlayerJoinEvent event) {
TextDisplay entity = (TextDisplay) player.getWorld().spawnEntity(player.getLocation(), EntityType.TEXT_DISPLAY);
entity.setCustomName("Hello, I am a text display!");
entity.setCustomNameVisible(true);
entity.addPassenger(player);
}```
why doesnt the entity apear / entity name apear above the player head?
Why are you mounting the player on your text display
Also use the spawn method that takes a consumer
And modify the text display there
Right now you're spawning the text display and then changing it's values
instead of setting the values and then spawning it
ok, but it still doesnt apear to be in the player
lets listen to rotation and moving packet and send entity moving packet too
i have never used packets
No need for packets
don't try it, i write my message for rofl
declaration: package: org.bukkit.entity, interface: TextDisplay
uj
Since it's a text display
what is that
Has an API been developed for configurable inventories that allow the addition of predefined actions to Inventory GUI elements through configuration?
999 apis
wdym
oh you mean spigot api
deluxemenus ?
No, something similar to what you showed me the other day
I know, don't worry, I was asking if they ever created something similar public lmao
then yeah
just google some
i'm sure there are lot's of apis for that exact purpose
ow do I make an ender dragon perch to a specific location?
I just created it actually but I don't like the system I used of Reflections, I think it's too heavy
heaviest class (in my opinion):
https://paste.md-5.net/lugacugode.java
How it works:
@LabAnnotations.Inventory(inventoryName = "example")
public class ExampleMenu extends CustomInventory {
public ExampleMenu(InventoryHandler inventoryHandler) {
super(inventoryHandler);
}
@LabAnnotations.ClickAction("example_action")
public void onExampleAction(InventoryClickEvent event) {
// Define what happens when the player clicks an item with the action "example_action"
event.getWhoClicked().sendMessage("You clicked an example item!");
}
}
Yeah there's no need for reflections
In my case I just have everything as a "menu element"
And those elements can have click handlers associated to them
There's also a main Menu#click where you pass the event and it gets whatever element was clicked on and runs the click tasks
Hmh, could you please suggest an alternative approach for linking an element to a task based on the configuration? Your input would be appreciated 🙂
Annotations seemed to me the easiest and most intuitive method (unfortunately heavy)
public void onJoin(PlayerJoinEvent event) {
TextDisplay text = (TextDisplay) player.getWorld().spawnEntity(player.getLocation(), EntityType.TEXT_DISPLAY);
text.setText("test\n2test\n3test\n4test");
text.setBillboard(Display.Billboard.CENTER);
}```
why doesnt the entity apear / entity name apear above the player head?
So "simply" you created an "Element" class that contains all the item stack values and the action value for an element, like this one:
@Data
@Builder
public class Element {
private Material material;
private String displayName;
private List<String> lore;
private String action;
// more stuff
private int amount;
private int customModelData;
And then on click you check what element was clicked and if it has an action?
Ideally element would be an interface
And instead of all of that crazy stuff you just pass an itemstack and a Consumer<InventoryClickEvent>, as well as any placeholders you'd want
The piece I am missing is this:
How do you formulate a Consumer<InventoryClickEvent> from an "action" value given in the config? I'd have an idea but I'd like to know yours as well
There's no specific action value in the config, I just link it to the "item name"
When reading the config each item is given a name
Which is the name of the section where the item is defined
So I make an element with that item and put it in a map
in ACF, how do i get the previous argument in command completions?
commandManager.commandCompletions.registerAsyncCompletion("culture-level") { context ->
val previousArgument = ???
val someValueBasedOnPreviousArgument = ...
return@registerAsyncCompletion someValueBasedOnPreviousArgument
}
So in addition to the char, you also use another String identifier
right?
Oh, WOW! That's great!
getContextValue(Class, Integer)
integer represents what?
Then you simply split any string in the List<String> by spaces, right?
To find elements
if your command has a signature CommandSender, String, String, String
then int 1 (or 0?) is the first string, 2( or 1?) is the next one, etc
ty, i'll test it now
but you can do it without spaces as long as the string is 9 characters long
and split it by each character
so I do have checks and support both
It's some icky code
but it works
I can't find org.bukkit.OfflinePlayer.getLastSeen() in the docs
what does it return?
paper method maybe
any examples?
because it doesnt exist
Thank you very much for your advices 😄
¯_(ツ)_/¯
imlusion gives free bukkit lessons fr
it was 1 for the 1st arg 🙂
OfflinePlayer offlinePlayer = getServer().getOfflinePlayer(username);
if (!offlinePlayer.hasPlayedBefore()) {
res.status(404);
return "Invalid";
}
res.type("application/json");
Map<String, Object> playerData = new HashMap<>();
playerData.put("username", offlinePlayer.getName());
playerData.put("last_seen", offlinePlayer.getLastSeen());
``` hmm im not importing any paper stuff here
I hope that's async
I wrote a minigame guide last afternoon
just because you dont import anything paper doesnt mean you dont use anything paper
well if you have paper-api in your pom or build.gradle, then you are importing paper stuff
hmm alright
you were literally explaining it for an hour in vc yesterday
Is there a way to run something as soon as server shuts down, but while all plugins are still enabled?
what are you trying to do?
why would you want this?
optic is at your doorstep
if whatever you decide to run, takes too long the server will force shutdown
I noticed some weird behaviour on restarts, if people are logged in while server shuts down, some plugin data isn't stored correctly. I want to forcefully kick everyone right before plugins start to disable themselves, so the data isn't corrupted
Just ask Carlos to insert the malware
?
maybe you should try to find the cause of that instead?
fbi, open up
sounds like a design problem
fr
I mean, I can't debug every plugin out there, it would be easier to handle it on my side
someone's not joining their futures onDisable
That's an issue in those plugins, tell the authors about it
but you kinda should, if some plugin is faulty you should find out which one is
the problem is more then likely instead of saving data when the server is stopping, they are saving data only at predefined times instead
optic is cool
Okay, if I ever figure out why, I will, but I have the problem right now and they will implement the fix who knows when
then replace the plugin
If I were to be reported such an issue I'd fix that within 1-2 days
if a plugin is faulty why use it?
you want a high quality server, not a hackishly built one, i reckon?
?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!
You? Maybe. Not you? Who knows. The issue isn't critical, I've seen some plugin authors not fixing critical issues for years
Are we talkin about some niche plugins?
I don't know yet which plugin causes the problem
find out
this is why I don't run plugins I don't control
So you know the data isn't stored and that causes issues but you don't know which data?
remove half of them, then if it didn't help, remove the other half, etc
^^ except for stuff like papi/protocollib/etc
I don't use any of that stuff
Oh come on
frostalf with his own WE and WG
even better haha
I have a variation of WE and WG
Okay, the question was "how to run something before plugins start to disable themselves" and the solution you propose is to "debug every plugin I use"
I don't care right now, I want to implement a quick fix
typically you do it in the onDisable() but as I said, you can't totally rely on it if it takes too long
but its strange you know data is missing, just don't know who owns that data
Even in the onDisable() his plugin is not guaranteed to be unloaded first
correct, they are unloaded in the order they are loaded usually
if all you need to do is kick players before shutdown, then why not make a plugin that does this then
it doesn't need to happen during the shutdown
That's exactly what I try to do
just kick all players, and set whitelist temporary
then you are free to shutdown
I typically have scripts that handle my shutdowns, but there isn't really a command you could do and get its output easily from script
so at minimum, just make a plugin that has a command to kick all players
and then you can run that command from script and then the shutdown
but as I said earlier your issue is one of the reasons I have all custom plugins. Very rarely do I run a plugin that isn't under my control
I mean you can always run a fork but remaking everything is definitly a long and tedious process
Is there any chance of Player.getLocation().getWorld() returning null? IntelliJ says it may produce NullPointerException but i'm guessing that would only happen if, for example, I were to do something like (new Location(null, 0, 0, 0)).getWorld(). Is this correct?
Yes, a players Location will always have a world
All IntelliJ does is listen to the @Nullable annotation
Awesome, thank you!
I don't run forks because its not like I will be able to pull changes from upstream without issues. Its far better to make your own because it will contain the features you need not stuff you don't need
as well as if there is any issues you can update it at will
not all plugins are open source either
There are some plugins that are huge lifesavers but there is also a lot of filth that needs a proper rewrite
There's no need to reinvent the wheel but you should always engineer your own solutions if the current ones available are below your standards
because I run custom plugins, its not like I have a million of them and usually end up having overall less plugins needing to be loaded
and they work together more seamlessly instead of some cobbled together system XD
while true, I don't use software or code outside of my control
I don't use anything where I have to wait for some outside entity to fix and then even if I could fix it, it creates issues when it comes time they decide to update
since the solution is a fork of those that are open source I may as well just make my own
an small armorstand will reduce my item ?
?paste
https://paste.md-5.net/isilohuzon.rb
guys why it keeping shows the waring
ur fine to ignore those warnings
only way to get value from mysql with java is sql codes ?
is there any other way?
i mean
you want to get sql out of mysql, without sql
correct
so i can do that
oh you want something like that for sql?
db.getvaule("money")
thats called an ORM
but mysql works only sql codes
google java ORM
i mean i create custom objects at mysql
its a type of library that makes working with SQL easier in object oriented languages
hibernate is widely used and ive seen people use ormlite
when i try building or installing i get this error
do you compile with utf8
yea the thing that things like this in 1.20 is doable in vanilla is mindboggling for me
java.util.ConcurrentModificationException: null
uhm i do
ur missing a bracket
on mysql for to get object name i do this String sql = "SELECT * FROM players WHERE name =" + name;
but on mongodb for to get object i do t his mongo.getValue("test")
( n t(() -> {}))
help
can u show console ?
[13:48:44] [Friends Pool Thread #186/ERROR]: Task BungeeTask(sched=net.md_5.bungee.scheduler.BungeeScheduler@5c92166b, id=9988, owner=net.multylands.friends.Friends@3725471, task=net.multylands.friends.events.JoinListener$$Lambda$1251/0x0000000801707438@53f7440e, delay=0, period=0, running=true) encountered an exception
java.util.ConcurrentModificationException: null
you either use iterator.remove() while iterating a loop
Sorry i dont understand what you mean
or you're running code in multiple threads which is not threadsafe
i was running an async task
you are missing a bracket
thats what you need
you have 1 missing
👀help
just add another bracket before the .start
.
i believe underlying implementation of snakeyaml that bukkit configuration api uses is not threadsafe
afaik
Not verified? Upload screenshots here: https://prnt.sc/
so just i cant use asnyc?
hey i was wondering if someone could help me with what this error is.
uh ok
im not sure if it would work but try wrapping plugin.saveConfigIntoData() inside
synchronized {}
``` block
hm
ill try to
but
i dont have many opportunities to test the code
is there anyone who can confirm that will work
?paste the method
btw today we received some sort of bot attack
maybe errors were printed when attack was ongoing
i would say dont touch the async part if you dont know what youre doing
and that caused some thread things
just the method
?jd-bcc
?jd-bc
ty
?jd-bc
saving config in async should be fine unless saving it from multiple threads
do you call save() method inside main thread?
I am implementing a plugin that wants to use the API of the EssentialsX plugin but not fail if EssentialsX is missing. At the moment I'm getting a NoClassDefFoundError because the Essentials class is not on the classpath. Are there examples of how this can be done gracefully?
or just in this runnable?
how can i check
add depend: Essentials to plugin.yml
do you call saveDataInConfig() outside of the runnable?
https://github.com/xxDark/SSVM whats the point of this again
^ will prevent yrou plugin loading if no Essentials
in the same event listener? no
yeah i use it in some command classes
private void activitySwitcher() {
(new Thread(() -> {
scheduler.scheduleWithFixedDelay(new Runnable() {
int previousIndex = 0;
@Override
public void run() {
Random random = new Random();
int index = 0;
while ((index = random.nextInt(activities.length - 1)) == previousIndex) {
System.out.println(index);
}
shardManager.setActivity(activities[index]);
previousIndex = index;
}
}, 0, 10, TimeUnit.SECONDS);
}.start()
);
}
jvm inside jvm
wtf
is it problem?
its probably can you try to execute the command and somehow invoke that listener
it should throw ConcurrentModification exception
probably
and if it does then what
you know where's the problem
the runnable that you're calling is on the separate thread from the main thread, and if you're using the same configuration object inside the main thread and the separate thread you need to synchronize the method you need do synchronization
try adding the synchronized keyword on saveConfigIntoData()
uhhh
public void synchronized saveConfigIntoData()
it worked for me
that way if you calling this method from separate thread, another thread will wait till it executes
i think context is lacking
can i just remove async from the code? i dont think saving config will impact that much server's performance
maybe you missed a bracket before or after this function
oh i did miss one ```java
private void activitySwitcher() {
(new Thread(() -> {
scheduler.scheduleWithFixedDelay(new Runnable() {
int previousIndex = 0;
@Override
public void run() {
Random random = new Random();
int index = 0;
while ((index = random.nextInt(activities.length - 1)) == previousIndex) {
System.out.println(index);
}
shardManager.setActivity(activities[index]);
previousIndex = index;
}
}, 0, 10, TimeUnit.SECONDS);
}.start()
));
}
you can, but if you have hard drive with big latency or you're saving lots of data, it could take a hit
usually hard drives are kinda slow to save data
so you can have some spikes
but it depends actually
new error while installing https://paste.md-5.net/qufuvadepe.sql
ok.
from runnable
yes
ok thanks
try it and see if that solves it
will try it tomorrow. cant restart rn
im not really good at multihreading stuff but im quite sure i know what's going on but without much of a code i cant do much so
if error persists you can contact me
tomorrow
but its really not safe to keep this running
on the server
im not really sure i understanded correctly. when does error happen exactly? like when player trys to join & some other player tries to execute command at the same time?
trust me, you can ruin your data
that's my guess
since you save config from main thread by executing the command and when joining from the separate thread
data race happens and boom, concurrent modification exception
thats something ur end then
because two threads try to modify something they couldnt do at the same time
yes but error was literally spamming like 2 in a second. i dont think someone was using the command too much
why are you even creating a thread just to do stuff in a runnable in the first palce
place
Show your code
true
?scheduling
Why are you creating a runnable in a thread lol
idk, but its multithreading issue, that should be solved ASAP. its critical and can lead to corruption of your data that you're saving instantly.
good to know
thanks for trying to help ❤️
i suggest saving things on the database tbh
that way multiple platforms can access your data (web forums can read your game data, etc)
?learnjava! moment
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. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
I want to create a listener in response to an event, then handle said event
so for example a player hits another player
that triggers an onDamage event, then the main listener creates more listeners to apply the effects
I want to somehow run the onDamage handler for the secondary listeners
how can I do that?
Sounds like you want one listener that does a couple of method calls
well yeah, but I don't want to write an interface
as the result would look very similar to the Listener interface that already exists
you 100% do not want to dynamically register new listerns during the runtime
makes sense
the server has to rebake the entire handlerlist when you register a listener which, doing that every time a onDamage happens is pretty not smart
i see
so how can I call the onDamage event of this secondary listener
for context im trying to implement custom enchantments
and on a damage event, ill parse out the item lore of the sword
have an interface or an abstract class with a handle method that takes the event as aparam
bungeecord question: is there any way to get the player's uuid in PreLoginEvent? according to the docs, This will NOT contain many attributes relating to the player which are filled in after authentication with Mojang's servers. Examples of attributes which are not available include their UUID.. or can I use another event, that has the player's uuid, to prevent the player from joining?
then instantiate the corresponding custom enchantments and run their onDamage events
but ofc it doesn't have to be ondamage
i see, that makes sense, thank you!
LoginEvent?
How can you prevent them from joining if you don't know who they are. There is Login Event but not sure if it's cancelable, try and see, if it's not you might just want to kick player
Login Event is cancellable
Cool then, just cancel it
are you sure that it's just cancelling? for example, in bukkit for AsyncPlayerPreLoginEvent you can do Event#disallow
and also there does not seem to be an uuid in LoginEvent
I have a question about hypixel the box is a customHead on an armorstand?
I made a custom head on an armorstand and it is smaller than the hypixel custom head why?
that was my initial thought too, but there's also PendingConnection in PreLoginEvent, which does not supply an UUID, which means that PendingConnection's UUID is something else
am i wrong?
i just started with bungee lol
The connection uuid can be empty
Small armor stand?
You can get the UUID from the connection in Bungee LoginEvent.
You register an intent in the LoginEvent, get all your processing doen, including db access, then set the cancel state and reason (if banned) then completeIntent
I stucked when I was running BuildTools (#160) I want to get JAR file for 1.8.8 Spigot, I used jdk1.8.0_271. Everything is ok at first, it extracts, decompiles but when it is starting to patch, I'm getting this error. I tried to handle that but i can't find a solution about that. I want to solve it. These are outputs
Git version which i used: 2.41.0
an intent?
Applying CraftBukkit Patches
Patching BiomeTheEndDecorator.java
Patching Block.java
Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:676)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.spigotmc.builder.Builder.main(Builder.java:627)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content doesn't match the target
at difflib.Chunk.verify(Chunk.java:86)
at difflib.ChangeDelta.verify(ChangeDelta.java:78)
at difflib.ChangeDelta.applyTo(ChangeDelta.java:44)
at difflib.Patch.applyTo(Patch.java:43)
at difflib.DiffUtils.patch(DiffUtils.java:70)
at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:664)
... 13 more
it's the same as a normal armorstand
it forces the LoginEvent to wait (async) until you completeIntent
so in between registration and completion i can get the uuid from pendingconnection?
if you don't need to do any db access you don;t need to register an intent
i do
intent is to make it wait
alright, cool
then register an intent and pass the event off to whatever code you need to run
Is there a way to force trigger a PlayerItemConsumeEvent to make them eat an item instantly?
I'm trying to do this without NMS and without making a giant map of materialtypes and hunger restore.
I tried new PlayerItemConsumeEvent(player, itemstack, EquipmentSlot.HAND)
and it doesn't seem to do anything.
event.registerIntent(plugin)
// :snip:
event.completeIntent(plugin)
correct?
The Event will not continue until all intents are completed
ok maybe i'm a bit confused, how exactly do i execute my code after registering an intent then?
you can do it in the event, or pass the event off to a future
so would this code be valid?
its a bug someone else had and most likely wont be fixed
alright then, thx! i'll wrap it into a future
its already async so you probably don;t need to use a future
it doesnt happen when do it for 1.13
yeah, its a bug for 1.8
how that can be unsolveable
is there a way to run something every tick?
im making a plugin for my server and it says the class "Rank" does not exist when it does:
?scheduling
1.8 is 8 years old and md has no reason to fix it
then why does bug caused
we should scream a choco for it not working with scheduler
because when i used wsl it worked for once
ye ik
Try using the latest Java 8. 271 is outdated.
can someone reply
Yea, I'm saying use Java 8, Update 381, not Java 8, Update 271.
i tried latest on ubuntu and another
from openjdk
but wait ill take a look again
java 8 202 worked for me a while ago
im making a plugin for my server and it says the class "Rank" does not exist when it does:
maybe git version caused this?
2.37.0.windows.1
ok
ive got 2.41.0
im not thinking caused bc of that
but it worked on wsl for once
that means
have you even shared the error
You just did?
config.set("key", new MyRankClass());
.
i got git from original website
?paste
?picture
?img
Not verified? Upload screenshots here: https://prnt.sc/