#help-archived
1 messages · Page 181 of 1
I'll just intercept the item packet and add the Flag so i dont break every pattern on his server when he decides to remove the plugin.
You can do it without packets but then its permanent
Here you go. @frigid ember
Ah
Im trying to install the build tools but I cant because I have onedrive
I have tried deactivating the folder from one drive
but it didnt work
I have now uninstalled onedrive
it still says onedrive in the address
i have restarted my pc after uninstalling
What?
So you went here;
https://hub.spigotmc.org/jenkins/job/BuildTools/
And downloaded the BuildTools.jar but its in your onedrive?
I have followed this guide https://www.youtube.com/watch?v=QdV-3OtXcPY
but when at the end it says i cant have it installed with onedrive
and i have git hub and the latest .jar file installed
Windows 10 ^4 bit
65 bit
64
Just create start.bat
write
java -jar BuildTools.jar --rev 1.16.1
In it.
Copy it to the folder that your BuildTools is in and doubleclick the start.bat
A batch file. Basically Windows' shellscript
In simple terms: It executes the line you write in it
but how do i create it
Whats the sound effects that most similar to opening a chest in fortnite, like a "reveal sound" after you open some sort of lootbox
rightclick somewhere. new -> textdocument or something -> change ending from .txt to .bat
The rightclick the bat file and click edit
hopefully a dev sees this:
i have copied and pasted java -jar BuildTools.jar --rev 1.16.1 into it
looking at https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/75a2fb8e0be1be0351966f9824648eeb58167b44, which fixed the issues with structures generating based on the setting of the main world, it seems that the theme with 1.16 and multi-world support has been replacing getMinecraftServer().getSaveData() with worldDataServer.
so why not just find and replace all instances?
double clicking it tries to open a prompt
Then put the bat and the BuildTools in a new folder and execute the bat
oh
it has done nothing
the same notepad doc comes up with Loading BuildTools version: git-BuildTools-19d26b6-120 (#120)
Java Version: Java 8
Current Path: C:\Users\benja\OneDrive\Desktop\build.
Please do not run BuildTools in a Dropbox, OneDrive, or similar. You can always copy the completed jars there later.
Then dont run it from a OneDrive directory
Turn it off
What? So you cant create a folder in C:\Users\benja
Like C:\Users\benja\buildtools
And while you’re at it, burn it
the address come up as C:\Users\benja
Like C:\Users\benja\OneDrive\buildtools
I dont understand. I have never used onedrive but this sounds absolutely trash.
So you dont have acces to your C:\ drive at all? Like if you navigate there and create a folder it is moved somewhere else?
i went into local disc and created a folder called build and the address is C:\build
but then moved it to desktop and the address went back
Thats not a feature. That sounds more like a virus. Uninstall it to death.
onedrive is an offical microsoft sofware
wait i moved it into the local disc
and clicked the start.bat
and its downloading
Starting download of https://static.spigotmc.org/git/PortableGit-2.24.1.2-64-bit.7z.exe
Downloaded file: PortableGit-2.24.1.2-64-bit\PortableGit-2.24.1.2-64-bit.7z.exe with hash: cb75e4a557e01dd27b5af5eb59dfe28adcbad21638777dd686429dd905d13899
Extracting downloaded git install
onedrive is supposed to back up your files
so... you now have C:\start.bat? You just moved it to your plain disk?
no i moved the folder with the buildtools.jar and start.bat into disk
k
now there are new folders
work
spigot
craftbukkit
bukkit
builddata
apache maven 3.6.0
portablegit
yes. stop. You only need your spigot jar.
*stop listing the folders you have
oh
Hah... stop.bat. Good one XDDD
buildtools will create a few directories
disregard these as once buildtools finishes without errors, you will have a spigot server jar in the same directory as buildtools
Would anyone by chance know why I would be getting a ton of SQLite related errors on the loading of plugins? Every plugin that's saving into a sql/h2 database seems to be throwing out errors similar to this world guard one. Running on CentOS 7 at the moment and these errors have just now popped up out of nowhere. https://gist.github.com/Stampede2011/7cf9cee7c3fc410f7cde7a34134053f3
Could you type java -fullversion in terminal and tell me what it sais?
It returns openjdk full version "1.8.0_242-b08"
Does it say if its 32 or 64 bit?
It's 64bit. java -version returns:
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)```
Normally a UnsatisfiedLinkError is thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method.
So its either a problem with 32bit vs 64bit java vs database or your operating system doesnt support the used methods.
Is the mc server application running on a local machine?
Or on a server
Dedicated machine from OVH, yeah. That's very strange considering I haven't touched Java in quite some time and it's been running smoothly for over a year
You can try updating java and your os.
Any particular reason you chose CentOs 7 over 8?
people do love their outdated software don't they? 😂
i remember using 7 like i dunno 6 years ago
Made the server 3 years back but should've update it by now anyway
...
realistic world plugin
Did you use paypal or another payment method
realistic world generation* sorry
Wait... paypal is the only way atm right?
And the payment occurs in your paypal history of purchases?
yes, I discount it
wdym by "discount it"
?
What do you mean by you "discount it"
What discount?
Yes it sometimes takes a while
There are occasions where ppl had to wait for one or two days.
Patience is a virtue
I never had any problem and had to wait 2min at max. Maybe you are just unlucky maybe paypal or the spigot servers are slow at the moment.
I would at least wait for the rest of the day. If nothing happened by then i would contact the plugin author and/or spigot staff.
If they just sent me what I have to do, thanks anyway c:
Just wondering, can you buy a resource with an unverified PayPal?
Hmm? I mean you can try
I don't know, I think mine is verified
Hi,
Im making a command that makes a new world and I want to set the worlds global flag settings when the world is created(I have the world creator code) how would I set the global flag settings? example, disable pvp, tnt explosions and block breaking
What do you mean by global flag settings? The gamerules?
using worldguard i want to set the global variable things so people cant break blocks and set off tnt for example
instead of a region i want the whole world
ok
Hey, i've been coding this gradient command for my Plugin but for some reason it's not accurate on the end. Anyone know why this could be the case?
It just generally doesn't look right lol
First of all. Use a StringBuilder. Concatenating Strings like this is extremely inefficient.
for the hex inputs?
For everything.
You create a StringBuilder, then .append() more to it and in the end you call .toString() to get the result.
oh you mean in the forloop?
Strings are immutable. Meaning if you add another String to an existing String, both objects get discarded and a completely new String is created.
And that happens every time a new String gets added. So it pollutes the garbage collector and generally takes a lot of CPU time
Like this?
StringBuilder sb = new StringBuilder();
sb.append("#"+String.format("%02X", r1)+String.format("%02X", g1)+String.format("%02X", b1)+chars[0]);
for(int i = 1; i < chars.length-1; i++) {
int Red,Green,Blue;
if(rs < 0) {
Red = Math.round((r1+(distancer*i)));
}else {
Red = Math.round((r1-(distancer*i)));
}
if(gs < 0) {
Green = Math.round(g1+(distanceg*i));
}else {
Green = Math.round(g1-(distanceg*i));
}
if(bs < 0) {
Blue = Math.round(b1+(distanceb*i));
}else {
Blue = Math.round(b1-(distanceb*i));
}
if(rs == 0) {
Red = r1;
}
if(gs == 0) {
Green = g1;
}
if(bs == 0) {
Blue = b1;
}
String RedS = String.format("%02X", Red);
String GreenS = String.format("%02X", Green);
String BlueS = String.format("%02X", Blue);
sb.append("#"+RedS+GreenS+BlueS+chars[i]);
}
sb.append("#"+String.format("%02X", r2)+String.format("%02X", g2)+String.format("%02X", b2)+chars[chars.length-1]);
String result = sb.toString();
return ChatEventListener.translateAlternateColorCodes(result);
Yes
This is redundant
oh okay
And yea i know my variable names are trash
also its chars.length()-2 because i want the first and last character to be the input hex.
return ChatEventListener.translateAlternateColorCodes(result); What does this do?
This basically turns #FFFFFF in the hex format
public static String translateAlternateColorCodes(String input) {
input = ChatColor.translateAlternateColorCodes('&', input);
input = input.replaceAll("#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])", "§x§$1§$2§$3§$4§$5§$6");
return input;
}
Ah ok
so hex1 is your start color and hex2 is your end color?
Yea
Shouldnt it be (bs * -1) / (chars.length - 2)
I have all 3 of them
What do you mean you have all 3 of them?
Nice
Thanks for the help 😄
np
I did many tries yesterday and i think i forgot to just add the () i was tired lol
?paste
@gusty comet Did the StringBuilder work?
If not here is my working version with it.
https://paste.md-5.net/xuvurajeni.js
@gusty comet Did the StringBuilder work?
@grim halo yes
Also its better but still not perfect...
XD
i want to get a random location for all online players
the location should not be more than 500 blocks away, and i need 3 int's
how can i do that
500 Blocks away from what?
Ah ok. Do you know how to generate random numbers?
yeah, but atm i dont get how to get the bound in this way.
I would only calculate X and Z and then use Location.getHighestBlock() or something
it should be a random y too
But then he is in the ground
ThreadLocalRandom random = ThreadLocalRandom.current();
random.nextInt(start, end)
int x, y, z;
location.add(x, y, z)
Random y too?
its like a challenge, every player gets an random location to be at in random time between 3-5 minutes
Is it possible to make the config use the default options if the option is not set in the server config?
I don't want to use getString(path, default)
and then in the time he has to get there
Ah ok.
Random rnd = new Random();
int coord = rnd.nextInt((256 - 5) + 1) + 5;
for y its no problem, but i dont get it with x and z, as it has no "border" if you know what i mean
wtf nvm
meant this
private ThreadLocalRandom random = ThreadLocalRandom.current();
public Location getRandomLocation(Player player, int radius) {
World world = player.getWorld();
Location loc = player.getLocation();
return new Location(world, loc.getX() + random.nextDouble(radius), loc.getY() + random.nextDouble(radius), loc.getZ() + random.nextDouble(radius))
}
Just make sure they don't suffocate before teleporting them
i am not teleporting them
oh okay
public Location getRandomLocation(Player player, int radius) {
World world = player.getWorld();
Location loc = player.getLocation();
return new Location(world,
loc.getX() + random.nextDouble(radius),
loc.getY() + random.nextDouble(radius),
loc.getZ() + random.nextDouble(radius));
}
its maybe hard to explain,
i am creating a random location, sending them to the players, and they have to get there between 3-5 minutes (random)
if they do it, after 8 mintes it goes on etc, if not they are dead
"challenge" like
Or even simpler
private ThreadLocalRandom random = ThreadLocalRandom.current();
public Location getRandomLocation(Player player, int radius) {
Location loc = player.getLocation();
return loc.add(random.nextDouble(radius), random.nextDouble(radius), random.nextDouble(radius));
}
Oh and you need to be sure that 0 < Y < 255
That'll ignore all the possible negative values tho.
Ah true
well i will try a bit, thank you
private ThreadLocalRandom random = ThreadLocalRandom.current();
private double midRand(double value) {
value /= 2;
return random.nextDouble(-value, value);
}
public Location getRandomLocation(Player player, int radius) {
Location loc = player.getLocation();
return loc.add(midRand(radius), midRand(radius), midRand(radius));
}
this will make it?
Not quite. You need to make sure that 0 < Y < 255 so they get reachable spots
well...
Expected 0 arguments but found 2
at the return of the double
my mistake, had another random with name random
Hi, it there a way to remove a half random selected entities of a specific type in 1.12.2?
And not writing a plugin specifically for that
with code? just use the EntitySpawnListener i think
well...
maybe there is a plugin for it
but i dont think its possible without plugins
Yes I'm looking for a plugin or a vanilla command. I know it's possible in vanilla 1.16
well, should i code it fast?
if yeah, just send me private all mobs you want to deactivate
It's just wither
so you just want to prevent the wither from spawning?
No, I want to limit it per chunk and remove half of already existing withers
I already found a plugin for limiting
then try that
ah i see, so you dont have an anarchy server? haha
32gb
Xeon something
how can it lag with 32gb wtf
you are going to want to generate your random numbers in another thread btw
yeah i know
What do you mean?
I recommend generating a few random numbers based off the amount of players you have then stuff those in a list
since you want no more then 500 you only need to generate numbers in the range of 0-500
Why does he need to generate them in another thread?
because Random will become cpu intensive if used a lot
so what you can do is generate your random numbers ahead of time
well, can i use something like create a random number between 0-500, and then just use player.getLocation.getBlockX.add(theRandomNumber)?
the problem is generating the random numbers here. If you are constantly generating random numbers it is going to become cpu intensive and start lagging the server
how you decide to go about it is up to you. All I can do is inform of you of the drawbacks of some methods
Depends on what kind of random numbers. If it's not cryptographically safe, than it's not soo cpu intensive I think
in this instance, you can generate the random numbers in another thread ahead of time before you even need them
well, can i use something like create a random number between 0-500, and then just use player.getLocation.getBlockX.add(theRandomNumber)?
@tough kraken the question is, would it work? because it think it would only generate +coords
@kind crow depends on how often and how many players 😛
have to take into account it is being done on the main thread as well
If it's not in hundred thousand s it's ok I think
@tough kraken the way I am talking about you can do an inverse operation to add negative numbers to the list
Just make sure it's least safe random generator
i can maybe post what i am using for only y-coords, its about 6 months old a bit later as i started coding, so its probably crap, but i am too lazy atm to chang it:
?paste
and then its just a matter of picking at random a number in the list.
@kind crow other thing is how large the range is as well
https://paste.md-5.net/ezihepaguv.java
dont hate me about this xd
trust me, getting new random numbers will become cpu intensive and it doesn't take much on a minecraft server to make that happen
I just generated 1.5k numbers (would be enought for 500 players) in 1.7ms
I dont think that will ever be a problem
it is one of the primary reasons randomTP lags the servers 😛
it isn't a problem to do it ahead of time @grim halo it is a problem when you got a bunch of other things going on lol
Its <1ms in one tick only. I dont think you should worry about that.
Unless its in a hotspot
Yeah it's probably better to do in a separate thread since minecraft isn't really multithreaded anyway you should use that free threads for something
why would a bussy server take longer?
load up some player objects about 50 of them and have them go do random stuff while at the same time generating numbers in the range of 500 and the schedule it every 8 minutes per player 😉
because code gets excuted in order
and then loops around again
exactly
if you execute the random stuff enough times it will cause the main thread to start lagging 😉
so the main thread doesnt magically take longer to generate numbers just because he did a bunch of other stuff before
depends on what is going on really
Not really unless JIT kicks in
look if you want to test it out properly load 50 player objects set those npcs to do random things
and then start generating random numbers for those player objects
and then tell me it doesn't lag the server 😉
If you don't want to believe me so be it, all I can do is inform of performance problems with certain methods
All speculations. The burden of proof is on you. Im the first one that supplied data.
true. Still better than speculating 😛
I am not speculating
Ok maybe im missing something here... why exactly would the main thread take longer to generate a number with an increasing number of Player objects on the server?
because the server has to do more work, more objects are loaded into heap space, the GC has to do more cleaning up
there is more going on in the JVM then just what you can visually see code wise
L2 cache being occupied because of stuff needing to be executed etc
anyways, like I said, don't have to believe me 😉
Last time i checked the GC doesnt run on the main thread
nope but it can certainly do pause the world GC's
you will never stop that from happening but you can cause it to be invoked more often with generating new objects and then throwing those objects away however
Still. I dont think generating 150 random numbers once every 8mins will ever take longer than half a millisecond.
per player
3 per player. 150 if you have 50 players
its not just 3 random numbers
should probably check where random gets its randomness from 😉
Ok i checked. It just uses a value taken from the current CPU state and does some arithmetic with it.
Your point?
last I checked it comes from dev/random which only gets filled up from running applications. so now you have I/O as well as bunch of other numbers and some math, then it will filter out what you want to get you within the range specified. So we are generating 3 random integers as the method is being executed, do some arbitrary math. And then afterwards throw all them objects that were just generated away once everything is done. and that is per player.
so yes CPU state
Use getString or default method or get out
There is like 0 reason for you not wanting ti use it
Im following the seed generation and dont see anything remotely close to IO
It'd be more convenient to just set a boolean instead of doing config.getString("blah", config.getDefaults().getString("blah")) every single time don't you think?
And thanks for giving such a lovely friendly answer.
@grim halo you are not going to grab the cpu state directly
try to and the kernel will be very unhappy with you 😉
hence, by default java grabs randomness from the dev/random
it is what it is for
Crypto, then write a method that wraps that shit?
declaration: package: org.bukkit.configuration, interface: ConfigurationSection
you can addDefault values to MemoryConfiguration
then it is just a matter of grabbing it whenever you want.
however, you are under the assumption that the server magically knows what the default is without being told
I already know I can use a wrapper. I just asked if there's an option or not. I got my answer thanks.
the other way you could do it, is grabbing the default config from the jar as a resource
which you can then use to map to default values
Yep, I'm doing that.
InputStream stream = plugin.getResource(resourcePath);
if (stream != null) config.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(stream, Charsets.UTF_8)));
then use that combined with addDefault
with MemoryConfiguration
and voila you have your default stuff if something isn't set
What's the point of addDefault if I'm already setting the defaults?
you don't have to specifically use it
can just stick with setDefaults
or even use getDefaults
in either case though, regardless of what you decide to do. The server needs to be told what the defaults are that is, it must come from somewhere lol
and you don't really need a wrapper either
Can just extend the Yaml stuff using your own yaml classes
server uses SnakeYaml for its implementation. All the API does is provides some convenience methods for Yaml
Yes, I know. Thank you.
well... if i only want to create one location, how do i do that best with multiple players?
as i cant get just the location from the player as outgoing location, because its not only one player
like if all players are standing in a circle, getting the middle point
something like this
Is it good idea to limit CPU whenever server starting? Nowadays, bungee arena system makes other server in same instance laggy due to CPU usage but I've to restart to the server... What should I do?
I have 32gb of ram,but I heared it's not recomended to use more than 10gb for one server. What can I do with the rest to improve the server's performance?
Do they do that automatically? Because the server doesn't use more than half
if you really want a superfast server, toss your server into a ramdisk 😛
Depending on the size of the server, that might not work 🙂
I can't use ramdisk, because the world is more than 200gb
oof
Is there a way to have frequently used chunks in ram so it doesn't have to save them to hdd as often?
how can i actually cast the player at bungeecord? because i see its a bit different from spigot/Bukkit
i know , probably with ProxiedPlayer, but how for ex. cast them in events
ProxiedPlayer p = event.getPlayer()
ProxiedPlayer p = (ProxiedPlayer)sender;
It is right tho
oh wow, had to restart intellij, it showed cant be casted, but now its working, ty
Hey, I'm new to Bungeecord development and was wondering if anyone can help me with fetching a string from a data folder? I am using the following ConfigManager - https://github.com/CookLoco/ConfigManager. I want to pull a string from the data folder "motd.yml".
Proxy.getInstance().getDataFolder("motd.yml").getString("motd") does not work.
Anyone knows how works Location (org.bukkit.location)? I always getting null pointer on every method
uhm... if i send a message, it happens exactly nothing.
why? no message in console, or even mc-chat
nvm i see the problem
yeah
i am sending a message ude
dude
after cancelling
i think you do not know the sense of #setCancelled
When it's cancelled you cannot do anything
Bro
Joke?
please... you only can be a troll
What?
the problem was this
if (event.getMessage().contains("&")) {
and not the event cancelling, wtf
at me.forumat.cookies.util.Machine.pasteSchematic(Machine.java:74) ~[?:?]
at me.forumat.cookies.listener.PlaceListener.onPlace(PlaceListener.java:54) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_232]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_232]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300) ~[patched.jar:git-PaperSpigot-"4c7641d"]
... 19 more``` Why my plugin can't find the Class ?
The class exists
In the Plugin.
Do you mean me ?
at me.forumat.cookies.util.Machine.pasteSchematic(Machine.java:74) ~[?:?] at me.forumat.cookies.listener.PlaceListener.onPlace(PlaceListener.java:54) ~[?:?]
that seems to b the problem
yeah
can you paste the whole class?
?paste
?paste
Hello? So my friend got banned from spigot for "Using Alts to rate himself" but he says he didn't do it, and he already sent an unban request to the unban email, how long does it usually take to get an answer? Also how long is the ban?
Hey, I'm new to Bungeecord development and was wondering if anyone can help me with fetching a string from a data folder? I am using the following ConfigManager - https://github.com/CookLoco/ConfigManager. I want to pull a string from the data folder "motd.yml".
Proxy.getInstance().getDataFolder("motd.yml").getString("motd")does not work.
spigot 1.16.1
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/inventory/ItemStack.java#57
So this constructor is exists. Make sure you built your project
Hello? So my friend got banned from spigot for "Using Alts to rate himself" but he says he didn't do it, and he already sent an unban request to the unban email, how long does it usually take to get an answer? Also how long is the ban?
@frigid ember i would suggest asking that in #general
ok! Thanks
well, actually idk whats the problem
@tough kraken https://hasteb.in/kayuparu.java
except this
close that file and open again, let see what happens
i assume its because of the runnable
@livid spruce
and "noClassDefFoundError" doesnt means it doesnt find the class
Did you use maven or gradle or external builds?
I would rather use maven, because exporting the server jar file is usually breaks the projects
and also causing this
Hey, I'm new to Bungeecord development and was wondering if anyone can help me with fetching a string from a data folder? I am using the following ConfigManager - https://github.com/CookLoco/ConfigManager. I want to pull a string from the data folder "motd.yml".
Proxy.getInstance().getDataFolder("motd.yml").getString("motd")does not work.
switch to bukkit
@forest sigil you should load that motd file using with net.md_5.bungee.config.YamlConfiguration
I have no issues loading it, I want to fetch a string from a datafolder..
motd.yml is not a folder
i think the datafolder is the server-plugin folder, or is it the folder related to the plugin?
Configuration config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file);
String s = config.getString("yes");
i think the datafolder is the server-plugin folder, or is it the folder related to the plugin?
that is the plugin related,Bungeecord/plugins/yourPlugin
ah ok, then nvm
hey guys 🙂
yes
In the InventoryClickEvent listener, how do I get the item clicked on by the player
well, can i get wich group the player is in the config.yml of bungeeCord?
In the InventoryClickEvent listener, how do I get the item clicked on by the player
@formal nimbus event.getSlot()
returns an int
In the InventoryClickEvent listener, how do I get the item clicked on by the player
InventoryClickEvent#getCurrentItem
?
well, can i get wich group the player is in the config.yml of bungeeCord?
BungeeCord.getInstance().getConfigurationAdapter().getGroups(player)
what do you want to do
I tried getCurrentItem?
I tried that but it didn't seem to work :/
BungeeCord.getInstance().getConfigurationAdapter().getGroups(player)
@rare prairie ty
I tried that but it didn't seem to work :/
because getCurrentItem can be null
and also use .equals for ItemStack
ok, but why would it be null?
thats not enum
i assume its because of the runnable
@livid spruce
@tough kraken Why?
And how can I fix it?
and also use .equals for ItemStack
@rare prairie will try this now
Works!
ah
1 more question though
@rare prairie
so
if(BungeeCord.getInstance().getConfigurationAdapter().getGroups(player.getDisplayName()).equals("Admin"))
would run, if the player is in group "Admin"?
how to stop players using hotkeys to move items into an inventory?
@rare prairie
so
if(BungeeCord.getInstance().getConfigurationAdapter().getGroups(player.getDisplayName()).equals("Admin"))would run, if the player is in group "Admin"?
getGroupsis a list of collection
I think the click event should still trigger
it doesn;t ):
ah
actually hang on...
it does???
ok
well using hot keys to move items OUT of the inventory triggers it
oooo
wait no I know
Yes, a click event does trigger
I'm moving items from my hotbar though
Either HOTBAR_SWAP or HOTBAR_MOVE_AND_READD
into the inventory
The javadocs is a good place for info
And how can I fix it?
@livid spruce
well, so it doesnt work?
@rare prairie
i want to use that to get Prefixes at ChatEvent
iterate with for loop and find the group you want to search
the inventoryClickEvent isn't being triggered when I move an item from my hotbar using hotkeys
It's always triggered for me just fine
Unless you're talking about the creative inventory hotbars?
Well, that's completely client side
You might get some events from InventoryCreativeEvent
What are you doing exactly?
Then you aren’t talking about the creative hot bars
so I have my custom GUI open
I am pressing 4 on an empty slot in the opened GUI
and that moves the item in slot 4 in my hotbar
into that slot
any other kind of click or weird combo doesn't work
including moving items from the GUI into my hotbar using the hotkeys
Yes, and that should fire the event - it always has for me at leasst
ima do a quick test
What version are you on?
server ignores some things when in creative
ah
ok
it fires the event lmao
something wrong wwith the rest of my code ;-;
I'll prob be able to fix it then
oh I see
I didn't check to make sure that event.getCurrentItem wasn't null
fixed 🙂
@gusty comet I think the problem occurs if you have more than 128 chars. Probably something you could fix with a modulo and some work.
probably...
How would I go about picking a random subpath in a config file?
The last line is the most amount of characters without issues
I think they meant to dynamically get path's without hardcoding them
Ive heard today that if you do anything random your server instantly freezes for a second
-.-
^^
Ah
@tame bough You can list the keys and pick a random one
On the green-blue one it looks a bit jarring between the last 2 colors
Even on the short ones
yes
maybe the delta you are iterating with is a bit off
Even the short ones? They work fine for me idk
@tough kraken ? What's worng with the code?
It is but it doesn't work when it's more than 128 chars 😄
@gusty comet F
@tame bough
Something like this works (No idea how to get a random entry from a Set)
public String getRandomKey(ConfigurationSection section) {
Set<String> keys = section.getKeys(false);
return new ArrayList<>(keys).get(ThreadLocalRandom.current().nextInt(keys.size()));
}
Ah there is probably a nicer way using a iterator...
@gusty comet lol how have you made this ????
But it isn't between 255 colors only like 100 each
I have a question - I wanted to make a back arrow for my GUI. I was thinking a good way of doing this would be to store with every player their last viewed inventory
I was thinking maybe a Pair? But a wrapper class or a hash map could also work?
I recently found a Inventory GUI API on the Spigot forum
@gusty comet huh, I could though I'd rather write the code myself 🙂
I would store a <UUID, Inventory> hashmap
kk, what advantage would this have over a pair?
yeah
You can just call map.get(UUID)
Hashmap lookups are really fast + that's really waht you want to store anyway
Yep i also think HashMaps are the best to go
@grim halo so that works, how would I then send the players the messages>
You want to (given a player), know which inventory they have open. Hence, a mapping from the player's UUID ot the inventory
But you could create your own Object which stores more than just the Inventory to add custom Items
You want to (given a player), know which inventory they have open. Hence, a mapping from the player's UUID ot the inventor
@wraith thicket yus
I would encapsulate the inventory in a GUI Class.
Then You can have a Class called GuiProgram where you store a List<InventoryGUI> and the current index.
After that you can maintain a Map<UUID, GUIProgram> so you can click forwards and backwards.
Other than that you could also have parenting. So one GUI has another as parent. This way you could just back to the parent.
@tame bough Just like you normally would... player.sendMessage(msg)
Oh you also need to get the StringList before. obvsly
ah
so section.getStringList(key)
after you got the random key you want to get the list that is saved under the key.
in your case something like
List<String> lines = plugin.getConfig().getStringList("Message." + random);
Ohhh
section#getStringList#get(random)
is it possible to prevent /plugins with a bungeecord plugin so I dont have to do it on every single server?
Yes you could also store the ConfigurationSection in a var and use it like mont.
Yeah just use ChatEvent for that
var type is memory leaker thing
is it possible to prevent /plugins with a bungeecord plugin so I dont have to do it on every single server?
@tacit trellis
i meant some sort of variable. Everyone uses Java 8 so nobody even knows you can use var types
okay ill try that thanks
please use && for multiple checks
Also the first check is obsolete.
My server keeps crashing with this error:
[Server] main/FATAL Failed to start the minecraft server
[Server] INFO net.minecraft.server.v1_16_R1.SessionLock$ExceptionWorldConflict: /./world/session.lock: already locked (possibly by other Minecraft instance?) 1
[Server] INFO at net.minecraft.server.v1_16_R1.SessionLock$ExceptionWorldConflict.a(SourceFile:98) ~[spigot_1_16_1.jar:git-Spigot-ad703da-e2403a3]
1.16 Server.
?paste
delete the session.lock file
Alright
@tame bough This looks suspiciously like you dont know the basics of java. 🤔
Hey guys, when servers say 2 vcores, does that mean 2 whole allocated cores to me?
are there other aliases for /plugins except for /pl and /bukkit:pl?
no
v = virtual
virtual != physical
Then what does 2 vcores mean
@grim halo Hahah maybe
Where is the session.lock file located?
are there other aliases for
/pluginsexcept for/pland/bukkit:pl?
@tacit trellis You could also make a Bungeecord command /plugins, then add the aliases /pl and /bukkit:pl so they can't tab complete it
but not sure if you can use : in there
Where is the session.lock file located?
its in your world(s)
bungeecord commands are before spigot commands right?
yes
Found it but what happened to the file needing to delete it
Normally i think the server deletes that file when stopping the server
@tame bough
// My last spoonfeed...
for (String line : lines) {
Bukkit.broadcastMessage(line);
}
Oh so it tried to make a new one I'm guessing
Alright my server finally started thanks oops
I think
Custom emotes are sadly disabled 😄
You get them when you boost the server lol
Oh I thought my nitro run out :lol:
OP rly?
?
how can i display the players hearts in a tablist?
Oh and @tacit trellis You should disable "namespaced-commands" (or something like this) in the spigot.yml which disables <pluginname>:<command>
oh never knew about that thanks
Does that disable minecraft:command
yes
I cant find it in spigot.yml?
I got this weird old discord status where boosts are only 40ct 
What
Skript @frigid ember
I kinda need the minecraft ones
@lone fog Note: This only disables disables pluginname:command not only command

