#help-archived
1 messages · Page 110 of 1
segment fault doesn’t have errors in plain english
The deprecated one will take a BukkitRunnable which won't actually work properly lol
you can also do this
@echo off
cls
:loop
git add --all :/
git commit -m "AutoUpdate"
git push
cls
echo Push complete!
echo waiting 1 minute before repushing...
TIMEOUT /T 60 > nul
goto loop
Is someone able to help with GSON and custom Object deserialization?
next time either use the paste site or surround your errors/code with 3 back ticks ` @torpid field
I'm getting some errors, but I have spent already few hours reading the docs, and don't seem to understand
what's causing the IllegalStateException
Though scheduleRepeatingTask() can take a Runnable which isn't deprecated and can be used if you'd like
Just don't use the deprecated ones. There are alternatives
is there an event for anvil renaming? I couldn't find it
@alpine cedar cursed
Ehm, not really, Rundik. You kind of have to check for that yourself with an InventoryClickEvent
If the inventory is an anvil, you can cast it to an AnvilInventory and getRenameText()
Json array =/= Array @sturdy oar
@sturdy oar are you certain it is valid json array? and not just you thinking it is one?
That JSON formatting makes me cry
and I do deserialize it this way, but I don't see why it breaks inside the chapters
If the inventory is an anvil, you can cast it to an AnvilInventory and getRenameText()
@subtle blade I found PrepareAnvilEvent, can I use this somehow?
PrepareAnvilEvent is called when the item is put in the anvil
Not when it's taken out
Figured there'd be an AnvilItemRepairEvent or something but guess not
"chapers", should contain an array of chapters, and each chapters should contain an array of pages, and each page an array of verses (strings)
Not when it's taken out
@subtle blade Is it possible to add Inventory event listener when the item is put in the anvil and remove it afterwards? Would it be better for performance?
I found that https://bukkit.org/threads/inventory-anvil-events.142990/
Is that the only way to listen to InventoryClickEvent ?
Yea that's pretty much how I had suggested you do it as well
Ah ok, yeah I think it is client side when taking the item out of an anvil for the repair
Though I think there are constants for those anvil slots if I'm not mistaken
Though I think there are constants for those anvil slots if I'm not mistaken
@subtle blade do you mean thisif(inv instanceof AnvilInventory){?
Nah I meant slot 2 being the output slot for instance, but maybe there aren't
ok, thanks. I'll try the solution from the link. I think it would work
nvm guys i fixed my deserialization
Sounds like most issues.
my Ide(eclipse) shoots errors when i try to use sender.sendMessage("blah blah string") in a command. Error: sender cannot be resolved to a type but if I parse sender as a player i can! Whats wrong?
with semi colons
get a real IDE 🤷♂️
works fine for me with IntelliJ ¯_(ツ)_/¯
lol maybe its just eclispe being shit
sure
How can i detect a player taking damage (for everything)?
EntityDamageEvent?
EntityDamageEvent with instance check
Yh.
nice, ty
how can I rename the item here?
code: ```public boolean onCommand(Command sender, Command cmd, String commandLabel, String[] args)
{
if(cmd.getName().equalsIgnoreCase("ping"))
{
if (sender instanceof Player)
{
sender.sendMessage("pong");
Player p = (Player) sender;
p.sendMessage(ChatColor.ITALIC + "Pong!");
return true;
}
else
{
sender.sendMessage(ChatColor.DARK_GRAY + "Computers can't hear");
return true;
}
}
return true;
}```
and you apply the new meta the the ItemStack
@sturdy oar how do I apply the new meta?
xD it worked, thanks
have anyone got a plugin that can reload other plugins while the server is up? so there is no need to restart
i mean,.. there is PlugMan
but I don't recommend it if you're looking for stable stuff
ok then ill just go with restart
can't you do like /plugin reload
if you need to reset a specific's plugin data
usually authors implement reloads
There is an option to send a message to players that have a specific permission?
check the permission?
welp its my plugin and oc i am really pro so i have not xD
it's not that hard to make a class storing values, and supporting reload
check the permission?
@sturdy oar I know how to check permission but how I send message to specific players
does it just enable the plugin agian
Bukkit.getOnlinePlayers().stream()
.filter(player -> player.hasPermission("perm"))
.forEach(p -> p.sendMessage("ur msg"));
@ripe ledge
i don't know if this is what you needed , but I think so
it sends a message to each player with a permission
Bukkit.getOnlinePlayers().stream() .filter(player -> player.hasPermission("perm")) .forEach(p -> p.sendMessage("ur msg"));@ripe ledge
@sturdy oar Ok, thanks!
streams 👀
they're perfect for making things like that shorter
he would've had to do this otherwise
for (final Player player : Bukkit.getOnlinePlayers())
if(player.hasPermission("pex")) player.sendMessage("msg");
didn't bukkit had Bukkit sendMessage(message, perm)?
no idea
pretty sure it does
how can i say a message in the chat when the plugin is activated?
No one would be on the server to send a message to when your plugin is enabling
Unless you're using /reload I suppose
and how can i make that?
I don't understand the question. It's not something you need to do. There's no one online to see it and I guarantee you it's just an annoyance to see another message in chat after a reload
You can send a message to the console using your plugin's logger if you'd like.
ok
hi
can someone explain how i can install spigot mods?
Im trying to install it on a minehut server
?resources
does it work there or do i need to use a different site
thanks
Can get plugins from there, drop them into the plugins folder
Through FTP or the in-built file system for your host's panel, whatever
I want to split a string, in such a way.
String str = "Hello Hi \"hello lol\" ok this is a test";```
I want to split the string for every space str.split(" "); but handle words in quotes as one
Someone knows why event.getPlayer().hasPlayedBefore() not working? (it always thing that I don't played before)
Someone?
What event is that?
Maybe try making that check a few ticks later?
Maybe try making that check a few ticks later?
@fossil shoal How?
With the BukkitScheduler or a BukkitRunnable
BukkitScheduler#runTaskLater
BukkitRunnable#runTaskLater
what
Ok thanks I will try this
Hey, anyone know what to do to open an anvil inventory?
https://bukkit.gamepedia.com/Scheduler_Programming
Ok it's working now, thanks!
[19:11:28 WARN]: [RaptoR-Plugin] Task #63 for RaptoR-Plugin v1.0 generated an exception
java.lang.NullPointerException: permission
at me.lucko.luckperms.bukkit.inject.permissible.LuckPermsPermissible.hasPermission(LuckPermsPermissible.java:172) ~[?:?]
at org.bukkit.craftbukkit.v1_15_R1.entity.CraftHumanEntity.hasPermission(CraftHumanEntity.java:221) ~[patched_1.15.2.jar:git-Paper-226]
at me.YaronD.RaptoR.CustomJoinLeave$1.lambda$0(CustomJoinLeave.java:26) ~[?:?]
at java.lang.Iterable.forEach(Unknown Source) ~[?:1.8.0_251]
at me.YaronD.RaptoR.CustomJoinLeave$1.run(CustomJoinLeave.java:23) ~[?:?]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.15.2.jar:git-Paper-226]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:461) ~[patched_1.15.2.jar:git-Paper-226]
at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1240) ~[patched_1.15.2.jar:git-Paper-226]
at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:430) ~[patched_1.15.2.jar:git-Paper-226]
at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1157) ~[patched_1.15.2.jar:git-Paper-226]
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:946) ~[patched_1.15.2.jar:git-Paper-226]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
Someone can tell me what is the problem here?
Does anyone know how to get "Å,Ä,Ö,å,ä,ö" working in the "unknown-command:" (spigot.yml) When I do it defaults to "Insufficient permissions...." I'm editing in VS Code.
Send your CustomJoinLeave @ripe ledge
@slow swan are you directly typing those into the config?
Why yes, how else I ask...
When using special characters use double quotes for the value instead of single quotes. Then replace the special character itself with its unicode.
Aha
You can probably google up the unicode for a specific character. Then when we’re putting it into config, you’d need to write something like this: ”\u<unicode>”
What is a time change event called?
Are you looking for TimeSkipEvent?
One is not called because time changes every single tick
Time is a tick based value
either have a looping task setting it to day or set the gamerule daylighCycle to false and then just simply set the time to day
How would I cancel a task that implements Java Runnable? I've seen Thread.interupt though that stops the whole server
Send your CustomJoinLeave @ripe ledge
@naive goblet https://pastebin.com/wU8RgGsW (I add to the class output messages to see what working)
It's just stop working when the if coming
idk why
@empty salmon Player#openInventory(Bukkit.createNewInventory(null, InventoryType.ANVIL))
I cancel BlockFromToEvent when putting lava. When I remove the line that cancels that event the lava stays in one block. Is there a way to fix that?
@naive goblet It throws Caused by: java.lang.Error: Unresolved compilation problem: 31.05 18:25:26 [Server] INFO The method createNewInventory(null, InventoryType) is undefined for the type Bukkit 31.05 18:25:26 [Server] INFO at me.candinoDev.AnvilGUI.Anvil.onCommand(Anvil.java:21) ~[?:?] 31.05 18:25:26 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.14.4.jar:git-Spigot-56f8471-7554e08]
What version?
Send your CustomJoinLeave @ripe ledge
@naive goblet
1.14
Send ur code candino
https://pastebin.com/wU8RgGsW (I add to the class output messages to see what working)
Can you help me?
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
public class Anvil implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (label.equalsIgnoreCase("anvil")) {
if (!(sender instanceof Player)) {
sender.sendMessage("You don't need an anvil!");
return true;
}
else {
Player player = (Player) sender;
Player.openInventory(Bukkit.createNewInventory(null, InventoryType.ANVIL));
return true;
}
}
return false;
}
}
What can I do @naive goblet
I have a problem, this is the error:
[19:23:38 WARN]: [RaptoR-Plugin] Task #65 for RaptoR-Plugin v1.0 generated an exception
java.lang.NullPointerException: permission
at me.lucko.luckperms.bukkit.inject.permissible.LuckPermsPermissible.hasPermission(LuckPermsPermissible.java:172) ~[?:?]
at org.bukkit.craftbukkit.v1_15_R1.entity.CraftHumanEntity.hasPermission(CraftHumanEntity.java:221) ~[patched_1.15.2.jar:git-Paper-226]
at me.YaronD.RaptoR.CustomJoinLeave$1.lambda$0(CustomJoinLeave.java:29) ~[?:?]
at java.lang.Iterable.forEach(Unknown Source) ~[?:1.8.0_251]
at me.YaronD.RaptoR.CustomJoinLeave$1.run(CustomJoinLeave.java:23) ~[?:?]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.15.2.jar:git-Paper-226]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:461) ~[patched_1.15.2.jar:git-Paper-226]
at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1240) ~[patched_1.15.2.jar:git-Paper-226]
at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:430) ~[patched_1.15.2.jar:git-Paper-226]
at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1157) ~[patched_1.15.2.jar:git-Paper-226]
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:946) ~[patched_1.15.2.jar:git-Paper-226]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
And this is the CustomJoinLeave class: https://pastebin.com/wU8RgGsW
Someone can help me?
candino
it’s Bukkit.createInventory
@ripe ledge seems like the path isn’t set and returning null
Or smtng
And then when you use it it will cause NPE
@kind crow wym
@ripe ledge seems like the path isn’t set and returning null
@naive goblet what path?
@wind dock no why?
Right, cheers
Yaron
what
ohhhh
But the path is the same
Staff is uppercase in config and lowercase in code for instance
Im setting up spleef, and I want to make it so that players can hit each other with snowballs, but cant hit each other with their fist or shovel. How do I do this?
EntityDamageByEntityEvent -> if damager is not snowball, cancel the event
@fossil shoal srry, I dont really understand what you mean. Where do I find that?
EntityDamageByEntityEvent#getDamager()
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityDamageByEntityEvent.html
Listen to the event, if the damager is not an instance of Snowball cancel the event
You coding your spleef plugin or using one?
Is there a function to update block by location?
Im not using any plugin :/
Well
I am using worldguard
and worldedit
but no actual spleef plugin
Then u can do anything u want with that block
@bronze marten I don't want to change any properties of the block. I just want to trigger a block update. Is there a function for that. For example loc.getBlock().update()
You need to use the BlockState#update(true) method for that
do I get the blockstate from the getBlock() ?
getState()
Hey guys, If I make a plugin using 1.8, will p.getItemInHand() work on newer versions of the api?
ok thanks
Do you know a good plugin that can change the nickname in the chat tablist and overhead on the BungeeCord server? the /nick <Name> command, and /unnick
Where are the best anticheat for a factions server (300-400 players) ? pls
is there a command to get current server tps without measuring it manually?
Where are the best anticheat for a factions server (300-400 players) ? pls
@tawny gale probably AAC
/tps
/tps
@subtle blade I mean internally, inside an event
ok
@kind crow NoCheatPlus + Cerberus (if u know) < AAC ? ;p
@kind crow You can get tps with nms
yeah
MinecraftServer#recentTps[]
it's an array of double with length of 3 if i remember correctly
@kind crow NoCheatPlus + Cerberus (if u know) < AAC ? ;p
@tawny gale not sure. Didn't use Cerberus
MinecraftServer#recentTps[]
@sturdy oar how do I get MinecraftServer?
Reflection
not sure how do I do that. Do you have an example how do I get MinecraftServer from an Event Handler?
need to depend on the spigot jar itself as opposed to the API
Hey guys I'm using FreeDNS (freedns.afraid.org) to host my minecraft spigot server. Anybody know how to get the port working properly? My server address is my ip, with the port number as 7771. Is there a way to specify it from a dns address using forwarding, or will that not work?
Srv record?
need to create an srv record
how to do that
but most acs falses 😔
You should be able to find plenty of guides about srv records for minecraft with a simple search online
@severe hemlock https://freedns.afraid.org/faq/type.php
Someone knows why the code found that the player is no staff it's continue too check? (after this saying I am no staff its saying also forEachloop around 5 more times ?
https://pastebin.com/MW5LdPDN
read the pastebin first to understand
https://github.com/explored/packetevents/blob/master/src/main/java/me/purplex/packetevents/utils/NMSUtils.java here i made a recentTPS method with reflection supporting all versions(1.7.10->1.15.2)
to get the current tps do double tps = recentTPS()[0];
@kind crow
thanks @frigid ember
hmm looks similar to atlas
np rundik
inspired by atlas tbh i like what atlas did
just ma own taste yk
made wiki for ot
Hello guys, I need help asap. I port forwarded my ip and the server works, but only if I start it from the spigot.jar file. Doing so won't show me the console. If I start the server with a start.bat, the server won't work for other people. PLEASE HELP, I've been trying for 5 hours.
and mine supports 1.7.10 -> 1.15.2
not only 1.8+
the way atlas or protocollib do
send your start bat file
the text inside it
ok
java -jar spigot-1.8.8-R0.1-SNAPSHOT-latest.jar
yes
The server starts, it works for me, but wont let my friends do so
The console appears
ur friends cant join?
no, they can't join
did u port forward correct
yes
k
what?
a plugin to use console in game
please don't ever install one of those
Does vault manage the playtime?
because i have no plugin who does that but i can display it with PAPI
How I can create advancements?
Someone have tutorial or something?
?paste
Hey guys, why am I getting this error? https://paste.md-5.net/oduxudamon.rb
this.rank = HypixelSkyblock.getPlugin(HypixelSkyblock.class).getRankManager().getRank((String) map.get("rank"));
this.rankManager = new RankManager(this);
this.accountManager = new AccountManager(this);
rankManager.enable();
accountManager.enable();
customItemManager.enable();
I enable accounts after ranks
What's line 36 of the Account class?
this.rank = HypixelSkyblock.getPlugin(HypixelSkyblock.class).getRankManager().getRank((String) map.get("rank"));
cursed
Have you checked that map.get("rank") isn't null?
Have you debugged to see where it is null?
No but I don't think rank can be null
@Override
public Map<String, Object> serialize() {
Map<String, Object> map = new HashMap<>();
map.put("uuid", uuid.toString());
map.put("rank", rank.getKey());
map.put("bal", bal);
return map;
}
this is where I serialize
and this is what config looks like
if rank.getKey() is null it will not be in the map
but honestly split up the large statement and just debug where it goes null
I recommend literally just putting like System.out.println for most values. That's what I do.
wouldn't it be cleaner to use your own serialiser ? 🤔
supposed you want your users to go in there
It's just for data storage
if you use JSON to save, it can also automatically handle a Map if you use Gson 😉
Anyone know how I can fix a double clicking issue on my GUI?
roller gson is not that user friendly tho
In what way? I've found it fine so far. I very lightly use it tho. Unlike Google to make things not user friendly.
in the way those who will end up with users bothering you to explain how to add this, why this isn't workin and so on
?paste
@odd knoll I'm still getting the same error https://paste.md-5.net/obekeredez.rb
Did you debug what was null?
protected Account(Map<String, Object> map) {
this.uuid = UUID.fromString((String) map.get("uuid"));
this.bal = (double) map.get("bal");
Bukkit.getConsoleSender().sendMessage((String) map.get("rank"));
this.rank = HypixelSkyblock.getPlugin(HypixelSkyblock.class).getRankManager().getRank((String) map.get("rank"));
}
Ok, literally just debug all the values.
None of them are null though
Erm. Ok, I'm clueless then.
So you checked the rank manager wasn't null? Checked the method call getRank didn't return null?
How could I check to see what is in someone's main hand?
I know there is player.getMainHand(), though I'm not quite sure what I'd be setting that equal to to check seeing as it calls for MainHand
player.getInventory().getItemInMainHand()
Ah thank you!
for some reason when a player clicks in my gui, it clicks twice
for example if they click open settings gui, then it opens the settings gui and clicks an option in the settings gui
I think rankManager is returning null
@odd knoll this keeps returning null
Bukkit.getConsoleSender().sendMessage(main.getRankManager().toString());
Wait actually I think it's because I regisered Serialization it before I registered ranks
Is Location hash map safe?
I.e. if I do Block#getLocation in several places, am I guaranteed the same location instance?
@odd knoll it's still not working
this.rankManager = new RankManager(this);
this.accountManager = new AccountManager(this);
rankManager.enable();
ConfigurationSerialization.registerClass(Account.class);
accountManager.enable();
rank manager is not null when I use it other places in my project, only in that one spot
?paste
Make sure you actually assigned it.
https://paste.md-5.net/tokubarolu.pl this is the error
I can't rly look RN, I need to do a lot of work.
Upon using CustomModelData, can I just make a json based around the item I want to have CustomModelData and then assign that integer, or will I have to use a texture pack? Basically I'm just confused about file formatting
sorry if that doesn't make sense
Hey guys, what's the gravity constant for players in 1.8
Is there any guide for Spigot resources category?
I can't really figure out which category i should choose to publish my plugin in
Just put fun
hello "rollermachine
ok
'Misc'
Or guide
Idk
(Copy pasted question from earlier) for some reason when a player clicks in my gui, it clicks twice
for example if they click open settings gui, then it opens the settings gui and clicks an option in the settings gui
And I am not registering the listener twice btw
Hey guys, what's the gravity of an armorstand
Yeah like entities have a gravity constant, I just cant find it
https://bukkit.org/threads/setvelocity-vector-and-parabolic-motion.86661/ I just can't find it for armorstands
For having a commands be like:
/c test
/c test1
/c test2
Instead of
/test
/test1
/test2
Wouldn't I do this?
public boolean onCommand(CommandSender commandSender, Command command, String label, String[] args) {
if (commandSender instanceof Player) {
String[] test = {"test"};
Player player = (Player) commandSender;
if (args == test) {
// command stuff here
}
}
}
Args is an array.
You'd need to:
- check the length of the array to make sure there actually are arguments.
- Get the position you want for the array and see if it matches test, test1, etc..
I knew it was an array which is why I was initially confused but I went with it and tried it out.
mm okay
Yh, all good. If you have an array of something, it's a bunch of something. So that's why it's String[] and not String.
Also, bear in mind the positions in arrays start at 0.
Mhm. And yeah ik, thanks haha I get confused with Lua sometimes since it's different there
Does the legacy version of WorldBorder work with /wb fill?
WDYM?
does it have that feature
I use ChunkMaster for 1.13+ and WorldBorder for 1.8 -> 1.12.2
So if I am using 1.8.8 should I get both of them or one
Hello, I'm making a custom jar I was wondering where can I add a console output when the jar is loading thanks
Wat
Someone told me a player in Creative mode may spawn in items with PersistentDataContainer stuff inside as well, is this the case? If so this could potentially bypass some stuff from a plugin I was working on.
or to be more specific: Is it a dumb idea to serialize lambdas into PersistentDataContainers
when is player abilities ever received or when does the client send it?
hacked client,
?
when a hacked client sends it
when does the client send it
what must he do
no idea; but it contains flags, walk and fly speed
ik
Hey guys, whats the command to get the skull owner of a head? Or to see all the nbt tags and values
when is it sent is the question
I did some debugging and never received it
changed gamemode and tried a lot
I'm trying to get the skull owner or skin so I can get this head
Skull
If I am on 1.8.8 viaversion do i need 2 world border plugins or just the one for 1.8.8
yo do y'all know if you can add color to Essentials /list?
For example group default
Default: &7default
I tried that, but it didn't work ^
Is PlayerItemDamageEvent triggered for armor items as well?
you should be fine, 1.8.8 doesn't have horrendous world loading
if you still want the plugin you should get the 1.8.8 version
@vernal plank easiest way is to test it
@frigid ember yes you can, I think it's in the localization file
if not it's probably somewhere in the config
Do you guys know what head this is?
High demand for what?
then it's custom and they made it
No yeah I totally agree copying stuff from other servers is really dumb imo
Let them have their thing, come up with your own ideas
@iron nebula I made it for fun then stopped, but then 25 people asked me to continue
For what?
Do people want Hypixel skyblock copy that badly?
I mean, server owners for sure want to copy all the good ideas but what about the players
It's an original idea that they worked on. I think it's really... poor character... to copy the same ideas.
I don't mind people copying and reusing ideas
But what I don't get is that everyone 1-1 copies the server
@iron nebula they want the same concepts but they want to customize it
The server owners, or the players?
Hey, anyone knows how to change the direction/rotation for a banner?
The server owners
Rite
And technically, Hypixel didn't make the idea of skyblock if you want to talk about originality
I hope you are at least getting paid
Yeah $250 alraedy
Yeah it was for an old version but people want me to continue
As long as u get paid to rip off someones work its fine to me LMAO
Skyblock wasn't hypixels idea
Thats not what I'm saying
They ripped off the idea from other servers
Which idea?
The whole server?
I'm speaking about 1-1 copies, not copying some fairy souls
Why does it matter what I'm making, I'm just asking for the skull of a head
Who said it matters?
You did
Where?
It was my opinion
Yeah look, I'm dropping it
Don't take it personally. I was just wondering bcs I have seen many people do the same and I have no idea where the demand is other than server owners being greedy
People have tried to abuse my plugins to copy Hypixel stuff
I just help them with the plugin stuff, could care about the other 🤷♂️
I have no idea, but all I kjnow is that people want it
download more ram
Is there a ChestInventory or something similar rather than DoubleChestInventory?
Or if there is another method as to make a command that opens up an inventory. I'm trying to make a menu of some sort, just want it to open the chest inventory and have the items I specify in there. Am I correct in assuming that I want to use InventoryView and then link that to an Inventory of some sort?
Yeah well if you want to make gui menus, consider encapsulate an inventory and reference compare it in events.
But using InventoryViews is not a bad practice and Bukkit#createInventory has a lot of implementations
How do I make a spigot server that other players can join?
@naive goblet Thanks, I'll look into Bukkit#createInventory. I am also new to Java so terminology isn't all that easy for me to understand haha
@wispy kettle You can search a tutorial online, there's plenty!
Can bukkit.saveWorld be run asynchronously?
afaik, worlds are saved asynchronously already
Unless I'm mistaken and that's a 1.16 thing. I know they added a server option, I just don't recall which was the default
parallel-world-save or something
(again, this being a 1.16 option)
My issue is I’m using swm and my worlds don’t auto save
So if I happen to get annoyed and ctrl + c my server, worlds get damaged
And sometimes I have to go into a backup and use an older world file
So I was trying to make my own auto save method
So I should schedule a sync repeating task?
So I just decided to take my IDE recommendations and I got no errors so...
player.teleport((Location) Objects.requireNonNull(player.getServer().getWorld("world")));
Would this work in teleporting a player to another dimension?
I don't expect it to, but if it does I don't have to keep working on that 😉
Ignore that! Figured out a way. It's quite similar so that would work with one little fix ^
saving blocks the main thread while it's throwing stuff off
part of the thing you've gotta remember is the contract of a save method, it's gotta ensure that the data is actually saved
Paying someone who knows how to setup soyoustart and my pterodactyl panel @me if you are interested
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Hey guys, trying to get a player head to have the UUID of the person who runs the /skull command. No errors in the console but I'm only getting steve head not my skin ahaa
if (sender instanceof Player) {
if (cmd.getName().equalsIgnoreCase("skull")) {
Player player = (Player) sender;
OfflinePlayer id = Bukkit.getOfflinePlayer(player.getUniqueId());
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
SkullMeta meta = (SkullMeta) skull.getItemMeta();
meta.setOwningPlayer(id);
player.getInventory().addItem(skull);
}
}
return false;
}```
What exactly am I doing wrong?
ItemMeta is a snapshot, you need to apply it back to the itemstack
Hey guys, is there a gravitational constant for armorstands?
I've got this
public static Vector calculateVelocity(Vector from, Vector to, int heightGain) {
double gravity = 1;
int endGain = to.getBlockY() - from.getBlockY();
double horizDist = Math.sqrt(distanceSquared(from, to));
int gain = heightGain;
double maxGain = gain > (endGain + gain) ? gain : (endGain + gain);
double a = -horizDist * horizDist / (4 * maxGain);
double b = horizDist;
double c = -endGain;
double slope = -b / (2 * a) - Math.sqrt(b * b - 4 * a * c) / (2 * a);
double vy = Math.sqrt(maxGain * gravity);
double vh = vy / slope;
int dx = to.getBlockX() - from.getBlockX();
int dz = to.getBlockZ() - from.getBlockZ();
double mag = Math.sqrt(dx * dx + dz * dz);
double dirx = dx / mag;
double dirz = dz / mag;
double vx = vh * dirx;
double vz = vh * dirz;
return new Vector(vx, vy, vz);
}
But I can't find out the constant for armorstands
It works when the distance of between from and to is close, but not when its far away
And it's not very accurate
ItemMeta is a snapshot, you need to apply it back to the itemstack
@chrome lark I'm a dumbass and just realized this ahaha thank you so much
how would I place blocks under someone?
Basically I'm doing a command that switches their dimension and if they just so happen to spawn mid-air I want some obsidian to pop up under them so they don't get obliviated
Thanks 🙂
Hey guys, how can I delete a resource on my spigot page?
report it and ask staff to remove it
Hihi, does anyone know how to send block break particles to all users in range? Or, does anyone know how to make plugin broken blocks break with particles? I've tried what the documentation says, but it's not working.
I've done:
Block b = some block; World w = b.getWorld();
b.breakNaturally(); // <- does not produce any particles
w.playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType()); // <- no sound or particles
w.spawnParticle(Particle.BLOCK_CRACK, b.getLocation(), 20, b.getBlockData()); // <- likewise
and the code doesn't produce any particles. I've searched around but to no avail; do I need to go with sending players packets?
https://github.com/CoreyShupe/SpigotArchetype just made a spigot archetype, not sure if this is the right place but I'm looking for some feedback on it
How I can create advancement?
Shoot, about my issue:
I realized b.breakNaturally() will turn the following b.getBlockData() to the BlockData of air block.
Big derp moment
This solved it for me
Block b = some block; World w = b.getWorld();
w.playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType()); // b.getType() is no longer Material.AIR
b.breakNaturally(); // <- had to move this down
what license is the spigot code/patches under?
GPLv3 iirc. May be wrong, but you can find the license on their repos.
is there worldborder for 1.8.9?
Probably. But you're on your own. We don't support 1.8.x here
@frigid ember yes
wait why
i dont understand
Probably. But you're on your own. We don't support 1.8.x here
@worn temple WHY
oops caps
It's 5 years old. Simple as that. There's not a single reason to use it over other, newer versions
OldCombatMechanics
you can disable it
Either way, you're on your own. Neither this server nor the forums support 1.8.x
no suffient reason though
Lol
1.9 is old too
^
yes it shouldnt be supported
I only support 1.13+ to be honest
I only made a compatibly plugin for the hell of it to test my own skill and problem solving. Not actually meant to be used on anything older than 1.13. but don't really need a reason other than it's over 5 years old and the spigot team officially announced end of life for support on it ages ago.
They don't even use a known fork of spigot.
1.8.9 is client only just so u know
all of their server is custom so there is no way of saying if its 1.8 or not
it could be a 1.15 server with a back compat plugin
?
why not make it 1.15 client version
They also get paid a LOAD to dev
Cuz of people like you who think using the 1.8.x client is worth it. Literally just for that. You can join hypixel with 1.8-1.15.x.
yeah and it has no 1.15 features
just make it 1.15
people will play
also
will 1.15 plugins work in 1.16?
Depends
This gets asked on every version change. Depends on what the plugin does and what it touches
if they use NMS or Reflection they may require an update
My auto broudcaster from 1.7 still works on 1.15 without changing cuz it just sends messages and does nothing else. I don't use the plugin. But it works.
Well my plugin' as well only uses chats
interesting
There's so many things that change and that plugins can do so it's entirely dependent on the plugin
Anyway. I need some fucking sleep. Gotta finish up a modpack tomorrow.
#help-archived message can one of the spigot staff double check
just want to be sure
Ehm i think
cubecraft said the other day its actually eaier for them to add protocol support and reimplement gameplay mechanics than it is to update their code to the newest version and deal with mojangs breakages.
And after doing these updates myself having to handle the server side updates for everyone too... man I agree. I wish I had stayed on 1.12 and just implemented protocol/newer blocks
Yeah main reason is a lot of servers probably can't handle 1.15.2 performance
Expecially because they are small servers designed for minigames
Could anyone help me with coding a permissions plugins, I can’t find any well explained tutorials.
Cheers
This should give you the basics of how it works. But in my opinion the system is kind of over complicated
Anyone knows when did Spigot\Bukkit started to shade GSON library into the final JAR? I have developed my plugin for 1.15 however it seems much like in 1.8 the GSON is not available at runtime
How do I prevent a server from loading too many chunks when a player moves too fast?
It's already limited. I don't want to slow down elytras more than I already did
Otherwise the rockets don't work
can bungeecord connect servers of different versions?
for example, my hub is 1.8.8
but my server is 1.15.2
they just need to be on 1.15.2 to join, since the hub has via version
No, its impossible
little question, i would use (CraftArmorStand) in 1.15.2 , that still exist ?
but you'll need protocol translator plugins
little question, i would use (CraftArmorStand) in 1.15.2 , that still exist ?
@dreamy glacier it should
try it out
I remeber having hub in 1.8.8 and game servers with other versions
so u can def. do it
cause he doesn't propose it to me when I write. ((CraftArmorStand))
any forum staff able to change my age on my account on the forums? I made this account ages ago and so I put in a fake age, I can tell you my real DOB via DM on request
okay
in packetplayinabilities
what is a & d, im seeing conflicting stuff; one person put a as creative and d as instantbuild
another put a as creative and d as invulnerable
there is really no official documentation for NMS fields
so either you're lucky and find someone that knows it, or you do the reverse-engineering
a is isVulnetable
b is isFlying
c is allowflight
those three are boolenas
instantbuild is d
also a bool
e is flyspeed
f is walkspeed
Nms pro
How I can check if player have a permission, but it will not work on OP until they will add them the permission? (because right now OP have all the permission)
ok fatal?
Player#hasPermission and !Player#isOp
That would be the general case
what i said is correct
Player#hasPermission and !Player#isOp
@naive goblet But I want this will work on OP only if they have the permission (Give the permission to themselves)
i remember before inchecked nms src it was quite clear
Then do the check ?
i made a wrapper for abilities thats why i remember these field names
i write wrappers 🎤
Then do the check ?
@naive goblet What?
@frigid ember these are them in order
'd' -> godmode,
'c' -> can fly,
'b' -> is flying,
'a' -> is Creative
if (player.hasPermission(“perm”) && !player.isOp()) {}```
I've looked at 1.15.2
Or you want to check if they have the permission assigned but they’re op?
the bit mask are still the same
b - isFlying
i promise
i checked
theybeven have a method
named isFlying
and returns b value
Or you want to check if they have the permission assigned but they’re op?
@naive goblet Yeah
I am to check if the player have the permission, and dont allow op but if the op player give themselves the permission it's ok
in all versions
yeye they're correct. There's nothing more to say
I mean he could've checked by himself , but whatever
You will probably have to get the permission and get set it to default not op
yeah
the field names do
and the whole layout
did u see 1.7.10 block place and dig
very hard to support 1.7
it changes 1.7.10, 1.8-1.12, 1.13+
You will probably have to get the permission and get set it to default not op
@naive goblet What?
How?
Eventually 1.7.10 shouldn’t be used under any circumstances
1.8 has it different to 1.13+ too
i'll check
or 1.8.8
1.7 literally had fields for the position
like a b c
in newer they made a base blockposition class
if you are attempting to support more versions and not just one version, its very hard to access such classes, its a lot of reflection.
if bukkit didnt get stuck i wouldnt have to use packets, isFlying, isSneaking, isBlocking all break
field names im the base blockposition class changed too
they never changed from 1.8 to 1.15.2 @frigid ember
and in the packet itself for the position changed the field name
@ripe ledge well what’s the use case of that though?
changed what?
the internal values names
these are valid from 1.8 - 1.15.2
oh ok
FatalPacket why do you have Dawson's gif as pfp lmao
I was in that live lmao
ect
me too
https://streamable.com/n7ytcg <--- most acs break because of the server breakage 😔
server thinks you're still blocking
😔
since wikepedia annoys me so much with that dono message i donated
like ffs 😂
then they ask me should we send more emails 😑
chargeback
nah ill get banned
nvm i dont even have an account
how dumb am i
why did i dono
who cares
they need it cos por
do you guys have any plugin recommendations for factions?
@ripe ledge well what’s the use case of that though?
@naive goblet What?
I got a server using OMGServ and i created a world using the admin panel. This world is in the panel worlds list but it's apparently not enabled on the server.
Because i created a command /worlds giving server's worlds list and the world a created is not in the list.
Do you know how i can fix it ?
Does someone know a good rankingKill plugin with elo ranking up and stuff like that ?
is it possible to set the view distance per-world?
i saw the method world.setmetadata but im unsure of what that does, there arent any other methods that signal that functionality
i found this
((CraftWorld) world).getHandle().spigotConfig.viewDistance = 3; does anyone know if that will override what is in server.properties?
seems as if that way of doing it isnt that great
Filezilla is ew
Help
have a problem and it is that it appears to me "your country is prohibited on this server
at the time I want to enter my server
did someone ping me
Help 😔
do you have authme
inb4 has authme
(he does)
inb4 has offline mode server
Yes
your authme config has a prohibited countries option
:ree:
how do I deactivate it?
Thanks 👌
I don't know much about NameSpacedKeys, would this work?
String[] enchants = ench.split(":");
Enchantment enchantment = Enchantment.getByKey(new NamespacedKey(MineTropicalSupplyDrop.getPlugin(MineTropicalSupplyDrop.class), enchants[0]));
Integer level = Integer.valueOf(enchants[1]);
Where the enchants array contains DURABILITY as 0 and 3 as 1
what are you trying to do
Pretty sure getByKey goes off of the minecraft:whatever names
Not the class static names
Oh really
So enchantment = Enchantment.getByKey(NamespacedKey.minecraft(enchants[0])); would work
Have you tried yet?
Mhm, NamespacedKey seems to be added on a version higher than 1.8 so I just used:
if (Bukkit.getServer().getVersion().contains("1.8")){
enchantment = Enchantment.getByName(enchants[0]);
} else {
enchantment = Enchantment.getByKey(NamespacedKey.minecraft(enchants[0]));
}
Enchantments still don't seem to be added to the item
not returning null?
I've done some debugging before, printing the values etc.
enchants[0] outputs DURABILITY
enchants[1] outputs 2
are you putting this on item meta
ItemStack
Wait you have config values like :
enchants:
- 'DAMAGE:1'
```?
'3':
item: "DIAMOND_SWORD"
amount: 1
enchants:
- "DAMAGE_ALL:2"
'3':
item: "DIAMOND_SWORD"
amount: 1
enchants:
- "DURABILITY:2"
etc.
Looking at the https://helpch.at/docs/1.8.8/ documentation, I believe I have all of the values right for the Enchantments.
Any ideas?
Fixed it
meta.addEnchant(enchantment, level, true);
You could add a method in your utility class btw
//Utility
public static Enchantment getEnchantment(String name) {
return Bukkit.getServer().getVersion().contains("1.8"))
? Enchantment.getByName(name)
: Enchantment.getByKey(NamespacedKey.minecraft(name));
}```
okay I wrote a bible but nice that you fixed it :p
Pahaha, sorry
kit plugin 1.15.2?
Right now I'm trying to make a win task and in it only the person who is first in the alphabet will win, can anyone help me? Here's my code so far:
@Override
public void run() {
if(plugin.getGdHHM().isGameOn.get("skyknock")) {
int count = ASliveCoubnt.count;
for(Player player : plugin.getServer().getOnlinePlayers()) {
boolean alive = plugin.getGdHHM().alive.get(player.getUniqueId());
if(!alive) count = count - 1;
if(alive && count <= 1) {
//plugin.getServer().broadcastMessage(ChatColor.GREEN + player.getName() + " HAS WON!!!");
for(Player players : plugin.getServer().getOnlinePlayers()) {
plugin.getGdHHM().alive.put(players.getUniqueId(), true);
players.setGameMode(GameMode.SURVIVAL);
players.teleport(GDLocations.spawn);
players.getInventory().clear();
}
plugin.getGdHHM().isGameOn.put("skyknock", false);
}
}
}
}
dude
Sorry I just entered it at the same time
ctrl c ctrl v: am i a joke to u?
I use IntelliJ for Java
!??
dont answer if u dont know 🤦♂️ 😂
i was thinking kotlin wouldnt be bad what u guys think
!????
I haven't used Kotlin
you dont know my question even
its ok
Hello, how to get precedent complete elements on TabComplete event ?
I have tried PlayerChatTabCompleteEvent but it's deprecated and don't work
just maybe someone else knows
Skript
no thats wrong
nothing to do with mc and ew skript
efficient scripting engine existing for java*
nashorn is inbuilt but bit slow
You're editing the messages as if I haven't already seen them lol
You can indeed😂
====================Trying to save player data using config.yml having some problems
Cannot load plugins/classes/config.yml
org.bukkit.configuration.InvalidConfigurationException: could not determine a constructor for the tag tag:yaml.org,2002:java.util.UUID
in 'string', line 3, column 11:
User: !!java.util.UUID {}
how do i get an entity to point towards another entity
i have a problem with my server, it may be caused by windows it self but i want to look into it any way
over the past 12 hours my server stopped responding and restarted several times
OS: windows server 2019 standard
IP: tnsu.ddns.net:14004
problem that keeps kicking in:
[14:54:21] [Spigot Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to Spigot!):
[14:54:21] [Spigot Watchdog Thread/ERROR]: ------------------------------
[14:54:21] [Spigot Watchdog Thread/ERROR]: Current Thread: Server thread
[14:54:21] [Spigot Watchdog Thread/ERROR]: PID: 17 | Suspended: false | Native: true | State: RUNNABLE
[14:54:21] [Spigot Watchdog Thread/ERROR]: Stack:
[14:54:21] [Spigot Watchdog Thread/ERROR]: java.io.WinNTFileSystem.delete0(Native Method)
[14:54:21] [Spigot Watchdog Thread/ERROR]: java.io.WinNTFileSystem.delete(Unknown Source)
[14:54:21] [Spigot Watchdog Thread/ERROR]: java.io.File.delete(Unknown Source)
[14:54:21] [Spigot Watchdog Thread/ERROR]: net.minecraft.server.v1_15_R1.WorldNBTStorage.saveWorldData(WorldNBTStorage.java:62)
[14:54:21] [Spigot Watchdog Thread/ERROR]: net.minecraft.server.v1_15_R1.WorldServer.save(WorldServer.java:820)
[14:54:21] [Spigot Watchdog Thread/ERROR]: net.minecraft.server.v1_15_R1.MinecraftServer.saveChunks(MinecraftServer.java:655)
[14:54:21] [Spigot Watchdog Thread/ERROR]: net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1004)
[14:54:21] [Spigot Watchdog Thread/ERROR]: net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:824)
[14:54:21] [Spigot Watchdog Thread/ERROR]: java.lang.Thread.run(Unknown Source)
that just happens randomly
now i am a first year system administrator so dont be afraid to go technical on my ass
now this also happens from time to time
just stops before finishing the thread dump
note the server is inside a active directory domain
not a domain controller as my CPU is too old to handle this
as well as the network load was too high
Hello, how to get precedent complete elements on TabComplete event ?
I have tried
PlayerChatTabCompleteEventbut it's deprecated and don't work
What essentials permission is to be able to tp me to the warp?
Thanks
Hello, How I can get the name of an inventory without Event ?
I do this but since somes versions the 'getTittle()' method exist only on InventoryView
https://hastebin.com/qobahalace.cs
the Inventory object itself doesn't store a name
What is the best choice to get the name ?
you can think of an Inventory as just the contents and the InventoryView as a display of the contents (which includes the name)
what are you trying to do?
Save an Inventory with the name. (this a 2nd inventory for the player)
where does it get the name from?
Bukkit.createInventory
that can get you the InventoryView that's currently open without events
from there, you can grab the name
Yes but for save, I can't use Event
you don't need to use an event
I'm assuming you're running this as an executor to a command?
I save The inventory each time the server restart
So I just have an Inventoty
@frigid ember I haven't used it personally and I have no idea how it performs in benchmarks but you might want to look into lua
I do use Kotlin
Nashorn is for javascript
yes
in java
Kotlin is an entire different thing
I think so, you can use .kts files
does anyone know any more efficient ones than nashorn itself
before i test kotlin by jetbrains tomorrow
Skript 🤣
because it's a meme
if u dont kno dont say, so many people said skript it’s annoying now
java
anyone know a fast scripting engine or method to embedd another language that can compile and is fast
mincraft is built on java
when you say "that can compile", that kinda defeats the purpose of a scripting language, yeah?
if you want compilation, don't use a runtime execution
nashorn can compile
use C++ or C#
and is still considered part of the scripting api
or python
im java
well then shut up
jython api for scripting is real large
really large, I didn’t see much performance difference to nashorn.
why you so rude
compile converter Skript -> Java 🤣
having a “atleast it works” mindset isn’t the best in most cases
You can optimize code yk..
pffft
if you're referring to https://docs.oracle.com/javase/8/docs/api/javax/script/CompiledScript.html I'm almost completely certain it's not being stored as java bytecode
just askin if sth yk bit faster than nashorn that someome added
you wont survive a day in a world of system administration
techdoodle thanks for helping tho
CompiledScript removes some overhead and if you run it over and over again, so it will be faster. The call can happen inside the script especially in case of recursive functions. It is not a immutability guarantee, but like a constant - if you need changes in the script you need to recompile. +more you can just call "cscript.eval();" as well, however if you want to use different aka mutable parameters then, yes. It would not make sense to recompile each time as it has larger overhead.
@white kite I'm not sure what Bukkit.createInventory is doing to save the title but at a glance, there doesn't appear to be a way to get the title from the returned Inventory object
techdoodle ^^
How I can get the tittle ? NMS / store on variable ?
@white kite yeah, storing it with the inventory in a map or an object would probably work but it's hard to say it'd be best without more details on what you're doing
fatalpacket yk other ones
@frigid ember it's just saving the overhead of parsing each time
nashorn isnt as good anyway
its js is very uhh
not good
like print... why not console.log()
Nashorn isn't that bad tbh
console.log is specific to the dom, node just wraps that for api niceness
@opal marsh Thanks you
true
if nashorn were to follow ES standards, print means print out to printer
its a better practice to use console.log
I am using jdk 8
thats only in jdk 11 according to that article
that's when nashorn is being deprecated
Why do you think i asked for another scripting engine?
idk, you never told us
I did
specify two reasons
lmao
i just asked for another one man
yk another one compatible with jdk 8?
you mentioned reasons you feel one is inadequate but you never told us your use case
to suggest another one would be to guess at what you're trying to do
I may not tell you the use for my project.
skript alternative
I want something fast, sth I know is faster than nashorn.
^
I AM not developing any minecraft plugin 🤦♂️
@frigid ember can you suggest for me a language other than Java? I won't tell you what I'm using it for but I don't like Java
and skript is 💩
see how ridiculous that sounds?
Serious Spigot and BungeeCord Help 🤔
Cos there no java help
xd
i asked for a java scripting engine specifically
Skript isn’t one
@frigid ember can you suggest for me a language other than Java? I won't tell you what I'm using it for but I don't like Java
@opal marsh when did i say that
Now you are just manipulating the situation
kalm
@frigid ember https://www.merriam-webster.com/dictionary/analogy
im trying to support other scripting languages for scripts in a project or game
won’t give more details
??
@frigid ember go to a dedicated server they can help you better
with java
I mentioned from the start that lua could be a good option
look at gmod
what even is gmod
facepalms
check drupi
how old are you?
irrelevant
u are off topic generaaleric
you are talking about something very different
that should have what you're looking for
yuss add me
https://cdn.discordapp.com/attachments/468737437460332567/717072152821760141/unknown.png
ill post it as screenshot again
if it even shows up lol
it doesnt
yushunadd me
@final osprey at a glance it seems like some funky filesystem business
what
it shouldnt though
could possibly be from open file handles?
no
if it even shows up lol
@final osprey “how old are you”
“you defo wont last a day in cs class” 😂
@frigid ember if you can't effectively describe a problem, you defo won't last a day outside cs class
i agree there
@opal marsh another problem occurs when i take the domain controllers offline
I actually described as much as I needed to if you know about javas scripting engines.
the domain controllers are virtual machines hosted on my laptop
Ok
the server cannot update his dynamic dns name
@final osprey is this on a network drive or being shared with any other machines?
but i will look into lua
no
who knows maybe ive been underestimating it
have you ever used lua in java or did u just recommend me something random
that's probably the problem @final osprey
what you mean
@frigid ember check this out: https://discordapp.com/channels/690411863766466590/690470011382267904/717072892030091376