#help-archived
1 messages · Page 176 of 1
IM BOREDE
and so on with every java element
Hello BOREDE im 7smile7
what did you do after that? I assume learned java by reading docs
nope i was like
this may sound like a really odd question but does Bukkit#getOnlinePlayers() tick non-player entities?
guys is there something like saveDefaultConfig, but for custom yml Files?
get unix epoch time, add X seconds, then compare when another command is ran
that's what I did at least
i want to make this plugin,i started working on it and when i got stuck i looked up on spigot forum to see possible solutions
@slim hemlock What do you mean by "tick"
thicc
its really impressive the size of spigots forum
tick non-player entities in a way that would be detected by the timings
there is multiple solutions for every possible problem
it reall yis
you can have
It just copies a List and gives it to you.
declaration: package: org.bukkit, class: Bukkit
Returns:
a view of currently online players.
yeah I meant the implementation of it
or more specific
declaration: package: org.bukkit.configuration.file, class: FileConfiguration
I'm having a hard time understanding why the timings say what they say
it doesnt saves the file, existing in the plugin jar
it just saves an empty fiel
file
if there is something in it it should
@slim hemlock Timings v1 or v2
I iterate through the list of players and check their inventories to //do stuff and somehow that ticks non-player entities
v2
or @tough kraken https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/Plugin.html#saveResource(java.lang.String,boolean)
declaration: package: org.bukkit.plugin, interface: Plugin
i think this is also used when calling getconfig.save
there is
`#Supported Languages: German 'ger', English 'eng'
#Just Change this, and restart your Server. you're done!
language: eng
lang:
eng:
test: ''
de:
test: '`'
Would you mind sending me the link in a private message? It sounds odd.
@tough kraken call saveResource(customfilename,false)
me?
yes
also double them
so theyr 6 and write in middle to have full block grayed rather than only text
juicy
i will try
@tough kraken call saveResource(customfilename,false)
@vernal spruce
the file returns null lmao
not sure i just hit to build the hole module
excluding spigot jar
cast Color to the blockdata?
Colorable*
well from there
use the fileconfiguration.save
thats whats in my onEnable
it should save the contents to the file
still empty
Why was I tagged? Did I miss something while eating brunch?
i just want to allow multiple languages, so i create a config with all the Strings
some guy typed his server in here by mistake
not knowing its bannable
so i have a
thanks ford, now i am hungry 😦
quests.yml creating in my plugin folder in IDE
and i have these methods
private void createQuests() {
quests = new File(getDataFolder(),"quests.yml");
if(!quests.exists()) {
quests.getParentFile().mkdirs();
saveResource("quests.yml",true);
}
loadQuests();
}
public void loadQuests() {
questscfg = YamlConfiguration.loadConfiguration(quests);
}
public void saveQuests() {
try {
questscfg.save(quests);
} catch (IOException e) {
e.printStackTrace();
}
}
public FileConfiguration getQuests() {
return questscfg;
}```
i will look at it, thank you
this i know for sure it copys whats inside
also this is inside main
so a main instance is needed if you have a object for it
maybe i did something wrong, actually has to be_
no need to getplugin when creating the file
its by default there
also im not calling get path
on it
aaaaaand
still empty 😦
does someone know off the top of their heads if I two itemstacks will return as being equal if one is a damaged version of the other?
im sure those methods i posted work
copy-paste them then switch names
@slim hemlock dont equal them
do .isSimilar
equal will return false even if its same item but with 1 more stacked
I thought so, been a while since I had to do smth like this
isimilar should return true if its same item but with lowered durability
you just call the create in onenable
its kinda selflooping
one call to create and everything should be good to go
okay it finally works
much thanks
but does it now overwrite the config, if it gets edited from the file itself=
?
it acts just like config.yml
alright, then thanks
this
saveResource("quests.yml",true); will only get called if there is no file with that name
so it wont overwrite next reload/restart
perfect
well
if i update my plugin (public), in most updates the config gets updated with more Strings added.
how can i add them if they are not in?
because if not, the users have to everytime remove the config
declaration: package: org.bukkit.configuration.file, class: FileConfigurationOptions
however keep in mind that calling this will always copy a section if it doesnt exist
and call .save after
yeah thats what i want, thank you!
guys I don't get it I did Bukkit.createNewPlugin("Good Plugin, "No bugs", "Very profitable"); and it didn't work
aww shit
where are preferences in intellij?
i think strg + alt + s
what is strg
no its not ctrl alt s
nah, i have community
yeah, doing the same i think
look into the keymaps for settings, maybe for you they are set other
How can I get the Docs for 1.14.4
Get them from the maven shit
Hi there, does anyone know how I can play the rare achievement sound (https://www.youtube.com/watch?v=RAcfzyNkTVw) ? I googled for quite some time but I never managed to find it
dont think there is a playsound thing for advancements
@river cradle UI_TOAST_CHALLENGE_COMPLETE
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html#UI_TOAST_CHALLENGE_COMPLETE
declaration: package: org.bukkit, enum: Sound
Wow, thank you!
What do you mean by you cant get it?
it doesnt even exist
Hey, on my 1.16 server there's a bug when players go to the end cities they just die.
My host told me its a spigot bug, is there any way I can fix this?
What are they dying from?
What's the version of your server? (/version)
They just fall into the void, let me get the version real quick
If they fall into the void then they're supposed to die...
But they just fall into the void when teleporting there
When entering end city they just die, my host told me its a Spigot bug
Then they issue is most likely with the telorting
It's done the vanilla way.
by throwing an enderpearl into that portal thing.
My host told me it was a Spigot bug, and it happened to others to
Just because your host said it's a Spigot bug, doesn't mean it is.
Throwing an ender pearl into an end portal gateway and ending up in the void used to be a vanilla bug.
But in 1.16 that should be fixed. :P
There's plenty of bugs that should be fixed.
If you want to know if this is a Spigot bug, then try it on the vanilla server and compare the results to that of a Spigot server.
Did you use the same world/seed for both the tests?
guys, can i have help in my mineacrft aternos spigot java server? the mineacrft version u need is- 1.12 1.13 1.14 1.15 and 1.16, can anyone help?
And you've still not provided me with your server version
I cannot provide you with it sorry
My host is temporarily closed.
So I cannot acces my ftp.
Because I know there's been enderpearl issues before that have been fixed in updated versions of Spigot
So it's possible you're simply running an outdated version
So it's possible you're simply running an outdated version
@wraith thicket who?
When was the latest update?
Every day
guys, can i have help in my mineacrft aternos spigot java server? the mineacrft version u need is- 1.12 1.13 1.14 1.15 and 1.16, can anyone help?
plz
You don’t need FTP access to do /version
That is true.
Atlhough he said his host is down, so I assumed the server was as well
@frigid ember
The Spigot server can only ever run on one MC version at a time.
If you want to support multiple versions of MC on one server, you'll need to use ViaVersion and/or ViaBackwards.
This is not the place to advertise your server.
Are you allowed to request help for custom plugins here?
This is not the place to advertise your server.
@wraith thicket but isnt this help channel?
im not advertising my server, i just want feedback from other peoepl to it
Its not really a help situation
Go to the forums and post in the "Rate My Server" section
oh ok
Does anybody know/recommend any plugins that allows you as a player to change your prefix titles based on the ranks you have? Like if you have ranks 1, 2 and 3 you can select any of the actual prefixes and change them.
Use a permission plugin for that and a prefix plugin?
Like any chat + permission plugin?
LuckPerms and deuxetags or something
I want the actual players to have the permission to change their prefix.
LuckPerms even has its own meta system
I've used DeluxeTags but it doesn't have that feature.
I'd like players to like run a /prefix command and it would inform them available prefixes & give them the option to change based on those available prefixes they have access to.
If anyone knows any similar plugins that do this I'd appreciate it a lot.
Hello! So I have a spigot 1.16.1 server connected to bungee and I have issue with nametags (prefixes not showing up above player head) I spent 2 days figuring out whats the problem. When I setup localhost the prefixes works.. I removed all plugins on spigot 1.16.1 server and they still didn't show up. (bungee plugin list https://prnt.sc/thldzx)
this way I setup the nametags
/team add Test
/team join Test myName
/team modify Test prefix {"text":"Test","color":"dark_blue"} PS: I even tried to upload same plugins on my localhost bungee and it worked so..
@neat orbit it’s possible to combine different plugins to achieve that
Does an event get fired when closing an inventory, say a crafting table, and the items in the grid get re-added into the player's inventory?
jesus my back hurts
@neat orbit i'd say just make a command such as /setprefix whatever, and either run a command from the console sender that sets their prefix to whichever they chose, or use luckperms api to set their prefix
oh you asked for a plugin, nevermind aorry
sorry*
@frigid ember i believe InventoryCloseEvent ?
and then just get the contents of the inventory and add them back to a player's inventory
possibly
No no, I mean, when you close an inventory that doesn't store items (such as an anvil or a crafting table), if there are items in there, they'll get added back to your inventory. What I need is take control over those items that get added back.
@frigid ember cast it?
i believe on an inventory, you can check if they're an instanceof CraftingInventory
or whichever
then cast it like Conclure stated
how would you get a class cast exception
wat
you're listening for when they close an inventory
InventoryCloseEvent event
Yeah it would be the blockdata ig
event.getInventory
@bronze acorn how would i do that exactly? the luckperms api version
i can't code anything unfortunately
But its right tristellar, do an instanceof check
i thought you were another dude i said that to
lol
What is even Colorables super interface?
It might be blockstate
package index
Wait what exactly ru trying todo
@EventHandler
public void onInventoryClose(InventoryCloseEvent e)
{
if (e.getInventory() instanceof CraftingInventory)
{
CraftingInventory workbench = (CraftingInventory) e.getInventory()
}
}```
Yeah I guess I can listen to InventoryCloseEvent, check the inventory type and all that and loop through the inventory to do what I want to do with the items in there
yeye pretty much that
I'm in the process of coding a 1.16.1 server is there anyway to allow older clients to connect to it? I was also wondering what the blocks would look like for a 1.8 client (i.e. I add a honey block)? Is there an API I could use in my plugin to check whether or not a player is on a version that is below 1.16 and if they are change a block to something else?
for older clients I suggest protocolsupport
1.8+ i usually use via stuff
@frigid ember what API version?
taahanis, do you recommend any exisiting setprefix plugins?
What are the benefits of ViaBackwards vs. Protocolsupport for allowing older clients?
they have a table on there to tell you which if you have this server version you need this
Okay so there is no meta for chaning that stuff
i can't seem to find any good ones
Basically you’d have to create your own help class for that
i do not know.. if you need a simple one command plugin for that i could make one and post the source code and send it to you
if you want
i'd rly appreciate that
oof rip tristellar
but the thing is
Not at all
@bronze acorn ProtocolSupport doesn't. I saw one on Viabackwards, but I thought the purple checks were future updates because the only thing in green under 1.16 server is 1.16 clients
it'd just have to be the ability to select existing prefixes
@frigid ember pretty sure it only has to be a switch of all the different colors including unknown
if its a 1.16 server use viabackwards and viarewind
And idk if an enum or a collection is best
Just do something you believe is good
I can check it out later then if you want (:
@bronze acorn have you used Viabackwards before? and will I need ViaVersion to get Viabackwards working?
yes and probably? i dont think so because you're allowing older clients not newer to join
Yes, you need the core ViaVersions for ViaBackwards to work
Personally, for allowing older clients exclusively, I had had better results with ProtocolSupport, but if you need to go both ways, ViaVersions (+ ViaBackwards) is the one you'll need
I have a 1.16.1 server so right now all I need is older client support, but I guess it might be smarter to use ViaBackwards for future use
ProtocolSupport is better
rewind is for 1.7 and 1.8 clients
@mellow bobcat may I ask why you say that?
and I didn't see an API for ProtocolSupport. I'm making custom inventories and if a user is on a version earlier than 1.16 I'll have to pick a different block
i dont think you have to use an api to get a player's version
isnt like an nms thing to do that
or smthn
No idea, I figured it would be easier to use their API if offered
aight
I mean.....
🤦 it's been the first ever resource to ever add support for older versions and even when ViaRewind had to stop development they even mention to use ProtocolSupport and i don't see a point of not using it
ProtocolSupport says this on the top of their resource page? Adds 1.12, 1.11.*, 1.10.*, 1.9.*, 1.8.*, 1.7.*, 1.6.*, 1.5.*, 1.4.7 clients support to your spigot 1.12.2 server
okay I'll download that and see how it works
How can I run a listener for the CreatureSpawnEvent after the Listener for the RaidSpawnWaveEvent
(and in the github page it says Support 1.16, 1.15, 1.14, 1.13, 1.12, 1.11, 1.10, 1.9, 1.8, 1.7, 1.6, 1.5, 1.4.7 clients on Spigot 1.16.1 lol)
yup
but that would be pretty damn hilarious if anyone still plays on 1.7 or 1.5 until up this day.
i mean if their pc is that bad 🤷
I mean, I'm not gonna judge anyone for playing in 1.4.7 single player, I play in 1.5.2 form time to time, but playing in 1.4.7 in a modern server... that doesn't sound very anti-cheat friendly lmao
expect getting kicked less than 5 seconds
i remember playing 1.8 on a 1.15.2 server the glass pane was bugging me and making me stuck there i was kicked everytime i try to log-in
eventually i had to do quickly log in and typed /jump
it was not a fun experience
Hey people, anybody here know how to bypass the new Hoglins and Piglins "brain", so that I can manage their behaviour with pathfindergoals?
Is there a way to sync inventories between servers without MySQL?
web interface
i have no idea how to use it
i have no idea how to use it
@fathom coral big brain
https://www.spigotmc.org/resources/invsync-sync-inventory-more-between-multiple-servers-1-16-support.26496/
this resource might be of use 🤔
What's the range for bee anger level?
mysql is way easier
how do I use it then?
What's the range for bee anger level?
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java#78
@fathom coral I'd highly recommend learning how to use MySQL it's super efficient for saving data and, as stated above, it's really easy to learn and use.
@fathom coral I'd highly recommend learning how to use MySQL it's super efficient for saving data and, as stated above, it's really easy to learn and use.
@balmy sentinel mongo db for mongos
I've always used sql
SQLite 🙂
¯_(ツ)_/¯
where is the download page for just the spigot part and not the build tools?
@rare prairie What are you trying to say by giving me that link hmm?
@peak socket it's not possible.
You just need to run BuildTools again using a different version argument.
Make sure to delete the other folders before doing that.
When I try to upload a resource pack with custom sounds accessible only through commands, to a spigot seerver, according to tutorials I've found, the sounds aren't accessible through the autofill in the /playsound command (The pack works fine if you have the resourcepack on through the options menu and it loads like it should on the server). Oh and when I upload a resourcepack with textures only, with the same mcmeta file it works just fine.
but i dont like build tools, they never work on my pc
Well, that's how it is. I wished Spigot could provide something faster too.
so how did get it before? like 2 weeks ago?
I don't know lol.
let me attach a screenshot
BuildTools is a must 
Is there a good 1.16 alternative to votingplugin that can award money, Because I have tried everything and I cannot get it to work.
The aptly named https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#updateInventory()
declaration: package: org.bukkit.entity, interface: Player
You really should refactor your code. The one you've posted is next to impossible to follow.
DRY principle, for one
You need to remember, code is generally read more times than its written.
And most of the time the re-reading is done by the author itself
So by writing spaghetti code like this you're doing a disservice to yourself (multiple times - once when writing, once every time you're forced to read/change it)
is it possible, with a custom entity extending EntityPlayer, to give said custom entity a PathfinderGoal although it isn’t an EntityInsentient?
No, you don't. You only need to update it after you change something in the inventory.
@lone fog When I set it to do the eco command it awarded it every time I joined the server instantly
mysql is way easier
just watch tutorials
you need to setup it tho
setup is the easy part
@sullen harness yeah dude, getting into the KGB facilities is easy, just do it carefully and plan it thoroughly, you need to plan it tho, the planning is easy
and boom, you'll succeed 👍
@sullen harness yeah dude, getting into the KGB facilities is easy, just do it carefully and plan it thoroughly, you need to plan it tho, the planning is easy
@frigid ember just use a paper
and draw
The plugin or the spigot version?
Both
I updated the plugin last night
And I last updated spigot a week ish ago
But i feel like it isnt due to that
As it just does nothing instead of outputting and error
Do you think you could send a screenshot of what your votingplugin reward folder looks like
Are you using setResult?
If you want to change the result of a crafting recipe, you can create your own recipe
CraftItemEvent extends InventoryClickEvent, for which the javadocs clearly state:
"Modifications to slots that are modified by the results of this InventoryClickEvent can be overwritten. To change these slots, this event should be cancelled and all desired changes to the inventory applied. Alternatively, scheduling a task using BukkitScheduler.runTask( Plugin, Runnable), which would execute the task on the next tick, would work as well."
Or, you can change the result in the PrepareItemCraftEvent event
is it possible to assign a PathfinderGoal to an entity that doesn’t extend from EntityInsentient?
how many unique map IDs can there be?
Presumably ~4.5B. Integer range
is there a way to stop Time-Changing if a boolean is false?
so if its false, dont change Day-Night Cycle
world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false)?
thx Choco
well, but i would have to set this on boolean-change i think?
and other question, what does that mean that an ItemFrame is fixed? Whats different if i setFixed to true
eh?
Whenever you change the boolean. Just put it in the second param vngc
@tough kraken Either gamerule or you can listen to TimeSkipEvent
timeskipevent... thats what i was searching for. thank you
well
there is no event
@hasty crag Read the javadocs: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/ItemFrame.html#setFixed(boolean)
declaration: package: org.bukkit.entity, interface: ItemFrame
Cannot resolve symbol 'TimeSkipEvent'
declaration: package: org.bukkit.event.world, class: TimeSkipEvent
declaration: package: org.bukkit.event.world, class: TimeSkipEvent
what the
beat you
You must be running an out dated version
Rip
It's there since some 1.15 version
It does - you just need to upgrade to an up to date version of the software.
then my plugin doesnt work on 1.14... and thats my server version
and the most stable for my system
It's there since some 1.15 version
1.15.1 👀
It's just that it is the 1.16.x docs
@hasty crag Read the javadocs: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/ItemFrame.html#setFixed(boolean)
@wraith thicket thx mate, i read the thing i got from my intellisense editor i guess it wasn't enough
much appreciated ❤️
maybe i will update my Plugin to 1.16.1... if there are no performance issues anymore for me
i read the thing i got from my intellisense editor
never trust your IDE
how to get the item that was clicked from an InventoryClickEvent?
the one you're picking up? getCurrentItem
No I meant like in a GUI, how do yo know what material you clicked?
getCurrentItem().getType()
ty
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
Hey, is it only me having problem adding description for my new resource or is it website bug???
I need help with bukkit's help.yml, its index-topics section is not displaying in-game.
Hey, is it only me having problem adding description for my new resource or is it website bug???
Just to let @Spigot know, there is problem with editor in chrome
@tranquil edge you registered each of those, getCommand(labelhere) and set the executor for that same class, and added each of those labels into the plugin.yml?
can i loop through all Concrete-Materials?
or do i have to add them manually to a list
i have a question regarding the version checker API (https://api.spigotmc.org/legacy/update.php?resource=), how long till it get refreshed?
Does anyone have experience with help.yml?
nvm, I saw public, max-age=21600 on the response header
Anyone know where the comparator calculates it's strength when reading a chest inventory in NMS code?
oh you got those
well dang lol
does it change at all?
when you do /day what does it change it to?
sunrise?
Hey everyone. I got a plugin that used to work fine with 1.8 until 1.16.1. I never use nms to guarantee better compatability. Now one of my plugins got recently recompiled with the new 1.16.1 jar which used to be the 1.15.2. When the plugin is running on a 1.8 server, the following error got reported by one of our users, any ideas if this is just a bug or permanently removed as of 1.16.1 ?
then which ones dont change?
Caused by: java.lang.NoSuchMethodError: org/bukkit/entity/LivingEntity.isSleeping()Z (loaded from file:/pro/bin/mc/spigot/1.8.8/spigot-1.8.8.jar by sun.misc.Launcher$AppClassLoader@13b5ea1a) called from class me.qintinator.sleepmost.services.SleepService (loaded from file:/home/gs-40119/plugins/sleep-most%204.3.0.jar by org.bukkit.plugin.java.PluginClassLoader@9e9ec214).
@peak marten
@tranquil edge try replacing "true" with false maybe
general i believe isSleeping() is no longer a method as of 1.16.1
Yes @bronze acorn , but the exact same code used to work fine until I recompiled with the new 1.16.1 jar
ah that explains
according to that
Any idea on the new correct method?
let me check
So any ideas on how I could possibly solve this?
Or should I no longer mention 1.8 compatibility ?
@EventHandler
public void onSleep(PlayerBedEnterEvent event)
{
Bed bed = (Bed) event.getBed().getState();
if (bed.isOccupied())
{
// here?
}
if (event.getBedEnterResult() == PlayerBedEnterEvent.BedEnterResult.OK)
{
}
}```
you could try these?
oh
oh it is
uh
is the plugin 1.16
but the server is 1.8 possibly?
oh
update the server to 1.16 probably
if thats not an option then uh
yeah i dont see a bed event on 1.8
The thing is that I got quite a few people using my plugin, question is how many people are using it for 1.8 🙂
oof
did you have it working for 1.8?
if so i'd say just check the server version and if it's this, use this method
It used to work, until I recompiled with the 1.16 jar
and if it's this version, use this method
Maybe this helps, thanks already btw
@Override
public int getPlayersSleepingCount(World world) {
return (int) world.getPlayers().stream().filter(LivingEntity::isSleeping).count() + 1;
}
That's a lot of overhead fora simple for loop
What do you mean @bold anchor ?
hm isSleeping is also a method in 1.8.8 already
@bronze acorn , not sure to be honnest
i have it here and it is 👁️👄👁️
@bold anchor , agree, but this is the only and fastest way I believe to achieve the result I need
oh
livingentity doesnt have isSleeping
but player has isSleeping
wait huh xd
ah
i see
Are you sure ? Because if I'm not mistaken, villagers also sleep no?
Ah so that could actually solve my issue 🙂
Instead of using LivingEntity
I could use player
Wonderful, I believe I'm going to try that 🙂
how to get the offline player's profile of WHATEVER minecraft account from name, whether they have played on server before or not
@hasty crag , Bukkit.getOfflinePlayer(String UUID)) ?
Not sure if I understand you correct
well i need to provide an OfflinePlayer inside SkullMeta.setOwningPlayer(...)
All I have is a string as player name. And this has to apply of any players, whetehr they have played on the server before or not
a Question:
i want to do something like Snake.
if the Players move, they leave a concrete-line under them. if someone runs on a line of another Player, or even on his own Line, he dies.
There is no "Cooldown" or anything, they should can stand still if they want.
so i made this: https://hastebin.com/ebizatijul.cs
but i have to spawn the line behind the player, and not directly under him, as then he dies.
how can i make that?
One message removed from a suspended account.
cancel PlayerCommandPreprocessEvent if their gamemode is SPECTATOR
well i need to provide an OfflinePlayer inside SkullMeta.setOwningPlayer(...)
All I have is a string as player name. And this has to apply of any players, whetehr they have played on the server before or not
@hasty crag I'm quite sure it works with the username also, so Bukkit.getOfflinePlayer("playerName");
@bronze acorn , problem: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/LivingEntity.html#isSleeping()
declaration: package: org.bukkit.entity, interface: LivingEntity
ye
isSleeping comes from LivingEntity
Bukkit#getOfflinePlayer is potentially blocking - if the player hasn't joined the server, a call is made to the mojang servers which will freeze your server for some time
its due to
LivingEntity#isSleeping
doesnt exist in spigot 1.8's api
but Player#isSleeping does
idk that logic
but its that apparently
and because you're using spigot 1.16 plugin on spigot 1.8
well ye xd
Is there any 1.8 docs?
aight
can someone help me out and indicate me whats wrong with my code? My goal is to put a player's head as a result of renaming a zombie, skeletton or creeper head in the anvil.
@EventHandler
public void onPlayerItemRename(PrepareAnvilEvent anvil){
AnvilInventory inv = anvil.getInventory();
if ((inv.contains(Material.ZOMBIE_HEAD) || inv.contains(Material.SKELETON_SKULL) || inv.contains(Material.CREEPER_HEAD)) && inv.contains(Material.AIR)){
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullmeta = (SkullMeta) skull.getItemMeta();
skullmeta.setOwningPlayer(Bukkit.getOfflinePlayer(skullmeta.getDisplayName()));
skull.setItemMeta(skullmeta);
anvil.setResult(skull);
System.out.println(skull);
}
}```
i don't really get what i'm doing wrong tbh
i don't have any errors
but it simply gives me a zombie head back (if i tried it on a zombie head)
you're
setting the owningplayer
as the skullmeta's display name
and the skullmeta has no display name
xd
yeah
i meant
anvil.getResult().getItemMeta().getDisplayName()
thanks a lot @bronze acorn u saved me frustration
no problemo
what would be the event triggered when someone place sth in an item frame?
PlayerInteractEntityEvent?
Is there any way I can possibly add a user to my Spigot resource page to modify the page?
The page is formatted the same as any other page on the site. So send them them raw text (the "Use BB Code Editor" button on the right)
You can then have them edit it on (i.e) on a converstaion tab and preview it there and then send back the formatted message/page.
a Question:
i want to do something like Snake.
if the Players move, they leave a concrete-line under them. if someone runs on a line of another Player, or even on his own Line, he dies.
There is no "Cooldown" or anything, they should can stand still if they want.so i made this: https://hastebin.com/ebizatijul.cs
but i have to spawn the line behind the player, and not directly under him, as then he dies.
how can i make that?
@tough kraken maybe an idea?
PlayerInteractEntityEvent?
@wraith thicket thats the one i used yeah but it triggers only when we rotate the object within the item frame, not when we place it
@EventHandler
public void onPlayerClickItemFram(PlayerInteractEntityEvent event) {
if (event.getRightClicked() instanceof ItemFrame){
ItemFrame itemframe = (ItemFrame)event.getRightClicked();
if (itemframe.getItem().getType()==Material.GLASS_PANE){
itemframe.setVisible(false);
}
}
}
@EventHandler
public void onPlayerClickItemFram2(PlayerInteractAtEntityEvent event) {
if (event.getRightClicked() instanceof ItemFrame){
ItemFrame itemframe = (ItemFrame)event.getRightClicked();
if (itemframe.getItem().getType()==Material.GLASS_PANE){
itemframe.setVisible(false);
}
}
}```
Is there a way to directly change the attributes of an entity rather than putting it on an item?
I'm trying to have certain players have a constant, small speed boost.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attributable.html#getAttribute(org.bukkit.attribute.Attribute)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/AttributeInstance.html#addModifier(org.bukkit.attribute.AttributeModifier)
declaration: package: org.bukkit.attribute, interface: Attributable
declaration: package: org.bukkit.attribute, interface: AttributeInstance
thank you!
how do i change the color of firework spark particles?
wait does that work for the spawnParticle method?
not entirely sure
actually no
the explosion
is different than the launching fireworks
Firework sparks do not have colour
They're white
The explosion itself can be changed if you'd like using FireworkMeta as mentioned above, but that requires a firework
is there something worng with spigot?
If you've got a specific issue, you'll need to desribe it.
the two step verification couldn't be complete it
pleas try again
._.
I've tried 3 times and nothing
@wraith thicket help pleas
What's the best way to check if an entitys AABB is colliding with any others? (Specifically a player)
declaration: package: org.bukkit.util, class: BoundingBox
could someone please help me out on there https://discordapp.com/channels/690411863766466590/690470011382267904/732676713091432499
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/util/BoundingBox.html#contains(double,double,double)
@wraith thicket Colliding with other bounding boxes, not a point.
declaration: package: org.bukkit.util, class: BoundingBox
@pliant lion I'm not entirely sure where you're having the issue? Is it when setting up 2 step verification? Or when logging in with it?
login in
@hasty crag I don't know exactly. You can try a bunch of different events and see which one gets triggered
@wraith thicket But thanks, that doc helps. Do you know if it's more efficient to use bukkit or the minecraft world#clips function?
I'm fairly certain CoreProtect had a check for items in item frames - you can check how they did it
I'm unsure the best way to get nearby bounding boxes, either filtering the entire world by range, or doing what minecraft does and getting all relevant chunks entities.
What's your end goal, though? Because if you have a location, then checking with the method I've linked above is pretty straight forward
@wraith thicket I'm trying to see if bounding boxes are colliding why do you keep linking me the point definition
You're looking for BoundingBox#overlaps
Or rather I am
I'm just unsure the most efficient way to get potential bounding boxes from nearby entities
Sorry, doing multiple things at a time, thought you were looking for a location contained within, but you're looking for overlaps
Anyway, sounds like you might simply want https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#getNearbyEntities(org.bukkit.util.BoundingBox)
declaration: package: org.bukkit, interface: World
@wraith thicket Thanks, that's actually exactly what I want
Thank you very much
@wraith thicket You seem to know the spigot API very well, do you know why the IDE never seems to autodetect org.bukkit.entity.Entity when suggesting imports?
I've seen a few mention this issue, and it's a huge pain
That's an issue with your IDE
It's most likely because there's other Entity classes also available
I have this error when the world saves which makes my server crash, does any of you know how to fix this?
but it's never been an issue with other classes
God damn it, Swing
@grim halo Worldguard manages the region, I just want to grant them access into the region but apparently there is no permission node for regions such as worldguard.region.access.exampleregion. I am wondering how can I grant them access into the region from an NPC, what plugin can I tie into CitizensCMD to give them access
i thought people knew by now alexis
anyway, the bukkit used to be the base server
and spigot used to improve upon it
however since spigot took the lead bukkit became a part of spigot
so spigot is now the base
any of you know of an app that you can use to get spigotmc forum notifications on mobile thats not literally spyware? (aka not tapatalk)
Entity extends Nameable. Check
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Nameable.html#getCustomName()
declaration: package: org.bukkit, interface: Nameable
Okay thanks
Why is it when I do /kick PlayerName in the terminal or in-game it passes PlayerQuitEvent instead of PlayerKickEvent?
@wraith thicket Is there any way to fix the Entity import suggestion in IntelliJ?
No idea, I don't use IntelliJ
Okay, something else then, is there any way to check if a bounding box is colliding with blocks / world voxels (as some code seems to refer to them as), @wraith thicket ?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Block.html#getBoundingBox()
And
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/util/BoundingBox.html#overlaps(org.bukkit.util.BoundingBox)
?
declaration: package: org.bukkit.block, interface: Block
declaration: package: org.bukkit.util, class: BoundingBox
?paste
trying to use API's using maven but it isnt working?
is anything wrong in there? :/
order of classes
is there a plugin for making it if u click a block you teleport
(right-click)
@frigid ember Maven's default source directory is src/main/java and within that you'd have the group id
@wraith thicket No I mean if a bounding box is overlapping with the world, as in like a wooden plank
Say I create a bounding box and I wanted to see if it fit in the air space
Does the API have any support for that
wait whatt?
Location loc = event.getEntity().getLocation();
for(double x=-4; x<=4; x+=1) {
for(double y=-4; y<=-4; y+=1) {
for(double z=-4; z<=4; z+=1) {
Location temp = loc.clone().add(x, y, z);
if(temp.getBlock().getType()==Material.FIRE) {
Bukkit.broadcastMessage(ChatColor.GREEN + temp.toString());
temp.getBlock().setType(Material.AIR);
}
else {
Bukkit.broadcastMessage(ChatColor.RED + temp.toString());
}
}
}
}
Why does the y not change?
yeah it checks a 9x9 area for fire
y=-4; y<=-4; y+=1```
Yes, and you're starting with a value of -4
middle is also -
@wheat mirage I don't quite understand what you're saying above
And saying, keep going while it's below or equal to -4
yeah it goes from -4 to 4
its different than the first and third one
@lyric cypress Stop trolling
look at 2nd y
ooh
and 2nd x - z
I see
@wraith thicket Minecraft has some built in functions which checks if an entities bounding box collides with the world, does the API have any support for this
thanks
np
Still not sure what you're saying. A world does not have a bounding box as far as I'm aware
@wraith thicket I mean blocks within the world
As in if it the current location of the bounding box does not collide with any blocks.
For example checking if an entity has space to spawn
You'd likely need to get the blocks within the bounding box and get the bounding box and then use the #overlaps method
But you're welcome to dig into NMS to see if there's another way
@wraith thicket Yeah NMS definitely has an api for it
But I wanted to know if spigot directly supported it
Again, check its implementation. I'm not sure what it does, haven't looked into it.
?paste
How much RAM do you recommend for 1.16.1 server with ~100 players?
10Go
it doesn't entirly depend on ram either, what CPU are you going to use?
I9 9900k
I'm the boss
How much RAM do you recommend for 1.16.1 server with ~100 players?
@rose crystal you want a very good dedi to handle 100 players in a single server
It's really hard with .16.1
I9 9900k is pretty good tho
Although depends on the game mode
survival
Ok, I'll stop it when I'll never see any: lb, miles or other stuff than the metric unit (and liters, grammes)
Survival is the heaviest one 😩
lol
no plugin survival with spigot?
with plugins
self hosted I assume?
dedi good ok
Good luck I guess
I mean just get something flexible with a good amount of ram, so incase you need to upgrade or something
I'd start out with 8gigs and gradually increase it with demand
goodluck
Okay thanks!
Any idea why this InventoryClickEvent isn't working properly (Yes it is registered)? The issue is whenever I click slot 9 or 18 it opens their preference menu (the inventory they had to open to get to this one) instead of reopening their privacy menu. The only way I can keep the privacy menu open is if I add player.closeInventory(); before I reopen the privacy menu. However, I don't want to do this as it resets the mouse to the center of the screen. Code: https://paste.md-5.net/jefefeqace.cs
Do you guys remember the good ol times
shh we don't speak of those times ):
D:
Is that return Bukkit.getPlayer(player.getUniqueId()).getPlayerProfile().getProperties().iterator().next().getValue();, so in 1.13.2 Since I did not get get ("textures")
I'm using befor 1.13.2
return ((Property)entityPlayer.getProfile().getProperties().get("textures").iterator().next()).getValue();
@balmy sentinel Please read the 3rd line of the javadocs:
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryClickEvent.html
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
@wraith thicket so create a private method that will run a BukkitScheduler.runTask to execute player.openInventory()?
If that's what you want to do.
What event would be fired when the /kill command is called and an ItemFrame is removed?
Huh I didn't know about that with inventory events
@wraith thicket could the Bukkit.Scheduler.runTask go within the InventoryClickEvent?
yes
Yes, that'd be fine
okay sweet thanks
How would I test multiplayer things in my plugin?
mock them?
Use unit testing and mock the player instances
It depends on what you're trying to test exactly, of course
ok
I ended up buying another MC account and just using that for some things
what does this mean?? I dont get it https://i.imgur.com/YFc9iyG.png
Or you set your dev server into offline mode and login with an offline client 🤷♂️
Again, depends on what you want to test. As far as I know, offline mode doesn't guarantee matching UUIDs for players
its my intellij thats telling me that
It does, but just means switching your server back into online mode will break UUID's. In offline the UUID is just a hash generated from the name of the player
I wasnt even able to compile
But in online mode you can actually change your name. Which means offline mode will not be able to track your UUID
Like I said - depends on what you're testing
For most things, offline mode will likely suffice
@tacit trellis looks like you're trying to use NMS code and you probably don't have it as a dependency in your pom
You just told us that you got an error in your IDE?
I doesnt show it in red but maven tells me it cannot compile i think
Maven errors like that aren't very helpful in IntelliJ
If maven won't let you compile then it's an issue in your dependency setup
I would try running maven clean
i do clean install
try running BuildTools --rev 1.16.1 --compile craftbukkit , to install the CraftBukkit jar to your local repo again maybe?
I will try but I dont think its work, its only that one and Ive seen a lot of people have the same problem on the internet
And what have they said about it?
never found an answers thats why I asked it here
Is there any way to prevent block entities from lagging back on the client? They seem to always move slower on the server than on the client, huge desync causes ugly lag-backs.
Even with 20.0 tps
It's an issue
This is especially apparent when it isn't just falling, it's been given velocity.
Any of you guys have made a bossbar plugin before
Ah man, HangingBreakEvent isn't called when /kill @e[type=!player,distance=..4] is called to remove ItemFrames
How would I change the block water and lava forms?
I've tried a lot of different events though none seem to work
Beat me to it @lone fog 😛
Ok thanks
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>6.1.3-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>6.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
The WorldEdit one works, wg doesnt
thought it was the version but none worked :/
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>6.0.0-SNAPSHOT</version>```
the 3 names are all red
I only have 4 plugins across 5 servers that are connected to a mysql database
just curious if 3004 connections is normal or if I done gone and messed something up
How can i make a boss bar plugin
With boss bar API
Ok
I'm wanting to change the block a water and lava combo making cobble does, can anyone help? I'm using the BlockFromToEvent though that checks every block change, I've tried limiting it though there doesn't seem to be a way, is there a better event to sue?
Use*
If you on 1.8.8 I think you need to use NMS/Packets/Someone else's library
I have this so far https://hastebin.com/yevamekuha.cs
Yeah may have to use NMS for bossbars in 18 ^
I don't see any BossBar object
I am wondering if I've misconfigured the plugins or if I have just set them up wrongly in general... Not used to setting up plugins that connect to mysql... >.<
Viper I have it, so now what
Have what
OwO
I've never used it, people just told me it works
There must be a documentation I guess
Btw what version are you even developing with
1.8
I'll look one second on spigot
The BossBar api works for 1.8
Yea
Yeah there's javadoc and a usage sample on the spigot page...
Are there any good tutorials out there for connecting bungeecord plugins to a mysql database? (luckperms, litebans, etc...)
Not sure if I should be connecting only the bungeecord-side plugin to the database or also each server instance of the plugin as well...
yeah, but do I do it in every server instance or only in the bungeecord plugins folder?
Every server
ah, ok! So I should have it connected properly in theory...
@sturdy oar Hey, did you ever find out how to do the bed stuff?
Viper their docs is broken
The reason being that my backend software to connect to server instances in the browser is having issues ever since setting up mysql. The guy who created the software is thinking that it keeps timing out because I am going over the connections limit, so we are assuming that it has something to do with the mysql database pushing us over our connection limit... I guess I will just have to reduce the number of plugins that are connected to the database.
@sturdy oar Hey, did you ever find out how to do the bed stuff?
@wheat mirage no I'm angeri
Other servers are doing it tho
Like Cubecraft
Viper do you know any other?
@sturdy oar There's always a way
Is there a way to fix the 2-seconds delay when changing world?
there is a delay on the chunk loading on screen
Some time
yeah there's no unread emails that old
either you got it wrong or it was a crappy ban appeal that got ignored
@sturdy oar so i put this in my BossBar.java ```java
BossBar bossBar = BossBarAPI.addBar(player, the BossBar
new TextComponent("Hi " + player.getName() + "!"),
BossBarAPI.Color.BLUE,
BossBarAPI.Style.NOTCHED_20,
1.0f,
20,
2);
Ah ok sorry
I'm GMT+2 timezone gang
true
Is this the best place to get support for Protocollib
Trying to send an entitymetadata packet
And the source here tells me entitypose exists in the source.
what is protocolib for anyways
However, I'm using the latest version they have on maven and it doesn't exist there
Packets
ah
It’s for listening to packets and sending them out easily with customized data
@sturdy oar I'm a bit out of practice with protocollib, think you could lend a hand?
^^ same, metadata is not going well for me right now
@zinc basin Any reason protocollib 4.6.0-SNAPSHOT doesn't seem to have EntityPose in the EnumWrappers class?
how am Suppose to use the bossbar api if there is no doc
How can i use the api if there is no docs
@unborn jewel what are you talking about
The bossbar api doc doesn’t work
Link me
declaration: package: org.bukkit.boss, interface: BossBar
if you want support with third party plugins, ask them
Yeah just use the built in spigot API
We can't provide docs for something we know nothing about
Bruh, check if it's in your 1.8 version
bruh, go find your own help if you don't want to use the spigot api
@ashen nebula Does your protocollib dependency have EntityPose as an Enum?
its not
Are you modifying metadata on entity spawn? I'm just trying to edit an existing entities name.
@ashen nebula Trying to send a sleep packet
I need to access entitypose for this
But it's not in the dependency I have
which is the latest snapshot
which is bonkers
Uh, no?
A player
Could you please just answer my question
Does EntityPose exist for you?
I'm not sure I assume not if we're both using 4.6.0-snapshot
I'm just trying to dig into metadata and understand wtf is going on
Well just see if it exists in the EnumWrappers class please?
I can't find it in any dependency
Makes little sense
Could you send a bit of your code? Are you putting this into a datawatcher or how are you sending the packet?
@ashen nebula I'm just trying to use the EntityPose enum which doesn't exist in the code
Please look at around line 380 in EnumWrappers.java
And see if you find EntityPose
Yeah I dont see it
When I download it off jenkins
It does exist
When I download off of maven, it doesn't exist even in the non-dev latest build
@zinc basin
Hello I have a problem with entities automatically despawning in the nether when another player is in the nether. I got rid of all plugins. Here is what it looks like : https://cdn.discordapp.com/attachments/244687572067024896/732706794962419763/2020-07-14_23-13-59.mp4
¯_(ツ)_/¯
When I type say @e[distance=..100] in console, where's that distance relative from?
You
Actually, nevermind -- I found out. It's relative to the world spawn
does PersistentDataContainer only saves to the saved block state?
Anyone any good with protocollib? Please ping me.
when i try getting the state of the block again it doesnt show the saved variable
try state.update(true)
i'm getting this error in bungeecord console
https://pastebin.com/QQewRMC4
anyone can help me?
its not
1.8.8 doesn't have a BossBar class, gotta do it with nms. ;)
@lilac echo you should ask the appropriate devs
you are not using official bungeecord
@keen compass so the problem from the bungeecord.jar not from plugin
yeh i use flamecord
not the official one
I am aware you are not using official bungeecord, therefore I can't make an accurate assessment in what your problem is
hmm ok thank you
i am getting this eror when loading my plugin-config:
https://hastebin.com/udozupoyit.pl
here is my yml:
https://hastebin.com/epibafihep.http
i dont get it, i know this mapping eror, but i think its right formatted
Is 1.16 more stable than 1.14 was server side?
yes, close or possibly above 1.15
The method registerEvents(Listener, Plugin) in the type PluginManager is not applicable for the arguments (a, Plugin) how come im getting this
one or both arguments are not possible..
first should be your Listener-classname
and second should lead to your main/plugin
you named your class a? or am i dumb
idk if that is so good...
why
Is it implementing the correct Listener?
There are some from Swing among other libraries in the JDK
import org.bukkit.event.Listener;
And you're importing the correct class? (because as mentioned before, a really is not a great name)
yes I am
is a the name of the class?
idk if something other is called "a" in java
oh that was answered oops
yeah probably should name it something more identifiable, even just naming it "Listeners" is better
two*
i think i am the wrong to talk about java conventions etc, but a is really bad
^
imo class names should be somewhat identifiable
If you got two classes named the same thing in the same paths they will clash with eachother
and a doesnt seems identificable...but thats just my opinion
i have to classes named a
@unborn jewel thaths the cause...
i fixed it
good
i named it p
i suggest giving your classes real names.
even Class would be better than a simple letter
that is horrible practice @unborn jewel
not sure how you are going to remember what class does what but good luck
There's not really any good reason to name a class a single letter
well
like i said i am probably the wrong to talk about such stuff, but thats what i am doing
don't see why you'd be in the wrong, that's not a bad way of naming imo
it's better than a lmfao
You should be able to at least infer a little about what a class does from the name of it
^
well naming yeah, but
i dont use any packages etc
that's fair, i tend to do the same
if some good coders see that... ouch