#development
1 messages · Page 57 of 1
btw I have no package with the same name 👀
Yes you do
No.
bro i know better my plugins then you do
why would i put a package named fr.idaamo.ranks in a plugin that doesn't have the function of changing ranks
no i never put a plugin with the same package name of another one
Then tell us why you had that issue
mf gaslighting
Yeah
Idk
Lol
why is reading this painful
lol
hi, my math is really bad and I never worked with entity movement so I have this custom plugin for soccer in minecraft and I wanna make goal explosions like the ones in rocket league using falling blocks. So the main problem is velocity vector and I want it to have curvature like this https://prnt.sc/PIQsPTYVkRfN
can someone help xd
what would be the best way to schedule a sync repeating task on my onEnable method to run every 15m to do the following:
Generate a random number 1-3 every time the task is ran
Access that number through a different class
Based on what that number is, a boolean is = true whereas the other 2 are still false
Send a countdown warning in chat (10m till... 5m till... 1m till...)
have the in game event last for 5m and then end
and then rinse and repeat every 15m
Essentially: Every 15m there will be a random 5m event that will happen in game
I would just like to know the best way to approach this would be 😄
Just describe it directly without abstracting it to the moon we won't steal it
I didn't understand anything
So sorry for the lack of clarity!
Essentially I want the following to happen
There will be 3 differnent in game events (2x harvest, 5x harvest, 2x sell)
I want a random one of these 3 in game events to occur once every 15 minutes for 5 minutes.
What would be the best way to approach this? I already have everything setup for the individual in game events, I just don't know how to set it up so that a random one of these 3 occur once every 15m for 5m
Is there a way to remove NBT tags from an CompoundTag? If so, any chance anyone has the method name before obfuscation and the names after?
Looks like there's remove(string) https://mappings.cephx.dev/1.20.1/net/minecraft/nbt/CompoundTag.html
Yeah. Was looking at that as well (just for 1.17.1) https://nms.screamingsandals.org/1.17.1/net/minecraft/nbt/CompoundTag.html
Thanks Gaby
Im not sure what to say about the obfuscated name xD, maybe you have better luck https://mappings.cephx.dev/history/4dc75c837e.html (cool af feature)
It seems to be r on every single version starting with 1.17
in 1.14 it is r then in 1.15 is s, then in 1.16.1 is r again, idk
Yeah that's fine though. I only need it starting with 1.17
Yeah.
Probably like you described, scheduler every 15 mins, random 1-3 and start the event
Would anyone bychance know the best method for mass modifying a large amount of blocks at once
Block#setType is so heavy and spigot doesnt allow async
even if it involves using nms to skrt past spigot
I would take a look into FAWE
im trying but i have not a diddily clue how they do it
They modify blocks without triggering block updates
Hm, lemme look
however, tbh, at this point I would just install FAWE and utilize it's API
since honestly this is just too much to tackle by yourself
id rather see if i can get it done without requiring a third party dependency first
I wouldn't count on it
Yeah no
I have a question about apis
i wanna make a website that has a login when the player logs in the website their minecraft inventory shows up on the website
issue is in the database i encryt the items so how wuold i do it
do i have to do it like hypixel where each player needss a api key and when you search this api key up a bunch of items come up and i need to filter and stuff
Why are the items encrypted?
I mean just load it again then
public String encodeItems(ItemStack[] items) {
return itemStackArrayToBase64(items);
}
public ItemStack[] decodeItems(String data) throws Exception {
return itemStackArrayFromBase64(data);
}
public static String itemStackArrayToBase64(ItemStack[] items) throws IllegalStateException {
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);
dataOutput.writeInt(items.length);
for(int i = 0; i < items.length; ++i) {
dataOutput.writeObject(items[i]);
}
dataOutput.close();
return Base64Coder.encodeLines(outputStream.toByteArray());
} catch (Exception var4) {
throw new IllegalStateException("Unable to save item stacks.", var4);
}
}
public static ItemStack[] itemStackArrayFromBase64(String data) throws IOException {
try {
ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(data));
BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
ItemStack[] items = new ItemStack[dataInput.readInt()];
for(int i = 0; i < items.length; ++i) {
items[i] = (ItemStack)dataInput.readObject();
}
dataInput.close();
return items;
} catch (ClassNotFoundException var5) {
throw new IOException("Unable to decode class type.", var5);
}
}```
yeah but this is in a website
i dont have accese to bukkit api
yeah
then the itemstack array from base 64 function should work fine
okay wait
so im devloping a website
when its time to load in the items
how can i do that
without using BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
and ItemStacks
or i might not be the brighest
because all i have accces in the website is the encrypted base 64
but what i really wanna know that could make this work is in the onEnable from my plugin can i host a website and change things from inside the plugin and interact with the website
yes
might be of use
from what i can tell, the heavy part isnt really the modifying of blocks themselves, its the block updates, lighting updates and packet sending
if you dont care about block updates and lighting updates being vanilla accurate, then you can just not do block updates, manually set the light values of each block and then send the chunk/section updates manually to the players
when working on my prison core i had to do exactly that to make the server not die on reset
https://github.com/lunaiskey/LunixPrisons/blob/master/src/main/java/io/github/lunaiskey/lunixprison/util/nms/NMSBlockChange.java might be of some help
thank u
needs cleanup and some more testing but should get something mostly functional
its still so silly how intense Block#setType is
and the fact it cant be async is even sillier (without nms)
block changes shouldnt be async afaik
tho ive seen something on doing stuff throughout the entire tick, what doesnt get done gets paused for the next tick until its complete
tho i cant remember the source on that
I remember one person in this server had a really optimized system for it and put it in #showcase
not a fuckin clue who though
when it comes to prison mines ive given up trying to allow for tons of block changes, now im working on a packet based mine implementation of not actually modifying blocks, and to just have 1 area loaded at all times for all players since mines for the most part are the same for everyone
its not in a functional state yet so im not gunna show anything about it but hopefully thatll address a couple of the resource issues standard mines can have
@Override
public void onEnable() {
try {
webServer = new WebServer(8888); // Set the desired port here
webServer.start();
System.out.println("TESTING SERVER IS UP");
} catch (Exception e) {
e.printStackTrace();
}
}```
when i go to my local host8888
it gives me the error 404 not found
Well, Id guess because you havent defined any routes to accept and send response to
We cant magically know what library you're using
Have you tried asking fawe discord help? Probably fawe devs can explain best how does it work?
try BlockState#update but dont update physics
or only update physics on outside
and drag it out over some ticks
¯_(ツ)_/¯ (worked very well for me)
or FAWE, but that requires plugin dependency
I love how this seems to be written by ChatGPT
fr
does anyone know what the friction option controls in custom knockback configs? (plz ping if you answer)
in laymans terms
anyone know why I can't add dependency for PlaceholderAPI
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.3</version>
<scope>provided</scope>
</dependency>
my repository
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
what does it complain about?
I can't do import me.clip.placeholderapi.PlaceholderAPI; in my code
oof I can't send picture
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload or similar service to upload images/screenshots.
when you added the dependency to your pom.xml, did you click the little maven button to reload the depenencies?
I reload maven using this: https://imgur.com/a/4TXyFY1 option when I do that dependency no longer in red color anymore
so you fixed it?
I already reload it when ask about dependency question 😅
i see, try using 2.11.1, i know that one works or atleast it does for me
If using old version can I still using it in newest PlaceholderAPI plugin version ?
yeah afaik
could you post your full pom.xml to paste.helpch.at?
then post the link here
could just be a formatting issues in the pom
oh wait
nvm
by some magic way
When I turn off intellij and re-open it and dependency working now
weird
might not have reloaded correctly or didnt reload at all
atleast its working now
thats what matters
yes that all I need 😅 lucky you asking for pom.xml I planning to turn off intellij and go play game instead
idk what unit but prob the friction between player and ground
ex 0.0 = ice-like?
wait
im dumb
thats knockback
ice knockback :)))
maybe air resistance? 🥴
no idea
thats all handled clientside
slipperiness and air resistance
idk, maybe it means like momentum? where if you're moving in one direction, it reduces the velocity or something
hmm
have you tested with like extreme values?
like 0 and 100
🥲
thats the best plan tbh
but i didnt feel like restarting the server
ill test it later tonight
see what breaks when i have 100 friction xD
wasn't there a builtin method in java utils or whatever to like, check if an object is null/0, if it is, return the provided text, otherwise return the value?
Wot
Objects.requireNonNullElse()?
Maybe you want an optional of nullable and use their functions
Idk maybe
wot
What could be the reason for span transition underline to just stop working occasionally? (i use tailwind btw)
This is the code of my blade component (laravel project) ^
<x-nav-link
class="flex items-center"
:href="route('zinas.index')"
:active="request()->routeIs('zinas.index')"
:color="__('blue')"
:underline="true">
<p class="ml-1.5">{{ __('Ziņas') }}</p>
</x-nav-link>
^ This is how I call it
It works when it wants to, idk how to explain it
Does anyone have experience with paypal webhooks? I got a project that worked just fine until a few days ago, and now I don't get any events and they don't show up in the event logs either.
I just realised there is JavaPlugin#getDatabase, is it something new?
not really
d;JavaPlugin#getDatabase
public JavaPlugin()```
d;paper JavaPlugin#getDatabase
public JavaPlugin()```
???
?????
I can't send ss lol
Is this a fork
Besides spigot and paper
Or custom JavaPlugin
I'm using org.spigotmc:spigot-api:1.8-R0.1-SNAPSHOT (I hate developing 1.8 plugins but this is my customer's server version)
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
electroniccat[no-ping] — Today at 7:53 PM
Because it relied on a stupidly old version of ebeans nobody was using
^^ that's why it exists
There seems to be some invalid syntax in your config! You can paste it into https://yaml.helpch.at/ in order to find out where your issue is!
d;1.8.8 javaplugin#getdatabase
com.avaje.ebean.EbeanServer getDatabase()```
Gets the EbeanServer tied to this plugin. This will only be available if enabled in the PluginDescriptionFile.isDatabaseEnabled()
For more information on the use of Avaje Ebeans ORM, see Avaje Ebeans Documentation
For an example using Ebeans ORM, see Bukkit's Homebukkit Plugin
ebean server instance or null if not enabled
@fading stag ty Mr afonso
oh this is not something new this is something old
yeah, got removed in 1.9
it could be a cool feature maybe
Spigot barely removes stuff for backwards compat so if they remove something it's probably for a good reason
no one used it lmao
🥲
like, no one
I mean not Ebeans (I've never heard it before) but maybe something like HikariCP
don't think it's a good idea
I mean, maybe implementing it already in jar, so that we can access it through the api? maybe, but directly in spigot, def. not
don't like the sound of that
lmao
its on orm iirc
Well the version that has it is old asf and he asked if it was a new thing
You should be more specific though
nice one
Anyone use Lands (Angeschossen) updated API?
His wiki doesn't really go into detail and it uses deprecated methods. Also doesn't tell how to use the new methods.
His wiki doesn't really go into detail and it uses deprecated methods. Also doesn't tell how to use the new methods.
Anyways I think I already figured it out. Gotta wait for the user to test it.
i read it once a year ago and i think it worked correctly, anyways ¯_(ツ)_/¯
Yeah user had their console spammed because the methods output to console to not use them.
If anybody could help me with this I’d really appreciate it!
Im making a discord bot that uses a GUI to display the homes, but if i open the gui multiple times the things get executed multiple times.
I have 2 modes creation and deletion (and normal mode) whichz you can temporarily see in the chat. But sometimes they glitch and switch to a mode 2 times, how to fix that.
I cannot paste links, how to paste links to code and a video
https://pastebin.com/RNNLsv0Y
video is streamable com link
ryx6zf
well it's the plugin itself, i just added the plugin into the project
I had no problems when i started using it, but now i don't understand what's the problem
The menu is named literally "menu" in the files and i tried to rename the .yml to 'mainMenu' and i renamed it in the config.yml too and still doesn't work :D|
And if this is not weird enough, when i try #getAllMenus() it returns null (i have 21 menus loaded on my server)
why do you want to use dm?
Will PlaceholderAPI ever add Kyori/Adventure support?
Kyori/Adventure library supports hover event, click event, hex colors, etc... for chat messages, titles, etc, and can simply be casted to normal string. I think supporting Kyori/Adventure makes PlaceholderAPI's capability much stronger
Probably, although I'm not exactly sure how. Atm if you need that, you can serialize the components with MM before returning them.
Previously I was using;```java
LandsIntegration integration = new LandsIntegration(MinionMain.getInstance());
if(integration.isClaimed(location))
return integration.getAreaByLoc(location).canSetting(player.getUniqueId(), RoleSetting.BLOCK_BREAK);
Now I am attempting to use;```java
public static boolean canUserBuild(Player player, Location location) {
LandsIntegration api = instance().getAPI();
LandWorld world = api.getWorld(location.getWorld());
if(world == null)
return true;
return world.hasRoleFlag(player.getUniqueId(), location, RoleFlag.of(api, FlagTarget.PLAYER, RoleFlagCategory.ACTION, "BLOCK_BREAK"));
}
```The user I have testing this got an error.
`java.lang.IllegalStateException: Flags need to be registered in onLoad of your plugin before Lands is fully enabled.`
I know what the error is saying... I just want to check if lands won't allow the player to do something. Don't want or need to register anything if the lands plugin already has the methods to check.
How can I have a command on a bungeecord plugin which then will use message channeling to send a message to a papermc plugin to open a gui?
there are multiple questions here:
- how to have a command on bungeecord
- how to send a plugin message from bungee
- how to listen for a plugin message on the server
- how to open a gui from the server
which ones do you know how to do and which ones do you not know how to do?
I just need an example of how I can send a plugin message from bungeecord then listen to it on the papermc plugin and then an example of how I can execute things if thats possible as I don't know how to do that. thank you
why is hasSymbol false? https://img.srnyx.com/javaw_BDFQI3mIpw.png
final boolean hasSymbol = message.startsWith(symbol);
Bukkit.broadcastMessage("message: \"" + message + '"');
Bukkit.broadcastMessage("symbol: \"" + symbol + '"');
Bukkit.broadcastMessage("hasSymbol: " + hasSymbol);
ok figured it out, ChatColor.WHITE is before the ! in the symbol variable
dare I say legacy colour moment
is there any plugin to show / hide chat?
ew bukkit components
is it possible to create a placeholder on a bungeecord plugin so it can be used on all servers or isn't that possible?
Hello, I have a problem, the block placed is not resetted after the player disconnected, someone asked me if the chunk was loaded, I answered no, bc there's no one, i think that may be the problem, can someone help me?
@EventHandler
public void onPlace(BlockPlaceEvent e){
if(e.getBlockPlaced().getLocation().getY() >= 50){
e.setCancelled(true);
}else {
if (isPlaying.get(e.getPlayer())) {
int slot = e.getPlayer().getInventory().getHeldItemSlot();
e.getPlayer().getInventory().setItem(slot, new ItemStack(e.getBlockPlaced().getType(), 64));
main.getServer().getScheduler().runTaskLater(main, () -> e.getBlockPlaced().setType(Material.AIR), 600);
}
}
}
what????
- wrong channel
- why did u reply to my msg that had nothing to do with that
- its called minecraft client-side chat settings
u replied to mine
and i dont want the settings i want like a plugin
i replied to brister not u 💀 u werent even in the chat before
and still wrong channel
look closely who u replied
my eyes are clearly working https://cdn.venox.network/Discord_dYLVTz1GHv.png
💀
the boxes made it 10x funnier
thank you 
idk tbh i see Emmma's name in the screenshot
so maybe i did reply to her????
L
Checking up on you fr
nahh
they're so sweet ❤️
So kind
Has anyone ever had an issue where tailwind hover thing is not working?
(i am using laravel btw)
nahhhh
bro
how tf
well, haven't used laravel + tailwind enough to say, but what's the context?

