#help-archived
1 messages ยท Page 219 of 1
@fading frost Probably because the whole UnsafeVaules class has been deprecated, should still work, just be aware it may have weird functionality at times ๐คท
[xxxxxx] disconnected with: Invalid payload REGISTER! what does this mean
@fading frost Probably because the whole UnsafeVaules class has been deprecated, should still work, just be aware it may have weird functionality at times ๐คท
@frigid ember does spigot still use it though?
or is there an alternative now
Yeah there you go
It's meant for internal use
so why did it fail? i dont want ppl using mods not being able to join
UnsafeValues is not really meant to be used by plugins. It can be - it has a front-facing API, though Bukkit's ideology of forwards compatibility does not apply to this class
Failed because something they're using meant the client wasn't conforming to the protocol standards ๐คท
It's Bukkit's equivalent of sun.misc.Unsafe
Spigot uses unsafe internally, but there's absolutely no reason for plugin devs to use it
which is why its deprecated
Yeah ok, I'm using it to emulate the transformations happening when loading classes regularly
I reckon this is the best way
Although I could use commodore directly of course.
If I have a method that gets a value from the config:
public int getTimeUntilSwitch() {
return main.getConfig().getInt("time-until-switch");
}```
if I create a private field at the top of the class that = getTimeUntilSwitch(), when I refer to that variable will it still pull it from the config every time?
no
Ah alright
Any good guide on how to start making plugins? everything I have found with google is giving us troubles. Bukkit is not recognizing our pluggin.
Use youtube
^^^
pogostick ๐
I'm new to plugin development so don't look at me
Pogostick was bae
Wait...wrong chat. Sorry
Pogo was the first person who really got me started
yeah they're decent
did anyone say static abuse?
I received this yesterday, https://paste.md-5.net/fivogofuke.java
๐
60% of the beginning programmers don't know what half of their code means.
Formattings broken (new line spaces)
50 Chrome tabs is how I'm starting...I think I have to many tabs
@wispy pewter Can confirm
Do 100 incognito chrome tabs >:)
They ask for help in discord and use the code they are given
without searching what it dos
does
and why its being used.
What's a java???
Coffee
A type of coffee

You need an eclipse first tho
or a j that is intelligent
Or internet beans
Ok so I go to Indonesia and wait for eclipse
Nano ftw
I use Kate
Wordpad++ or noob
๐
I'm on KDE
Sublime is betteer
Yes
no
Sublime, Atom, VS-Code
Sublime text + Sublime merge and boom you're already best developer
wordpad++
@frigid ember
Sounds like word with less steps
Tbf there probably is a wordpad++ out there somewhere and it's probably a cheap knock off of notepad++ lmao
Real developer use Alexa/Siri and voice-to-text to write their code
Found one on source forge lmao
NO
it's a legit thing
Yes
Can you not lol
Switch too Assembler lol
@frigid ember Become a web developer, this isn't worth it
Alpfa let the man be
๐ค
๐คฆ
Why dont you start writing power shell
What IDE are you using @frigid ember
Command prompt
Discord to Spigot is fun ... when your plugin runs on Bungeecord
Is there a way to modify itemstacks from vanilla villager trades?
I'm trying to code a halloween plugin, and basically it's that every single item that will be collected while my plugin is running, will have a custom lore that I made.
I already made it work when picking up, when crafting, and even when looting, but now I was thinking...
What if a player tries to trade while the plugin is running?
The villagers will trade normal items without lore...
How can I get their itemstacks? Is there an event in which I can get their inventory?
@frigid ember you can do this
For web use PHP storm
Merchant stuff
Any jetbrain product ever โค๏ธ
I use eclipse
hey guys ๐
Pain in the but to get working...but sunken cost fallacy is sunken cost fallacy
Simply listen to InventoryDragEvent , if the item has been dragged from a villager inventory type , give him the lore I guess?
is there a way to check if a player clicked on their hotbar in InventoryClickEvent?
there is event.getClickedInventory.getType()
but I don't know what to compare that to?
Why not just disable villager trading?
Couldn't you just create villagers with custom trades ๐ค
is there a type hotbar?
Couldn't you just create villagers with custom trades ๐ค
@quick arch also... Maybe
@timid edge TIP: The change Inteliji memory from 2 to 4
it will become 10000X faster
uh...
Mhh idk about that
Idk chief
Just change their trades when they spawn? ๐ค
Make custom trades
Players can see /pl on my server somehow and I didn't give them permissions on pex? How do I fix this?
Could you even trade renamed items?
anyone?
@daring oracle The permissions are true by default you need to manually set them to false
@wispy pewter Thank you, I changed it
A bit old but should still work
oh no
I wrote something in my plugin to handle LuckPerms stuff... I'll be honest.. I'm still confused to whether my code for that is working correctly
If it doesn't crash it works
^^^
That's how I publish my plugins
Every programmer ever
I test it on 1.5->1.16 and expect the code to work on 1.16+, if not it was made incorrectly.
If it doesn't crash it works
@sturdy oar Im going to start using that
I think I should support 1.8-1.12.2 for my plugin
Lol literally everyone
Clearly someone
The 1.5 community is so huge
It doesn't crash...but the code reminds me of ducktape

I know at least 6 servers that use 1.4.7
and how big are these servers?
There is probably a few servers that still run 1.2.5
nty
I'm lazy, the only reason it supports those is simply because 1.7 support provided support for those too
do it
I'm guessing my advancement things will break
Comment it out
Although 1.8 doesn't go to fancy with achievements. I could just run a version check and say "if you're running on 1.11.1 or older. Just don't bother with advancements"
How do i fix this?
java: me.gui.gui.commands.guicommand is not abstract and does not override abstract method onCommand(org.bukkit.command.CommandSender,org.bukkit.command.Command,java.lang.String,java.lang.String[]) in org.bukkit.command.CommandExecutor
Import it
package me.gui.gui.commands;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
public class guicommand implements CommandExecutor {
}
i have
so where is the method the interface gives ya?
Is there a Map API or class that Spigot has?
declaration: package: org.bukkit.map
not much detailed sadly
it hasnt received much attention
Thanks mate
Can some one help me im having trouble with bungee cord
i can
22:45:01 [SEVERE] Exception in thread "main"
22:45:01 [SEVERE] java.lang.RuntimeException: Invalid configuration encountered - this is a configuration error and NOT a bug! Please attempt to fix the error or see https://www.spigotmc.org/ for help.
22:45:01 [SEVERE] at net.md_5.bungee.conf.YamlConfig.load(YamlConfig.java:73)
22:45:01 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:71)
22:45:01 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:272)
22:45:01 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
22:45:01 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
22:45:01 [SEVERE] Caused by: while scanning for the next token
found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
in 'reader', line 27, column 14:
address: 116.202.229.20:25404
send me your bungee config
lol
How can I get a player locator map in 1.16 using Spigot
@languid hill btw, don't forget to add a firewall rule to block any traffic that isn't from your bungee front end, otherwise people will be able to UUID spoof onto your servers using their own bungee instance
Hello. I need some help. How can you set the border, outside which the world will not generate? I try to run server on raspberry pi zero w and I want to make very small flat world. It won't be used for normal playing, I want it to be something like on this video at 2:50.
https://www.youtube.com/watch?v=YNrFOClrzTA
I tried "world border" plugin, but it doesn;t seem to work. Or maybe it works, but, when i login, world outside trimmed border is generated again.
how do you monitor packets?
I want to prevent certain players from sending packets to other players
What exactly are you trying to do? Players don't "send packets" to other players, only to the server, who in turn sends different packets to players
Oh, you want something like VanishNoPacket
no bounding box or anything
yea
I want to implement it by myself though, is it open source
It is
thanks
You're welcome
eh guys
can someone help me fast
why am i getting redirectionErrorNoOnlineServers
https://pastebin.com/8Dgeu9KF
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
i have a question if you have group2 taking inherit from group 1... would group 3 4 and on inherit all lower groups even though you have it group 5> group4>group3>group2>group1?
@urban wharf Presumably your BungeeCord instance has no online servers to send you to
@urban wharf Presumably your BungeeCord instance has no online servers to send you to
@obsidian scroll All the servers are up and owrking
You can choose how it resolves all that in the config.
can your hub actually connect to any of them, though?
Yes i can
Hm
you might have your throttle connection set to -1?
139.99.124.204:25568
you might have your throttle connection set to -1?
@frigid ember Lemme check
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
that's my config
if no luck check your server properties and port forwarding too
is the powermine 1.16 compatible?
did you test connection directly to the other servers? just asking
Yes i did
and that's working
this is very weird
I can connect to hub without any problem
hopefully someone else who understands more depth on this can help. its been years since i have done bungee
hmm anyone experienced in sql can tell me what this might result into?
String makeTable = "CREATE TABLE IF NOT EXISTS "+tableName+" ";
StringBuilder stringBuilder = new StringBuilder();
for(String s : values){
stringBuilder.append(s+" ");
}```
this starteed happening after i updated jpremium
please
i have had issues with some plugins causing startup/shutdown issues so i added .bak to the broken ones and server runs fine again. just let the plugin developer know of the issue and they should fix it asap.
someone help me install this in miy minecrfat survuval world https://www.spigotmc.org/resources/jodelle-powermining.59834/
1.16
msg me on dis
?
doesnt look like it is @deft zinc
frick
if(e.getClickedInventory().getTitle().equalsIgnoreCase(ChatColor.AQUA + "Custom GUI")){
anyone know why getTitle is not working ?
how did i join a server tha was on 1.16 and yet it had it?
i have had issues with some plugins causing startup/shutdown issues so i added .bak to the broken ones and server runs fine again. just let the plugin developer know of the issue and they should fix it asap.
@frigid ember Yee it was jPremium
viva verson
Gonna have to ping dev asap lol
wha viva version
inventories don't have titles, tdash
their views do
in your case, an inventory event, event.getView().getTitle()
Can you help me? I'm trying to put "3;minecraft:air;127;decoration;2;" into generator-settings in my server.properties, to create empty world, but i get JsonParseException. What am i doing wrong?
Also tried to put \ before :
@subtle blade if(e.getClickedInventory()getView().equalsIgnoreCase(ChatColor.AQUA + "Custom GUI")){
What what would i do to fix it i tried if(e.getClickedInventory()event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){
Right so... do you confidently understand the basics of Java? Because based purely on that I'm going to assume not
I have recently started java i did a bit a long time ago
is this even a viable way of returning something from a try/catch? IDE seems to think so
final ResultSet[] resultSet = new ResultSet[1];
asyncExecute(new StatementSQL() {
@Override
public void execute() {
ResultSet temporaryResultSet = null;
try {
temporaryResultSet = statement.executeQuery(path);
}catch (SQLException e){
e.printStackTrace();
}
resultSet[0] = temporaryResultSet;
}
});
return resultSet[0];
}```
why is that an array though?
basically making an array,filling out index 0 then trying to return it
thats why im asking intellij thinks this is alright for auto-correct
this will not work
it will work it's just very poor design
no it won't
or are arrays pass by value?
bit hard to pull something out of try/catch
the array is populated asynchronously
yeah, though that value will inevitably be set
ideally you'd be using completablefutures
yeah most likely ill end up using it
yeah, though that value will inevitably be set
@subtle blade at the point of return this will be null
dont think there is any faster way
yes of course, though at some later point in time it will not be
depends on how that method is used lol. though again, completablefuture here is best
the caller won't see this change though
are arrays pass by value?
damn im making the most scuffed sqlhelper
I suppose the value being passed is the reference, yeah
yes
while this is technically a race condition, the return will always be faster than the task
so completablefuture is basically a way of delaying the return till the value is set
@subtle blade How would i fix this if(e.getClickedInventory()event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){
completable future acts sort of as a wrapper for an object that may or may not have been set
so completablefuture is basically a way of delaying the return till the value is set
@vernal spruce no, it will return instantly. But the caller can decide what to do with it, e.g. register a callback for when it's done or wait
right. it's the call backs that are useful from future instances
ahh so it gives me full control what happens at the end
Do views still have tittles?
yes
man this bout to be so scuffed
so this might do it?
CompletableFuture<ResultSet> completableFuture = CompletableFuture.supplyAsync(new Supplier<ResultSet>() {
@Override
public ResultSet get() {
try {
return statement.executeQuery(path);
} catch (SQLException e) {
e.printStackTrace();
}
return null;
}
});
return completableFuture.get();
}```
this defeats the purpose of completable futures
you're meant to return them
also yes, use prepared statements and try-with-resources
yeah, it's the CompletableFuture that you want to return
On that object you can invoke methods like whenComplete() where you can pass a completion stage invoked when the future has been completed
Avoid get(). That's a blocking operation and defeats the purpose entirely
so...
return CompletableFuture.supplyAsync(new Supplier<ResultSet>() {
@Override
public ResultSet get() {
try {
return statement.executeQuery(path);
} catch (SQLException e) {
e.printStackTrace();
}
return null;
}
});
}```
Yeah, though you can simplify with a lambda as well
fine..
try {
return statement.executeQuery(path);
} catch (SQLException e) {
e.printStackTrace();
}
return null;
});```
ye
but how does it work once called
when you call it, use the completion methods
will it just return the object i placed?
getData().whenComplete(data -> { });
hmm
That gets called whenever your async task is done
so this is more of a utility method
also yes, use prepared statements and try-with-resources
how do you get spigot to place a player skull?
I know how to make one with a itemstack but you can't place itemstacks
are you sure there is no PLAYER_HEAD when talking about blocks?
Are you using pre 1.13?
If so you place a skull and then set the data of the block to 3.
you can place using .getType() but it can't be a custom one it can only be a steve one
Which version are you using?
Get the state of the block and cast to https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Skull.html
declaration: package: org.bukkit.block, interface: Skull
no I'm using 1.16.1
3?
I said 1.16.1
how would I do that?
sorry I'm new to spigot
Do what i said last.
but how?
how would i cast it?
idk how to cast
I just know basic stuff like:
player.sendMessage(ChatColor.GREEN + "hello");
@bold anchor thanks for your help tho
I Need Help with a Plugin..
Go ask your question ...
@solemn verge to cast means to do something like Player player = (Player) sender
Casting is to change one variable to another by putting it next to a data type in parenthesis
Im about to download some plugins for my Server, but then i ran into a problem with This plugin "EasyPlant" And the Console says this... Could not load 'plugins/EasyPlant (2).jar' in folder 'plugins': uses the space-character (0x20) in its name
so I would do block b = (skullmeta) loc.getBlock();
no
What can i do to fix the Problem and fix the Plugin?
Anyone know why this does not work ?
if(e.getClickedInventory()event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){
Yea Between P (
Not the jar name
The internal name
if(e.getClickedInventory()event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){ That shouldn't even compile?
it does not
Well yeah... e.getClickedInventory()event.getView()
Where do i find the Internal name? (Sry not a pro...)
plugin.yml
how do i fix it
Remove e.getClickedInventory()
so if(event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){
Can i speak with one of you guys to get help?
i swear you're writing this poorly on purpose lol
there's no way you can fuck it up that badly
i seriously advise stopping what you're doing and learning a little bit about the basics of the language. it will help you ten fold
my initial message would have resolved your issue much earlier
Youโd be surprised
not to mention i literally gave you, word for word, what to write in order to get it to work
its getting heated
This is why i hate asking for help. I want to try and get away from script and i am just trying to fucking learn
@subtle blade what would be the difference from thenApply and whenConfirm when trying to get the data from the completeablefuture?
The documentation for it is so fkd jeez
whenComplete() uses a BiConsumer that passes through a throwable object as well
thenApply() just uses a Consumer with the result. Throwable is ignored
CompletableFuture can complete exceptionally as well so whenComplete() takes that into consideration
if you wanted to delegate your exception through the completable future, you could do that and do your exception handling from the caller rather than from within the async implementation
Thatโs sad. I almost type Like Code. ๐ :F
hello srry if this isnt supposed to be on this text channel but does anyone have a plugin which makes a item stay in a certain number on a players hotbar when they spawn in?
i do have to say... the completable future documentation is an absolute mouthful
Returns a new CompletableFuture that is completed when this CompletableFuture completes, with the result of the given function of the exception triggering this CompletableFuture's completion when it completes exceptionally; otherwise, if this CompletableFuture completes normally, then the returned CompletableFuture also completes normally with the same value.
like, holy fuck. take a shot every time you see a variation of the word "complete"
You're 11 shots in. Lesgo
Lmao
The CompletableFutue Future Complete FutureCompletable
Coroutines >
CompletableFuture when it completes. Duh Itโs already in the name.
hello srry if this isnt supposed to be on this text channel but does anyone have a plugin which makes a item stay in a certain number on a players hotbar when they spawn in?
you're in the right channel though it's not often that people have these sorts of recommendations, especially for niche plugins like this. Most active users here offering assistance are plugin developers, not server owners
Still trying to read what does block mean when calling .get
meaning the main thread will halt trying to get the value
Like does it stop that specific operation or the entire thread
i.e. it's not async anymore
it will wait until that async task is done which... y'know... defeats the purpose of asynchronousy
then why are so many examples spamming it
we have no idea
because some people don't know how to use that API properly lol
Me: Learning Code.
Alsocode: CompletedFuture.
Innerme: We are not Immortal.
it is rare that you will ever need to call get() on a Future instance
it should all be handled through completion stages
also where did you even find things about whenComplete
i literally cant find anything but javadoc
yeah, that's where I look are the javadocs lol
though i've also had experience with this API in the past so I'm not unfamiliar with how it's used
wich just points to a interface not making it easyer to simply return that resultset
Hmm, isnโt that executed on the async thread
the thenApply() method does the same thing, only it returns another completable future with a new result. Kind of like Stream#map()
No
thenAcceptAsync() is
Ah isre
Damn, Reading that is like predicting the future. Explains alot.
Could get fancy by using both if you want
getData().thenApply(MyData::getString).thenAccept(System.out::println);
I saw that semi colon
๐
When two or more threads attempt to complete, completeExceptionally, or cancel a CompletableFuture, only one of them succeeds.
I feel like this summarizes it.
Could get fancy by using both if you want
@subtle blade where did that MyData come from tho?
I was just pulling things out of my ass, but you get the idea lol
Got a lot of stuff up there? ๐
Tell me whatโs longer the Bible or learning to code? xD
HashSets has no idea of entries
i'm confused about the question lol
Depends...java or C?
Anything can be finished if you live long enough. ;)
Unless your girl/guy left ya.
Save it as a list
Programming is a continues effort that wonโt be reached any time soon
save the hashset as a list?
Anyways off to general,
As for that Slot Plugin.
BSP addon โGUI Shop Managerโ
wym
Itโs like how a musician keeps practicing to not forget or learns new stuff to not get outdated
Would be my recommendation
k1 (If they see it lol).
public final List<UUID> someListStoringUUID = new ArrayList<>();
or do you mean it like this @bold anchor ?
I just meant you can save it as a list
holy shit my brain start to turn into a mush
ResultSet resultSet;
resultSet = (ResultSet) completableFuture.thenApply(resultSet1 -> {
return resultSet1;
});```
holy shit ima bout to simply look for another solution
๐ do all your logic in a thenAccept method
Use gson
getResult(path).thenApply(result -> {
result.getString("whatever");
// Do everything here
});```
JanTuck I meant how would you loop through all uuids in the Map to save them into the .yml file
you have your result and it's passed to that callback
Could just use taskchain
Can't you just wrap it with bukkit.runTaskAsync
You can easily loop over the values in a hashset
task chain is also a viable solution but you also have completable future just part of the sdk
Thing is i dont want to do logic
i need to return a ResultSet
why's that?
basically the object itself
Why
its basically a helper for sql
if you want to do something asynchronously, you can't
there's never a guarantee that the returned result will be available at any given point if you're fetching is asynchronously
that's why you use a callback that gets invoked when it is available
Return a CompletableFuture<ResultSet> then
time well spent i guess
lol
@subtle blade so for example everything
inside the interface "accept" will run?
@Override
public void accept(ResultSet resultSet, Throwable throwable) {
//Code goes here
}
});```
Yes
Hmm guess its pretty manageable
(though, again, you probably really only need thenAccept())
you don't delegate your exception so the whenComplete() is a bit excessive
fair enough
Ugly anonymous inner class
Looks better nothing about speed
fair enough
does &r not reset formatting too when used with TextComponent.fromLegacyText? I see it resetting the color but not formatting, like bold
Do anyone know a raid farm design that will work on Spigot?
private int randomTime;
private void registerLightning() {
List<Player> online = new ArrayList<>(Bukkit.getOnlinePlayers());
Bukkit.getScheduler().scheduleSyncRepeatingTask(main, () -> {
randomTime = new Random().nextInt(30);
world.strikeLightningEffect(online.get(new Random().nextInt(online.size())).getLocation());
}, 0, randomTime * 20);
}```
Why isn't "randomType" setting to the new Random? it's staying at 0?
someone here should make a parkour plugin with which you can detect if someone is flying during it, and a item in inventory that can tp them back to last checkpioint
I'm pretty sure that already exists and if not and you know some Java it's really not that hard to code. Just put them in a map when they enter "parkour mode" and disable flight and add an item to their inventory. Listen for PlayerInteractEvent and when they click that item just teleport them back to a checkpoint or the beginning of the parkour stage.
would looping through all players' inventories and modifying items if they fit a criteria cause lag?
Any one know why i am getting this:
[19:36:05 ERROR]: Could not load 'plugins\ExampleGui-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: main class `me.dash.examplegui.ExampleGui' does not extend JavaPlugin
does not extend JavaPlugin
main class me.dash.examplegui.ExampleGui' does not extend JavaPlugin
Pretty much means that
Make your main class extend JavaPlugin
public class ExampleGui extends JavaPlugin {
nobody is stupid, just silly mistakes.
alright
thanks
sounds easy enough
but now, if i want one of those leaderboard plugins to be able to see my player's times
what would i have to do for that
Have a data class then that stores the player's uuid, their time, and their last checkpoint
then save the time in a yml or database for future use.
if you want to store the information in a database than yes
it's really not that bad or hard imo and it's a very efficient way of storing data.
would looping through all players' inventories and modifying items if they fit a criteria cause lag?
Depends how often you are doing it
this is a stupid question but how would i call public ExampleGui() { in my code
new ExampleGUI();
i just did ExampleGUI();
dam i get java: cannot find symbol
show me
if ExampleGUI is your main class do not do new ExampleGUI
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (command.getName().equals("die")) {
if (sender instanceof Player) {
Player player = (Player) sender;
if (player.hasPermission("test.test")) {
sender.sendMessage(ChatColor.RED + "hi");
new ExampleGUI();
} else {
sender.sendMessage(ChatColor.RED + "You Don't have permission");
}
}
}
return false;
}
}
You have to do something like ExampleGUI myGUI = new ExampleGUI();
any way to show more details like coords of death
06.08 02:48:08 [Server] INFO loveandy was blown up by Creeper
then player.openInventory(myGUI.methodName());
Oki ty
I would just put the player identifier and then a unique key of some sort to represent the achievement
public void onEnable(){
this.getServer().getPluginManager().registerEvents(this, this);
saveDefaultConfig();
loadData();
}
public void onDisable(){
saveData();
}
private void loadData() {
if (getConfig().getConfigurationSection("GUIinformation") != null) {
for (String lore : getConfig().getConfigurationSection("GUIinformation").getKeys(false)) {
UUID uuid = UUID.fromString(lore);
List<String> listString = getConfig().getStringList(lore);
guiInformation.put(uuid, listString);
}
}
}
private void saveData() {
for (Map.Entry<UUID, List<String>> guiInfo : guiInformation.entrySet()) {
getConfig().set("GUIinformation." + guiInfo.toString(), guiInformation.get(guiInfo));
}
saveConfig();
}```
Each achievement is its own row, not sure if thatโs the most efficient way but itโs easily expandable because you donโt need to add more columns to add new achievements
its not saving anything
private final HashMap<UUID, List<String>> guiInformation = new HashMap<>();```
btw
I was thinking of storing uuid, achievementA, achievementB, etc. and then have it set to like true and false
just trying to weigh every option and see what will work out best and be the most efficient
any1?
Anyone have time for yml assistance? I have a long command that is confirmed working in the console, but because it contains item naming/data stuff it is full of single and double quotes, which I can't just escape or encapsulate in a simple way. I've tried multiple methods of escaping things, and the ONE time I got notepad++ to actually show it as a properly encapsulated string it said "invalid escape character" on the singlequote escaped with another singlequote (as the yml primer I was following said to use).
- "replaceitem entity %player_name% armor.head turtle_helmet{display:{Name:'[{\"text\":\"Grippli Respiration\",\"italic\":false}]',Lore:['[{\"text\":\"You can\\'t wear helmets,\",\"italic\":false}]','[{\"text\":\"but you can breathe\",\"italic\":false}]','[{\"text\":\"underwater for longer!\",\"italic\":false}]']},Enchantments:[{id:binding_curse,lvl:1},{id:vanishing_curse,lvl:1},{id:respiration,lvl:1}],Unbreakable:1,HideFlags:39} 1"
nevermind, NP++ is being dumb and just highlights it wrong.
guys i need help
im bad at spigot
here's my issue
I have a block at a location
it is a spawner
first I want to set its block entity data
like i t this command
/setblock ~ ~1 ~ spawner{SpawnData:{id:zombie},Delay:299}
the stuff like SpawnData and Delay
second, I want to get the block entity data
so I want to be able to get this stuff
how do I do this
Block.getState cast to creatureSpawner
ok
but then I don't know what to do after that /:
because
like
I know how to set the zombie as the id
wait actually give me a second
does anyone know of a good tutorial on how to make a gui?
google has some pretty good ones
Youโll have to use nms to modify stuff like that
I donโt believe there is any API for it
alright epic
I can't even get the data as a string
bruh
I don't know how to convert CreatureSpawner interface into NMS Spawner
oh
can I use getMetadata for that?
since it implements Metadatable
does getMetadata and setMetadata have that infor?
No
I think you can use worldServer.getTileEntity
hm
custom blocks?..
I don't want to use mushroom blocks
Spawners are too laggy in large amounts unfortunately
it will be a great day when we can natively have mods that are server only and only require a resource pack on the client
without mods and shit
@lone fog what are all the methods
theres mushroom blocks best solution
armor stand + barrier laggiest and you can't break blocks
and spawner which is less laggy than just straight up armor stand but is still laggier than mushroom blocks
mushroom blocks are the best but they're also limited
because you don't have basically infinite additions
the spawner is laggier than the armor stand
Some other plugins are already using the mushroom blocks
it is?
yeah, the client has to render the spawners
I thought tile entities were less laggy than normal entities
normal entities is heavier on the server, spawners is heavier on the client
ah I see
Thereโs a new one in 1.16
hm?
ooh, which one
Walls have a bunch of unused block states
ohhh
pogchamp
so adding on to mushrooms then?
And can make more shapes than mushroom blocks
we can have even m ore mushrooms
well you can modify the model for each blockstate of the mushroom blocks right
Unless mojang comes out with something first
right
@quick arch I would like to use barriers and armor stands if its less laggy on the client
but
you can't break barriers in survival
and I want players to mine my blocks
oh, just change it to something else, i.e. stone
You can use any block if the armor stand model covers it
and make the armor stand slightly bigger?
Which is nice for breaking speed
It also allows you to have stair shapes and stuff
But yeah itโs just too laggy on a large scale
that one was with a stone block and an armor stand
the only annoying part is you can't get block breaking textures that way
ยฏ_(ใ)_/ยฏ
I guess you could if you really wanted to
by like rapidly changing the model
but that would be a major paing
pain
the real epic thing
Skript, ew
would be if mojang added custom model data for blocks
do hope that's coming soon
but i bet that would require some rewriting of the render engine
Simple data driven blocks would be nice
because I believe minecraft renders the world to one mesh instead of a seperate mesh for each block
But it would need to be sent to the client
require some rewriting of the render engine
Pretty sure they rewrote it in 1.14 or something
1.15
i mean if forge can do it mojang can too right?
i mean its not like sudden resource loading
actually disregard my previous statement
forge is server and client side though
They would need to add something like a ContentPack
well you know what
And then send it to the client on login
they wouldn't really need to rewrite the render engine
because the way it currently works, whenever you reload the resources, it puts new models and stuff into memory
so obviously there is a method
since we're not adding new stuff on the fly
we're adding i t when resources are reloaded
at least new models
so I think its possible
I wonder if mojang is working on it? It's possible they tried it and it was too laggy...
or they just don't give a shit ยฏ_(ใ)_/ยฏ
It feels more like 75% of the feedback site is "1.8 pvp"
lol
well like the top thing is cave update
so obviously people have some priorities
Forget about the cave update, I'd rather have custom blocks
that's true
Could just make your own cave with that update
lets make our own cave update
:D
exactly
baobab
It almost feels like the next update is going to be about the desert
but mountains are next...
is mojang pulling one over on us
probably
the only winter thing on that is the Goat
And we also have the new combat update at some point
Frogs and desert stuff was also in the biome vote
when did they add custom model data?
And termites, chest boats, etc
1.14?
Technically they have 5 biome updates they said they would do eventually
Who knows when
exactly
maybe they'll do the first two before the 3 new ones
nobody expects that
so desert and the other one
+5 years ๐ฌ
There's mainly around 1 update per year or something
2
๐ค
They aim for 2
o
remember 1.13
you mean 1.14
almost a year
that was actually when I first got into minecraft
didn't notch used to do updates like weekly/monthly
way back when
when the game was simpler
yeah
1.0 to 1.1 took only 2 months
To be fair they seem a bit bigger now
And they keep doing big rewrites internally
which will hopefully make newer updates faster
gotta get rid of all that shitty notch code
from back when he was not an experienced developer
nah jk
And they keep doing big rewrites internally
heh, Optifine 1.15 isn't out while Optifine 1.16 is out
yeah, preview 30
he's not gonna make any more
when a new version comes out all old version development ceases
mhm
notch can make a game in lwjgl
the most i can do is make the screen pink
i'd say he's a pretty good developer
also wasn't the first version of cave game made in like a day
or a week
or some very short time period
rubberninja is typing
or not
I'm looking for someone who has worked with paginated GUIs before. PaginatedMenu class - https://paste.md-5.net/ovudexipey.java and my GUI class - https://paste.md-5.net/axuxayurow.java . I currently have an array list of strings of 31 phony punishments. In my PaginatedMenu class I set the limit to 28 items per page, however, items 29, 30, and 31 still show up on the first page and nothing shows up on the second page. There are no errors, yes I registered my events, and yes the list is populated. I can open the GUI as intended, however, items after 28 aren't being added onto the next page.
@quick arch @lone fog I'm going to upload this post to Minecraft Feedback
In 1.14, a new feature was added to Minecraft: Custom Model Data! This new feature allowed developers of datapacks and custom maps to add new items without having to use item durabilities. This allowed datapack developers to add new items to the game without having to take the slots of other items (like low durability versions of hoes).
This feature has added so much to the game and is so helpful. So when is it going to come to blocks? I understand it is a big undertaking to add this feature for blocks, but it would be so helpful to the Java edition community and would really allow for extensive mod support using only datapacks and resource packs, no external tools.
Datapack developers currently get around this by using armor stands wearing an item with custom model data, or putting an armor stand wearing an item with custom model data in a structure block. These are laggy methods that give a subpar experience to players. Don't get me wrong, this is some powerful stuff, but support for CustomModelData with blocks would open up so many possibilities for modding Minecraft without an external tool, just a resource pack and a datapack (and maybe a text editor and photo editor to make those with ;) ).
Does this seem good? Any edits I should make?
Yeah that's good
Epic
Posting
ok its pending approval so I don't know if you can see it
but here's the link
seems like you can't see it until its approved
well check back on it tommorrow i guess
gn everyone
yup can't see it
I am looking to set a timer for an event I want to happen in 1.15.2. Any help / suggestions?
I mean honestly man, I just use multicraft for most scheduled events I have. There are loads of ways to do scheduled events, a lot of people are disgusted by multicraft, because they associate it with shared servers. However, you can attach multicraft to a dedicated server and it runs perfectly fine.
is there aplugin for making it so if someone does a command it does sonthing different?
that what the command is
I don't understand what you even mean by that. You can make a command that is "/Dog" do literally anything you want
I mean, I'm pretty sure /kill is built into spigot. You might be able to make a plugin and create a /Kill command. I'm not sure if it would override it or not, I've never done that. Why would you even want that.
becus
What?
I mean I guess maybe you could cancel to playercommandpreprocessevent when they type it, and then do something else? I mean that would be so weird but it might work
well I am trying to make a plugin that every 5 mins it randomly teleports players to somewhere in the world and I need a timer in the code.
I mean the only timer I'm really personally comfortable with is a bukkit runnable, however I'd probably get shit on in here for suggesting you should use it haha. Really any timer within java or bukkit will work for that.
/spreadplayers ๐ค
i installed buildtools but i cant see git
it isnt in the start menu and i cant right click to access it...
you have to download git manually
oh
How can I have a player open their own inventory? with the armor gui showing
If I have a Location with world already set.. how can I fix this to remove the .getWorld() ```List<Entity> entities = new ArrayList<>(l1.getWorld().getNearbyEntities(l1, 25, 25, 25));
[this is location already grabbed] Location l1 = new Location(dl, -32.0D, 65.0D, 89.0D);```
how would i stop vindicators from dropping banners and iron axes
EntityDeathEvent??
Hey I am pretty new to spigot plug-ins and I was wondering if I need to state a class other than the main class in the yml doc
@steady osprey try event.getDrops().clear();
@viscid tundra if youโre talking about the plugin.yml then no.
K thx @balmy sentinel
try event.getDrops().clear();
@balmy sentinel that would remove all the drops though
event.getDrops() returns list
iterate over list and remove specific items if they meet a criteria
how would i remove them from the list though
same way you remove any object from a list.
thats no help, how would i figure out the index of the item i want to remove
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html check List.remove(Object o)
Isn't that the basics of Java tho?
yes
pretty much so I donโt understand how my response โwas no help.โ If you donโt understand something then use your search engine to look it up. and that search engine better not be google
what else am i supposed to use microsoft edge ๐
DuckDuckGo is actually very good and useful if you know how to use a search engine. DuckDuckGo also doesnโt save and sell your data to other companies like google.
bing it
id rather stick with google
every single thing you touch saves your data ๐ค
^
yep
how do u know duckduckgo isnt saving ur data
welp china gonna see the freaky stuff in my search history, idc lol
๐
Iโd prefer to stay on topic for this channel, but if youโre interested look and read up on them. (Edit: https://duckduckgo.com/privacy)
I mean who cares if Google saves & sells your data lol ๐คทโโ๏ธ
Does anyone know of a plugin that allows a github repository to be used as a file store for a servers config files and syncs it automatically?
How can I have a player open their own inventory? with the armor gui showing, not the player.openInventory(player.getInventory) or is that client side
When a player opens their own inventory itโs client side
Ok but is there any way to replicate the armor gui?
How do I hide my custom command from users who dont have permission to use it
no idea, you could create your own GUI and have it mirror what armor a player currently has on.
@faint lance check if they have permission to execute it.
I think he means stopping the client from seeing it on the tab list
I want to hide it from them
mhmm you could try tab complete, but Iโm not sure.
@faint lance I found this, but itโs only 1.7-1.13 https://www.spigotmc.org/resources/command-hide.24492/
I found that as well
hi cna i get help with cpanel
how do i disable people to redirect to the domain
nd only allow connections within the server
Hey md I found your Spigot-Plugin project and I'm having watchdog issues.
It says to report the issue to http://spout.in/cbpp but the URL seems dead :/
Says The server has stopped responding! and then a stacktrace.
spotted pls, let vic use the most performance increasing CraftBukkit plugin out there
It only happens when I use https://github.com/BukkitDevTeam/Spigot-Plugin
Without it installed I don't get any crashes
:/
@strange roost do u know?
?
why is it breaking
pls help our server is dying
Have you tried turning it off and turning it back on
how do i get only the first word of a string and delete all the words past the first word?
string = string.split(" ")[0]
ok thanks
when I try to set PlayerFishEvent drops to Material.AIR or null, it throws an error and gives a normal drop
when i try to cancel the event completely, the bobber stays in the water
is there a way to make the catch nothing (without errors) or retract the fishing bobber when i cancel the event?
How do you make it so players cant use the /pl or /plugin command?
when I try to set PlayerFishEvent drops to Material.AIR or null, it throws an error and gives a normal drop
when i try to cancel the event completely, the bobber stays in the water
is there a way to make the catch nothing (without errors) or retract the fishing bobber when i cancel the event?
event.getCaught.remove
is there a way to get BuildTools to be silent?
I want to run java -jar BuildTools and see no output until it done, is that possible?
ok so I'm running java -jar BuildTools.jar > /dev/null but that feels dirty, are there any flags for this?
thank you Coll
can i store an int in a persistant data tag
how do i get a specific scoreboard tag which stores a variable
If this is not the right place then I apologise, but I'm currently running a network just by running the jar file hosted myself. Is there anyway I could use a web panel and which one?
how do i get a specific scoreboard tag which stores a variable
i am a beginner in use of NMS and what not. I've watched youtube videos where they are able to import multiple versions of NMS on the same project? (notably: https://www.youtube.com/watch?v=Yzte-aAfFsQ)
but they don't go any detail into how this works. as if they just made the tutorial and are fine with how it "just works" and not actually going into specifics. could someone explain that to me?
for example: i only have one import here https://imgs-i.sabel.dev/w3ptspp.png
Hey everyone!
I have a question/bug regarding aliases
I am new to Spigot, and haven't checked if this problem exists in other versions besides latest (1.16.1)
The problem is:
My aliases are registered to the command list in the server (they are suggested in the tab completer if I just press /)
But most of them aren't really registered....
plugin.yml as follows:
commands:
addGravityBlock:
description: Add a gravity affect to a block.
usage: "ยง4Usage: /addGravityBlock <block> <gravity>"
aliases: [gb, gbAdd]
removeGravityBlock:
description: Remove a gravity affect from a registered block.
usage: "ยง4Usage: /removeGravityBlock <block>"
aliases: [gbRemove, gbRem]
listGravityBlocks:
description: List all blocks registered with a gravity affect.
usage: "ยง4Usage: /listGravityBlocks"
aliases: [gbs, gbList]
You're right, I'll clarify:
It means that if I use them - I get the "command not found" thing (the one that tells me to use /help to see all commands)
that syntax works on my plugins and they work fine in 1.16
how do i get an equation from a message
Interesting, I'll try to update my spigot, maybe it is a bug that was fixed already..
@warm stirrup NMS isn't recommended unless you really need it. It's higly version depended and will break with almost every update
...
cool. i really need it
Alright what are you trying to do
actionbar
ah I see
ive taken a look at this page https://www.spigotmc.org/wiki/nms-on-different-versions-without-reflection/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
which literally uses actionbar as an example but it goes into no detail as to how to actually be able to import multiple versions
You will have to add every jar to the project
I would just manually install all of the jars in to the local repo
Not sure what's the best way
you can i think just remove everything exceppt the nms classes
in repo
for each version
that way no clashes will happen
due to their package difference
it's a hack tho
I know a certain repo that might contain NMS...
I'm 99% sure they shouldn't but they decided to put it there
yeah you cant distribute that :/
here's what im trying:
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
then of course i put another dependency with 1.15.2 instead
but then it yells at me for it being a duplicate
Yeah you need modules
One module per version
And then a parent POM that compiles everything together
but I would have multiple jar files, one for each version, no?
yeah that isnt exactly what I'm looking for either. my goal is to have a jar that works no matter the server version
Then you need reflection
do my hack then
๐
create local repo with only the nms package
and of course craftbukkit package
i think i know what you're getting at thanks. so either way im still gonna have those folders with the different versions
If you're using reflecton you don't need all the versions
Reflection allows you to get the class from a string
Which means that you can do something like "net.minecraft.server." + version + ".actionbar" and grab the actionbar class. This will also allow you to access all of it's methods
I do have to note that it's slower
is there a way to put " : " to "unknown-command:" on spigot.yml
yee that one video noted that it takes like 400ms longer to do that method?
but in theory it shouldnt be that bad if i have a switch statement for each supported version?
You don't need a switch statement
All you need to do is grab the correct NMS version on startup and then grab the class with reflection
Then when you want to send the actionbar you need to invoke a method inside of the class
You can easily use a multi module system to put together one jar that works on all the versions you wish to support
do you mean "one jar" as in like one jar for each version? because yeah that's not quite what I'm looking for
No
It will create one jar file for all versions
no lol
oh
internally each module has only a dependency
which then you will add them to a parent
Hey
i think this is what confused me https://imgs-i.sabel.dev/nqcWG9m.png
so i can use maven just how ive been doing it, I just need modules for each version and maven will sort it all out?
sort it all out as in, make one jar file that works
oh sorry for confusing you
