#help-archived
1 messages · Page 154 of 1
have something happen when the player has a specific item in their hand
PlayerItemHeldEvent#getPlayer()#getItemInMainHand()
Material inHand = event.getPlayer().getInventory().getItemInMainHand().getType();
why is this line giving an eventException
lmao
Did that as well @naive goblet , the problem there is that it only activates once I switch away from that item. So If I put a diamond sword in my hand, the event doesn't trigger, but when I take the diamond sword out of the hand, the event triggers
getItemInMainHand is Nullable iirc
what method should i use to get what item a player is holding at the time of when they interact with a block?
player.getInventory.getItem(event.getNewSlot)
kk
That was to tanku
i'll try that out
What’s wrong with the player interact event
Atom wait if you have the interact event check hasItem and then getItem?
huh?
Get item in main hand doesn’t exist in 1.8
API version 1.9+ and Server Version 1.8
Because there was only 1 hand
Hmm possibly yes
It is
getItemInHand() delegates to getInventory().getItemInMainHand(), yes
Though if you're doing this to support 1.8 servers, don't
Bukkit does what it does for forwards compatibility, not so you can use those deprecated methods for backwards compat
Obviously
Also because 1.8 is 6 years old ya dang PvP community
Nah, my server is 1.8 xD
Then yes, use getItemInHand()
kk
Not the PvP community just the 1.8 fan base
Wait are you in a PlayerInteractEvent?
He is, so he should use getItem if hasItem I’m pretty sure isn’t deprecated
Yep. Use PIE#getItem()
Even better, if you're looking for a specific item, if (event.getMaterial() == Material.WHATEVER)
(it's air if there is no item)
True
Huh I didn’t know about get material
is there any event to check for attacking with a weapon?
also thank you @lone fog that worked 🙂
is there a way to close only upper inventory? or is it best to close both, then open player inventory?
If you want using a weapon use interact
If you want actually hitting something use entityDamageByEntity
@subtle blade may i request your help on fixing my account so I can login and re-enable 2fa so my Google authentication can save it cuz when I transfer data from old phone for some reason it didn't save spigotmc code
@mystic forum i don’t know but maybe just reopen the player inv
is there a way for using the weapon but only left-click?
it worked other than that, just don't want right-click to do it
just check the type of click
how do i do that 😛
That returns one of these https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/Action.html
Okay 😥
thank ya
Hey, just a quick question, ArrayList is cleared when plugin disables, right?
Yeah because the JVM is stopped
I don’t know if they are cleared on reload, but reload bad anyway
But if you initialize it in onEnable it should
is there a reason i was forced to use jre 1.7 to reference a static method in another class
Idk but setting it to null in onDisable can be smart if you use plugman and you want the list to be cleared when your plugin is disabling
robby what lib?
Alright thanks
And another question is, does TicksLived at Entity count even after server shutdown, or it's resetted?
Hmm pretty sure it’s persistent
it was a class i made
How did it “force you” to use 7?
it gave me an error when i tried to export it and said i had to use it
i have no idea why
i mean nothing changed in the long run
it works the same in the end
it was just weird
Well you want to take advantage of jdk 8 though
that’s true
What IDE?
eclipse
You should try IntelliJ btw
Idk if that will fix it but I have a feeling it perhaps will (:
yeah i’ll probably switch over
eclipse is starting to give me problems lmao
problems?
There is no problems with Eclipse but I just prefer IntelliJ and you should give it a try
Following back onto my previous question, how do I open the player's regular inventory view? p.openInventory(p.getInventory()); is definitely not right (opens inv as a chest)
my experience, intellij isn't much faster than eclipse
but more user friendly
plus native dark mode, so that's a big plus
i’ll try it and see
Matt hmm that didn’t work?
eclipse also has a dark mode
Eclipse you can change some colors. On windows, title bar is always light
there are some plugins that can help, but it's not perfect
Maybe Player#openInventory(Player#getOpenInventory())
So first close
Then do that
naw, now it's just closed
Is it possible to link the spigot javadocs to my eclipse? I always have to search the web for stuff
idk but intellij does it automatically
Mine says no attached javadoc
Hmm if you run buildtools it should come with docs
@mystic forum do it with a task scheduled 1 tick after
I'm not familiar with maven or gradle
Hi, i just checked Spigot firewall guide, and i tested
ufw allow from localhost to any port 25565 proto tcp for ufw config as the text says, but first problem was that it gave me error which says Bad source address . so i just replace localhost with 0.0.0.0 which does the same thing, and now, a new error apreard: ERROR: problem running . Any idea how to fix this?
I use buildtools and add the jar to the build path, that's all.
😩
:"(
Wow dude
Nowadays knowing how to use maven / Gradle is basically a required skill for Java development
A must defo
I have tried to look into it some time ago, but I didn't find my way in.
There are some good plugins on IntelliJ that create maven build files for you
Well we can help you now with it
@sturdy oar I use eclipse
I’d suggest trying IntelliJ
I mean you can do it still
But you need to create a maven archetype for Minecraft projects
Which isn't really simple if you have no idea of how it works
Let's save that for tomorrow then, thanks anyways 🙂
Gradle just looks hard because some people have crazy ass scripts
Maven rly isn’t
Since it requires Groovy/Kotlin knowledge
I see..
But correct me if I'm wrong, maven and gradle are dependency handlers?
And learning gradle instead of maven isn’t that much harder in my opinion
Yes
I mean my gradle scripts aren’t funny but surely useful
Anyone know a serializer for datetimes that is easily readable? I need to have a section in my config that the player can edit
@EventHandler
public void onTwinBladeStrike(PlayerInteractEvent event) {
CraftPlayer player = (CraftPlayer) event.getPlayer();
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(((CraftPlayer)event.getPlayer()).getHandle(), 3);
if (player.getInventory().getItemInMainHand().equals(Items.jasonSword)) {
if (event.getAction() == Action.LEFT_CLICK_AIR) {
ItemStack sword = player.getInventory().getItemInOffHand();
((CraftPlayer) event.getPlayer()).getHandle().playerConnection.sendPacket(packet);
}
}
}
This triggers the animation of the off-hand to swing once the main-hand swings using packets.
Is there a way for the packet to only run once? Once I left-click it plays the animation over and over and over
yeah it comes out like 2018-07-14T17:45:55.948353600
If any of you have time to help me out tomorrow, or got a recommendation for a source to start reading through, please let me know!
first bit is readable the second is eh
You can have custom time formats
File file = new File( path + User.getUser(event.getPlayer()).getIsland().getOwner() + ".json"); this is returning null
I don't remember it now because I basically never use dates
uh let me fetch error
@lapis plinth maybe the user has no Island 😄
The hell is Player#getIsland ??
Wut
It’s User#getIsland
Oh ok weird I'm out
User.getUser is just a wrapper
hi guys, im trying to install this (https://www.spigotmc.org/resources/compasshunting.73061/) plugin to my spigot server, ive followed all instructions everywhere and tried 4 different versions of minecraft, even on the plugin's listed native version, i keep getting "Could not load... Invalid plugin.yml" can anyone help me out?
@cursive mulch damn thanks bro xD
Maybe contact author?
Though Island#getOwner isn’t a string ?
xoxo
its a UUID treated the wrong way
.
its just an issue with how the plugin.yml file was written?
Imagine having a plugin on SpigotMC that doesn’t load
@warm summit the plugin is broken, it has no plugin.yml in its source
You could probably make one
oh jeez
Lmao
But I question if the rest of the code is worth it
True lolol
@lone fog it looks really bad...
lol it seems to be the only plugin that adds hunger games compasses for player tracking
question about mysql before I write/read anything from it
I am checking if conenction is still open
with this code
by grabing UserName
from connection
so now should I do it on every request
that wont work
it returns always
false
it needs to be really closed
by my side
so now should I just make runnable
and check every few min
You should return false in that catch clause btw?
if connection is still open
I just use a connection pool to handle it for me tbh
because if there was no any communication between server and mysql
conenction get closed
by mysql side
after 8h
is default
Doesn’t seem great to rely on an exception for checking if the connection is working
You shouldn't keep a connection open like that anyways
Use a connection pooling library like Hikari
You should return false in that catch clause btw?
Code flow, it reaches false anyways
There is also an AutoReconnect option I think
@lapis plinth are you using json simple?
Then yeah I recommend hikari
Doesn’t spigot have a json dep?
@subtle blade any good tutorial on spigot about it
my plugin is based on economy system for tokens
plz help, any idea why i use ufw allow from 0.0.0.0 to any port 25565 proto tcp for firewall cfg, i can not connect to server anymore (bungee)
so I am loading tokens on player join event
LogBlock has an example of it
Conclure should I set json simple as a dependency thingy in pom.xml?
But the general documentation on it should work fine
Atom I don’t think it’s necessary
kk, so how do I add lines / read lines
kk
And there is a lot of documentation of how to use it
@subtle blade can you help with my issue?
kk
@warm summit ya still there?
yes
heh, I'm not familiar with this json simple shit in general - you got an example?
whats up
I can help you out if you like with the compass tracking, I've been looking for something to do for a while haha
that sounds great
pm
got ya
😕
Sent email to support so I guess I'll wait for respond and I know it'll get banned for week i can live with that as long as i get my access back :)
I dont understand JSON Simple at all, can someone help?
{
"value": 100,
"queued value": 100,
"mission": 100,
"mission time": 100,
"lost value": 100
}
Im basically trying to make this with all the values readable
Hello, I'm getting a really strange lag on my servers that I can easily recreate related to whenever the new DiscordSRV plugin is enabled on my 1.16.1 server... I noticed the timings report has 385.92% World Save is that a high value? https://timings.spigotmc.org/?url=yagecisiqu
kk
I advise you opt for Gson instead of JSONSimple
JSONSimple is very, very old and not type friendly
Yeah fr
The aforementioned object can be done with the following in GSON:
JsonObject object = new JsonObject();
object.addProperty("value", 100);
object.addProperty("queued_value", 100);
object.addProperty("mission", 100);
object.addProperty("mission_time", 100);
object.addProperty("lost_value", 100);
System.out.println(object);```
Use an instance of Gson to read/write to/from file
It's constructable but I typically opt for GsonBuilder so you can set pretty printing (especially if you want users to edit these files)
public static final Gson GSON = new GsonBuilder().setPrettyPrinting().build();```
(or something to that degree, I forget the exact methods)
what code would i use to cancel the vanilla spectator teleport feature and would it be triggered by the PlayerTeleportEvent?
I think so
Im not confident an event is fired. If one is, yes it would be teleport event and you’d just check the player’s game mode
how to set hand to airrrrrrrrrr
@reef folio I got started with that video. It got me in to it but I had to unlearn some bad practices.
Does not exist
like for the longest time, because of how he sets up the project
Hey
I was shading my project
I need some help
for no reason
Sooo I have uploaded my plugin to the spigot mc page
but I tried to make an update checker
for some reason
spigot api got stuck to version 1.0.0 of my plugin
this makes it imposible to hook my updater
:C
what did you use for your update checker?
Anyone know if any of these relate to on-time? https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html
what did you use for your update checker?
@dark shuttle spigot api?
whats your resource id?
80886
I'm seeing 1.0.2 too
k
same
have this ever happened to you??
Ctrl+F5?
same'
Try a different browser
So I am trying to update my spigot minecraft server from 1.15.2 to 1.16.1. I am having difficulties. When I run the command java -jar BuildTools.jar --rev 1.16.1, an error message comes up saying "unable to access jarfile buildtools.jar". Help!
Is it in the same folder
setItemInMainHand(new ItemStack(Material.AIR))
@torn robin that parameter is nullable
Browser caching is the likely culprit
@subtle blade sorry for tagging you
But is it hikari faster then regular mysql
Browser caching is the likely culprit
@subtle blade wat?
help!
Hikari and MySQL serve two different purposes. MySQL is the database, Hikari is a manager to handle connection pooling to said database
Your browser caches the result of webpages, Resently
All browsers do unless otherwise stated
How can I stop an animation with the Animation Packet? Using PacketPlayOutAnimation and when triggered it continues forever lmao

:c
how do i give access to the jar file? I am trying to update to 1.16.1
I guess i'll have to wait
?1.16
Spigot and BungeeCord 1.16.1 are now available. Please see https://www.spigotmc.org/threads/447405/ for more information.
Reminder that BuildTools is the only supported means of obtaining the Spigot server jar.
how do i give access to the jar file? I am trying to update to 1.16.1
@burnt idol what do you mean by giving acces?
whenever i run the command java -jar BuildTools.jar --rev 1.16.1, it says it does not have access
"unable to access jarfile buildtools.jar"
So you're running the command where BuildTools is not located
server crashes when going to end city
how do i run it where it is located
im on linux
ok
(is it cd in Linux? I don't remember lol)
it is
Then yeah, just be sure you're located in the correct directory when running the command
If you setup a shell script to run that command for you that's also much easier as you can just double click the script instead of having to rewrite the command every time
(like I have with my run.bat - Linux would use sh)
anyone know my problem with the packets?
https://discordapp.com/channels/690411863766466590/690470011382267904/727672880980164688
how do i locate the directory buildtools is in?
It's wherever you put it
yeah im looking there, not sure why it just keeps playing lmao
Are you sending it more than once?
Does it somehow trigger the interactEvent?
Actually, yes, it would
That's why
Choco papa
a hand swing
Add UUID to list before send packet, remove after, and only send if UUID is not in list
Am I allowed to post an error here?
30.06 19:59:57 [Server] INFO java.lang.IllegalStateException: Removing entity while ticking!
30.06 19:59:57 [Server] INFO at net.minecraft.server.v1_16_R1.WorldServer.removeEntity(WorldServer.java:1081) ~[spigot-1.16.1.jar:git-Spigot-758abbe-2b00831]
30.06 19:59:57 [Server] INFO at net.minecraft.server.v1_16_R1.WorldServer.removePlayer(WorldServer.java:1100) ~[spigot-1.16.1.jar:git-Spigot-758abbe-2b00831]
30.06 19:59:57 [Server] INFO at net.minecraft.server.v1_16_R1.PlayerList.disconnect(PlayerList.java:444) ~[spigot-1.16.1.jar:git-Spigot-758abbe-2b00831]
30.06 19:59:57 [Server] INFO at net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.java:1416) ~[spigot-1.16.1.jar:git-Spigot-758abbe-2b00831]
30.06 19:59:57 [Server] INFO at net.minecraft.server.v1_16_R1.PlayerConnection.disconnect(PlayerConnection.java:268) ~[spigot-1.16.1.jar:git-Spigot-758abbe-2b00831]
30.06 19:59:57 [Server] INFO at net.minecraft.server.v1_16_R1.PlayerList.shutdown(PlayerList.java:1054) ~[spigot-1.16.1.jar:git-Spigot-758abbe-2b00831]
30.06 19:59:57 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.stop(MinecraftServer.java:725) ~[spigot-1.16.1.jar:git-Spigot-758abbe-2b00831]
30.06 19:59:57 [Server] INFO at net.minecraft.server.v1_16_R1.DedicatedServer.stop(DedicatedServer.java:644) ~[spigot-1.16.1.jar:git-Spigot-758abbe-2b00831]
30.06 19:59:57 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:887) ~[spigot-1.16.1.jar:git-Spigot-758abbe-2b00831]
30.06 19:59:57 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.1.jar:git-Spigot-758abbe-2b00831]
30.06 19:59:57 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]```
Are you writing a stupid plugin? lol
uhh.. my server crashes when we try to throw a pearl into the end city
that's exactly what happened.
boy oh boy this'll be complicated lol. i'm not entirely advanced in java but i should figure it out
Add UUID to list before send packet, remove after, and only send if UUID is not in list
@winged sparrow
i know i saw that haha
i have the exact same issue
Why don’t you just put it in a Set
Do you want to allow them in there multiple times?
Any good open source projects to look at for good use of conventions and structuring?
Yeah a hashset would be better
Wow this sounds self-glorifying, but I like to think mine are decently structured
hi everyone
Lol
Look at the ego on choco
could you link your github?
i need hel with my server
@hushed viper allow-nether = true
Good advice
👍
Is anyone available to test the compass tracking I just made with me?
I need to be with 2
Sorry wrong chat
Guys, I have no clue why the second line in the Motd doesn;t work. I use the server proprieties for the MOTD
Any answers?
With Spigot API using JavaScript, what would be the best way to get a players join date without it being the weird "milliseconds after Jan 1 970 (1592469208699)?
DateFormat is your best friend
https://docs.oracle.com/javase/8/docs/api/java/text/DateFormat.html
There’s a spigot api for java script?
There’s a spigot api for java script?
@nimble stump I guess...
Why would you use JavaScript for spigot
mfw willingly using JavaScript > Java
Why would you do that to yourself
It's for Papi
Ah, could have mentioned that lol
k what?
PAPI has JS addons iirc
k what?
@torn pilot KO
what version of ecma is supported?
i found this but no clue how useful it is, i never used javascript spigot api
Using that cx
my server crashes when ender pearling into end city teleport
var player = BukkitPlayer;
function getFirstPlayed () {
var join = player.getFirstPlayed();
return join;
}
getFirstPlayed();
Used this but it returns milliseconds after 1970 Jan 1st
Right
it's an epoch timestamp
You could do maths
searching for something like "format epoch timestamp" should help you search, but im not familiar enough to help with actually doing it in js
^
Leap years @sullen harness
@nimble stump good for big brain
when i kick someone, the rest of the server thats not opped cant see
is there a specific perm node or config in essentials or something
Welp will try
@torn pilot https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
this should help
Thanks
@dawn trout Imagine not being verified i joke ok pce since this is help
anyone know why my server is crashing when i pearl into end city gate?
idk but several people are having issues like that it sounds like
@torn pilot https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
this should help
@zealous lynx Is this easier with Java?
@zealous lynx Is this easier with Java?
@torn pilot well
You can just format
And thats it
:v
In Java obviously
It's just cause I need to use it as a view_requirement in DeluxeMenus
Sooo I assumed it only supports JavaScript
Sooo I assumed it only supports JavaScript
@torn pilot what are you trying to do?
Just get the join date of a player?
I want people who join before a certain date to be able to see the menu item, else see something else. So I'm trying to compare the player's join date with a defined date.
Something along the lines of if player joins before say 5th October, return true, else false
Mmmm
@honest tusksently kinda easier, it lets you pass in a format string
@zealous lynx well he ia getting 12394872727172 ms
Since he joined the server
Stop tagging RE xD
Xd
reeeeeee
That's the return atm
@torn pilot 69 nice
try to put it into a Date object then call toLocaleDateString() on it
Java is weird if that's what that is in Java
most things use timestamps
Java is weird if that's what that is in Java
@torn pilot I think its the same XD
var myDate = new Date( join*1000);
document.write(myDate.toGMTString()+"<br>"+myDate.toLocaleString());
hmm
ya thats close to what i was typing
maybe "\n"
for some reason console isnt being broadcasted to ops even tho its set to true in server.properties
anyone know why that could be
var player = BukkitPlayer;
function getFirstPlayed () {
var join = player.getFirstPlayed();
return join;
}
var myDate = new Date( join*1000);
function dateFormat () {
document.write(myDate.toGMTString()+"<br>"+myDate.toLocaleString());
return dateFormat;
}
dateFormat();
oops did that wrong
when a player enter a server
got kicked
woo makes me not feel so nervous, this javascript papi expansion uses nashorn too. i was nervous that since nashorn is deprecated that it wouldn't be an acceptable script engine to use...
but i can not worry now
how i repair that
what it do?
join is not defined
it's out of scope
Pretty sure i can't reference variables in other variables
function dateFormat (epoch) {
var myDate = new Date( epoch*1000);
document.write(myDate.toGMTString()+"<br>"+myDate.toLocaleString());
return dateFormat;
}
dateFormat(BukkitPlayer.getFirstPlayed());
Ok so how do I actually use hex colors in a scoreboard it just keeps returning like its base color
ReferenceError: "document" is not defined in <eval> at line number 1
@tall crystal Does scoreboard support json?
Well it supports regular chatcolors
still ReferenceError: "document" is not defined in <eval> at line number 1 wondering if I can't use document
k
function dateFormat (epoch) {
var myDate = new Date( epoch*1000);
return myDate.toGMTString()+"<br>"+myDate.toLocaleString();
}
dateFormat(BukkitPlayer.getFirstPlayed());
(fix last line to do whatever it is that papi wants for logging)
Ahh that worked
It's an html thing usually
oh lol, never used it but i've done lots of javascript
?
Welcome to the year 52433
Whoops
so many upvotes, thought i could trust it
I meant *1 with I did that
You can't have it on it's own I don't think
It has to be *integer
I wonder if other platforms return it as epoch/1000 on default 🤷♀️
does getFirstPlayed return a string in that expansion?
function dateFormat (epoch) {
var myDate = new Date(parseInt(epoch));
return myDate.toGMTString()+"<br>"+myDate.toLocaleString();
}
dateFormat(BukkitPlayer.getFirstPlayed());
oops dont do that
epochs are longs
I did
function dateFormat (epoch) {
var myDate = new Date( epoch*1);
return myDate.toGMTString();
}
dateFormat(BukkitPlayer.getFirstPlayed());
Which seeeems to work
Minus it saying GMT which isn't actually my time zone
One message removed from a suspended account.
One message removed from a suspended account.
if you want to get rid of it just substring it
One message removed from a suspended account.
srry was @ Absentt, idk how to obfuscate
One message removed from a suspended account.
do you mean magic chatcolor?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
&f[&k~&r&fDonator&k~&r&f]
or something
Is there anyway to get the associated NMS EntityTypes for an Entity class?
Trying to automatically use a declared constructor
via craftbukkit's entity class, then getHandle()
One message removed from a suspended account.
@zealous lynx Get the handle of an entity class, does that work on non-objects??
Basically I'm trying to get a map of EntitySkeleton.class -> EntityTypes.SKELETON
etc
Thanks for you help @zealous lynx c:
No, the NMS EntityTypes enum @zealous lynx
It's now required in all insentient constructors
Which can be a bit bothersome
...So uh... adding an Entry to a scoreboard with a hex color doesn't work but adding a team and setting its prefix works :/
...So uh... adding an Entry to a scoreboard with a hex color doesn't work but adding a team and setting its prefix works :/
@tall crystal are you using spigot api?
@tall crystal That's because the hex color changes the entry you're adding
I set it to use the bungee api chat color
The entity you're now targetting is COLOR + entityName/Id
Instead of just the entity
Well they are just fake entities
Not to the client
@wheat mirage Entity.f stores the EntityTypes
Kinda wierd because I can add normal ChatColors
I need it before instantiation @zealous lynx
try {
monster = (EntityInsentient) entityClass.getDeclaredConstructor(
net.minecraft.server.v1_16_R1.World.class
).newInstance(world);
} catch (InstantiationException e) {
e.printStackTrace();
return null;
} catch (IllegalAccessException e) {
e.printStackTrace();
return null;
} catch (InvocationTargetException e) {
e.printStackTrace();
return null;
} catch (NoSuchMethodException e) {
//Find new constructor and relevant EntityTypes
return null;
}```
@zealous lynx
can I see if a snowball hit a either block or a mob using ProjectileHitEvent
ok, so you need the enum from the nms and you don't know how to access the enum.
if i understand.
1 sec, i wrote a helper function to do that
@zealous lynx Basically I need to map the EntityTypes enum to it's relevant classes
lets take a step back, what are you trying to do? construct an nms entity?
Yeah, I register some Entity classes against certain mob types I want to spawn
Some of them are my own NMS classes
Tbh I use a low enough number of vanilla mc ones I'm just going to hardcode it in
Sure thing
Tbh this help channel gets a ridiculous amount of messages per day though 😛
I'll take "What the fuck is this?" for 300, Alex
catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
return null;
}```
The aforementioned object can be done with the following in GSON:
JsonObject object = new JsonObject(); object.addProperty("value", 100); object.addProperty("queued_value", 100); object.addProperty("mission", 100); object.addProperty("mission_time", 100); object.addProperty("lost_value", 100); System.out.println(object);```
@subtle blade I dont really understand what this does - How would I be able to utilize this in adding lines to my file?
Read and write. Read from file, get a JsonObject, edit it, write to file
That Gson class I mentioned earlier has methods to read and write files
Yeah but it adds the stuff to the JsonObject, but how will the JsonObject add stuff to my json file?
You write it to the file. Lol
so far after most everything my brother and i have tried it still loops the animation
we tried it with another animation and it didnt loop that one
lmao my head is gonna explode
That Gson class I mentioned earlier has methods to read and write files
public static final Gson GSON = new GsonBuilder().setPrettyPrinting().build(); this?
xD
im so braindead
@subtle blade What's your issue with that code?
You're repeating yourself in 3 identical catch statements. Merge them
the lack of ors
Yeah it was an IDE quickfix thing and it just wasn't important enough to merge
I thought you'd posted the actual code
It was important to my eyes :((
Is bukkit.yml world-container not working in 1.16?
No
my brain is slowly dying
Don't know whether or not md plans on reimplementing it
Damn, that's a right pain
Is there a way to see if an entity or a block was hit with a ProjectileHitEvent or should I use a different way
If you want to take a stab at reimplementing it, source is open, we encourage PRs 🙂
event.getHitEntity
^
@subtle blade What broke it?
The entire concept of how worlds and dimensions are handled internally was rewritten. md just didn't bother reimplementing it because he'd figured nobody used that option
You got it 
@fleet crane How difficult would re-implenting bukkit.yml's world container be? I'd be happy to PR if it's not too difficult.
Anyone know a plugin which stops someone from going into like spawn when combat tagged?
I’m looking for a Plugin that Let’s you use Plugin Commands Inside /Function and Command Blocks ;3
PvP Manager? @frigid ember
something else
Move spawn 10 Blocks Higher. Done.
lmfao
i mean that is pretty simple tbh
but i rather have something like a HCF border around it
i would make it if i knew how to
Does anyone know ehy when I first created my server, everyone except me(because I was running on the host machine) had really high ping and had 1 bar. After a bit, it just stopped.
your internet is ass
^, plus never host on your machine
End.
facts
Uh
@frigid ember why not
@golden valley also it stopped now
So my internet being ass cant realy be the problem
ran out of memory prob too
“My Internet being ass can’t realy be the problem.” Think about that.
and just never host on your machine its facts
i was just aboutto say that
check tps maybe
you just admitted your internet was ass, mine used to be ass, so i changed server locations
Recent plugin?
@frigid ember why though
just dont?
thats okay internet
its poor practice, its not the only thing running and security issues too.
easier to have a dedicated machine
You use your own ram/Wifi. It’s Out of balance.
Uhm does it cause any sort of damage to the hardware itself? Such as wearing out the cpu, ram etc
yes it causes it to explode
Samsung
oh, you got lucky
Dedicated machines are literally just pcs
but dedicated, yea
Yes, how come they don't explode then?
luck
im telling you man, you run your server on a computer, not a dedicated machine, it will explode
Ok, Geometry. It’s your internet if you don’t pay the good stuff to your Internet provider. End.
@fierce briar yeah internet, but apart from that can the hardware be damaged?
Yes, After many many years.
I know it can't explode.
You will lose stuff.
Wdym by lose stuff, files?
Let’s say it’s not beneficial to host on your own Pc.
yea, notch will come into your house and drill your hdd
I'm gonna be stopping hosting on my pc soon, but I want to know about the hardwarw aspect
Geom seriously, Not worth to host on Your Own pc, Unless for tests.
Just in case I ever just want to chill with my friend and have some fun
hero brian will come over and pirate happy feet in HD24K
without a vpn
nah man, you are fine
Well, Friend is cool, But Like 24/7 hosting is more for Dedicated Servers.
^
@fierce briar yeah, but im pretty sure my internet can handle 1 or 2 other friends. I just want to know about the hardware damage, since that's really what worries me atm
And i def don't do it 24/7
internet is not always consistent, its more of a river.
Like 3 hours a day at most
Nothing much.
pay a buck a month for a host, i got nothing for you
you asked a super vauge question
both 😄
True
I'm just saying like, seeing as my cpu temps to soar to the mid 70s, can this be a problem
Well, I do have a 3800x with onlh the stock cooler
im a Dr. the prognoses is exploding syndrome
If we could know when my HDD will fail. extact sec. I would probs have a better answer.
Oh yeah another thing
My hdd is showing signs of failing and I'm hosting a minecraft server on it, could the server had lead to this?
Well the hdd is a seagate barracuda which fail quite a lot... but
not tommrow
So, Vague, Is “Depends”
“Depends”= Hours/Time/Quality,etc...
@golden valley uh what
@golden valley could u repeat that again I dont understand
Back it up?
“Showing signs of failing”
Also GeometryPro: Forgets to backup
no fr if you dont, you will loose everything
oh my lord
I backed it up?
you sure did pal
Ok, I did back it up. What I'm wondering is
Could the minecraft server have lead to this
Or been a factor in thos
This
you are going to hate the answer
maybe, maybe not
When would it be yes when would it be no?
idk man, im not a wizard
Uhhh why do u say maybe or maybe not @golden valley
Pray, and Hope the Hardware/Software Lasts a long time.
~ The Way to host.
idk, try the stairs hard reset method
just take your pc, and toss it down your local flight of stairs, see if it fixes the issues
Bruh
^ Spoiler: ||Joke||
Please dont
quick question, anyone know if the glow effect supports rgb?
Sarcasm: Deleting Windows system 32 Should solve the problem...
honestly though, i say maybe because its not possible for me to diagnose your PC from discord IRC
Glow Effects: 🤔 They work with Teams
Ok anyways, last 2 things
Just give me a yes or no answer: hardware damaged by the server or no
Anyways to reduce the strain on my cpu and make my server more efficient in a way?
Teams Idk if they support all colors.
@golden valley what info would u need?
not more than normal wear and tear, yes
i know the scoreboard works with rgb, that's why i was wondering
Ok ty for that straight answer
I have done everything to update my server to 1.16.1. I have everything ready, and I have the .jar file in the server folder, and I am ready to start the server. I run the server and it says "unable to access jarfile spigot-1.15.2.jar". I thought I did everything, but my server won't even start. Help!
The .bat should have the same name
its not really doable my man. it could have effects if the damaged part of the HDD contains the server. Damaged HDDs can also lead to OS slowdown, regardless i would change HDDs ASAP
Update your bat file
im on linux
Or sh file or whatever
anyone here a god at linux or is it stack overflow time
I wish I was, Someday thoe
Open it with a text editor and find the jar file name
ok
I'm not bad, but some legacy things bonk me on the head
thanks!
The hardest thing(s) in life is Launching a Minecraft server and hoping for the best.
idk man, have you tried driving with your feet?
@golden valley ty for the help
Damn. True
I have been having this black screen issue, could my failing hdd been behind it?
its a stretch to call it help, but i am here
Thats what a guy said
it sounds like you really need a new HDD my guy
The screen starts lagging, then goes black with the cursor still there, then it comes back(sometimes) with the game crashed
@golden valley yeah, its a seagate barracuda
get a SSD for os and games, and a large HDD for files
Hopefully Everything Supports Hex colors in the future. Glow Rip, for now.
what is the failing drive?
yea, try deploying the server on the nvme
The server doesn't cause the crash btw
that will eliminate the hdd issue
if there is one
I had 4.3 billion timesouts on the hdd lmao, pretty sure its a problem
Anyways I gtg to sleep, thanks for the help everyome
Everyone
hello.. i have a scoreboard plugin
here is the class https://hastebin.com/hexawolebu.java
can anybody tell me where to start to AutoUpdate/Refresh ?
i made it for my lobby
i dont need config
or anyother thing
can someone help me with an error i got? I cant post the logs so i need someone to dm me
?paste
Are you doing large world edit operations
How would i use world guard and disable pvp protection if someone has been combat tagged?
Probably need a custom add on
Ayo, looking for some serious BungeeCord help. Made a post on the forums but I'm having no luck.
I'm running on a Windows Server 2019 Dedicated Server. Got a bind error on BungeeCord startup, checked all connections via cmd prompt and the port assigned to BungeeCord is not in use by any other programs/services.
Can post link to forums post if needed
I need some help, details here https://www.spigotmc.org/threads/placeholderapi-check-how-many-people-are-in-the-current-world.448704/
Has anyone used tebex before? They say there is a transaction limit of $250 dollars. Is that per transaction or the total amount per month for transactions your server can gain?
No clue they use to say on the site.
how do you check how many players are in the same world as the player is in with placeholderapi?
@velvet halo per transaction
i believe
in my experience they're able to process at least 10s of thousands total per month
Alright cool!
aam i verfyied
nope
any errors?
oh okay, maybe when you're back on the computer?
How can I create a comparator that sorts by minimum, and a comparator that sorts by minimum
public class MinimumComparator implements Comparator<IReward> {
@Override
public int compare(IReward o1, IReward o2) {
return Float.compare(o1.getChance(), o2.getChance());
}
}
public class MaximumComparator implements Comparator<IReward> {
@Override
public int compare(IReward o2, IReward o1) {
return Float.compare(o1.getChance(), o2.getChance());
}
}```
I found this somewhere but I dont see how you can guarantee that this works
hey
When I try to install spigot 1.16.1 maven repo using gradle, it gives me this error v
Hello! Is anyone here? AuthMe Crashes my server
am blind
Anyone?
whats your full pom?
is there a way to run both a modded and spigot server
whats your full pom?
@opal bay
It is a build.gradle
@plucky egret not in a way that won't result in bugs
Everything results in bugs
spigot is built for vanilla not mods
Yes
it's on the forums under "Hub" on the navbar
When I try to install spigot 1.16.1 maven repo using gradle, it gives me this error v
@cold wharf
Any chance anyone can help with the issue I posted above?
I'm running on a Windows Server 2019 Dedicated Server. Got a bind error on BungeeCord startup, checked all connections via cmd prompt and the port assigned to BungeeCord is not in use by any other programs/services. Can post link to forums post if needed. Also a little desperate here.
I keep getting an error:/
code
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
ItemStack item = player.getItemInHand();
if (item==null)return;
for(String key : main.getConfig().getConfigurationSection("items").getKeys(false)) {
String id = main.getConfig().getString("items." + key + ".id");
String name = main.getConfig().getString("items." + key + ".name");
List<String> list = main.getConfig().getStringList("items." + key + ".commands");
System.out.println(name);
System.out.println(id);
System.out.println(item.getType());
System.out.println(item.getItemMeta().getDisplayName());
System.out.println(Material.getMaterial(id));
if (item.getItemMeta().getDisplayName() == name && item.getType() == Material.getMaterial(id)) {
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
for(String commands : main.getConfig().getStringList("items." + key + ".commands")){
player.performCommand(commands);
}
}
}
}
its a null pointer exception
My server won't function when I use 1.16.1
yes
It says this line has the error i think
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
ive used that type of code before
and ive never had an error on that scale
you have imported everything right
yes
got it working
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
ItemStack item = player.getItemInHand();
if (item==null)return;
if (item.getType() != Material.AIR) {
for (String key : main.getConfig().getConfigurationSection("items").getKeys(false)) {
String id = main.getConfig().getString("items." + key + ".id");
String name = main.getConfig().getString("items." + key + ".name");
List<String> list = main.getConfig().getStringList("items." + key + ".commands");
if (item.getItemMeta().getDisplayName() == name && item.getType() == Material.getMaterial(id)) {
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
for (String commands : main.getConfig().getStringList("items." + key + ".commands")) {
player.performCommand(commands);
}
}
}
}
}
}
made it so it checked if it was an empty hand and if it was not it ran the code
https://cdn.discordapp.com/attachments/421260739970334720/727797469601202297/unknown.png hey, how do I fix lighting?
w/o placing blocks in shadows cuz i tried that
1.16.1 ?
yep
Spigot or spigot fork ?
When I try to install spigot 1.16.1 maven repo using gradle, it gives me this error v
@cold wharf
Hi there, I'm trying to call Player#teleport() asynchronously because I've got a timer ticking down every second (using Timer#scheduleAtFixedRate()) which would need to execute the teleport command when at zero seconds.
I tried to create a Runnable and add the code to the run() method, but that threw the same exception. Does anyone have any other ideas?
teleport method should be called sync. I know a create api to manipulate switch between async and sync, then I think you'll be able to sync your teleport method. It's called TaskChain
@undone narwhal spigot
Then I don't know. It might be an issue.
can we pls then have a fixlighting command?
teleport method should be called sync. I know a create api to manipulate switch between async and sync, then I think you'll be able to sync your teleport method. It's called TaskChain
@undone narwhal Hm, and there is no "dependencyless" way? I guess I'll go with that if I have to, but is there no basic-java solution?
I've to check how this api synchronize on the main thread
However I've got an idea but dunno if this is a way efficient method
Create a kind of Queue, every x ticks on the main thread the queue is pulled and teleport the pulled request (Create a sort of Pair with a Player and its destination).
And async you can add someone to this queue
You can use like a ConcurrentLinkedQueue
Haha that contains a lot of more advanced Java which I'm unfamiliar with, but I'll try! Thanks!
This is something not that hard, just have to go deeper on it and then you'll master all of that stuff !
Good luck
Yeah, I've been picking up a fair bit of programming languages recently and I've "learned how to do stuff", but never really understood them in-depth like I did with my first programming language. When I get my current plugin done, I'll take a more elaborate Java course 🙂
You don't really need to take course. Actually I learned 95% of my skills just by trying, and searching online
^
you don't need to look for someone to teach you, they don't even hold the skills themselfs
making mistakes and learning from them will get you much further
A 1 month course will not teach you in depth no matter how well it is made
no, but you will learn the basics
I think that the better courses, are the most specific one
I don't know about you, but most of my experience comes from having read hundreds of tutorials, watched hundred hours of courses, and sometimes even read books
Something really precise
I don't know about you, but most of my experience comes from having read hundreds of tutorials, watched hundred hours of courses, and sometimes even read books
For me it's reading and experimenting
I think I've spent 50€ on Udemy so far -.-
Sometimes videos, but not the ones that try to teach you all about the language.
hi
hi?
how can i download 1.16 with buildtools i use java -jar BuildTools.jar --rev 1.16.1
yes that's how you build 1.16.1
Hi, does anybody have any idea how to use Async World Edit for schematic placement? Their documentation is pretty much non-existent.
it's WorldEdit documentation
But nothing works as they write
I had a very painful time using WorldEdit / FAWE / AsyncWE api
I tried just using WE in the hopes that async WE takes care of the rest, but it won't work asynchronously
Async World Edit is just a WorldEdit addon
it has same commands if i remember correctly
Oh, I'm talking about the API for the placement. Not the commands. I'Ve tested it and it did not work asynchronously
Let me try again, thanks for the help
oh i thought you needed commands
?paste
