#help-archived
1 messages · Page 169 of 1
Well I guess I could check if its inside the mine or like if the block has flag: block-break deny
ah so you're using worldguard/worldedit?
I think the easiest way would just to get all the blocks in the region and filter them via y level
not sure about optimization
Wow that is a really good idea
Are you making like an addon to that plugin?
can't tell if that's sarcasm @paper compass
Not sarcasm
lmao ok
you could get all of the blocks of a specific Y in the min/max for the region the player is breaking the block in, and then break those specific blocks.
not sure if there's really any other way to do that
Thats what I'm making rn
are you having trouble making that or are you just curious if there's a more optimized way?
Just curious
yeah I'm not sure if there is one.
for(int z = r.getMinimumPoint().getBlockZ(); z <= r.getMaximumPoint().getBlockZ(); x++) {
}
}```
That seems the best way right?
that's exactly what I was thinking. I'm not sure if it's the best way though
It is the easiest for sure
how are you getting the blocks to break them?
I was thinking of using nms
This to be exact
if you're using that then what I was going to say doesn't really help.
I was going to say if you're creating a new Location object for each block you want to break, you could save the unneeded object creation by using a different method to fetch blocks.
regions aren't necessarily rectangular
bungee ServerConnectEvent I have this https://sourceb.in/8347992ef6
Have effective jail: true
however I don't get connected to the jail server
nor i get disconnected about jail server being null
@paper compass it looks like Region implements Iterable
so you should be able to just use for(BlockVector3 block : region)
@sturdy oar do you still need help with sleep animation?
@frigid ember no it's done and Ive even created a resource post
Ty
BV3 has getBlockY
Im trying to implement giving permissions based on a discord role and everything works fine except that it looks like you cant use a command, while you actually can. (It just shows red and says there is an error). This is my function for setting permissions: https://pastebin.com/AjtcMHSY Is there anything else I have to do
@torn robin java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()[Lorg/bukkit/entity/Player;
i get this error now
I used Bukkit.getOnlinePlayers()
Bukkit.getServer().getOnlinePlayers() both throw such an error
hope you're having fun supporting even deadlier versions
are you basing off the 1.12 library or still the 1.8?
1.8
can you try building off 1.12
assuming that's the server version you're exporting for
yeah, can you try swapping 1o 1.12?
im exporting for all
ima ask him to test on 1.8
iirc even bstats has to account for outdated version checks
try {
// Around MC 1.8 the return type was changed to a collection from an array,
// This fixes java.lang.NoSuchMethodError:
// org.bukkit.Bukkit.getOnlinePlayers()Ljava/util/Collection;
Method onlinePlayersMethod = Class.forName("org.bukkit.Server").getMethod("getOnlinePlayers");
playerAmount = onlinePlayersMethod.getReturnType().equals(Collection.class)
? ((Collection<?>) onlinePlayersMethod.invoke(Bukkit.getServer())).size()
: ((Player[]) onlinePlayersMethod.invoke(Bukkit.getServer())).length;
} catch (Exception e) {
playerAmount = Bukkit.getOnlinePlayers().size(); // Just use the new method if the Reflection failed
}
How can we regenerate a chunk? I saw that the method is deprecated
public void checkBoats() {
new BukkitRunnable() {
@Override
public void run() {
final List<Location> toRemove = new ArrayList<>();
for (Location b : boatLocation.keySet()){
long placeTime = boatLocation.get(b);
if ((placeTime + 750L) <= System.currentTimeMillis()){
//b.getBlock().setType(Material.AIR);
toRemove.add(b);
}
}
toRemove.forEach(boatLocation::remove);
}
}.runTaskTimer(this.plugin, 0L, 150L);//20=1s
}```
I need to remove boats instead of blocks
so entities
b will get the location of the boat
@undone narwhal what method did you use originally?
but it seems like I can only remove them by gettingg the chunk and all the entities in it
@frigid ember what exactly are you trying to do? remove all placed boats?
no
like kill boats after a delay?
how are they added to the hashmap in the first place?
@EventHandler
public void onBoatExit(VehicleExitEvent e) {
Location bloc = e.getVehicle().getLocation();
Long seconds = System.currentTimeMillis();
boatLocation.put(bloc, seconds);
}```
I would just create a runnable for each boat when someone exits it
instead of having a master runnable
public static final HashMap<Location, Long> boatLocation = new HashMap<>();```
nah
is there a plugin when you put a diamond in a beacon and you sellect haste you get it for 15min?
but that will create a lot of runnables
@south shoal that seems very specific, you could probably look for a custom beacon plugin
yeah but they will self-terminate after they've done their job
it shouldn't create any substantial amount of lag
but is it not possible like with the above way ;p
yes but im also using that for buckets
so it'll just look to all the buckets/boats placed
you should reverse the <= to >
and in that gamemode that'll be a lot
if(placeTime + 750 > currentTime) remove();
I have a following timings. https://timings.aikar.co/?id=850524900df941c0a0bd0c51d0703862
Are villagers and sheeps the problem?
The method remove() is undefined for the type new BukkitRunnable(){} :/
ahh toRemove()
sure
that won't actually remove anything
world wise
it'll just remove it from the hashmap
you're not keeping track of the entity/boat anywhere
just the location of it, from what i see
guys this timings are good ? https://spark.lucko.me/#j0RmUAO6A1 https://timings.spigotmc.org/?url=cikotateso
those timings are not good @cerulean musk
actually they are
19.88 TPS on average is good
What is the problem ?
@frigid ember yes but where are you keeping a reference to the entity
toRemove just removes the location of the entity from the hashmap
it isn't actually removing the entity
MSWS its Good rgiht ?
@cerulean musk yes it looks good
Oh thanks :)
no thats the problem
how I still have to do it
cuz I can only remove all entities from the chunk
ahh
not THE entitity itself
i see i see
Now just cleared this in like 0.1 second
nice
//b.getBlock().setType(Material.AIR);
Lazinq you'd have to change it to either a Map<Entity, Long>, Map<UUID, Long>
but that wouldn't allow it to work with buckets
in that case i strongly recommend just making a delayed task when the player leaves
instead of checking and looping constantly
@torn robin World#regenerateChunk
hm yeah I can see why that would be deprecated
it should still work, why exactly do you want to regenerate it?
I have a custom biome edit
But 4 chunks aren't affected and i think it's cause i edit too late
bungee ServerConnectEvent I have this https://sourceb.in/8347992ef6
Have effective jail: true
however I don't get connected to the jail server
nor i get disconnected about jail server being null
I'm working with the new strider - StriderTemperatureChangeEvent & setShivering, I want shulkers to be "warm" regardless if there in water, is this possible? or is it a client thing that changes whether or not the shulker is shivering or not, if so what is setShivering achieving? Thanks in advance.
taking a very quick look at the entitydata for it, it looks like it's client sided
might be somewhere in packets
Hey guys is this only dev help or i can ask about plugin recommendations and some off topic recommendations for spigot ?
I would like to ask if the plugin exists in spigot community or if someone could give me pointers on setting the system with combining multiple plugins.
The idea is to make a vote system something similar to Hypixel Hype.
The player could earn some kind of points or currency by completing tasks, ontime play, wining in mini games etc etc.
And with that points they could spend them on any server (in npc, gui or any way) to show support to that server, by that i mean if players really like factions they can spend those points to support factions to give our head team info which server is most popular (not just player amount) and which server needs more attention with updates, fixes etc.
I thought about implementing token manager plugin with shop which could send money to fake player called FactionsServer and with placeholderapi show percentage to amount of points earned for that.
I have posted this already on the forums but no answer so hope for any feedback
ah shame, i've never really dealt with packets so wont be able to achieve my goal on this then
thanks anyways
I have posted this already on the forums but no answer so hope for any feedback
@faint basin I think this is a very specific plugin, in my opinion it's probably better if you get it done on commission by someone
Yeah i know i just wanted to check if there is maybe some combination of the plugins
Note that the shivering state is updated frequently on the server, therefore this method may not affect the entity for long enough to have a noticeable difference.
Is there no way I can keep my setShivering going on a strider?
I'm not really worried about performance on this
StriderTemperatureChangeEvent(Strider what, boolean shivering)
looks like you could listen to this
I had that, it changes but I think the server just changes it back fast
hello
Huh, I'm getting some strange behaviour when trying to read an inventories viewers. There appears to be two of every humanEntity in the list. Any ideas what causes that?
Hello people, A server i play on (Multiplayer, 20 player, Java edition) has recently installed spigot 1.16 when player head's broke, We tried fixing it with failure when we suddenly broke tnt duping aswell. A few minutes ago we tried deleting Spigot to see if tnt duping is back and it was infact back but our nether (and end potentially) reset for some reason. Can anyone help me out?
I would not recommend using 1.16 on a production server yet.
What do you mean by "player head's broke".
Also how did you break tnt duping?
By player head's i meant that we had a plugin that made player's drop heads and some blocks dropped mini heads. I thought that the player head/mini block plugin was related to spigot, Correct me if im wrong
Also, we have no idea how we broke tnt duping
Did the plugins update to 1.16?
brb
What's the name of the plugin too
May take a few more minutes, asking the admin
Sorry people but the admin is not going to be available to answer questions, i hope it will be fine if i return later with more detail's (and maybe even ask him to come here).
playerheads are broken on 1.16 paper on early builds (has been fixed by now)
might be the cause
nbt libraries will probably break on 1.16.x.
@fleet crane, the se.llbit.se parsing in BungeeCord might fail since they added NBTTagLongArray, not sure if its used in that login packet
anything with JNBT might also fail, throw exceptions if it gets that NBTTagLongArray tag
(like all of my economy plugins that shade JNBT)
might already be a commit, my bad.
just my outdated library
https://cdn.discordapp.com/attachments/713154327350607963/714547005375905803/unknown.png guys how can i make like this ? (Killer hearts) 2.5hp left
Any plugin ?
@inland oxide LongArrayTag isn't new
I have a JNBT library that has it too 😛
There are several, but the original JNBT doesn't look updated
Nope, you will have to do that yourself or use someone elses
I have an updated version
Original Author of JNBT isn't active anymore
is that based on JNBT?
It is JNBT yes, I just add updates whenever they come out 🙂
https://github.com/llbit/jo-nbt is what's in use now
yes, not sure how to port to jo-nbt tho
I'm using NBTInputStream
stuff like this
NBTInputStream nbt = new NBTInputStream(fis, NBTCompression.GZIP);
CompoundTag tag = (CompoundTag) nbt.readTag();
int xpLevel = tag.getTag("XpLevel") instanceof IntTag ? ((IntTag) tag.getTag("XpLevel")).getValue() : 0;
nbt.close();
return xpLevel;
} catch (Exception e) {
e.printStackTrace();
}```
might just diff my JNBT 1.8 with frostalfs to see what's different
also another fork "sarhataboaot" has the LongArrayTag
is there a problem with villager breeding
https://hastebin.com/uborepikow.php
first if statement is true, second if statement is false and still the target is not being updated
does mongodb need to be run on another thread? seems i cant get the MongoClient to connect
i have a block or a location, but i need a net minecraft server BlockPosition. how do i convert them?
does mongodb need to be run on another thread? seems i cant get the MongoClient to connect
if you're doing database queries async is a must or else your clients will cry on you
is there any good documentation on jo-nbt?
ah right. dont know why i though mongodb is exempt lmao
Hi, does someone know a way to prevent elytra players from loading chunks around them? Like on 2b2t where players only leave one chunk wide trail
Is there a method that should be used instead of the deprecated Player#isOnGround?
check yourself, basically
isOnGround relies on the client, iirc; if you don't mind that, isOnGround should be okay
ugh, well guess I'll have to update my own JNBT since it needs other methods
the version I have doesn't work for you @inland oxide ? o.O
does it support GZIP compression?
I mean, I'd like to use it
the other one was completely rewritten without the NBTInputStream and NBTOutputStream which I need
could probably have added it back lol
most of JNBT is actually pretty modular in that you don't necessarily need all the classes lol
well you would have to add back the NBTCompression code, and change the NBTInputStream and NBTOutputStream accordingly
it's a lot of changes in there
the code I use isn't using all the StringBuilder stuff as well
Well the classes in my version doesn't use StringBuilder in the Input or Output streams
might be easier for me to add LongArray
looks like I will have to update it to handle compression though
looks like it won't take much to add that it seems
yeh, i'm almost done adding long
oh I meant the compression
just need to create 1-2 additional classes to handle it lol
the shop plugin i am using makes you pay for premium if u want to update it for 1.16
this is unfair in so many levels
why is it unfair?
because when i download it for 1.14.4 it didnt say anything about paying for premium if i want to update it in the future
u have no idea how many hours i spent adding each item and changing the prices
now i have to find another plugin and do all this again
or pay something like 10 bucks...
Is it bad to have a command class file be over 300 lines of code? Lmao I can definitely reorganize it I just want to know if it will run like shit
u have no idea how many hours i spent adding each item and changing the prices
the developer spent more time coding the plugin
bruh just quit this you are probably the dev
lol I don't even know what plugin you're talking about
This is a help channel to ask for help relating to spigot, so try to keep it on topic! Don't want any arguments in here o.o
i didnt pay attention to the channel name
sry
m just gonna repaste what i said then xD
Evening, im trying to find a plugin that allows to set particles on entities like armor stand
or be run through cmd block
its mostly so that i can have a style like whirl on a entity
@tiny pebble It highly depends on what those 300 lines of code do
they're mostly all if else statements, determing what arguments are what
though many of them are also just objects
when i port forward, what internal and external ports do i use? right now i have only 25565 external tcp/udp 25565 internal
is that rule enough?
That's fine
ok ty
You should be fine but I can't be sure since I don't know what the code does @tiny pebble
though it isn't like if after else-if after else-if after else-if. it shouldn't check through every single statement
it runs fine as of now, i'm just worrying it may run badly seeing as i am going to end up adding more exceptions and checks and such for more arguments
its one base command with many other commands within it technically, such as:
/base a /base b, and so on
@inland oxide there added compression 😉
I'd say go for it, if you find preformance problems you can fix that later
👍 thanks for the input
in the server.properties do i need to put sometihng in the server ip?
blank, internal ip or external ip?
internal ip
in the router, should be the internal ip of the host
make sure your host system uses a static ip as well
@keen compass thanks, but, I've already added the LongArray stuff to my JNBT and updated the 6 plugins.
Yeah there isn't much to change to add that
I've never put anything about my ip in the server.properties and I've never had any issues but I guess that depends...
think there is just like 1-2 classes where you add that for the cases
interesting, Well I know my JNBT version will differ from most others
I got mine from the original author off of SF and then I updated it as necessary
ok maybe 5 files, but multiple places in each
so mine isn't a fork of someone elses except the authors XD
mine is updated from 1.8 version.
there is no 1.8 version
as close to the original, not rewritten, but complemented
lol
maybe I should fork it officially from the 1.8 and add my changes
Anyway compression is important since all the NBT files like player data files are compressed
Anyone here know how to make custom enchantments with TokenEnchant?
Yea
Well, go ask for support!
can't connect to the server, already forwarded ports 25565 to my pc, server is running
how are you trying to connect?
i checked those sites to see if ports were open
and then inside minecraft tried with localhost
from inside the lan?
and also my externalip:25565
does localhost:25565 work?
no it doesnt
win10
Has anyone else experienced an issue with random crashes, with console spam regarding 'AdvancementDataPlayer'?
so you are on your server, running both the server and the client as separate java jvms and using localhost?
yes @inland oxide
wait
separate java jvms?
im just on my desktop running both the server and minecraft
well you run the server jar in a jvm, and the client jar in a jvm.
i ran the run.bat in the server folder and launched minecraft on the def launcher
did you make sure your system has a static ip?
although the client itself can run an internal server, this is not for multi-player server
right so you are running two jvms, one the server ,one from the launcher
it is using the same internal ip @keen compass i just checked
if you set the server to the systems ip, use that ip in your launcher
and your server.properties has the server-ip as 0.0.0.0?
using my internal ip instead of localhost worked
but idk if this is working for my friends yet, maybe my port isnt forwarded yet
so in my server.propeerties in server ip what do i put?
should be 0.0.0.0 to listen on all interfaces, the static ip of your network interfaces and/or localhost
Generally shouldn't allow it to listen on all interfaces, but setting a specific ip is also ok too
while that might be the case, might not be something you want if say you have 2 ip's assigned. Although generally most people don't do this though lmao
Anyways, you can either modify the file and put 0.0.0.0
or leave it how it is
im testing with a friend rn to see it everything's fine
the thing that is important however is that your system is set to use a static ip though
you don't want it to change otherwise you will have to update your router stuff again
hey, i'm getting this error when trying to run luckyperms on my bungeecord server, and it said to ask spigot for help, so here i am, here's the error i got: https://pastebin.com/i4hxjV1w
your config.yml is wrong
how do you do line breaks in hover event component?
what do you think is wrong with it?
you need to look at the line around 24
k
probably missing a newline or improperly formatted
you can also paste into the pastebin site, save and copy the url here
?paste
there are also online yaml parser that can tell you if your config.yml file is malformed
https://imgur.com/l1H92no this is the router port forwarding page, my friend can't connect and i can't connect too when using the external ip
its very particular to proper format and spacing
i tried with 0.0.0.0 in server properties and also with the internal ip
maybe just remove the blank line with the spaces in it
@undone pine because the server is on the same system as your client, you do not use your external ip to connect. Everyone else outside of your home connects using your external ip
also, might need to use 127.0.0.1 not localhost, not sure.
depends if they left the server.properties to 0.0.0.0 or not
but my friend is trying and he cant
are you certain you are using the correct external ip?
check to make sure you allowed it through windows firewall
also might want to check that the systems IP didn't change either
it didnt
and occasionally AV's tend to get in the way too
no av on
so check to make sure you don't have AV's running or add it to its exception list, and check to make sure windows firewall isn't blocking it
what should i look into on the windows firewall? is it java?
Should be able to just add custom programs in there
so you would point it to your servers jar
and like in the router add the port
it only lets me add .exe .com and .icd
could try adding java.exe to it. Not sure if that would work
other thing you could try is temporarily disabling the firewall
could be that your firewall is detecting your connection as public instead of private as well
which is annoying sometimes
how would you remove getNearbyEntities
public void checkBoats() {
new BukkitRunnable() {
@Override
public void run() {
final List<Location> toRemove = new ArrayList<>();
for (Location b : boatLocation.keySet()) {
double x = b.getX();
double y = b.getY();
double z = b.getZ();
long placeTime = boatLocation.get(b);
if ((placeTime + 200L) <= System.currentTimeMillis()) {
// b.getBlock().setType(Material.AIR);
b.getWorld().getNearbyEntities(b, x, y, z);
toRemove.add(b);
}
}
toRemove.forEach(boatLocation::remove);
}
}.runTaskTimer(this.plugin, 0L, 100L);// 20=1s
}```
grab a copy of the chunk, iterate for your list in a separate thread, then on main thread, remove entities that meet your criteria @frigid ember
Hello i have a problem,
when i try to connect to my server it say
[17:51:30] [main/INFO]: [CHAT] Teleporting your to the server sbv
[17:51:30] [main/INFO]: [CHAT] Exception Connecting:QuietException : Unexpected packet received during server login process!\n038002
so i found out it is the windows firewall which is not letting the connection go through
Is there a way to force playerdata to be flushed and written?
if i turn it off completly the connection works with the external ip
usually happens if the firewall detects your internet connection as public instead of private
you can change that if that is the case, simple google search will give you the necessary steps to do for that 😛
or just leave windows firewall disabled
not like it adds a whole lot of protections then what your router already does lol
Is there an opposite to ConfigurationSection#createSection? I'm trying to get something to delete the section 😛
nvm, found it
ah okay, thanks
Is there something in spigot that makes mobs specifically Zombie pigmen(piglin) act differently towards turtle eggs?
They seem to not care about the eggs when i am a certain distance from the are or they will edge towards it extremley slowly
@fossil mural If you are far away the mobs AI is in a sort of "saving mode" so they are not using as much CPU. I thought this was a Paper thing tho
Is there a way to check exactly what the server is running in that regard
/version
You can always extend the NMS entity, override the function you want to check, sysout info and call super.function afterwards
Here, for example, you can check when the AI gets ticked.
But you might have to dig deeper.
ah sadly i am not the server owner but the server owner we have is not exactly adept at these things
/version shows craftbukkit
It should show a commit hash too
Something along the lines of git-Spigot-abcdef-abcdef
As well as how many versions out of date you are
Guys
Is there a plugin that I can manually disable plugin in-game to figure out what plugins are breaking each other? Because doing it by restart takes way too long due to the fact my server takes a good 10 minutes to start up (because of how big my towny file is)
Yes there is... didnt use it for quite some time but ill see if i can find it.
plugman
Don’t expect any support from developers if you’re using plugman
I don't expect support from any developers of any kind.
Then you’re good to go
biletools
Not because I want to, because they either take days to answer or throw a pissy fit when they hear a discord notification from an @
How do I get the item slot that's being moved of the source inventory during a hopper InventoryMoveItemEvent
I mean generally we are doing other things. A lot of our free time goes into development and support without anything in return
Can’t be on call 24/7
No but it sure as hell can't hurt to hear a notification when you're on do not disturb, especially when I'm on a deadline to finish this server.
aren't plugins nowdays having a reload command?
my plugin for example can be fully reloaded by doing javaplugin.ondisable / onenable
with no consequences
Generally yes and are safer, but Janny wants to shutdown the plugins individually
^
I have a plugin that's breaking even though I completely resetted it with a fresh new copy, so it's obviously being fucked with by another plugin.
And I can't keep restarting my server to unload plugins because it takes a good 10 minutes to start my server.
Half & half is quicker. Binary searching
not sure if any plugin managers actually work
🤔
i k for a fact perworldplugins won't work at all anymore
plugman works for me on 1.16 though I don't recommend using any type plugin that claims to "reload" plugins on a live server
But what is your problem. You should not need to disable every plugin by hand in order to find a problem.
just do the half at a time
Movecraft, it's doing a glitch it wasn't doing up until 2 days ago after working perfectly fine for weeks.
I've tried resetting it with a fresh copy 3 times and still getting the same bug.
If it was movecraft's fault, the bug would've gone away with resetting it because it's not a movecraft bug, it's a bug with my server.
just do the half at a time
@tiny dagger If I do half at a time, whatever half fixes the issue, I'm going to have to put them back 1 by 1 either way to figure out which one is the problem.
Yes but keep in mind every time I restart it takes 10 minutes, I have people that want to play.
then you put back a half of the half, and a half of that half until it's reasonable to do one at a time
copy the server and do it offline?
you shouldn't be doing debugging on a live servers anyway
My server is 17 GB big .-.
server map huh
Ye my map alone is 14 of the 17 lol
well
Hmm
3 gb is reasonable
how can plugins be 3gbs wtf
14gb isnt that big
It's definitely not normal lol, it's a 1:1000 rendition of earth
so thats about the same as 30k x 30k
purge unaccesed chunks in a long period of time then 👀
not sure if linux has meta of that tho
?
i mean if you limit size of world then size isnt a problem.
oh and btw whats that glitch/bug you're talking about?
Basically, when you pilot a craft, you're able to move it one 1 before it breaks and doesn't move again until you re-pilot it, afterwhich it can only move 1 block again. Apart from this, when you DO move it that 1 block, you don't move with the ship how you're supposed to.
which version of mc?
1.16.1, and it's not an issue with the version because we've been using movecraft on 1.16.1 for almost 2 weeks now with no issues.
i mean it doesnt say its compatible. so maybe something got wrong
considering chunks are stuffed in region files @tiny dagger the only meta the OS will have is when the last time the region file was changed
It is, it's just not a fork of the original creator
One of the creators of movecraft got tired of it only being kept in 1.13 so they made a separate fork of the plugin.
groups:
founder: 100
permissions:
- smm.founder
In a YamlConfiguration can I set values of ConfigurationSections such as how founder is equal to 100, while also having permissions be a section under it? If so, how?
Socrates type shit right there, I can't stand servers that stick to lower versions.
if not I can just create another section named number or something, this would just be easier
idk if thats possible tanku
you could make something like
groups:
founder:
value: 100
permissions:
-...
@mellow wave Do you have an account on Oracle i can use because i don't wanna have to sign up to download jdk 8
yes you can @tiny pebble
a configurationsection can have a value while also having child paths under it
how would i get that to work then?
You would just specify the path that you want
so your example. Path would be groups.founder and then you could get the children like so groups.founder.permissions
public void onBoatCreation(VehicleCreateEvent e) {
System.out.println("yes");
}
doesnt print yes in console?
when I place a boat
also with the VehicleEnterEvent, VehicleExitEvent
need to make sure you implement Listener, register your event, and add @EventHandler above the method
ohh yea i made another class for it
thats why
still have to register it
srry
thanks
@unborn jewel I already told you what to do. You don't need jdk 8
Besides I don't have or need an oracle account
then what do I need
Also there are plenty of places where you can get jdk8 without an Oracle account.
OpenJDK
use OJDK, for Windows on https://github.com/ojdkbuild/ojdkbuild
for Linux
with apt install openjdk-8-jdk
other people are telling me to use adopt open jdk
I only use the official releases
8
I used to use open
ok so adopt then?
nah I am currently using the premium SDK from Oracle
Open should do the job
How do i uninstall jdk 14
Linux or Windows
windows
go to the control panel
yea
Uninstall software
yea
ok
you uninstalled it?
yea
All you need to do is set the compile version
oh
That's what I told you last time
woops
I also guided you to how
You can use JDK 14 but it is discouraged
hey, for some reason, even though i do /setworldspawn and /gamerule spawnradious false, players will still spawn at their last locations and sometimes random location in the lobby, is there a way to permanently set the spawn point for players? also, i get this error every time i hop servers in my bungeecord network if that has anything to do with it: https://pastebin.com/AZH2RXTB
@vale slate Why would it be discouraged?
so should I still use the openjdk
Because you always should stick to the version your API is using
When you set the compile version it disables the newer features
Which means that there shouldn't be any difference between the versions
Why is it discouraged to use jdk 14?
It isn't as far as I know
It could happen in rare cases that some parts of code will not be compiled correctly
Null: Caused by: java.lang.IllegalArgumentException: bound must be positive at java.util.Random.nextInt(Random.java:388) ~[?:?] at com.benyji.core.mobs.SpawnerController.randomMob(SpawnerController.java:66) ~[?:?] Line 66: ``` String entity = entityList.get(r.nextInt(entityList.size()));
Because they want you to use the latest version? That's the only reason I can think of
^
isn't jdk 14 though the latest
add a check if it's empty @frigid ember
The list?
yes
Okay bet ty
isn't jdk 14 though the latest
I have no problems downloading it at
https://www.oracle.com/java/technologies/javase-jdk14-downloads.html
i was in the archive one
[13:53:51 INFO]: true``` Ohh yee ik whats going on, thanks for getting me to check tho that helped @vernal lance , Appriciate it ❤️
Is there no way to get the inventory name in InventoryClickEvent?
@balmy sentinel Nah you gotta make your own sorta UUID to get the inventory and store it somewhere
took me days to realize that xd
there used to be a way..
Make like a public static key or something
Maybe there is? I tried reasearching and couldnt find poop
I can't find it I'll just do your UUID idea
How does the TabExecutor work in BungeeCord? Do i need to implement it in the Command extending class?
@mellow wave I would use 1.8 right?
@balmy sentinel Ye goodluck with it, if you need help or explanation DM me ill try my best
for compiler lvl
I have a class implementing LivingEntity and I want to make a function to pass all the properties from EntityType to that class. Is there a quick way to do it rather than setting every single property manually
ok thx
Unless you've used a method that's newer than java 8
Ah ok i found this: Registering the command is enough. Bungee will handle the rest. This is not bukkit
``` Makes it so that it can't be broken by a sword or get hit right? because for some reason I can kill it with a sword
oof. Hm how can i use Bukkits copy partial matches into bungeecord?
@frigid ember You in creative?
good question
If you are that's the reason
You could add the marker tag to fix that :)
Marker tag?
@mellow wave is it also possible to allow mobs to spawn through a mob spawner bypassing the rules like zombies can spawn at day and mooshrooms can spawn on any enviroment too through these tags?
hm not sure
It tells the client to ignore that the armor stand exists when interacting with it causing you to be able to place blocks and interact through it
How would I go about doing that? Never heard of it
It was added in 1.9 1.8.1
Oh gotcha, do you know if there is another way to do it for 1.8?
Turns out it was added in 1.8.1
Ohh perfect
So just tell your users to use a newer version than 1.8.0
Yeah for sure, thanks for your help <33
No problem :)
Hi anybody have his mobs freezing ?
It tells the client to ignore that the armor stand exists when interacting with it causing you to be able to place blocks and interact through it
@mellow wave I believe it makes the stand's hitbox of size 0
Yeah I didn't know the exact effect just told him what I knew from personal experience :P
either way, it works xd
Who can help me ?
Are all the mobs freezing?
Yes and villagers too
🤔
Do you have any plugins installed that would affect mob behaiviour
And have time when they are normal and next time they are freezed
I know there are plugins that freeze mobs when the server is under heavy load
Mmm i delete that pluguin witch cousse that and still happens
But when the surver is reloaded its not heavy loaded and they are freeze
Don't reload the server, always restart
Reloading can cause issues with some plugins and is generally a bad idea unless you know what you're doing
@mellow wave im still getting it org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/jtx/hubscoreboard/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:331) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:254) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:202) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Caused by: java.lang.UnsupportedClassVersionError: me/jtx/hubscoreboard/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
you don't need to register aliases for commands, just using getCommand("cmd")
and in the onCommand method you can use args to specify multiple arguments
You wouldn't need an alias because the command is the same
You know how to register commands right
bruh
Just register /score
I believe s/he wants tab suggestions
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (args.length == 1 && args[0].equalsIgnoreCase("score")) {
//code
}
bruh
it throws Argument exception
go learn java first
also there are lot of forums for using command arguments
use google
reading docs = knowns what that means
You probably don't understand a line because you didn't learn java first
OK so can I ask my question now O-o
Just ask
I made a class form the interface LivingEntity and I have a LivingEntity stored in a variable which I want to convert into my class I created, what's the best way to approach this?
use extends
LivingEntity isn't a class according to spigot docs
lmao
Pass in the reference entity to your class and implement whatever interface you are wanting
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/jtx/hubscoreboard/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:331) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:254) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:202) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Caused by: java.lang.UnsupportedClassVersionError: me/jtx/hubscoreboard/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
java.lang.UnsupportedClassVersionError: me/jtx/hubscoreboard/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
it describes
yea ik
Are you sure that you set and saved the compile version right
now you should compile your project to be runnable "exported" jar file
Yeah I don't use Eclipse so not sure what the issue is
update java
oh
hehe
i had it at jar file
wait no shouldn't it be at a jar file
@rare prairie why runnable jar file?
sorry, i mean "Jar file"
[14:44:14 WARN]: Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
What is this
that's what i had before
its night here going to dig myself
[14:44:14 WARN]: Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
you have plugins that uses materials and needs to be loaded, ignore it, its not a bug
Most likely you have a plugin that is using legacy methods
which has a method for it
its defined
It only shows that for plugins with no api-version
np
like for jobs, we have setup api-version and it the same
api-version: 1.13, maybe because the old version
???
Can someone show me any useless fragments I should remove in this build.gradle and what I can do to make it correctly have the full spigot api?
@frigid ember figured it out, there is a classes called InventoryView you can use if(event.getView().getTitle().equals("inventoryName"))
@balmy sentinel if only I knew that earlier I couldve saved myself 100 lines xd
but thanks i'll use that from now on
dead lol I knew there had to be something
?jd
package index
javadocs are handy you know 😉
that's where I went lmao, but it used to be inv.getName() last time I coded plugins. Getting back into it for a friend
there is a nice search bar in the upper right corner
🙂
if you start typing there it will start giving you suggestions of what is similar to what you are typing in
:/
there is a nice search bar in the upper right corner
He just said it used to be getName, how is he supposed to know that it's getTitle now?
Anyone able to dummy down this java error for me? It worked not even a minute ago, went for a reboot
and now it wont start
Its bungee
but I have not changed anything o,o
Its been the same config since start and it worked fine then
should I just clear config and generate new one?
can you send your proxy jar?
Btw is the best way to store some extra data within an entity to make a new class for the entity
or is there a better way
you can edit the pathfinders but that's about all you can do without extending the class
processResources {
project.properties.put("version", this.version)
expand project.properties
}```
What does this do and what is the point of it?
gradle?
It says done then closes
@median swift
it's gradle, yes...
02:18:37 [INFO] [TheVanshGamer] <-> ServerConnector [AuthLobby] has connected
02:18:37 [INFO] [TheVanshGamer] disconnected with: Kicked whilst connecting to AuthLobby: For registered players only! Please visit http://www.example.com/ to register
What part of the configuration is this from?
I am using AuthMe reloaded
Could you help me with my problem?
please
@median swift Maybe some of your plugins shuts the server down after start?
hOW
t PluginClassLoader as parallel capable
[19:15:18 ERROR]: Could not load 'plugins/HubScoreBoard.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/jtx/hubscoreboard/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:331) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:254) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:202) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
bro this is tupid
i don't think this is fixable
has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
You're running Java 8, plugin was compiled using Java 11
If you have 8 installed as well it's possible that's what you're running it with
Depends on your system. On Windows anyways you'd have to change your environment variables. Not sure how Linux handles Java
It goes server permissions.yml is empty, ignoring it.
then its the Done!
and then saving chunks
and closes
If I basically want a living entity that stores an integer value with it do I have to make an enum of every single living entity
How do I register it?
Score score3 = obj.getScore("Rank: ");
score.setScore(3);
``` it's saying this variable isn't being used but it is
Im setting Rank in it
k
Can I cast a bukkit entity to nms?
Hello, how to block enchant knockback on minecart? 😄
declaration: package: org.bukkit.event.enchantment, class: EnchantItemEvent
Can I cast a bukkit entity to nms?
anyone knows?
I need to add nbt tag to an entity but I can't do it in the bukkit entity
You can cast it to CraftEntity and use the getHandle() method to get the NMS entity
Why do you need to add an nbt tag?
at com.benyji.core.events.SpawnerBreakEvent.spawnerBreak(SpawnerBreakEvent.java:39) ~[?:?]
``` Line 39: ``` if (Main.getFileManager().getUUID(spawner).equals(player.getUniqueId().toString())) {
``` why is that null? it hasn't been deleted yet
I need an nbt tag to store a value with the entity
Use PersistentDataContainer.
If you are on 1.8 you can use the ScoreboardTags
at com.benyji.core.events.SpawnerBreakEvent.spawnerBreak(SpawnerBreakEvent.java:39) ~[?:?] ``` Line 39: ``` if (Main.getFileManager().getUUID(spawner).equals(player.getUniqueId().toString())) { ``` why is that null? it hasn't been deleted yet
Main.getFileManager().getUUID(spawner) this can be null, invert the equals
invert the equals?
how can i get what server they are on?
invert the equals?
if (player.getUniqueId().toString().equals(Main.getFileManager().getUUID(spawner))) {
ohhh gotcha thanks!
and make sure Main.getFileManager() is not null
bc equals is null save and player.getUniqueId is NotNull
Is it possible to allow Spawners to spawn Zombies during day and mooshrooms/slimes in any enviorment?
Unless... getFileManager() returns null. then you could still get an NPE
y
``` ```Caused by: java.lang.NullPointerException
at com.benyji.core.gui.interact.InteractionListener.uiInteract(InteractionListener.java:34) ~[?:?]``` The other null was fixed, this is the other one
fixed, thanks 🙂
Is it possible to allow Spawners to spawn Zombies during day and mooshrooms/slimes in any enviorment?
@frigid ember Anyone know about this?
Use PersistentDataContainer.
If you are on 1.8 you can use the ScoreboardTags
how do I use persistentdatacontainer with entities?
I've never used them
shopgui
BlockExplodeEvent, runs when tnt breaks a block right?
ty
BlockExplodeEvent is called, when a block exploded by any of explosion thing
Hmm mine isnt running, I have the annotation and registered in main
1 is never printed
How can i get the server name of the player is in?
List<String> list = usersConfig.getStringList(uuid + ".permissions");
list.add(name);
usersConfig.set(uuid + ".permissions", list);
This seems to set the list, not add to it. What am I doing wrong?
need to save it
i did
for it to apply to the file
It does, it just doesn't add to the list. It replaces it with the value
Anyone know what Material.SMOOTH_BRICK is in modern spigot versions?
I set the max health attribute of an entity to 200, but it is wearing equipment with a max health attribute. How do I get it to full health
List<String> list = usersConfig.getStringList(uuid + ".permissions");
list.add(name);
usersConfig.set(uuid + ".permissions", list); usersConfig.save(Main.getInstance().getUsersConfigFile());
@keen compass Is that not what I did?
huh
Map<String, Perm> = new HashMap<>();
and perm is like your perms class
you have to make a serializer and deserializer for your Perm class
and it can all be in 1 file
also you should probably use uuid instead of name in the case of name changes
All I am trying to do is add to a list within my YamlConfiguration.
and the list is of Strings?
yes indeed
Map<String, List<String>> map = new HashMap<>()
Oh, think you need to use an array instead
i'll try using an array
so String[] list = usersConfig.getStringList(uuid + ".permissions");
you can grab the array and stuff it into a list object
but when you go to save it you need to turn it back into an array
I usually just make my own lists
oh
List<String> list = usersConfig.getStringList(uuid + ".permissions");
list.add(name);
Object[] objectArray = list.toArray();
String[] array = Arrays.copyOf(objectArray, objectArray.length, String[].class);
usersConfig.set(uuid + ".permissions", array);
usersConfig.save(Main.getInstance().getUsersConfigFile());
So just conversion to an array then?
hmm
oh cmon...
still does the exact same thing
there's more materials to fix...
yeah not sure
always found that using stringList to not work properly
so I generally just implement yaml stuff myself
well implementing yaml yourself would still allow that
the only difference you are doing here is you are using the API to interact with yaml
you don't actually have to use the API for that
spigot uses SnakeYaml implementation
which is shaded into the server
huh
It used Material.SKULL_ITEM
Looking up skull items, there are 6 different skulls that could be...
how do I know which it referred to?
You don't know what version you're writing code for? o.O
no I mean
Ah Choco do you know why yaml's are wonky?
List<String> list = usersConfig.getStringList(uuid + ".permissions");
list.add(name);
usersConfig.set(uuid + ".permissions", list); usersConfig.save(Main.getInstance().getUsersConfigFile());
Or just what I'm doing wrong? It doesn't add the permission, it just sets it, still making it one permission :c
Post-1.13, there are separate materials for each
Material.PLAYER_SKULL, SKELETON_SKULL, etc.
yeah
Before then, they all used data values. I think player was a byte value of 3, skeletons were 0, etc.
How can i get the server name of the player is in?
That's a player skull then, yeah
@unborn jewel player.getServer().getName();?
ah thx
Not super well defined that value, Tanku. There's not really a "name" for servers
huh
There might be on the proxy though
Yeah you can grab it from the proxy if you're writing a bungee plugin
https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/net/md_5/bungee/api/config/ServerInfo.html#getName--
thank you
Though I don't think that's quite the same as what's returned by Server#getName() from Bukkit. I don't quite remember what that returns
Yeah, byte data doesn't exist anymore
TeamBridge teamBridge = (TeamBridge)game.teams.get(i);
byte data = ((TeamColor) Saves.teamColors.get(teamBridge.getTeamColor())).getByteColor();```
yeah I realized
Tanku im trying to make it so it shows like the #1 since its the first lobby is that possible?
so then what would I be setting now?
That's for wool colours?
Terracotta
Same idea?
for (int y = 0; y < game.bridgeYSize; ++y) {
Location location = game.gameCenterLocation.clone().add(new Vector(v.getX(), (double)(-y), v.getZ()));
Block block = location.getBlock();
block.setType(Material.TERRACOTTA);
block.setData(data);
}```
You seem to have a lot of same idea
Actually it was STAINED_CLAY, but that it now-a-days terracotta, so I changed that
like LockSecurity is same idea as PadLock
Ah, one of your resources. Well, klugemonkey. I regret to inform you that LockSecurity has existed before yours did so... lol
snoopy you have two options.
(1) Return a DyeColor enum constant and have a Map<DyeColor, Material> (where the material are the terracotta variants)
(2) Return a terracotta material directly
I think the DyeColor would be a bit more flexible but it's up to you
How can I successfully add to a list in a YamlConfiguration?
key:
- item
- item.2
- item.3
Such as ^
List<String> list = usersConfig.getStringList(uuid + ".permissions");
list.add(name);
usersConfig.set(uuid + ".permissions", list);
usersConfig.save(Main.getInstance().getUsersConfigFile());
Tried this, just replaces the list as name, while still being a list. So it doesn't add to the list.
hmm
I was gonna try doing something like 'Material.' + color + '_terracotta', but idk how to do that in java
so... maybe #1 would be better...
How would I do #1?
Well replace any instance of the byte data with instances of DyeColor for one
Beyond that, you'd have to create some constant EnumMap<DyeColor, Material> and for all DyeColor constants, map them to the appropriate terracotta material constants
The method's return type for instance. Change it from a byte to a DyeColor
im trying to make it so it says Lobby: #1 and the server name is called Hub is there a way I can make it so it somehow renames it but actually rename it just in the text to #1?
And anywhere a byte is passed for a colour, use a DyeColor instead. You can at least start with that.
maybe I am not understanding something, or maybe it's because I didn't show the whole area...
int i;
for (i = 0; i < game.GetTeamsCount(); ++i) {
TeamBridge teamBridge = (TeamBridge)game.teams.get(i);
byte data = ((TeamColor) Saves.teamColors.get(teamBridge.getTeamColor())).getByteColor();
int y2;
for (y2 = 0; y2 < game.edge; ++y2) {
Vector v = GetVectorFromGameDirection(game.edge - y2, direction);
for (int y = 0; y < game.bridgeYSize; ++y) {
Location location = game.gameCenterLocation.clone().add(new Vector(v.getX(), (double)(-y), v.getZ()));
Block block = location.getBlock();
block.setType(Material.TERRACOTTA);
block.setData(data);
}
Yeah,
byte data = ((TeamColor) Saves.teamColors.get(teamBridge.getTeamColor())).getByteColor();
That bit there
well yeah, I would remove (or replace) that
You can remove that getByteColor() method and add a getColor() method that returns a DyeColor instead
int i;
for (i = 0; i < game.GetTeamsCount(); ++i) {
TeamBridge teamBridge = (TeamBridge)game.teams.get(i);
DyeColor color = ((TeamColor) Saves.teamColors.get(teamBridge.getTeamColor())).getColor();
int y2;
for (y2 = 0; y2 < game.edge; ++y2) {
Vector v = GetVectorFromGameDirection(game.edge - y2, direction);
for (int y = 0; y < game.bridgeYSize; ++y) {
Location location = game.gameCenterLocation.clone().add(new Vector(v.getX(), (double)(-y), v.getZ()));
Block block = location.getBlock();
block.setType(Material.TERRACOTTA);
block.setData(data);
}```
So you have something like that now
Right under your color var, you can make a call to a Map<DyeColor, Material> you've created which will basically convert those DyeColor constants to a Material
How can I create a 3x3 Inv
Aight so I figured out my main issue.
List<String> list = usersConfig.getStringList(uuid + ".permissions"); This returns an empty list.
So how do I read a list such as:
key:
- list.object.1
- list.object.2
hmm
Then just call block.setType(theConvertedMaterial) and remove the call to Block#setData() (because data doesn't exist in 1.13+)
If it returns an empty list, Tanku, then the path doesn't exist
That, or YAML may treat . as a special character. Would at least wrap those in 'single quotes' or "double quotes"
oh no - one moment
I can set something with the same path though, and it successfully sets. Then I can just never read it.
ah okay, i'll try with quotes possibly
crap...
because as far as I'm concerned, rest looks fine
yaml is a sensitive bitch regarding indentation, blank lines, quotes and all that
json ftw
oh good nvm, I was concerned my IDE was about to crash
both are text files at the end of the day, all you need is a parser and you're done
So I need to change that...
Well if a getColor() already exists it's probably used somewhere
Color objects are fine
oh
Would just make another method, getDyeColor() or something
If you really want to, you could probably use that Color object for chat colour lol. 1.16 has RGB chat
wait, can I just convert that color to the terracotta material?
Also, why does bungeecord api have YamlProvider and JsonProvider (or however they are called) but bukkit api only "allows" (encourages is the word actually) yaml instead? 🤔
Or does it have to be a DyeColor?
Don't think there's a direct mapping from Color to Material
I mean either way you're going to have to Map something to a Material
Alright so