@raven hound yes but how?
This makes me want to boost this server now lol
But i only got nitro classic :WeirdChamp:
I know but certain plugins have overridden the minecraft ones
Oooh
Me too Xirado
nice thanks
the reviews on it are wack though
@frigid ember You can still use minecraft:command but it wont be recommended in the list
means?
Wrong tag methinks
xD
Probably get a custom plugin or use an existing one
but this one still works
Works for me
If you need to use minecraft commands instead of the plugin ones, you can still use minecraft: it's just not suggested
Maybe if essentials didn’t override tp and recipe
skyexit what server version?
Then follow this tutorial
@gusty comet I cannot find the setting in spigot.yml?
Then follow this tutorial
@raven hound thats vanilla
my bad
np
Only bet is to hire a developer as there are no plugins for that out there
This is what i got so far
Or make your own :lol:
thats what i'm doing
I'm not really a plugin developer so I have no idea about that
@frigid ember does it work?
This event throws a nullpoinexeption. and i dont know why
Which line
tablist = scoreboard.registerNewObjective("htl", "health", "§4❤");
Uh uh that looks like static abuse 
scoreboard is null
Hey uh xirado
do Scoreboard = Bukkit.getScoreboardManager.getMainScoreboard
I'm getting the same session.lock error
hey
even after deleting the session.lock
whats the error
long one here
Also yes @frigid ember dont make them static
?paste
what else @gusty comet ?
I've been trying to figure this out for a few hours no with no luck (trying all sorts of stuff incl. NMS); so figured I'd ask in here:
Does anybody know how to apply an NBTTagCompound to a block (such as a spawner or chest) and override the existing NBT on said block? [I know that the NBTTagCompound is correct and fully describes the block, I just can't seem to figure out how to get it onto a block now]
make the Scoreboard and Objective only private. If you need to use them somewhere else make a getter
k
then on the event set Scoreboard to Bukkit.getScoreboardManager().getMainScoreboard()
That should work
and the tablist?
You already set that with registernewobjective
https://paste.md-5.net/ogeledahin.apache
My error:
BUt i never worked with objective so i don't know if this actually shows the health
Yeah You still have the session.lock file there. Try enabling "Show hidden files"
@cobalt shoal You need to get the CraftWorld -> then CraftWorld#getTileEntityAt(x, y, z) -> then add/edit the NPTCompound
now its not throwing an error anymore, but it's also not showing the hearts...
It's also in the world_nether folder
Yes thats what i expected
does the /scoreboard command show the objective?
SkyExit make sure to check if the objective already exists i think with your current setup it will create more and more
first line it says world_Nether
But i never worked with objectives so i may be wrong. I only worked with Teams before
also remove it from world_the_end
Oh alright
and any other worlds you have
I'll test this one sec
I have 10 worlds :lol:
I'll test this one sec
@frigid ember
if(objective == null ){
// create it
}else{
objective = scoreboard.getObjective("...");
}
Crashed but has no error this time
If you have multiverse try unloading them
How do I do that as I can't start my server
there is a config in the MV folder
If it crashes there is some kind of error
@gusty comet its there and its appled, but it's not showing up...
@gusty comet its there and its appled, but it's not showing up...
@frigid ember Try looking up example objectives
is there a way to send a packet group? 🤔
i think i saw it somewhere
but i forgot where
or was it specific to some packet 🤔
k
No idea why my server is crashing
remove custom ore generator
There is literally an error in the 5th line
its a bit more
lol
20th line
Well there goes the ore generator :lol:
If only I had normal nitro to boost
Crashed again.
And the plugin just disabled itself and didnt crash the server
Yeah there are no other errors because Skipped 38 lines due to rate limit (30/s)
I'll just submit the log here
okay maybe I'm just being stupid here, but I'm not seeing a getTileEntityAt in CraftWorld (or anything that returns ); but if I get a WorldServer I can get a TileEntity; and from there I'm not entirely sure on what function to use since all the ones that take an NBTCompound don't seem to do anything or throw a warning Block entity invalid @ BlockPosition{x=0,y=0,z=0}. My current code is:
WorldServer worldServer = ((CraftWorld) Operator.currentPlayer.getWorld()).getHandle();
TileEntity tileEntity = worldServer.getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
tileEntity.load(((CraftBlockEntityState) block).getHandle(), tag);
tileEntity.update();
What about "World"?
Theres still the session.lock
world_the_end
Do I do it for all my worlds?
@cobalt shoal What version are you on?
Yes
1.16.1 right now
Doesnt TileEntity have a save(NbtCompound) method there?
What are you even trying to do?
I have an NBTTagCompound that my plugin saved from something like a spawner that I'm trying to apply to a new spawner (or chest - really any tile entity); and the only things I can guarantee are that the block are the same type (spawner and spawner, etc) and the NBT tag fully defines the NBT for the block (since the original block may not exist anymore)
and switching out the load() to save() doesn't seem to do anything (it doesn't apply to the block, but also doesn't throw any errors)
And you dont want to use PersistentDataContainer because...
I'm evenually going to need to be able to convert the NBT to and from a String to link it into an external API (but I can do that conversion correctly once I figure out how to get the NBTTagCompound onto the block)
rn I'm testing taking the NBT from a spider spawner and trying to apply it to a pig spawner to make it an identical spider spawner; but it's staying as a pig
You could try it using the BlockData
some of the stuff that the NBT can contain seems to be well outside what can get stored in the block data (stuff like customized mobs); unless I'm missing something I'll have to use NBT to get everything to match correctly, I think I'm just having a hard time finding the correct set of functions to actually apply the NBT to the block
Trying to connect to my hosted server but says connecting at first then after a bit says logging in then says timed out or disconnected
@cobalt shoal And the .save(compound) -> .update() didtn work?
Trying to connect to my hosted server but says connecting at first then after a bit says logging in then says timed out or disconnected
And in the console says took to long to login
it didn't throw any errors; but the spawner stayed a default pig spawner (the NBT didn't change at all)
WorldServer worldServer = ((CraftWorld) Operator.currentPlayer.getWorld()).getHandle();
TileEntity tileEntity = worldServer.getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
tileEntity.save(tag);
tileEntity.update();```
@cobalt shoal You can take a look here and see how he did it.
https://www.spigotmc.org/threads/1-8-x-1-16-x-v7-16-maven-single-class-nbt-editor-for-items-skulls-mobs-and-tile-entities.269621/
does anyone know who to make the spigot server online so you can play with your friends?
Port forward it.
@abstract shard go to cmd, enter ipconfig, copy ur ip (something like 192.168.x.x) enter it in Ur server properties as server IP, then go to 192.168.0.1 (or whatever is ur router ip is) and login via username and password (mostly admin admin) and port forward your ip (192.168.x.x) and enter port 25565 (or whatever port u selected in server.propeties default is 25565) then go to web, search what is my ip and u are good to go!
Every server i'm trying to join says logging in then disconnected or timed out
Please help [ping me]
What client are u using?
Normal java client.
My internet is at the max it can be.
Reinstall Minecraft 😉
excuse me what the fuck
Welp reinstall here I come I guess
do a speedtest
Wait xirado should I reinstall
do a speedtest first
alright
Hi, do you know a plugin that can reduce chunk loading while elytra flying?
You want them to fly in the void?
No, just make one chunk wide trail
hmm
A socket error occurred during the download test. A firewall could be blocking the connection or the server might be having some issues. Please try again later.
hmm you can try to code something like this for yourself
i think your internet is shite
hmm you can try to code something like this for yourself
@gusty comet you mean me?
When I tell him to do speedtest he tell me he have max....
no
When I tell him to do speedtest he tell me he have max....
I meant it cant be any better
try a different speedtest site
alright
or download a steam game to check the speed idk
But if even the speedtest doesn't work it's very likely your internet is shit
Yes
Welp i got 2 mbps
You should still be able to connect to a Minecraft server tho
Oh
2 mbps or 2 mb/s?
2mb/s is not enough for minecraft?
hmm thats crap
im running on like 1.2 maybe
I still think it's possible
I connected not too long ago to hypixel
just tried. its between 1 and 2,5 mbit
Yeah so why isnt it working for me
maybe your ping is too high
Cmd
I'm using a macbook
Bruh
I don't want to help u anymore
Racism
Ik xd
@raven hound open terminal by navigating to /applications/utilities, in the terminal type ping (serverip)
😧
Shitty apple user
@frigid ember "Haha apple is gay because it's expensive"
People have other opinions
Products that are not corresponding with prize
Hello, is there a way, with a skript or with world guard to make that, if we enter a place, if we have a boat we are teleported to another place and if we don't we aren't ?
@bronze quartz join skunity
do you have the discord link ?
It's gay because it's high prices for bad products
@frigid ember "I call something gay because i think it's bad"
That's kinda homophobe
Stop your ads
If you don't like apple
@bronze quartz dm
Does not mean everyone does not lik
thx 🙂
Haha i had apple it's shit
Hello :)
hey
How are you?
One message removed from a suspended account.
Yes
And you see Ur latency
And if it's higher than 700 u are in shits
And problem fixed
700 is very high
Yes
Idk
and it keeps saying Request timeout for icmp_seq 115
send the screenshot
but the number changes
Yes
Alright
That's timed out
well there goes my minecraft server plans
pinging from cmd doesn't give you the actual ping when you're connected to their server afaik, they have proxies everywhere. Cmd tells me ~13ms but I actually get nearer 120ms
or just get a better internet lol
Hypixel's minecraft servers are based in the US
One message removed from a suspended account.
Spigot plugin for linking chat between servers?
and best spigot plugin for land claiming that isn't easy to abuse?
Spigot plugin for linking chat between servers?
@frigid ember
If u zse bungeecord you can easily code it yozrself
hey there im kind of new and i have a question about versioning. i tried searching for this on google and in this server but i couldn't find exactly what i was looking for.
can i set 1.16.1 spigot as the dependency and specify a lower api-version and have it work? i'm trying to make a plugin compatible with 1.14 and above and it involves saving Materials and getting Materials using Material.getMaterial(String) now obviously you can't get a Material of 1.16 specific blocks if you're using a 1.14 package. How should I go about implementing the desired functionality?
you can decompile .class files in intellij
so
(if you try to open it it automatically decompiles and opens a viewer)
@warm stirrup You can simply use the lowest version you need as the api-version
JAR files are Java ARchives so you can essentially rename it to ZIP and extract it lol
then there's class files within that
You don't need to rename it to extract it
meh if ur just usin windows explorer /shrug
I don't use Windows
ah we cant just extract whatever
yeah that works ^
anyway to clarify, i can use a 1.16 package and specify a lower api-version? thanks
And it's not "extracting whatever". Changing its extension won't change the file. The file will still be exactly the same. You're just changing what it's named.
yep windows is just a bit picky about the actions you can use depending on the extension :p