#help-development
1 messages ยท Page 1844 of 1
please help me with the error
You'll have to show us the error here if we are going to be able to help you
i send
We can't help if you don't show us the error
Yup we got that
they do if you store them? Otherwise if its just in memory and you use the api methods to set perms or what not, then no it does not persist
oh... big oops
I thought it was stored by the server
not exactly what they are asking ๐
How will I make the interface
there is api methods to set permissions stuff on player objects
sorry to disturb again
if the player relogs and you didn't store what you had set, it goes away ๐
It doesn't, it's probably checking for clicking and moving
I can't guarantee that my users will use luckperms, I'll have to dump the perms into the database and set on every login
i am new to plugin devlopment
why is nothing ever easy
Obviously in the case of chests and stuff it can know, but not their inventory
@wraith apex please tell me the error in the config
You don't Interfaces can't be created. You will have to fetch a player
fair enough
if you really need to know when a player has their inventory open
listen for a an inventory click event
^
then check the inventory window to see if it is their inventory
That obviously won't be able to tell when it's closed though 
this ^
client sends inventory close packet when players close their own inventory
It does? 
I can't?
you have not provided an error message
you have only provided a config
but i dont know the error
ah
if you throw your config into a YAML parser it gives you a better answer
Validate and Verify your YAML documents, optimized for Ruby on Rails
@worldly steppe toss your file into a yaml parser. specifically this file modalidades.yml somewhere in that file near name: "&e&lSKYWARS" there is something wrong with its format. Odds you probably have a tab in there. Yaml hates tabs and instead need to use spaces.
or maybe a bracket is missing
but please tell me the error
I did
did not find expected key while parsing a block mapping at line 16 column 9
i see it like 1 hour and i dont know exactly the error
this is the error
Well can you show the file then?
can u send a keyยฟ?
?paste
can you go to that link, and paste the contents of that file it has issues with?
an key symbol
indentation is VERY important with yaml
then send us the link here
it will be an indentation error
or like frost said
tabs and spaces in the same file
sorry but i cant understand i feel so sorry to bother u so much ๐ฆ can u elaborate a little?
whats indentation?
im spanish, i dont know some worlds
This
Is
Indentation
oh ok
all the whitespace between your text and left-most area of the text file
lets goo
i found it thx for ur help now i knwo what u meant to say ๐
ok
and where is the identation? and what i do? i add 2 spaces, delete one, add 4?
now i can get the player cords
please answer
?
For starters I'm noticing you're missing a quote mark "
and the error is not always useful as it will point to where it failed to parse not necessary where the problem is
YAML still reports its borked
how to send msg to a player if he does a specific event?
ok, i add the quotes
hangs at line 41
@worldly steppe fixed it for you
https://paste.md-5.net/fusuyihulu.cs
what happens at line 41?
player.sendMessage("Hoi der");
They had empty array entries
ah
ok thx
thank you very very very much
ohh once a i fetch the player data i can get so many things of that player
last question
how i made in lore spaces for ejample
example*
hello, how are you
(space)
players :1
how i put an space?
i resolve bymyself
np
glad you solved it on your own ๐
1 mrore thing to ask that how will i give nbt tag to the mob that i spawned
@wraith apex
can u send me an symbol that is an arrow?
like that
โ
that can be used on ansi
please
one similar symbol
->
why is my Scoreboard team null when it actually exists
i register it onEnable and access it by manager.getTeam(name);
but its null
hey, for some reason, this isn't executing when i change the item in the hotbar
it is registered
Show the code?
doesn't it execute when the player changes the slot of the hotbar?
oh
is there any event that does this?
Yeah the PlayerItemHeldEvent
thanks!
I highly recommend you read the javadocs :)
yea... i thought that was the correct
custom nbt tag?
Entities have a PersistantDataContainer that you can access and store data in
This also goes for ItemStacks and Chunks
And tile entities
did you register the event?
getPlayer()
mark the method as eventhandler?
or do you want to have the player who wrote the message?
public void onChat(AsyncPlayerChatEvent e)
{
e.getPlayer();
}
oh like a private message system
do you have a command to send a message to someone?
like /msg ?
then you would have to split the string at " " and search for a name
Ah
why are team prefixes not showing up at all
as i said, split the message and look for a name
ill send code in a min
e.getMessage().contains("playerNameHere");
scoreboard.getTeam("the").setPrefix("why");
prefix doesnt show
i checked and the player is in the team
wait
if(e.getMessage().contains("playerNameHere"))
{
// Notify player
Bukkit.getPlayer("playerNameHere").playSound();
}
how do i add a player to a team in the first place
Hey! for some reason, the sout("2") isn't executing any time and sout("1") is only executing when i have the item but i change to other slot, could anyone help me?
im adding the player uuid..
team.addEntry()
yes
but what he heck is the argument im supposed to pass
the uuid as a string or the playern ame
still doesnt show
what are you trying to get to show?
sorting players in tab
I think the prefix only shows above the players head
to get something like a prefix working in tab you will probably need to register an objective
wut
WAIT I THINK I KNOW WHY
ITS A THEORY BUT ITS PROB CUZ IM USING getNewScoreboard
instead of getMainScoreboard
nope
that isnt why
I mean main scoreboard is just the scoreboard that is normally used in Minecraft
new scoreboard is just a fake scoreboard tracked by the server
it will disappear when you do a restart
isnt there a setPrefix in Scoreboard#Teams ?
I imagine through NMS
there is, but that's to show in chat and above the players head
not for the tab list
well you can completly remove players from tablist and create your own players for tab and set their names to set a prefix ^^
true
oh yeah so it does
Aight
Team t = s.registerNewTeam("someTeam");
t.addEntry(player.getName());
t.setPrefix("A Prefix");
Is it possible to force an iron golem to target a player without NMS?
entity#setTarget
I believe I tried that, but I don't think that works with iron golems
without a loop it would be possible to set a Target and once the EntityTargetLivingEntityEvent calls you can cancel and set new
I can double check that tho
check for EntityTargetLivingEntityEvent
But the iron golem does not target players until it's punched
Then make it mad :)
if you spawn it and setTarget it probably untargets because it has no reason to target a player idk
or there is smth like that
yeah that doesnt work
Ok thanks I'll play around
Can someone tell me where the default ChunkGenerators in spigot are located for the world, nether and end? i can't seem to find them
IronGolem interface has a attack() method
i am in the 'a' one
You doing this on the main or new scoreboard?
main
default chunkgenerator for world nether and end ?
there is just 1 chunkgenerator that generates end/nether/overworld by GeneratorSettings
are you even able to see yourself in tab?
yes
ahh okay, is it all in that class?
yeah... its a bit difficulty but what do you want to do ?
i need to see how they did it
how they did the api or how minecraft generates the world ?
Hey! for some reason, the sout("2") isn't executing any time and sout("1") is only executing when i have the item but i change to other slot, could anyone help me?
i need to make the default generator not generate after a certain amount of blocks, and i want that as optimized as possible
try ItemStack#isSimilar
so i guess i want to see how minecraft does it in order to replicate it with ChunkGenerator
is there a place where i can find the whole spigot server with dependencies
Just run build tools?
build it with buildtools?
what?
Player p = Bukkit.getOnlinePlayers().iterator().next();
ScoreboardManager sm = Bukkit.getScoreboardManager();
Scoreboard s = sm.getMainScoreboard();
Team t = s.registerNewTeam("someTeam");
t.addEntry(p.getName());
t.setPrefix("A Prefix");
yooo sphaxbd?
what version is it tho
im using 1.8
certain amount of blocks in a direction or at all ? ...
at all is mostly not possible ... you can check for chunks and all other generateions if you use the ChunkGenerator-API within WorldCreator#generator(ChunkGenerator)
I'm not sure what black magic md_5 pulled then during the different versions haha
dont try to check itemmeta... try:
handitem.isSimilar(compassitem)
thats the problem
nope
like this?
yes
custom texturepack using the starbound font
with packets mostly yes
^
did you try vanilla achieve this behavior ?
^^
throws an IOException when trying to rename the license files
Does this not work in 1.18 in isolation?
Caused by: java.io.IOException: Could not rename file <plugin>\CraftBukkit\._LGPL.txt7194590323968921571.tmp to <plugin>\Cra
ftBukkit\LGPL.txt
at org.eclipse.jgit.util.FileUtils.rename(FileUtils.java:323)
at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1514)
ok, now it works great, but only executes sout("1") when i change the item, not when i have the item in the hand
i mean, i have the item in the hand, and executes sout("2") then i change to other and sout("1")
what exactly r u trying to do then?
like, is 1 slot delayed
just running java -jar BuildTools.jar --rev latest
ur on java 17?
I guess i could just set every block to air in a chunk if i want it empty. should i do this with NMS or is the spigot API fast enough?
dont know where you run this and what exactly you want there ...
possibly, i think 1.18+ requires java 17
in PlayerItemHeldEvent
bad idea... you can use the ChunkGenerator and if the server reached a chunkgenerationlimit / chunks have enought blocks you can disable default generation
k thx
also not sure if --rev latest gets 1.18.1 instead of 1.17.1 yet, idk
ah
this event fires once if you change itemslot that you held.... and what do you want and what does not happen ?
think it does
hope it does
however I always specify version anyways
same
i want that when i have x item in the hand it executes a code, but it executes that code when i change x item to other item
also, Java 17 is standard now?
so like, is 1 slot "delayed"
Java 17 is an LTS version
^
you could try to work with that:
public int getPreviousSlot() {
return this.previous;
}
public int getNewSlot() {
return this.current;
}
not for a couple years at least
. ^
more than a few years I'd hope haha
I am not sure what this has to do with anything, 1.16 required java 16 minimum which is not an LTS
I hate moving Java versions
still throws the error with jdk 17.0.1 64 bit on windows
Yeah Mojang is just being an ass with moving up from 8 to 17
seeing how quickly J10+ came out, i think we could see the next LTS be something around J20-22/23
You see, i'm trying to create a plugin that generates one line of blocks only, so that wouldnt work right?
well it worked for years without updating minecraft java
not with the api
just because it worked doesnt mean it was a good choice ๐
Yes
but for that you can set the blocks after generation .... is just laggy as hell
yea true
java 11+ features were really nice for development and mc not supporting them or requiring a backport-y method of doing it was meh
i guess i could pregen the world
I'm still going to give people a glare if they use var
not to mention j8 streams were crappy, lord knows if theyve been improved though
Go back to web development :p
id use var if java supported it outside of the method scope lol
oof why
less words i gotta type
just creates ambiguity
and that will lead to code that no one will be able to read in 6 months
bold of u to assume thats not already the case
I mean sure with variable names yeah
possibly
but at least you knew the type
var a, var b, var c means nothing
I should start on that PR for spigot to make use of unix sockets ๐
u can tell the type from the right side of the assignment too tho?
any way of making each player have their own world on my server without taking a ton of storage, memory and causing lag?
yeah no
Not if the side is a method return from an API you know little about
only way to do this, is to essentially dynamically launch VM's based on conditions from in game
depends on players, ram ..... but mostly not
it is doable as I have made such a system before, just not easy
there was a plugin called "personal worlds". Look it up and update it
servers like hypixel have this, is there a way to make it with less resources?
limit world size
what do you mean?
Hypixel have their own 'realms'
i think its gonna be 300x300 per player anyway
like Minecraft
idk other languages get away just fine with inferred types
like csharp and cpp, hell even rust has it i think
hypixel skyblock
whats that
use the same world and spread players 5000 blocks
doesn't answer the question, I think you have this misconception on the whole resources part
Hypixel apparently gives you the ability to have your own server nested inside itself
Technically could implement your very own world system but that is gonna be objectively pain
ik i can do that, i'm just wondering if i can have the same thing but with personal worlds
you rent from hypixel instead
its free if u have a rank
first off, what you are asking will require an entirely custom solution server wise. Hypixel has custom server jar's that work with their hardware/software that controls when it should add more server or remove servers.
Personal worlds wise, I'd turn off spawn chunks because no point loading spawn chunks for individual worlds for each player
esp if the world is only 300x300
as I said, this is doable, just not something that can be created over night
It kind of could be tbh
Anyways the way hypixel has it is fairly advanced and sophisticated, they use redis and rabbitmq iirc along with both worlds and different servers with proxies and a super proxy so yeah itโs a bit hard to emulate them to the letter
it's not that difficult to do
i just used hypixel as an example, not trying to recreate or use their system
if you had enough people to create it sure
im just 1 basic boi
or if you want to ignore all security as well
Well I mean the infrastructure to move people to their worlds and create them
i dont know a lot of java nor spigot
Something like that over a night is prone to bugs
so how could one achieve this?
across 1 server & multiple worlds? or multiple servers and multiple worlds?
btw, the max players count is 500
i think this can be answered with:
if you want to know how your probably not good enought for this.... if you know how to do this, you would not just ask "how to do this?"
1 server, multiple worlds
i can atleast try :p
You can teleport players to different worlds
then to answer your question on resource consumption there is really no way to reduce it then if you go with this method without using some kind of custom server jar
multiverse? :V
using the teleport method in Player
then try to create 500 worlds and see what happens
multiverse is bloat and overkill for this
Yeah or a ton of injection and pain
Bukkit has a class called WorldCreator
which you can use to create said worlds
unless you plan to have a default template
then you can just have a world that you can copy
im supposed to save each block in a players world and then load it?
yees
well I answered the best I could, I am going to go make some food now >>
no try to create 500 worlds and see if your server can handle this
I don't recommend attempting this as a new person to spigot and java
but i can't access it in the if statement
WorldCreator will create a normal world which is probably not the most optimized thing if youโre looking for resource optimizations
one slight problem: i dont even know how to do that
@ivory sleet i am not sure but the api inits the World-Spawn-Chunks.... a pr for this could be usefull to reduce generation lagg :?
Elaborate
๐ฅฒ
what code
that was towards FreeSoccer
oh
they say a PR could be made to reduce generation lag
and this is true, but the reason this isn't happening is because of the code ๐
whats pr
pull request
wat
its part of git
a request to spigotmc to change their code
i was making a PR to add GenerationSettings and so on .... its quiete simple to add something to WorldCreator that disabled a simple method-call ^^
Whats the best way to change a block in a 10x10 area around a player
including 10 up and 10 down
I want to make all diamonds stone when a player gets close
when u make a (P)ull (R)equest to a project u ask someone to update their code to something possibly more efficient or useful
so you want to change all the blocks in a 10x10x10 ?
now do know that is an uneven square
technically that would be 10x10x20
ye but he said including which implies that its for all directions
well that is what I was going to ask
is it 10 completely across or 10 from the starting point
its so simple... the WorldCreator just needs a method to set "keepSpawnInMemory" already and set it after the WorldServer inits...
oh wait no
that doesn't help with the other generation stuff o.O
he said 10x10 and then including
The abstraction is simple, the concretion is not
Either works tbh, i just need them to not be able to mine the diamonds before they change into stone
thats why i ping you for this
evil
u makin a troll plugin?
oh so you just need to check that size of an area then?
or an anti xray
who knows 0.0
Yeah well Iโm not in the mood to make it ๐
a bounding box is your solution
i think if you wish to do this you can load chunks one by one to create a World in 50ms and then slowly generate the spawn region by themself ... just an idea
bounding box will let you know if a player attempts to modify a block in a defined area ๐
me too... since my PR for more chunkgenerator settings never got a answer after the first 2days ...
Yeah basically an AABB which stores a min point and a max point
Can you explain a bounding box a bit more?
I am going to have to look at the code again because there has been updates, but the Generation code in MC last I had looked and many others was a complete mess and nearly impossible to change anything with it without screwing up a ton of other stuff.
dont need to ... its simple in the this.getServer().prepareLevels
allow WorldCreator to set "keepSpawnInMemory" and thats it
bounding box uses the upper left corner or right, and lower left or right. So if you go with upper right, then lower left is the opposite. Once you have those you know all the coordinates in that box because of math(its not super hard) and you can easily check from the events if a particular block is in that bounding box. Good news is the spigot api has a method for bounding box
that doesn't help with other generation stuff
that just puts the level spawn in memory which isn't that large
Itโs not that simple, you see the keep in memory stuff is a side effect
So guaranteed something else will get influenced by that (and potentially broken)
the generation of this is a time problem ^^
There are a number of other stuff generation wise other then the initial spawn
in 1.17 i made and AdvancedWorldCreatorAPI that rewrited the createWorld-Method and just unchecked the "prepareLevels" ... nothing changed for me
declaration: package: org.bukkit.util, class: BoundingBox
For you that is
I assume you didnโt write any particular unit or functional tests to prove it tho
of course not... i dont believe @sullen marlin will look at my PR's at all ^^
or done some extreme stability tests to identify if it changed something elsewhere XD
Yeah
He probably will, I mean he investigates every pr I believe?
like the code for the generator stuff was a complete mess and was hard even for some of the dev's that I consider better then myself
XD
he did and never responsed to me after 2 days again... for no reason why this will not get implemented
now despite what I might be saying don't let it discourage you from attempting anything
just know that its not a matter of a so called simple pr is all
well not quite the same context lol
Truth be told, itโs unsurprisingly accurate
yeah sadly i dont feel to add smth when it doesnt get added or smth... its easier to use nms / rewrite ... and a lot faster if you need to use it now and not in 3 months
I don't think we were talking about API, rather implementation
back, so it it possible to make a basic plugin for this?
public boolean getNewSlot(boolean similar) {
return this.getNewSlot(similar);
}
@EventHandler
public void playerHand(PlayerItemHeldEvent e) {
SQLGetter shortn = MineSpaceSkills.getInstance().data;
Player player = e.getPlayer();
System.out.println("0");
if (player.getInventory().getItemInMainHand().getItemMeta() != null) {
System.out.println("0.5");
// if (player.getInventory().getItemInMainHand().getItemMeta().equals(ItemManager.warp.getItemMeta())) {
if (getNewSlot(player.getInventory().getItemInMainHand().isSimilar(ItemManager.warp))){
System.out.println("1");
Telequisword.put(player, ItemManager.warp);
shortn.addDamage(player.getUniqueId(), 25);
shortn.addStrength(player.getUniqueId(), 125);
shortn.addChanceDamage(player.getUniqueId(), 65);
} else {
System.out.println("2");
if (Telequisword.containsKey(player)) {
shortn.addChanceDamage(player.getUniqueId(), -65);
shortn.addDamage(player.getUniqueId(), -25);
shortn.addStrength(player.getUniqueId(), -125);
Telequisword.remove(player);
}
}
}
}
}```
Hey! i tried to do this since i was getting errors with sout("1") but now i got spammed with more errors
รง
but it could be part of API ....
I believe the general consensus is that yes it is possible, just not going to be easy. Might be able to find some plugins to use to make this possible but would hardly consider them basic.
yeah becasue you loop in your method
where?
Yeah that function calls itself uncontrolled finitely many times
How can i change all blocks in the bounding box though
or in my case all diamonds in the bounding box
^
you already have the coordinates
which is all you need to change a block at that spot
md_5 to everyone trying to change a shit ton of blocks at the same time. lmfao
its actually easy to change a ton of blocks at the same time
just a lot of people simply don't do it because they don't know how ๐
Didn't say it wasn't but NMS is faster
nope
yeap
not using the server is faster
Talking about API vs NMS
but I am not
But thats the context.
would 10gb of ram would even be enough to host a maximum of 500 players? i doubt i'll even get close to it, but still
Say what you're talking about if you want to say it was faster lol
500 worlds*
the fastest way you could change a ton of blocks is by simply modifying the region file directly
like fawe?
don't know how fawe does whatever it does
Only problem with that is the packets need to be sent.
if 10GB Ram is enought the CPU will die in seconds
not if you unload the chunks and then load them back later
then server takes care of that for you ๐
If a player is standing in a modified chunk you need to send them the chunk update
or just move them out of the zone
No fun in that
I like watching something just appear lmfao
soo... no?
no
oh ok
how much is good then
like whats the maximum of worlds and players i should have
10GB is technically all you need
however, the problem with hosting 500 players isn't just ram or cpu
You shouldn't have 500 worlds on 1 server. Maybe 10 worlds max. Players on the other hand it depends on all your plugins the data players create the worlds generation etc...
there is just game mechanics that will get in the way of being able to do this
500 worlds with each world 1000 chunks loaded will kill 10GB ram for sure
10 worlds would kill 10gb of ram xD
Depends on implementation arguably
im usin a server host so i dont really have a lot of info, nor do i understand it
But on spigot, yes
not the md5 implementation xD
Yaa
3 worlds with 1 player and all plugin data takes about 2 gb
I know that i have to loop through every block in it to change each one i just dont really understand how to check for all coords in it even though i have coords
I don't understand why you want to attempt something that is not easy, when you have barely any understanding of servers, the program language or anything else o.O
my server takes 5GB with a bigger overworld then default.... (probably because of 2220 chunks and 14k tile-entities)
for(int yCheck = minY; yCheck <= maxY; yCheck++) {
for(int xCheck = minX; xCheck <= maxX; xCheck++) {
for(int zCheck = minZ; zCheck <= maxZ; zCheck++) {
locs.add(new Location(l.getWorld(), xCheck, yCheck, zCheck));
}
}
}
honestly i just want players' plots to be at 0,0 lol
You will have to create a 3 leveled nested loop like yapperyaps and start from the minimum point then walk to the maximum point.
Or if you're good with math you can just get all the coords that way ๐
how do i translate color codes into colors
like &
IK chatcolor.whatever
i mean
in
scoreboard teams prefix
translateAlternateColorCodes()
ChatColor.translateAlternateColorCodes('&', String)
that was a pain to read the region files with biomedata and blockstates WITHOUT the server ... bits are s#it to use xD
even in scoreboard teams prefixes?
what?
o.O
bitshifting is a process o.o
so like int a = 1000 <<< 7;
i made and small tool that reads the region files of a world and creates images (biome, height, block-textures) with it ... a pain for my brain to get the data for each block with just 43 longs as input and 10 block states for example
so that shifts in binary, 1000 to the left 7 times
i know how to use bits probably but its not that simple to understand (mostly how mojang saves worlds is hard to understand)
1000 = 1111101000 in binary, now we shift 7 places to the left 11111010000000000 = 128000
that is bitshifting
and i still dont know why you tell me this ^^
because you responded to my comment about bitshifting and what you said didn't really relate to that XD
so I explained bitshifting
๐ ok miss understand ^ just wanted to say its not easy to read smth that is saved in bits if you dont know how they saved it as bits
that is why you use NBT library ๐
i believe there is nothing that tells you out of a long for 16x16x16 blocks the biome for each and also the blockstate
mincraftpedia is a great source of information on some of this stuff too
outdated for 1.18
even outdated information is still useful
not that much but yes it was
also not everything in MC always changes in every update, especially in regards to Region file format ๐
in 1.18 they changed how chunks / regions / sections and their biomes are saved since biomes are 3D now
yep, didn't change too drastically though
You can't put plugin-based libraries in Maven Central, correct?
since it requires standalone releases
Also a bit of a note for library plugins. If your plugin is a true library then it should extend PluginBase instead of JavaPlugin
when i make my libraries i usually dont extend pluginbase or anything
i just force the user to pass in an instance of their plugin
XD
Well, extending PluginBase lets your library exist in the plugin directory without the server complaining
also using PluginBase would force them to do that as well since your library will not get loaded
they essentially have to take care of all that ๐
Well problem is that youโll end up with a lot of incorrectly implemented methods if you derive PluginBase
it's still a plugin
tbf
it handles a few things ingame as well
then not entirely sure, I don't really know the rules of maven central off hand since I have no reason to use it
Yeah thatโs somewhat better imo
hey does Bukkit#getPlayer return offline players aswell?
Bukkit.getOfflinePlayer
Technically an instance of Player is an instance of OfflinePlayer
since Player derives OfflinePlayer
But yeah the player must be present on said server if the return should be non null
i just want a method that can give me a player object regardless of them being offline or online
Yeah then go with LogicalDarkโs method
However should be said, if he player has never joined before the name of the OfflinePlayer instance will be null
ok so the player has to have atleast joined the server once, got it
Yeah given that the cache hasnโt been touched in some odd way
(Nothing you should worry about fyi :))
ok, thanks a lot!
there if libraries for grabbing player info of players that never joined before too
not overly difficult to get such things from Mojang API
generally handy if all you have is player name because API wise you need the UUID
how to make in Bungeecord chat, a "button"?
On click in "accept", etc
Hi! Any http library for uploading multiple files via POST?
if you are using newer java versions
they have a built in HttpClient
which is very good
I always use java 1.8
:/
Its a minecraft plugin
So i cannot use another version. Because server thrown that im using a recent version of compiled plugin
what is your server version then?
1.8.8
Thanks
Why hate 1.8 users? Click spaming its the better thing that has be done by minecraft
lol
bc its old as fuk
I have break like 3 mouse because of jitter click
lol its like pay to win ... if you can buy a good mouse with high clicks you just win
the new combat update actually allows you to use ur damn brain instead of clicking as fast as you can
im glad my fingers still exist
Lol
the new combat is nice until u got a full hunger bar and regening in like 3 microseconds
and then it drags the fight on
until your armor breaks or you run out of food ^^
on the smps i play people are super sweaty and use crystals
so it doesnt matter
Lol
shields are also an issue of their own blocking 100% of damage but
axes disable them tho anyways
yeah
1.17x its good before you see that lot of minigames go to the trush
but i still wish they were just damage reduction rather than invulnerability
nah id take invulnerability
beating hard mode with skeletons without a shield that blocks arrows
maybe for arrows id like invuln
if u want realistic shield then the 100% block makes sense but ๐ฆ it just seems too op in most circumstances
Finally i could do the artifact upload to my webserver (via file://webserver-path) and then using it as maven dependency. Now im working for doing the same but getting the artifacts and deploying them via http
anyone know how to decompile and recompile after editing class files? I need to change some of a plugins features from 1.9-1.8 IDs
Yes
Right. First download a decompiler i use JD-GUI. Then you should check if its maven project (its easier to recompile it) but if it isnt a maven project you should manually look for the project dependencies.
The JD-GUI will give you a .zip that its the source itself. But keep in mind that if the plugin its obfuscated then i dont know
if you have questions only do it
I recommend using Recaf
yo guys any idea on why is spigot highlighting commandexecutor and changing it to executor? package me.Stephen.FirstPlugin.commands;
import me.Stephen.FirstPlugin.Main;
import org.bukkit.command.CommandExecutor;
public class HelloCommand implements CommandExecutor {
private Main plugin;
public HelloCommand(Main plugin){
this.plugin = plugin;
}
}
What that?
Oh lol
So if use that u can remove obfuscated plugin license request?
sorry if its a dumb question im a newbie
u need to add the onCommand method
Your command should implement CommandExecutor class and them implements its method
how to use ClickEvent.Action.RUN_COMMAND in bungeecord
how to do that? im literally just following youtube tutorial
a
click where it show the error
you mean those lightbulbs on the left?
sure
Yeah there you should see the posible solutions
One will say implement class methods
Or smt hlike that
there are two and none says anything like that unfortuantly, it reccomends to change comandexecutor to just exectutor but perhaps thats not what i want
or im just blind and increlibly dumb at the same time idk
If anyone here has worked with maven multi modules, please join the thread titled Issues with Maven Multi Modules. Could really use some help with it.
Have u added the spigot api to your project?
I have worked with multi modules but in maven
i think so, i added spigot 1.18.1
That's what I'm using. If you could give the thread a look, it'd be appreciated.
actually it highlights whole org.bukkit.command
you could code to have the shields have durability
that is after so many sustained attacks, the shield breaks
they do..?
then just modify the durability to your liking ๐
Where do I have to put the overworld.json in a 1.18 datapack?
is it possible to get a player's IP address?
Yup
what's the method for it?
getAddress iirc
thanks!
What is the most efficient way to save data from a plug-in? Is it efficient to create a single Data class, store all relevant into that class, then serialize the object created from that class into a file?
use a database
Java's object serialization sucks
Most efficient way is a database like MySQL or MongoDB. The easiest way would be YAML files.
how can i grab a random block
From the world? In a specific location?
Block (in the world) or material
I want to remind you that picking a random block in the whole world causes possibly the chunk to get generated or loaded and that possibly causes lag
You could use the Material Enum, use the #isBlock method to filter actual blocks, and then use random on the new list.
Iโm unfamiliar with MySQL, is it something I would need to pay to host?
sqlite
Aight thanks Iโll look into it
MySQL is basically a service that's decentralized from your server with a huge and efficient DBMS made to handle dozens of queries per second. SQLite is the alternative if you want to instead have a file on your server in which everything is stored in
You can communicate with both very similar, you don't have to change a lot within your code
Most efficient way is to not convert the data and just straight dump it into binary file
You can run MySQL on your local machine for testing. If you want to test with a remote database, then you will either have to pay, or obtain (legitimate) access to someone's database. Or just hope your implementation works lol.
I see, thank you sm guys
If weโre speaking solely data model. No usually you wanna create a DAO which acts like the cache and the manager of valid data objects. Then you want a DTO which are the data objects and basically have references to said data. Then you want to have a storage class which just takes a DTO and saves/reads it to/from whatever storage implementation you have
DAO - data access repository, basically the encapsulated Map
is the material enum embedded in spigot library already or is that something i'd need to create a list of
dude just wanted to know where to save data lol
DTO - data access object, basically the java data class representation of whatever you want to handle.
It's part of the spigot api.
awesome
The Block in spigot basically represents a cell in Minecraft's grid world. The x, y and z position of it is always equally and can't be changed. What you can do change however, are its attributes, such as its Material
All existing Materials are already predefined within an Enum
The JavaDocs is a great place to find things https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
declaration: package: org.bukkit, enum: Material
?jd my beloved
?jd paper
Jk
I've finally made it XD. A lib that exposes brigadier compatible from 1.8.8 to 1.17.1
If anyone would like to review my code I would really appreciate it
What would the 1.12 equivilent of "PlayerCommandSendEvent" be?
Thereโs the PlayerCommandPreProcessEvent
Link GitHub
@cold field (:
Do you want a review concerning api or just code architecture and infrastructure generally as well as if I find anything I think you should change because there are better alternatives?
Code architecture and any suggestion is welcome
Want me to go all in or just the most fundamental?
Choose you, I don't want to put too much work or problems on you
Oh no worries Iโm fine, I like to review code (:
Well first of all Iโd suggest getting familiar with the kotlin dsl (as opposed to groovy dsl)
Packages are all lower name
So thisIsWrong
thisisright or this.is.right
The dot hints a nested package
Ok, I'm going to change it right now
Also, all variables should come before any methods
class A {
B b;
void c(){}
D d;
}
This is bad
class A{
B b;
D d;
void c(){}
}
This is good
Should be said that constructors also come between the variables and the methods, so in the middle
Static fields/variables should come before instance variables/normal fields
Static methods should come before instance/normal methods
The utility class is not a utility class
Rather a helper class
A utility class must only contain stateless methods and constant variables such that no mutations happen, you know when you have a utility class due to this reason:
Given the same input, you will always get the same output no matter what methods or data is manipulated or called before or after
?paste
Empee generally I think youโre using static too much
XD
Hello guys, can someone please help me? For some reason this is not working
Main main;
public int getInt(UUID id) {return main.getConfig().getInt("Player." + id + ".Int");}
public String Att(UUID id) {
String a = "[Admin]";
String b = "[Player]";
if(getInt(id) == 0) {
return a;
} else return b;
}
@EventHandler
public void Chat(AsyncPlayerChatEvent e) {
e.setFormat(Att(e.getPlayer().getUniqueId()) + e.getPlayer().getDisplayName() + e.getMessage());
}
Itโs excruciating to deal with when doing concurrency and multithreading as you donโt really have a way of controlling when theyโre initialized as well as due to their global state
so yeah arguably try to get rid of it by using proper instances
static is good, but itโs often misused
Should be said static init blocks should be declared under the static variables imo
If I'm doing that it's just sending a normal message and a huge error message in the console
Mh ok. When is it good to use? For instance I used static to save reflection field. Is it ok?
Also avoid variables with names_like_this prefer thisTypeOfNameThoFineForSomethibtLikeV1_8_R3
I mean even then
You seem to be using it a lot more than just that
But itโs good that youโre caching reflective objects
Also disambiguate the name Main in your implementation source
Call it something more relevant in regards to your libraryโs functionality
Yeah well that was it, Iโll come back to you once youโve yeeted your static singletons and made your design more object oriented
But if you want to become more educated in architecture, learn SOLID, testing (Unit tests and try out TDD), learn the design patterns also.
10k tuition fee

I'm dropping out
Ok, thanks. Now on my country it is almost 2am. If I ping you another day is it ok? I will let your Christmas day free obv XD.
@hasty prawn
That static state can be troublesome especially if you wanna use it in a concurrent environment or something else. Create a CommandCollector class maybe? And for the command map, have a class which separately provides the instance, your XCommand looks like it could change for different significant reasons thus breaking single responsibility principle to some extent. Also Iโd argue for that you should initialize all of your instance variables in your constructor. Like either initialize em all outside or inside, it can be quite complicated when you do it in both places, especially if the class grows.
This CommandAPI class felt like it could be a utility where if you need to store state create a class for it
my guy doing code reviews at half 1 in the morning on christmas day
Also the static there could possibly be extracted into some CommandManager or PluginCommandHandler
This function looks copy pasted and the suppress warning lol. Well regardless Iโd say that you should extract smaller functions (can be done with IntelliJ > Refactor > Extract Method) as big functions like this are considered rude to the reader.
on a phone. @ivory sleet have you a buy me a coffe link?
Yeah that class is literally like, years old
I just haven't updated it lmao
Ah
The ItemBuilder is cool
Altho arguably a little superfluous as it doesnโt follow the builder pattern convention which is that mainly immutable objects should have builders tho I understand why people create those still (:
Because they're cool 
The static map there could be extracted out to its own class like for instance PlayerScoreboardCacheRepository
Also maybe make all the listeners separate classes where they contain the name Listener, as I think of classes with API in them to be interfaces
So basically anytime I'm storing a static list of things, use a separate class for that? 
Just a bit counter intuitive imo
Yes basically thatโd be something to look after
Because then you can test it
And you can easily adapt it into a multithreaded environment
And you can create abstractions
Hmm alright
Wdym by this
Guys can someone please help me? For some reason this is not working
Main main;
public int getInt(UUID id) {return main.getConfig().getInt("Player." + id + ".Int");}
public String Att(UUID id) {
String a = "[Admin]";
String b = "[Player]";
if(getInt(id) == 0) {
return a;
} else return b;
}
@EventHandler
public void Chat(AsyncPlayerChatEvent e) {
e.setFormat(Att(e.getPlayer().getUniqueId()) + e.getPlayer().getDisplayName() + e.getMessage());
}
What's not working
All your BlahAPI classes gives me the vision of an interface but instead itโs a listener class, I just think you should extract out listener logic to a separate class due to the fact that listeners are really low level in a code infrastructure
And also
It's sending normal chat messages
Listeners are allowed to have static singletons
And it's not setting my prefixes
Idek why that class implements Listener anyways wtf LMAO
๐ฅฒ
Are there any particular class you want me to look at? But itโs quite nice lib
I think I have have had it listening, separated them out, and then forgot to remove the implements afterwards
that made no sense
yeah, like Iโd say use kotlin dsl but thatโs merely preference.
So basically, stop using static Lists/Maps lol
Dessie to point out some good things
You use gradle
You have for the most have good and reasonably long methods
You have made your library very modular which makes it easy for users to grab only what they need
Ya
Gradle 
Like thing is that code mostly doesnโt need much comments because you mostly succeeded to explain yourself in code
I have fought that stupid thing constantly, fantastic when it works, makes me want to die when it doesn't.
๐ฅฒ
Yeah I'm not really great with comments but I try
comments explain why
Nothing can be as good as a good comment, but a bad comment can be worse than bad code
Yeah sadly
https://github.com/TechFortress/GriefPrevention/blob/master/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java btw this is consider average spigot dev.
@ivory sleet Can you please help me with this? For some reasons it's sending normal messages and not my format and also a huge error in the console
Send the error darth mango
can I use _ on package names? Otherwise If it is a multiple words name it's difficult to read it ๐ซ
please no
^
๐ข
empee the package structure has a convention apart from its naming convention
you start with your domain but reversed
if()
{
//code
}

ugly af ifs
So conclure.me is me.conclure
hi how can i get all server commands?
just.split.your.package.names
and then every package in your reverse domain packages should be ONE word which in ABSTRACT TERMS explain the content of the package @cold field
sometimes two words
[01:23:26 ERROR]: Could not pass event AsyncPlayerChatEvent to StarWarsEssentials v1.0-SNAPSHOT
java.lang.NullPointerException: null
at starwarsessentials.starwarsessentials.chats.test.getInt(test.java:14) ~[?:?]
at starwarsessentials.starwarsessentials.chats.test.Att(test.java:20) ~[?:?]
at starwarsessentials.starwarsessentials.chats.test.Chat(test.java:27) ~[?:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor63.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.5.jar:git-Paper-579]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[patched_1.16.5.jar:git-Paper-579]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.5.jar:git-Paper-579]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.5.jar:git-Paper-579]
Like itโs just a convention
at io.papermc.paper.adventure.ChatProcessor.post(ChatProcessor.java:222) ~[patched_1.16.5.jar:git-Paper-579]
at io.papermc.paper.adventure.ChatProcessor.processingLegacyFirst(ChatProcessor.java:102) ~[patched_1.16.5.jar:git-Paper-579]
at io.papermc.paper.adventure.ChatProcessor.process(ChatProcessor.java:60) ~[patched_1.16.5.jar:git-Paper-579]
at net.minecraft.server.v1_16_R3.PlayerConnection.chat(PlayerConnection.java:2085) ~[patched_1.16.5.jar:git-Paper-579]
at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:2000) ~[patched_1.16.5.jar:git-Paper-579]
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1938) ~[patched_1.16.5.jar:git-Paper-579]
at net.minecraft.server.v1_16_R3.PacketPlayInChat$1.run(PacketPlayInChat.java:43) ~[patched_1.16.5.jar:git-Paper-579]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_311]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_311]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_311]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_311]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_311]
[01:23:26 INFO]: <Darth_Mango> hi
please don't butt in a conversation with just an error log
Paper 
it's pretty disrespectful
Yes
Sorry
go ask the paper discord
Yeah allman style, like itโs fine but for the sake of god donโt mix it with another style, so ye consistency good
allman style is cringe
should be the noman style since no one should use it
makes code so much longer

@ivory sleet So Doc? What's my problem?
Alright I'll work on cleaning up my static use, ty for the feedback Conclure 
Hope you found it useful (:
If there are two words like commandManager how do I handle it? commandmanager?
@ivory sleet would you be able to review my code? ๐
call it command maybe?
all package names are always lowercase
xyz.msws.plugin.managers.command for example
Command_manager obviously
is commandmanager a necessary name? manager specifically
Oo sure lol
semi-big plugin, feel free to look at what you want
Good code since the functions are small however, I feel like this should be in a ModuleManager or ModuleRepository or ModuleCache or smtng since your derivative of JavaPlugin should change for one major reason, and that is if the bootstrap of your plugin is changed. However if thereโs a change to your module system implementation your JavaPlugin derivative might be influenced by this change.
Good that you extracted this method, it could be extracted a little bit more (:
A little bit concerned about the mutability of the Enum instances here, probably fine but yeah Iโd probably have something like a TranslationManager which encapsulates a Map<Lang,String> or smtng to handle loading separately maybe?
Your module system is good
The LoudoutManager looks good altho you sometimes do:
if (cond)
do();
Which I usually avoid since it visually degrades the scope.
do you usually do
if(cond) {
do();
}
?
Yeah
gotcha
Nice Attribute abstraction also
Same with the Selector infrastructure
Also really good that you got a proper utility class 
:D thanks for the compliments
interesting point, I can see how the mutability would be problematic
Hmm yeah, since spigot is mostly single threaded and since most devs around spigot donโt write tests, the design is not something most are influenced by.
04:04:44 [INFO] Loaded plugin TCPShield version 2.5.5 by https://tcpshield.com
04:04:44 [INFO] Loaded plugin cmd_server version git:cmd_server:1.18-R0.1-SNAPSHOT:b4ccdaa:1625 by SpigotMC
04:04:44 [INFO] Loaded plugin cmd_alert version git:cmd_alert:1.18-R0.1-SNAPSHOT:b4ccdaa:1625 by SpigotMC
04:04:44 [INFO] Loaded plugin BungeeGuard version 1.2-SNAPSHOT by Luck
04:04:44 [INFO] Loaded plugin cmd_send version git:cmd_send:1.18-R0.1-SNAPSHOT:b4ccdaa:1625 by SpigotMC
04:04:44 [INFO] Loaded plugin cmd_list version git:cmd_list:1.18-R0.1-SNAPSHOT:b4ccdaa:1625 by SpigotMC
04:04:44 [SEVERE] Exception in thread "main"
04:04:44 [SEVERE] java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
04:04:44 [SEVERE] at net.md_5.bungee.conf.YamlConfig.getServers(YamlConfig.java:224)
04:04:44 [SEVERE] at net.md_5.bungee.conf.Configuration.loadServers(Configuration.java:136)
04:04:44 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:110)
04:04:44 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:296)
04:04:44 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:49)
04:04:44 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
@cyan dock can you please not spam everywhere
just because no one is responding in #help-server doesn't make it ok, it simply means people are busy with other things and just going to have to patiently wait
just how it is for the free support ๐
keep in mind, half the world right now it is Christmas for them
the other half its christmas eve
Hah, I understand
how to get string from other class?? i have Player player = (Player) sender; but i cant use it in other class where i for example display name of item "botprzemek's item"
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
don't necessarily need DI for that
how would you go about it?
there are few methods, static is one, grabbing the object instance both of which don't require Dependency Injection
how would you grab the object instance?
singletons are a thing
Well arenโt you just speaking of static singletons which is basically static?
public class Something {
private Something instance;
private Something(){
instance = this;
}
public Something(){}
public static Something getInstance() {
if(instance == null) {
instance = new Something();
}
return instance;
}
Yeah lazy static singleton
yes and no, you could use static to get a reference, or you could store it somewhere and not use static
If you donโt use static youโd have to inject one or another way
but in either case you don't strictly need the main class reference to get information from another class
Apart from using something like reflection or guice
Guys do you know why my "testcommand" has been register like this "testcommand:testcommand"?
@ivory sleet I've made the changes that you told me. I'm unsure about the static. I've removed only two var from static. The other things are for caching reflection or builder used for backward compability
as long as the string they are wanting is stored and the class object doesn't go away, you don't need DI to obtain it.
Hmm Iโll have a look tomorrow, remind me then (:
How?
If their string is in a different class and you cannot use static, then only solution is injection
I'm going to sleep. Bye bye
Might not be explicit
well lets say the class object is just basically a custom array object, as long as a reference to it is stored you can obtain the string, or you can have methods to link 2 classes together too
But it will have to be injected one or another way
Sleep tight
no? why would the class need a dependency? You can reference other objects without requiring the main class
Iโm not talking about a main class
Iโm just saying that if you do not have the choice to use static, then there must be an injection somewhere
you can create the object of another class in the class you want the string in.
new object(); now anything that goes on in that object is accessible in the class you wanted the string. it really just depends how you need it done really XD
Yes but then itโs not in a different component theoretically if youโd do that, I mean given a dependency you must inject it, if you just instantiate an instance of a class within said class it is not a dependency then.
At least not what Iโd define as a dependency
I think the point I am saying, is why would they need to be dependencies of each other or one depend on another for either one to access the objects of one or the other
Hmm yeah thatโs probably a good question
im confused rn ๐
ye i'm so curious that why dependency injections libraries are not that popular in Spigot development comunnity
I mean
Spigot isnโt overly engineered which makes normal explicit dependency injection not a pain
Itโs a java 7-8 stylish api
not enterprise api directly ๐
Though personally I use guice for my highest level components, even in spigot.
because most who do plugin development are not very well versed to begin with