.
basically i have 2 buttons with identical style (except bg color). ones hover is working but other buttons hover is not...
well
it has to know the color beforehand, what to revert to, as far as I know
or maybe you're concattinating string for the style?
yes
yeah, that's not gonna work
but when i press f12 on the site it has color set correctly
ex. will not work:
const whiteColor = "#FFFFFF"; and className={`bg-[${whiteColor}]`}
will work
const whiteColor = "bg-[#FFFFFF]"; and className={whiteColor}
well the hover is working for one button
the same code is not working for the other button... 
You’re blind
Omg fisher I can’t believe u
hello, i saw that you can change the font, but i don't remember placeholder, would anyone have it please?
this is development
#placeholder-api message
https://paste.helpch.at/cuzumawale.csharp 😦 it doesnt load propperly even tho the console output of the array is correct on load up
the GUI works for if you dont restart
but its wonky when u restart and then try to open the gui it just doesnt work
https://paste.helpch.at/iwatipiyof.java
The issue lies on the following lines:
sellPrice = worth.getPrice(quantity, itemInHand);
Yes I understand that the getPrice() requires an instance of IEssentials, but how can I get and retrieve that? I am unfamilair with what IEssentials is, I thought everything was managed under Essentials?
dont cast it to worth use the getWorth method https://jd-v2.essentialsx.net/com/earth2me/essentials/iessentials#getWorth()
You are trying to cast a Plugin to Worth which won't work ever because Worth doesn't implement Plugin
Instead, cast the Plugin to IEssentials ,which will give you access to that getWorth method
is it still the same for 1.20 for pluginmessagereceived for plugin messaging stuff
Relevant Code: https://paste.helpch.at/yalokativu.java
Issue: Players don't get the broadcasted message (There is a message in the config that's not an issue) and there are no errors in console. Any reason why my code is not getting executed?
imma be honest but this code is kinda cursed lol
but what's the goal of this? also maybe try printing out your conditional statements to see what they print out
static access for a random number, weird case switch to with if, taskIdHolder single length array, atomic access
wtf
You are honestly much better using the Java timer class or scheduledexecutor
i usually try to avoid the bukkit schedulers and runnables these days cuz they suck
and i think the scheduler is just an executor behind the scenes lol
The else if statements are fun
- you probably could just use an int for the task id, don't need an int[] if its only 1 long
- you could probably use a map<int, string> and store the random number to event name, and get rid of a lot of duplicate code
.replace("%event%", eventMap.get(randomNumber)
-
could even just concatenate the remaining minutes with the
event-warning-string, and then do a null check in case nothing exists in the config (for example at 11 minutes). but this has the effect of allowing the user to add more warnings -
use some print statements to debug why your code isn't ever entering the conditionals like pulse said
ok, sorry
Thank you for the input.
The goal of this is to do the following:
- generate a random numb 1-3, depending on what that numb is an event will be queued up
- broadcast a message to players notifying them of the event
- execute the event depending on the numb in my EventsListener class
I asked previously for help for how I would want to execute my plan earlier and didn’t get much help so this is just a very rough first draft
Really? If you don’t mind me asking why do you say that?
Why would that be?
because i made a custom plugin which generate automatically events every week and i use deluxemenu to update a specific item with details about the next event (e.g prizes, levels, etc..)
Then make the player run the open cmd
the scheduler is just an executor behind the scenes lol
You are better off using the real deal than the scheduler
also the java executor gives you more flexibility
honestly it's not a big deal, but for me i usually try to avoid them unless i have to run something sync (like placing blocks) or if something relies on server ticks
So here is what I think you should do instead. This will be much more modular.
- Create a parent class called
Event. Make all your separate events extend this class and implement all the functions. If needed, you can make an interface too for the methods. - In your
Eventclass, add a method like broadcastMessage(); Then in all of your sub-classes (or individual events), override the method and broadcast the message to players. Similarly, create an execute(); method and override in sub-classes as necessary. - For picking a random event, make an
Event[]with all the events and just pick a random one from the array.
That way, you get rid of the reliance of an integer for each event and you actually use classes the way they are intended to be used
It's also much easier to debug since your code is in separate files rather than all in a single block.
Hey!
So, I have a core plugin that contains some utilities and stuff like that, I'm using the core in all others plugins as a runtime dependency.
The core plugin has a class called "BungeeCorePlugin" which extends the Plugin one (necessary to work as a plugin in bungeecord) and this class is used in the others plugins aswell.
Here's how others plugins use the BungeeCorePlugin class:
public class MainClass extends BungeeCorePlugin {
// plugin code
}
It should works well but I'm receiving the error "java.lang.NoClassDefFoundError: core/BungeeCorePlugin" and the plugin isn't loading. Is there any way to fix that?
What I've already tried:
Adding the core plugin as a dependency in the plugin.yml.
Trying to change the plugins load order on the bungeecord config file:
plugins:
- core
- others plugins here
Changing the plugin name to try to load the plugins in an alphabetical order:
This worked in my localhost but not on the host... My localhost uses the original bungeecord jar and the host uses waterfall.
I thought about adding the plugins into the core folder (only the plugins that uses the core) to load them after the core one is loaded, is it possible?
What
cool story
wow I love this idea! Thank you so much! Going to change everything rn!
Can someone rate my code? https://github.com/RazerStorm/PrizePulse
I'd start with excluding .idea folder :))
Using gitignore
Can't really look much since I'm on phone tho
Then dont reply???
no, thanks
yes 🙂
alr ty
Well hes using gradle, thats already a good sign
Well lombok + static abuse, but if it works it works
i tried to change to InventoryOpenEvent, but when i use Menu.getMenu(Player) is still return null
Not the right channel for that
Consider using an actual command framework like brigad, cloud or ACF
hell nha
static abuse and lombok are illegal
whats the point of a common package when theres only one module or whatever?
and ur command classes should use camel case aka ClaimCmd instead of ClaimCMD
So I'm trying to display heads using Deluxe Menus and placeholder api, and i did it like
head-%myplugin_playername%
but in the event of a player-head owner not existing on fetch i wanted it to have it just display air.
i tried to do this by moving the head- into my placeholder so it looks like
return "head-"+ playerName; but that wouldn't even let me load the menu.
so it would just be like myplugin_playerhead
is there a obvious thing im missing like some built in feature or should i try encoding the heads differently like with base64?
thought that was for having issues operating a plugin
ok if you are asking for support with a custom plugin, that might not be possible since the type of the material is parsed at load time, if the material starts with head- it will be threated different than an item with a normal material name (e.g. STONE)
I would suggest to have a fallback head if that fits your use case
np
Eh with abbreviations I can see it both ways
I am trying to add placeholder api to my tablist plugin but the placeholders aren't working, I followed the github steps to add it. Also when I uncomment the setPlaceholders line it breaks the entire plugin.
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
String headerText = ChatColor.of("#0471FB") + "" + ChatColor.BOLD + "Welcome to the server!\n" +
ChatColor.of("#D5D8D9") + "-------------------------------------------------\n" +
ChatColor.of("#0471FB") + "There are currently" + ChatColor.of("#D5D8D9") + " %player_name% " + ChatColor.of("#0471FB") + "players online!";
String footerText = ChatColor.of("#0471FB") + "MCMMO Mining Lvl:" + "%mccmo-mining-level%"
"server store";
//headerText = PlaceholderAPI.setPlaceholders(event.getPlayer(), headerText);
String joinText = "%player_name% &ajoined the server! They are rank &f%vault_rank%";
// Example: Set the player's tablist header and footer
event.getPlayer().setPlayerListHeaderFooter(headerText, joinText);
/*
* We parse the placeholders using "setPlaceholders"
* This would turn %vault_rank% into the name of the Group, that the
* joining player has.
*/
joinText = PlaceholderAPI.setPlaceholders(event.getPlayer(), joinText);
event.setJoinMessage(joinText);
}
Mainly the players online isn't working, I did the download command in game for player placeholders.
what does it say when you uncomment the placeholderapi bits?
am i able to send pastebins here
yes
tho paste.helpch.at does exist aswell
this shouts that you didnt put placeholderapi as either a depend or softdepend of your plugin
name: FigsTabList
version: '${project.version}'
main: figstablist.figstablist.FigsTabList
api-version: '1.20'
authors: [LitNotFig]
description: E
softdepend: [PlaceholderAPI]
Isn't that right?
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
and this?
looks right
Is there anything else you need?
is it supposed to do that
yes
Hey
If I save a file in Java and I have a few line of code after that, is that executed when the file is saved so the task is done?
Or are the few lines of code executed right after when the file isn't even saved?
For example:
cfg_playerdata.set("Kingdom", Kingdom.instance.kGetConfig().NoKingdom_Name);
try {
cfg_playerdata.save(playerdata);
} catch (IOException e) {
e.printStackTrace();
}
player.sendMessage("MESSAGE)"
Is the player.sendMessage.. send when the first lines above it are succesfully done?
Sorry if its a little bit weird what I am asking, but I don't know how to say/ask it properly..
It will wait until the previous code is complete.
👍
Just got this email from curseforge after uploading a freshly compiled plugin jar:
The status of the file SMPtweaks-1.0.23.jar has been changed to Rejected
Notes:
Your file SMPtweaks-1.0.23.jar has failed processing, this could be caused due to obfuscated code or corrupt files. Please check Class HikariPool.class to find the issue and try to upload the file again
I never had issues submitting a plugin using HikariCP in the past. What am I supposed to do now?
Contact curseforge. Ask what you need to do.
Fair enough, thanks!
Python help
Hey everyone.
So I have made this little program to run on my raspberry pi 24/7 (currently testing on windows though) and the stream buffers a bit and randomly skips songs.
Here's the source: https://github.com/developedbyalex/LofiStream
Here's my current folder setup:
https://i.imgur.com/taBHndg.png
https://i.imgur.com/nPx8aX2.png
helpful
hey, i know this is probably a simple answer but what is a mysql database? What do i actually need it for?
it's basically a convenient network accessible data storage
if you have multiple programs that all want to access the same data at the same time, you could use a MySQL server to facilitate that
you can interact with it using SQL, which is a very convenient and minimal way to get the data you want (instead of manually parsing a file and searching for stuff, etc)
so would i need to access this through a website or anything? because there's an option to create a databass on my hosting provider and then it gives me like name, address, port, user and password. Would i just input all this info into the database sections in the plugins configs or is there more to it?
if your plugin has an option to use a MySQL server in the config then it should be as easy as creating it on your hosting provider, and then copying the name / address / port / etc. etc. into the config
no websites or anything else needed
ah okay, thank you
what exactly would i put in these sections? I've filled out password and username but not sure what goes here
for the type you should change it from SQLite to MySQL if you're planning on using the mysql server your host provides
(although tbh you really don't need to use MySQL in the first place as long as you don't need to access this same data on a different mc server)
what plugin is this for?
wait i'm silly it's better social
yeah from what i can see you should really only need MySQL if you have multiple servers with a bungeecord setup
but if you really want to use it, all you have left to do is set the ip and port to that of what your provider gives you for their MySQL server and that's really it
you could also just leave the config exactly how it is right now and it would also work just fine, except it would use SQLite instead of MySQL
Hey! How would I be able to set up my plugin so that /sell hand works with EssX's /sell hand?
Essentially what I want to do is the following:
When players sell an item using /sell hand, its value is doubled
use essentials api to get the amount that is set in the item prices, not much more to it
or just double the price in the config? 💀
what are you even trying to achieve
@EventHandler
public void onEntityResurrect(EntityResurrectEvent event) {
LivingEntity entity = event.getEntity();
if (!(entity instanceof Player player)) {
return;
}
ItemStack totem = findTotemInInventory(player);
if (totem != null) {
event.setCancelled(true);
totem.setAmount(totem.getAmount() - 1);
}
}
I'm trying to remove the totem event such as Resurrection and the item began removed from the inventory, the only thing wrong is the item it gettin removed, it's should be alright like this, if anyone can help me with that I'll be greatful
Hello, I made this:
String[] message = args[1].split(" ");
StringBuilder builder = new StringBuilder();
for(String s : message){
builder.append(s);
}
but when I execute the command:
https://i.imgur.com/4Rwa7Wr.png
can anyone help me please?
I only want it to occur at a certain time not always
Running a double sell event
args[1] is already split... You have to build by the command length.
for(int i = 1; i < args.length; i++)
builder.append(args[i]);
Thank you, it works but there is no space https://i.imgur.com/VPUD7FU.png
StringBuilder builder = new StringBuilder();
for(int i = 1; i<args.length; i++)
builder.append(args[i]);
ProxiedPlayer to = main.getProxy().getPlayer(args[0]);
to.sendMessage("§bConsole §7» §7Moi§f: " + builder);
you can use StringJoiner
thanks
new StringJoiner(" ");
np
totem.setAmount(totem.getAmount() - 1);
Check to see If they only have one totem in their inventory, if they do just remove the item from their inventory
maybe I'm too dumb to explain, but I'm gonna be simple.
When player die don't remove totem
maybe like this is way easier to understand
do you mean me getting the main instance? or the utils?
so you want players to keep the totem on death?
if i die the item dissapear
it's doesnt get dropped
nvm
it's does work like this, was just the server laggy
that makes sense
you need to loop over the entire args array not just the 2nd argument
args is a String[], just loop that
It was already answered
i didnt see
how should i approach changing someone's skin on a server
Using skins restorer 👍
ok but how would i approach changing someone's skin w/o skinsrestorer or their api
idk, /skin set name name? no?
look at the plugin command usage
this aint a wiki
probably not what you want to hear but i'm sure the answer is somewhere in https://github.com/SkinsRestorer/SkinsRestorerX
ok ill look lmao ty
mfw Player.setPlayerProfile
Hello, I registred a command with the spigot api but only the alias works https://i.imgur.com/pBki4EM.png
Can anyone help me please?
apparently sending alot of ClientboundSectionBlocksUpdatePacket's cause client lag and im not entirely sure why
maybe its cus im sending an entire section worth of block changes instead of just sending ones that actually changed, no idea
Can you send the code?
How does minecraft get the whole number from a coordinate? Does it round down or either direction?
Round down I think
hello
i want to make player's character invisible (his hand in F5's first-person view and his character in F5's third-person view) except his item in his hand, on player join event
i don't want to use invisibility effect because that will make him see particle bubbles, i want to escape that
any ideas? this is what i tried so far
@EventHandler
public void on(PlayerJoinEvent event) {
Player player = event.getPlayer();
new BukkitRunnable() {
@Override
public void run() {
player.hidePlayer(plugin, player);
}
}.runTaskLater(plugin, 5);
}
it is not working tho, but it works when i want to hide other players from himself (different part of code, this is just a shorter version of what i am doing about what i asked)
@me whoever anwers, ty
Invis doesn't always have to have bubbles afaik
Doesn't the /effect command have a param to hide bubbles
omg!
Hello, is there anyway to avoid doing this please? ( And without putting i in the class )
atomic integer
wait dude
what is ur code
variable name not needed?
or im trippin
sorry solved alreaday
Might be a dumb question but, why is spigot not multithreaded?
Because Minecraft isn't
what is the syntax to send a clientbound packet in 1.20?
Huh
https://wiki.vg/protocol This?
trying to set the player's skin with playerprofiles. when i execute this, the first time i got. there are no errors but i can visibily see on tab i was removed, but i don't get added back.
ServerPlayer plyr = ((CraftPlayer)player).getHandle();
plyr.connection.send(new ClientboundPlayerInfoRemovePacket(List.of(((CraftPlayer)player).getUniqueId())));
profile.getTextures().setSkin(new URL("http://textures.minecraft.net/texture/b3fbd454b599df593f57101bfca34e67d292a8861213d2202bb575da7fd091ac"));
plyr.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, plyr));```
Make sure that you are sending the packet
yo any1 worked with dc webhooks in a plugin before? need some help
oh right so I made a system which should send a message thorugh the webhook, had no luck lately doesnt send the message nor a console error is generated
https://pastebin.com/UFhbpV8z
https://pastebin.com/7F7xs6gf
https://pastebin.com/Nk3nE2N3
https://pastebin.com/UXPwhx3k
should be all the important classes
Does VaultAPI work on 1.20.1?
changing skins yet im being removed from tablist and my outer skin layer is not showing.
im still on the tab and have my skin layer for others, but not for myself
please help
https://paste.md-5.net/irogomaxah.cs
What is the correct event to cancel Shift + Click item to put item to plugin's menu?
InventoryClickEvent
Only events u need I'm pretty sure are click and drag event
i don't think you need drag for shift click
Ye but to prevent putting items in Plugin menus
Unless u just disable all click events then that works too and is the safest
https://paste.helpch.at/jecivutuzi.java only a few days late
When making SQL calls ive heard its best to not do it on the main thread, but what i dont understand is if i do that, what if my code needs to access the user but they havent been fully fetched from the database yet because the database calls are run async
well, there are multiple ways to approach this
it really depends on the situation
say you want to load player data on command /stats:
StatsCommand:
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player player) {
StatsManager.fetchPlayerStatsAsync(player, stats -> {
// Display stats
});
} else {
sender.sendMessage("This command can only be used by players.");
}
return true;
}
StatsManager:
public static void fetchPlayerStatsAsync(Player player, StatsCallback callback) {
Bukkit.getScheduler().runTaskAsynchronously(YourPlugin.getInstance(), () -> {
Stats stats = new Stats(...);
callback.onStatsFetched(stats);
});
}
StatsCallback:
public interface StatsCallback {
void onStatsFetched(Stats stats);
}
alternatively just return a CompleteableFuture
or alternatively just return a Mono 😍
brr
You can use a taskchain
Or a completable future there is a few ways to make a main thread task wait for an async thread to complete a task
does this look like c# 🙄
huh
but doesnt that defeat the purpose of using another thread, because the main thread has to be put on hold
I'm not sure on how exactly taskchain works, but it runs the heavy calculations async and then gives you the result sync? no?
no, all the callback things let the main thread carry on with whatever it's doing until the async task is done
Ye
Used for heavy maths calculations is typical worldedit uses this theory
how can i set custom Aliases to my commands using the config.yml?
cuz people can make their own aliases using config.yml
people can open the jar file and edit the plugin.yml to add aliases 
lmao
PluginCommand#setAliases btw
well, for each alias register the executor again?
haven't used setAliases, turns out
Sets the list of aliases to request on registration for this command. This is not effective outside of defining aliases in the PluginDescriptionFile.getCommands() (under the `aliases' node) is equivalent to this method.
Params:
aliases – aliases to register to this command
Returns:
this command object, for chaining
i dont know
i never used it
nvm, it won't register if it's not in commands section
ik\
nvm about Aliases
i like this idea
I guess you can play with command arguments as command aliases
not sure, haven't really done that
just forget it, ain't wasting hours to just add some shuutty aliases 💀
Why the fuck does nobody know about commands.yml??????
i have no fuckin clue
bruv
never needed
useless
Its the exact use case you would use that for mate
yeah ik personally never used it
cuz that thing exists?
Yes
Who even uses bukkit command stuff
Use command map for you = based + epic;
Anyone that uses exposed know how to export a database as .sql in a way that UUIDs (which are stored as BINARY(16) or smth like that) are displayed right? Rn I got a bunch of broken characters when I try to view the sql with VSC
maybe there's a function you can use with your flavor of SQL that converts binary data to hex
And use where exactly? We are using MariaDB
not sure, but one scuffed solution might be to make a new column which is a copy of your uuid column except in ascii format, and then export that alongside everything else
idk much of anything about how exporting works and what settings there are with it tho so maybe there's something better
but also this seems like something you'd have to handle in VSC rather than on the side of exporting, maybe there's a plugin that lets you view binary data as text or as base16/base64?
yeah I'm not sure what plugin to use. I only find stuff related to editing hex https://marketplace.visualstudio.com/items?itemName=ms-vscode.hexeditor
good opportunity to learn vscode plugin development then i guess
or just any hex viewer, doesn't need to be a vsc plugin lol
HEX()
Yeah but uh, it doesnt do what I want :(( I just need the columns with type BINARY(16) as type to render properly =///
Why not just use text instead? 🙃
Or does sql/mariadb have a specific uuid type
Thats how exposed stores it 😛
+1 to this, use this mariadb function to convert it into hex for viewing
Exposed uses UNHEX() to store it, which is the opposite of that function lol
its afaik the best way to store uuids
Unhex should be called ahex
Ahh I see.
🥴
Well there's UUID datatype in MariaDB
Oh well =/ the MariaDB implementation simply extends MySQL, so I guess I have to deal with BINARY(16) :X
Its okay
I use binary(16) too
Or you can just store it as varchar
Which is not ideal cuz indexing and stuff
ohh i get it, awesome thanks
Anyone got an idea why the server crashes with this error? Not sure what is causing it
java.lang.NullPointerException: Exception in server tick loop
at net.minecraft.server.v1_8_R3.JsonList.load(JsonList.java:195)
at net.minecraft.server.v1_8_R3.DedicatedPlayerList.z(DedicatedPlayerList.java:94)
at net.minecraft.server.v1_8_R3.DedicatedPlayerList.<init>(DedicatedPlayerList.java:22)
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:177)
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:688)
at java.lang.Thread.run(Thread.java:748)
That's what you get for using 1.8.4(???)
no thats just the nms thing (or smth idk?)
im pretty sure thats 1.8.8
edit: it's 1.8.4 -> 1.8.8
I'm not sure why it's called _R3, but ok
im not sure either
spigot just lists it as "NMS Version" 🤷
its prob whenever theres a nms change that spigot has to change patches for
Yeah it is, for a factions server, any idea for the error?
the ban list json file might be corrupted
if thats a thing
im just looking at the source
banned-players.json
seems like it's from there
Where do you see that?
uhhh should be at the same directory as the server jar
oh I just googled spigot 1.8 source and it comes up as https://github.com/Attano/Spigot-1.8 🤷
Perfect, I'll try, thanks a lot
It's weird how this didn't catch the error then though
private void z() {
try {
this.getProfileBans().load();
} catch (IOException ioexception) {
DedicatedPlayerList.f.warn("Failed to load user banlist: ", ioexception);
}
}
This was the line in the error https://github.com/Attano/Spigot-1.8/blob/master/net/minecraft/server/v1_8_R3/DedicatedPlayerList.java#L94C12-L94C12
bc it only catches IOException
not NPE
getProfileBans points to this file
so you could prob just open it and check it manually or delete the whole file (although I wouldn't recommend that)
Ah yeah true, but it should right? In later versions of mc at least
Perfect, thanks
idk
alr
lmk if it works 👍
kinda curious what part of it was messed up too
Yeah same, I'll let you know when it's fixed
Is it still not possible to combine sub commands and options for Discord's slash commands? D:
I don't think so
Closest you can get is autocomplete

🥲
huh?
is this not what you mean?
you can have a base command, that has multiple sub-commands that have their own choice parameters
As clean as that looks it feels like arrow code to me.
ah I think the limitation is that the base command can not have its own separated options if you add sub commands
yeh, jda
kinda
or treat a subcommand as 'separated options'
yeah hm
Reminds me of pyramid code. It's also hard to read.
I always separated my sub commands into separate variables and added them that way, to make it more readable and debuggable
how would i check if the displayname on an item is equal to some text? I see .getdisplayname() is deprecated now, so want to use the .displayname() function
if(item.hasItemMeta())
if(item.getItemMeta().hasDisplayName())
if(item.getItemMeta().displayName() ... //text is equal to "cool name" )
return true;
Where do you see ItemMeta.getDisplayName() deprecated?
it is in paper in favour of components
@dense drift
Ah
maybe it's a filter thing
checking if an item has a specific name, its used in a minigame world, no players will have access to anvils, let alone even the ability to interact with their inventory
scuff
i'd still say that using metadata or even slots is a better idea
comparing names is just liable to breaking if you ever change the name in future, or if the component's internal representation changes
set a metadata / PDC key with some constant string value and compare that instead
well im hooking into another plugin, and pulling the name of the item from their language file, and the material from the config
and comparing if the item + name are the same
not able to do it since im hooking into a sep plugin, but can def prob submit a pr on the main plugin to do this lmao
would recommend doing that yea - comparing names is always liable to break things
but i guess for now just use the legacy component serializer
Welp... easiest option is @SuppressWarnings("deprecation") untill they actually remove that method 😉
yeah, trying to do everything right with what limited options i got, making sure pulling the correct item type + item name from the plugin config (not hardcoding it) then its also being used in an area where players cant rename items, or interact with their inventory
spent like an hr and figured out the way to the proper way to do it
👍
incase ur curious
Component displayName = item.getItemMeta().displayName();
if(PlainTextComponentSerializer.plainText().serialize(displayName).equals("cool item name")
return true
🤮
😄
deprecated method def alot cleaner looking, but atleast its nice to learn more about adventure api
Also make sure you have the untranslated name when using .equals there.
plain text is a bit of an eyebrow raiser
&chello and &bhello would have the same plain text
well, "cool item name" is being replaced with the name of the item from the language file
so im assuming those translations carry over?
Really?
i can test it rn
Does it remove the translations and just give the text?
no i made it up
yes, that's what it means by "plain text" and is why i suggested the legacy code serialiser instead
👍
hmmm, so then whats the adventure alternative
thats not deprecated (just for future use cases where im not looking at item names)
the legacy code serialiser
just use the legacy component serializer
🥲
LegacyComponentSerializer
will serialize to &c/§c
or of course do it the other way around, and instead parse a component from the config and just compare components
that might be nicer
Wasn't this a thing aswell? ChatColor.stripColor("name with color")
nvm then
Good old "deprecate everything" I mean PaperMC... I mean Paper.
well, minimessage format is 100x nicer and easier to work with, both as an end user and developer for writing out messages
god forbid software improves
I mean... Why deprecate everything and add to it? Just make a whole new software at that point.
we must continue using designs from 10 years ago that are totally orthogonal to how the game actually works
because making a full server implementation from scratch is pretty much impossible? what benefit would that bring
to make sure all spigot plugins are compatible with paper
folia is their new software, but its still years out before it'll be mainstream
and folia is still based on bukkit
Far from impossible.
Paper already tries to get people to switch from using spigot anyways. Don't know why they keep bothering to include its code.
Unrelated to this convo, but can someone try to tell me what I'm doing wrong? I want to access the second argument of my command, but args[1] always yells about Array Index being out of bounds (kinda massive codeblock incoming, if its too much delete it idk)
literally only for compatibility, but my guess is they will hard fork from spigot eventually
if (ZoneGui.getPermsManager().get().checkPermission(sender, "zonegui.user.gui")) {
if (sender instanceof Player) {
if (args.length == 0) {
Inventories.mainInv.prepareInventory((Player) sender);
Bukkit.getScheduler().runTask(ZoneGui.getInstance(), () -> Inventories.mainInv.sendInventory((Player) sender));
} else if (args.length == 1 && args[0].equalsIgnoreCase("edit")) {
if (args.length == 2) {
// Handle the case where no region name is provided
sender.sendMessage(ChatColor.RED + "Please provide a region name.");
return true;
}
String regionName = args[1];
boolean isOwner = WGUtils.isRegionOwner((Player) sender, regionName, "world");
if (isOwner) {
RegionEditing.setRegion((Player) sender, regionName);
Inventories.regionOptionsInv.sendInventory((Player) sender);
} else {
sender.sendMessage(ChatColor.RED + "You are not the owner of this region.");
}
}
} else {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', ZoneGui.getPrefix() + Messenger.getText("General.OnlyPlayer")));
}
} else {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', ZoneGui.getPrefix() + Messenger.getText("General.NoPermission")));
}
}
You're checking args[1] where length is 1
Can you explain it to me like I'm 3? lol
arrays start at 0
else if (args.length == 2 && args[0].equalsIgnoreCase("edit")) {
a lot of this logic is kinda messed up
I know it is
idk the term for it, but nesting is generally harder to read
if (args.length == 1 && args[0].equalsIgnoreCase("edit")) {
if (args.length == 2) {
// this will never be true
}
...
}```
hopefully it's clear why
I'm an absolute noob at java, I'm glad it even remotely works
arrow code
Yeah I probably screwed up the nesting lol
Just looking at it, this should work (I think lol)
if (sender instanceof Player) {
if (args.length == 0) {
Inventories.mainInv.prepareInventory((Player) sender);
Bukkit.getScheduler().runTask(ZoneGui.getInstance(), () -> Inventories.mainInv.sendInventory((Player) sender));
} else if (args.length == 1 && args[0].equalsIgnoreCase("edit")) {
Inventories.worldRegionsInv.prepareWorldRegionsInventory(player, false);
Bukkit.getScheduler().runTask(ZoneGui.getInstance(), () ->
Inventories.worldRegionsInv.sendInventory(player, "world", 1, PlayerStates.State.WAITING_REGION_SELECT));
} else if (args.length == 2 && args[0].equalsIgnoreCase("edit")) {
// Assuming args[1] contains the region name provided as an argument
String regionName = args[1];
boolean isOwner = WGUtils.isRegionOwner(player, regionName, "world");
if (isOwner) {
RegionEditing.setRegion(player, regionName);
Inventories.regionOptionsInv.sendInventory(player);
}
}
}```
basically to help with "nesting" is to limit it, and get rid of the bad cases at the begining
so like
if(!(sender insteadof Player){
// ur not a player code
return ...; // <--- return prevents it from doing the rest of the function)
}
if(args.length == 0) {
// logic etc
return ...;
}
// rest of logic ....
this is easier to read than nesting it all
its not really right or wrong, just imo, helps ALOT with getting confused when nesting
Far from impossible.
it pretty much is, there's no other implementation that actually supports everything, in the latest version, that isn't based on the notchian / bukkit server. and it gets more and more impossible as time goes on
even if it's theoretically possible, it's a gargantuan amount of effort for zero benefits and multiple downsides (loss of plugin compatibility, far more maintenance requirements, some of the notchian quirks like redstone are pretty much impossible to replicate - even mojang cant do it, etc).
the whole point of open source is that people can take other code and improve it, which is exactly what paper is doing. by your same logic, spigot shouldve made a brand new implementation rather than forking bukkit
i know you love being contrarian but anyone can see that a full server rewrite from scratch would be such a terrible idea that it's not even worth considering
some of the notchian quirks like redstone are pretty much impossible to replicate - even mojang cant do it
wait wdym by this?
@digital palm ```java
if(!command.getName().equalsIgnoreCase("zone"))
return false; // Wrong command, sends usage
if(ZoneGui.getPermsManager().get().checkPermission(sender, "zonegui.user.gui")) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', ZoneGui.getPrefix() + Messenger.getText("General.NoPermission")));
return true;
}
if(!(sender instanceof Player player)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', ZoneGui.getPrefix() + Messenger.getText("General.OnlyPlayer")));
return true;
}
if(args.length == 0) {
Inventories.mainInv.prepareInventory(player);
Bukkit.getScheduler().runTask(ZoneGui.getInstance(), () -> Inventories.mainInv.sendInventory(player);
return true;
}else if(args.length == 1) {
sender.sendMessage(ChatColor.RED + "Please provide a region name.");
return true;
}
if (args.length == 2 && args[0].equalsIgnoreCase("edit")) {
String regionName = args[1];
boolean isOwner = WGUtils.isRegionOwner((Player) sender, regionName, "world");
if (isOwner) {
RegionEditing.setRegion((Player) sender, regionName);
Inventories.regionOptionsInv.sendInventory((Player) sender);
} else {
sender.sendMessage(ChatColor.RED + "You are not the owner of this region.");
}
}
theres already alternate redstone engines that are supported by paper no? or am i miss understanding what he meant by that
im assuming he means that theres some glitch that redstoners use but i dont use redstone a lot so idk what he means
bc yeah theres alternative redstone engines
i think paper has a config option for it
they do, i think theres 2
redstone behaves differently on bedrock edition
Alternating current?
and yeah in paper
AC and EC, ye
yeah and eigen
Just because its hard to do doesn't mean its impossible... Someone can and might one day make a server from scratch. Look at minestom they started from scratch.
Glowstone did as well didnt they
Minestom started from scratch and is still very much there
yeah and minestom isnt trying to repliciate vanilla behaviour, it's not in the same league at all
No sane person will ever fully reimplement all vanilla features
no sane group, even
Exactally... Imagine a a person or team that actually tried to recreate the vanilla server. It can be done. Nothing impossible about it.
Krypton 😔
bro im convinced you just didnt read my message
even if it's theoretically possible, it's a gargantuan amount of effort for zero benefits and multiple downsides (loss of plugin compatibility, far more maintenance requirements, some of the notchian quirks like redstone are pretty much impossible to replicate - even mojang cant do it, etc).
please name a single benefit of actually doing this
hes not saying its impossible, it just be really dumb for them to do it
I read it. Just doesn't matter. I'm talking about you calling it "Impossible" in your original message lol
Minecraft did it. It can clearly be done.
also pufferfish etc are already really optimized
i feel like even if you did make one from scratch, it'd be less performant unless you get like the whole paper + mojang dev team to make one
once again you're just proving you dont read the full thing
I think you under estimate the term impossible. Saying "pretty much" doesn't really counter it lol
"pretty much impossible" doesn't have to mean 100% impossible

"pretty much impossible" quite clearly means "with unlimited time and effort you could do it, but it's not practical"
any infinite monkey theory enjoyers?
hell yeah
Practicality or not it can be done. It wouldn't take a whole team to recreate the vanilla server, it would take time obviously.
it'd take a whole team to recreate the vanilla server while being more performant than forks like pufferfish
and a lot of time
mc took a lot of time to make
with a billion dollars of course you could do it
but paper does not have a billion dollars, so your initial message saying "waa waa why do they use spigot code" is clearly unreasonable
🤦
so true man
looking at it, both plaintext and legacytext dont pull the color from the itemname, and just use the text of the item (without the color code)
Component displayName = item.getItemMeta().displayName();
String rawDisplayName0 = LegacyComponentSerializer.legacyAmpersand().serialize(displayName);
String rawDisplayName1 = LegacyComponentSerializer.legacySection().serialize(displayName);
String rawDisplayName2 = PlainTextComponentSerializer.plainText().serialize(displayName);
Util.log(rawDisplayName0);
Util.log(rawDisplayName1);
Util.log(rawDisplayName2);
logging it to the console, and its just showing the name of the item, (which in game is colored yellow)
why are you using ampersand
ampersand = &
section =
oh
rip alt key
section = alt + 2 + 1
my alt key is broken
ty
all 3 log to the console with just the text of the item
section = §
exact same
how is Util.log implemented?
i wouldn't trust Util.log
its mine
public static void log(String msg){
MiniMessage mm = MiniMessage.miniMessage();
Component parse = mm.deserialize(PREFIX + " " + msg);
Bukkit.getConsoleSender().sendMessage(parse);
}
😬
😬
whats wrong?
if you are using paper-api, there is Plugin#getComponentLogger or smth
i want to make sure im compatible with paper and spigot
well, sendMessage(component) exists only on paper
i suspect that's messing with things
The console might not support colors, or the item is a rare one (e.g. Enchanted Books are displayed yellow, Barriers are pink)
if you sysout the components i think theyll be different
what
then use a kotlin script to convert it back
bc console did weird things with the color codes
ok just doing system.out.println(msg) in my util.log
Component displayName = item.getItemMeta().displayName();
String rawDisplayName0 = LegacyComponentSerializer.legacyAmpersand().serialize(displayName);
String rawDisplayName1 = LegacyComponentSerializer.legacySection().serialize(displayName);
String rawDisplayName2 = PlainTextComponentSerializer.plainText().serialize(displayName);
Util.log(rawDisplayName0);
Util.log(rawDisplayName1);
Util.log(rawDisplayName2);
prints out this:
[11:34:54] [Server thread/INFO]: [testplug] [STDOUT] Cool item name
[11:34:54] [Server thread/INFO]: [testplug] [STDOUT] Cool item name
[11:34:54] [Server thread/INFO]: [testplug] [STDOUT] Cool item name
the item is named "cool item name" but the color is yellow in game
i love minecraft
Component displayName = item.getItemMeta().displayName();
String rawDisplayName0 = LegacyComponentSerializer.legacyAmpersand().serialize(displayName);
String rawDisplayName1 = LegacyComponentSerializer.legacySection().serialize(displayName);
String rawDisplayName2 = PlainTextComponentSerializer.plainText().serialize(displayName);
System.out.println("Length: '" + rawDisplayName0.length() + "'");
System.out.println("Text: '" + rawDisplayName0 + "'");
System.out.println("Length: '" + rawDisplayName1.length() + "'");
System.out.println("Text: '" + rawDisplayName1 + "'");
System.out.println("Length: '" + rawDisplayName2.length() + "'");
System.out.println("Text: '" + rawDisplayName2 + "'");
output:
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Length: '14'
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Text: 'Cool item name'
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Length: '14'
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Text: 'Cool item name'
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Length: '14'
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Text: 'Cool item name'
good name
try just System.out.println(displayName)
[11:42:08] [Server thread/INFO]: TextComponentImpl{content="", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=null, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[TextComponentImpl{content="Cool item name", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=null, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}]}
Aren't these crystals default yellow?
Lol
idk why either tbh
minecraft moment probably
Because item names that aren't the default item names are italic by default
You have to tell Minecraft to not make it italic
I think
oh i thought that was just for lore
Yeah you're correct
I was right
congrats
gives u cookie
could u help
@surreal kelp #minecraft
Does anyone have an idea why my Bungeecord Plugin is not loading my config file?
I saw this method on a SpigotMC wiki. Am I doing anything wrong?
Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(TengokuBungeeCore.getTengokuBungeeCore().getConfigFile());
ProxyServer.getInstance().getLogger().info(configuration.getString("database.host"));
It does just log an empty string.
And yes, the config is getting created.
ConfigurationSection reportReasons = config.getConfigurationSection("reasons");
if (reportReasons != null) {
for (String reasonKey : reportReasons.getKeys(false)) {
ConfigurationSection reasonConfig = reportReasons.getConfigurationSection(reasonKey);
String reasonTitle = reasonConfig.getString("title", "null");
String reasonText = reasonConfig.getString("text", "null");
int slot = reasonConfig.getInt("slot");
gui.setItem(slot, createItem(Material.BAMBOO, reasonTitle, reasonText.replace("%player", reportedPlayer.getName())));
}
}```
idk why this aint working help
reasons:
hacking:
title: "Hacking"
text: "Click to report %player for hacking."
material: "BOOK"
slot: 11
spam:
title: "Spam"
text: "Click to report %player for spam."
material: "BOOK"
slot: 12
advertising:
title: "Advertising"
text: "Click to report %player for advertising."
material: "BOOK"
slot: 13
other:
title: "Other"
text: "Click to report %player for other."
material: "BOOK"
slot: 14
i'm dumb or what
what does "aint working" mean
loop doesnt loop
sout donest print
so it's doesnt work
😵💫
Anyone using this to their code? May I ask if this can cause lag on the server?
for (Player player : Bukkit.getOnlinePlayers())
{
//Player the sound for player
}
I just want to add some bit of coolness but if it makes the server lag a little bit, I'd rather not use it
If something will cause lag or not depends on how you use it. If you run something for all players every tick for instance, it could eventually cause lag, but if you play a sound from time to time you should be fine
Thank you. I just want to trigger it only if I type the specific command..
something something premature optimisation
Hi, is there a reason why the helpch.at website is missing the javadocs for 1.19.4 and 1.20?
yes they are the same, iirc 1.20.1 was just a client update to fix some problem(s)
1.20.1 is a minor hotfix update to Java Edition, released on June 12, 2023,[1] which added a new language and fixed critical bugs related to 1.20.
major.minor.bugfix 
they are not the same, it's literally 2 different maven dependencies
💀
I don't wanna say that there was any changes in teh javadocs itself, but it's still 2 different maven artifacts
in therms of api structure or whatever you want to call it
in terms of API methods, they are the same
it terms of versioning, they are not the same
better?
yeah but that's not the point, there shoul dbe one javadoc per version
there's also no difference between 1.8.7 and 1.8.8 still both are on the website
and 1.19.4 is missing completely although it was a big change
sure I will let funnycube know about your request lol
sorry didn't mean to be rude or anything lol
but 1.19.4 definitely was a big change (the display entities, etc) so that should definitely be uploaded if possible :3
well, the thing is, there's no need to rush to add X version if it's the same as Y, for reference maybe, if you don't know, yeah, but you were just told that they are the same
yeah sure I know that basically nothing changed between 1.20 and 1.20.1 but if someone is actually running 1.20, they will be looking for 1.20 docs and not for 1.20.1 docs
anyway, as mentioned, 1.19.4 was big update and it'd be nice if that could get added :3
well, people don't get paid for it
if someone is actually running 1.20, they will be looking for 1.20 docs and not for 1.20.1 docs
eh I mean you should know more ab the version you are running
you can always look elsewhere 
btw if you really need the docs for 1.19.4, you can unzip the javadoc jar
... I know that I can get the javadocs, I was simply suggesting to add it to the website
no clue why you're all so hostile here
if u don't wanna unzip the jar
jokes aside, I will let fc know ab this.
im just listing an alternative that doesn't involve unzipping the jar
huh, i didn't actually know that 1.20 and 1.20.1 had separate spigotmc maven artifacts, but it turns out there is approximately 7kB of difference in the jars
md5 be weird af for sure
dude I don't need the 1.19.4 javadocs but someone else might, I was simply suggesting that if a website already offers javadocs for 1.8.8 and 1.12.2 and literally every other version, why not also add that specific version lol
ohhh ok, I didn't read the whole context so I assumed you needed 1.19.4 javadocs
yeah and if you run buildtools with --rev 1.20 it also builds 1.20.1
md_5 must have been drunk, idk
buildtools 💀
I wonder what's up with that
the day paper does the hard fork will be a good day 😌
to get 1.20 one has to specify the actual commit from the git history
yeah cause like the actual protocol numbers in the game are the same, didn't know spigot actually changed some stuff
even the mappings for 1.20 and 1.20.1 are exactly the same
i mean yeah, they should be lol
probably won't happen I guess
there was no serverside changes
oh it's coming
especially with stuff like Folia becoming actually pretty big
but what's the purpose of "hardforking"
to not have to worry about spigot compatibility
being able to do whatever they want without having spigot compat
and following md5's insane reasoning and updates and stuff
and they can release before spigot for updates, instead of having to wait until spigot releases, then doing their release based on it
can you explain what you mean with "insane reasoning"?
just all the crazy stuff md5 has done to make the spigot api weird
yeah but what exactly do you mean?
i don't have any examples off the top of my head, but i know the paper guys want to change a bunch of stuff and they can't right now because they have to have spigot compat
ooh a big one is the loader setup, hence the whole paper-plugin things they're working on
well paper already broke compatibility with spigot many times (remember the AdvancementDisplay stuff for example?)
would be easily fixable if paper would just contribute upstream sometimes 😄
🤣
nah I am not, I just wonder what the actual arguments are
e.g. when we made the buildtools GUI, md wanted to turn this into a separate .jar, I found that very stupid
I'm not an md5 simp but I prefer to discuss using actual arguments
the "Using Mojang Mappings" would be a great thing
but it's debatable whether that's even allowed
Fabric and Forge both do it
no more build tools ❤️
so I figure that's plenty prior experience lol
I mean didn't Mojang release the mappings themselves?
(although why do they still obfuscate
)
I'd definitely like it if there'd be no more need for remapping .jars
however it'd break literally every plugin that uses NMS currently
I think people would be pretty amicable to that when the benefits outweight the negatives so much in the long run
I don't really understand the "Improving the API" part of that article though
You should probably go ask some people about it in the paper discord then, as they have much more intricate knowledge of what they want to improve than I do
"just"
two big things are Adventure and the classloader setup, but I know they want to do a lot more
yeah well I miiight got banned there lol
yeah well even I managed to contribute to spigot, it's not that hard lol
Fixing typos doesn’t count
I'm not talking about fixing typos
hacktoberfest moment
I mean, just look at the PR to deprecate the Material enum
For how long is it open now?
🙂
I think that exact scenario is a big part of Paper's hard fork reasoning lol
and why Paper even exists
on the other hand, I don't think it provides any advantage
whats it being deprecated in favour of?
what are you talking about? Material is not deprecated in spigot at least
The idea is to bring it (and other enums) closer to the dynamic nature of Minecraft
smh like ItemType.get(ResourceKey.of("minecraft:stone")) ig
I.e. make it registry based
I know that there are plans to replace EVERY enum that implements Keyed with normal classes, but thats all I know
I remember asking in fabric discord how to get x material and they were like "wth is a material" 🤣
lol
there would hopefully still be an enum or at least constants
I would dislike having to type minecraft:stone every time
ofc there'll be constants
Also split up blocks and items because that’s just a huge mess atm
oh ok
it'll work like the Enchantment class
a shit ton of public static final fields
only thing it'll break is if people use EnumSets or EnumMaps or similar
That's the cost of a better api
9/11 for enummap fans
that's why I came up with this shit lol
public static <T> Set<T> createEnumSet(Class<T> clazz) {
if(clazz.isEnum()) {
return EnumSet.noneOf((Class<? extends Enum>) clazz);
} else {
return new HashSet<>();
}
}
the fandom will not recover from this
Imagine using EnumSet/Map for Material
well why not
Waste of space most of the time
waste of space?
Memory
how is an EnumSet using more space than a normal HashSet
An EnumSet always has a fixed size, depending on the amount of constants the enum has
yeah it is not just a fancy name for a HashSet xD
isn't the point of enumset to be better than a regular set?
EnumSets uses some fancy math to avoid using the ordinary hashCode
yes
although it probably doesn't make any real life difference lol
For small enums, definitely, if you only care about speed, depends
