#help-development
1 messages ยท Page 812 of 1
maybe head with certain name?
are all the heads created by your plugin?
so if i eventually add other items using head
yh
instead of item name
yes
give all your heads a data
in der pdc
pdc is used to store data in items and entities
and block entities
in the listener class right?
on death u can then loop through all the items in the inv and remove the ones with the pdc
yes
ok how do i create a data for the head?
youi also need to make sure to add the pdc to the items before giving them to the player
.
what else have you been doing with classloaders
hold on now
im using GreatKits its great because when u create a kit when you it , it stores all data of the item even if its modified by a plugin
if you have to basically ask someone to write your code for you maybe you should consider practicing first
on some simpler project
and maybe watch some tutorials first
is that an API?
maybe i don't reallt know, its amazin though i reccomend
so if you help me just implement to the head when i get it in-game i will use GreatKits to save it and it stores everyaspect
doesnt c++ do that too
never used interfaces in cpp so idrk
public class Shit : Interface1, Interface2, Abstract1 {
}```
what is the next step friend im alr confused :-:
you need to learn java
jree
or learn basic logistical reasoning
you're taking on too big of a project for your skill level
which to my understanding is basically none
no way fourteen brush
im just trying to modify a plugin its a big waste of time not because i don't want, its because i don't have it
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
there are also is and as operators in c#
which are not present in cpp
cpp doesnt even have interfaces, just structs/classes with a bunch of pure methods if you really want to give it a name
well that probably explains why i haven't used them
what the hell is this lol
guys just made an interface operator
i dont have any idea what greatkits is so i cant really help u with that sorry
thats c#
cpp doesnt have ^, delegate and ref keyword
yes
Like you can technically emulate a java interface, but there exists no such keyword semantic
why would one even want to
equivalent
yeah yeah
Yes but the diamond problem is easily addressed if the language allow for more precise and specific inheritance semantics
Like javaโs interfaces
well in c# you do interface
not an interface class
C# is not cpp
no i does not have to do with GreatKits
C++/CX (C++ component extensions) is a language projection for Microsoft's Windows Runtime platform. It takes the form of a language extension for C++ compilers, and it enables C++ programmers to write programs that call Windows Runtime (WinRT) APIs. C++/CX is superseded by the C++/WinRT language projection, which is not an extension to the C++ ...
oh
it's cpp/cx
based on cpp11
so well, that's a variant of cpp
with a lot of #define 's ig
and modern c# also added pattern matching same to java one based on is operator
Is it possible to access buyrs list thru some spigot site API
oh it's deprecated
i believe so
I know the papi devs do it somehow
this looks old does it still work?
xd
Spigot Site Plugin. Contribute to Maximvdw/SpigotSite development by creating an account on GitHub.
gl with that
huh? ๐ญ
What do you need the server for?
Bukkit is already = JavaPlugin.getServer()
getting all online players
Just use Bukkit#getOnlinePlayers
doesnt work either
wdym
it says it dowsnt exisz just as with bukkit.getServer
what does exist in Bukkit. then
try mvn update or smth
Try invalidating caches
It show error because you are doing it inside for
for(Player player : Bukkit...)
it might be cuz you didn't make correct loop?
it doesnt work outside the for either
and no it doesnt show the error because of that
or Bukkit.getOnlinePlayers().forEach(p -> { });
i know how to make a for loop
show the error when
already did.
for getOnlinePlayers
ah yeah complete the loop
butkkit doesn't have getServer() method
and that error should go away
Ofc it does
look,
declaration: package: org.bukkit, class: Bukkit
oh i'm dumb
oh okay thats odd but thx
Maight be useful when working with nms ๐คทโโ๏ธ
there's also Bukkit.setServer(Server) lel
sure why not
code me the thing which would actually change the server
without erroring
setServer(getServer())
๐ server
so well, it's literally useless
public static void setServerToNull(Server myNewServer) throws ReflectiveOperationException{
Field serverField = Bukkit.class.getDeclaredField("server");
serverField.setAccessible(true);
serverField.set(null, myNewServer);
}
when is the server not set though
before CraftBukkit calls setServer
well, and you won't ever be able to do your stuff before that
since your plugins require pluginmanager
which is accessed from server
oh shit
well ig it would still error tho
thing would instantly crash after that code is executed
why that
I need to fix my Adapter for EnchantMeta someone can help me?
since when is #showPlayer depricated
NullPointerException
you need showPlayer(plugin, player);
or is it player, plugin
idr
why should that happen?
what if i dont
won't plugins with listeners try to access events stack
will it fail?
nothing
crazy
Why are we nulling the server
I see
which im making null
Why are we overriding the server
sus
i forgor how to set event priority
@EventHandler(priority = EventPriority.HIGHEST)
public void onWhateverEvent(SomeEvent event) { ...
How to properly delete a scoreboard? Is Objective::unregister() enough? What about the teams, I can go through and Team::unregister(), but what about the scoreboard itself? Thanks
how so? remember, LOWEST is executed first, HIGHEST is second-last and MONITOR is last
because usally my memory is that of a potato
so i dont trust it
https://pastes.dev/btoN5JOd8I
any feedback on this design?
i have no clue what else to call the class when new players join the server that then need have invisible players set invisible for them
any suggestions
writing database abstraction for fun
what was right clicking a block event
playerinteract?
playerinteract
PlayerInteractEvent
lmao
blocks dont hve pdc
(a) PlayerVisibilityListener or something is probably fine
(b) I think it's better to avoid articles in most situations when declaring method names (a/an/the)
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
if yall dont got any the name stays
1 sec
why are the methods LikeThisIForgotTheNameOfTheConvention
maybe syncHiddenPlayers(Player) or smth ikdk
C# dev spotted
addNewPlayersToTheSoup is vague as shit tho i thought u were coding a soup pvp server at first
thx
lmao
Lol
it makes more sense in german
a soup can be a group or a collection of things
i want to code this rn but i have physics test tmrw so shit
ah
would make absent() cached() and pulled() an enum, or is it internally? \๐
i stopped about carring about test a long time ago
ill prob do that as well
but absent() is cleaner than getType() == QueryResultType.ABSENT imo
or something like that
how to get
custom model number of block
to represent it internally ill use an enum though
that is exactly what i meant
lmao nice
static imports :p
ig
cant be bothered to do that in every file tho
so ill add the option
for myself
lol
were we able to add custom model data to block
you're that kind of person that writes c style java code and im fascinated about it
lmao
is there like any reason to have your field transient?
to denote that it shouldnt be serialized
you doing some reflective serialisation?
thats the whole point of the keyword
yeah
i will
probably
other types of queries will be annoying to do but whatevr
ill prob just do Query.match().eq("myField", 6) or smth but i dont know how to efficiently find that in the cache
mongodb syntax is awful
i hate my live
turns out customer wants plugin for 1.8.8 and ive been using EntityPotionEffectEvent
but it got added in 1.9
thats just awsome
whats the alternative for older versions
what if i just loop through all players and check if they have the effect
every few seconds
rathwer
miliseconds
best option here is to tell them to just cope and turn them away
its not worth the money
i already made the entire rest of the plugin
everything else works
just this doesnt
๐ ashame
make sure you ask for version in the future before starting
I wouldn't do anything under 1.19.4 personally
is this just for players?
yeah
might want to try NMS here, but otherwise you can probably use a shit ton of events and conditional checks here
for exmaple 1.8 has PotionSplashEvent
this still seems like the easiest
its like
you can get a list of affectEntities
10 players max
its easiest but inefficent
what do you need to know the effects for?
if you could expound
i just need to check when players get or loose the invisibility effect
need to do some stuff with those players
by any source?
can probably use PlayerCommandPreProcessevent, PotionSplashEvent and add player UUID's to some form of timer task
this way you are never looping on players who don't recieve the effect
potion splash doesnt apply to drinking potions though does it
once their effect expires you can remove them from the cache and trigger the event
nein but iirc PlayetItemConsumeEvent does
nein
This event will fire when a player is finishing consuming an item (food, potion, milk bucket).
make sure you also use PlayerJoinEvent
already doing that
so you check on PlayerJoin for any lingering effects and add them to your cache
thx thouhg

how to disable backgroudn vanilla gui //
what i want to do is to turn off the bad looking gui in the background when the "custom gui" is open, is it possible with datapack or shader core?
I use "deluxemenui" for special gui
you sure you dont wanna be in #help-server
if you are already using a resourcepack, cant you just remove that texture?
that'd just be a naive solution
negative space fonts are the way to go here
to remove/hide textures?
to hide them
oh I didnt know that I thought you could only put new stuff overtop
that's really the goal when you do this you overaly the current inventory texture using the title of the inventory and use negative space to adjust and hide the old textures
I mean client doesn't sync containers with the server so you can't register new ones and expect the client to recieve them
yeah I know
but like
a resourcepack is on the client anyways
so how do you hide a texture using negative space?
like in the example image shown above
you negative space the title to go upwords
that would allow you to utilize the extra slots their too
you can adjust left right up down with negative spacing
yes that I know
but its just that the design they drew will never not show any of the vanilla ui if they want the tab buttons to work
that really should be a thought they had then, you can't just remove the texture too because that would break other plugins
its very naive to do so and expect things to be all okay
like what
remove a vanilla texture
I mena what does it break
the menu? it'll be blank aka not there
I just mean to edit teh texture to make it dissapear
or supply the no texture error
other plugins utilize these menus though which is why its naive
you've essentially broken teh design / styling of every other plugin which utilizes that same container
okay sure
so to fix this issue you would just have to come up witha shape that covers the existing ui
yes
there is not really a way around it until mojang makes contianers Data Driven and allows servers to sync with clients
yes true
even now there are a few things you can do as far as utilizing smaller containers with packets etc, but its no easy task
okay seems like I was just confused with what you said earlier I think we on the same page now
but as far as a server owner goes they're options are limited to only using negative space fonts
and they have to conform to whatever the plugin allows them to utilize, as a dev you do have a few more options, but they are indeed very hacky
is it possible to stop an entity's hitbox when riding on a player from interfering?
if I just keep the same Block object, will it stay updated?
good question
honestly no clue
?tas ig
A block is mostly just a position in a world. You can keep it and get values from it after it changed, and even after the chunk it is located in, unloads.
"mostly" = "literally". It has no state
Reminds me of how weird Location is lol
In a world where location isn't kinda weird it'd jsut be 3 numbers or a vector
hi , how would i make it so it send the Arena info each time the arena change its status?
so for example :
- IN lobby
- waiting
- playing
- ENDED
etc , i already have an enum for it , iam talking about the redis part .
and i want to show it in a gui of some kind
Hey guys, I'm probably doing this wrong. I'm getting an error that MemorySection's can't be cast to just about anything else. I haven't found a tutorial that spells out exactly how to do this specific part, maybe you all can help? Here's my code.
public FactionManager readData() {
if(getConfig().get("data") != null) {
System.out.println(getConfig().get("data"));//MemorySection[path='data', root='YamlConfiguration'], is this right?
return new FactionManager((Map<String, Object>) getConfig().get("data", Map.class));
} else {
return new FactionManager();
}
}```
And here's the contents of the yaml it's trying to read:
```yaml
data:
invites: []
factions:
- members: '[a8570f8f-d7cd-4df3-b864-e7e5b5e71eb9]'
factionID: b9a7e163-8c91-487a-a7d5-1ee079bf6ef7
factionName: best
power: 10.0
enemyFactions: '[]'
allyFactions: '[]'
have a method that changes the game mode that sends the message through redis when its called
iirc a mem section isnt exactly a map, call getValues on the section
- Let FactionManager implement ConfigurationSerializable
FactionManager factionManager = ...;
FileConfiguration configuration = ...;
//Save the factions
configuration.set("factions", factionManager);
//Load the factions
FactionManager loaded = configuration.get("factions", FactionManager.class);
im trying to implement a feature where i want to change loot drops based on nearby structures, but the documentation says this
whats the point of giving a radius if some structure types can just ignore it? is there any method that detects structures that respects this radius parameter?
Just write your data into an RMap and look into it when someone opens the GUI.
Additionally you can use a Topic and publish/subscribe on it.
@twin venture
wrong reply moment
Everything seems to be working now. Thanks!
huh..?
so clone an item but not using clone
why
The clone() doensโt seem to working
how are you using it
The item is still immutated
I clone an item from an inventory and send it to another inventory
If I modify the other inventory the other got modify too
show code
cloneItem is just an utils class that I use to try methods of cloneItem
for this cause you can see it is just return item.clone();
and updateLore i just assume takes the meta, sets lore, applies meta to the given item
even removing the updateLore() still result the same
i guess you could also just try doing item.clone() when setting the item to the gift menu
instead of just item
clone it again fuck it
well still no luck doing that :l
yeah thats weird lol
feels like you're doing something wrong though because its definitely supposed to keep items separate like that, so you're saying both the item in the original menu as well as the one added to the gift menu are both modified with lore
Hi. I'm trying to get the entity height but none of these methods work:
Method 1: Using bounding box
So, in this method I used entity's bounding box getter and got the values to calculate like so:
boundingBox.e - boundingBox.b```
This will return the same value as other mobs' height value, so I tried the method 2.
**Method 2: Using length field**
This method also returns the same value like bounding box did.
..what about get height
a height is BoundingBox.getMaxY() - BoundingBox.getMinY() or for short BoundingBox#getHeight
I don't have that method. Using old version of NMS.
oh lol ๐ legacy moment
bruh
the random letters make sense now
If I had that method, why would I come here to ask?
legacy isn't supported especially legacy NMS
you gotta find your own way on this one
i mean have you seen how many clueless noobs come here to ask for questions
yeah, that reminds me my first days of coding
when I was a really noob and was trying to register a listener. lol
anyways, it's been a while that I'm trying to find a way to get a exact mob height, however I can't find any.
NMS is always challenging.. smh
even Citizens use Entity#length to get mobs height. They don't know this is wrong. lol
https://github.com/CitizensDev/Citizens2/blob/master/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/util/NMSImpl.java#L437
I think the problem is creating 2 inventories like this?
do you have any idea?
even with no operator both inventory are now the same one?
@river oracle just checked the PR again... Arguably nothing went really wrong though? Is md_5 for real?
I mean technically speaking he is right nothing "went wrong" per se quite literally nothing did go wrong though. What did happen though is a server owner removed a plugin that changed their server which they shouldn't have done
I've yet to write out a proper response since I'm busy with school
fair
imo this isn't spigots job to be cleaning up after plugins that misuse features or cleaning up from server owners removing key plugins form their servers and expecting everything to go away without warnings/errors
Literally all it is is a warning message?
I'm confused why you're being so aggressive about this
oh yeah md
is there a reason Advancements don't have a proper API in spigot
just not been PR'd?
or is there some other underlying thing
Wdym proper api
uh creating them is what I meant
Bukkit Unsafe has something to load it from json
but there's nothing programatically
Because it's a json datapack nightmare
๐จ I see
I was thinking I might take a crack at it after finals are over, but ig I'll have to look closer
md do you have any ideas how can I do this? I think you are so familiar with NMS.
@sullen marlin oh btw if you are just not going to remove that line its fine you / I can decline the PR when i get around with it
again that is legacy modern spigot API provides BoundingBox methods that do this for you, you won't find much help with NMS here especially legacy. It should just be the maxY - minY. if that doesn't yield correctly especially at an NMS level might be legacy jank
Sorry no idea, but it sounds like the correct approach. Have you tested 1.20.2
I'm using 1.8.8, I already know there is a method in 1.20.2 called getHeight()
Too old! (Click the link to get the exact time)
wow 8 years 4 months
boundingBox.e = maxY
boundingBox.b = minY
1.8 is older than some of my cousins
then i'm not sure especially on such an old version too who know how tf it worked back then
if you're getting the entiies bounding box and your sure thats it should work
yep, because I use https://mappings.cephx.dev/ for mappings
I mean if I wasn't making SkyWars plugin, I would really switch to 1.20.2
You can't really make 1.20.2 PvP like 1.8, even with plugins.
It will look so odd and buggy and most of the mechanics that are in 1.8.8, wouldn't be in 1.20
You would think that the skywars bedwars kitpvp market is saturated for 1.8 at this point...
not enough
not yet
and also it uses so much CPU and ram.
and u think
that yours will be better
someone has already probably poured years into their skywars plugin
more features, more resources
idk what year your in but if your PC can't run 1,20 you need an upgrade :P
i mean nothing wrong with coding the plugin again, but really reconsider your options
For vanilla definitely. But if you tailor your server for you needs you might be better off.
My PC is alright. You won't believe that the best server aspect you can get is Xeon 2667 v2
I mean, there could be a million other things bottlenecking your server...
what thing?
wdym what?
what thing would make my server bottleneck?
- your cpu has many threads but many mc server operations are performed on one thread (only some are async)
- memory
- hard drive or ssd
- network
- server configuration (server software, plugin configuration)
- type of plugin you are using
7)... so on
all we're trying to say is that it isn't worth your time to make another 1.8 skywars plugin
yes, but if there was 16GB memory and only few plugins on server, what would you say?
no never enough 1.8
not old enough
we dont care about how powerful your server might be - we're just recommending u to either update or code something different
1.8 is a pretty small clientele. Pretty sure the hand full of servers are all running pretty much the same plugins.
Why should I code something different? when the market needs a good SkyWars plugin?
lol
there are some SkyWars plugin out there, but they aren't like Hy server
even if they are, they might be so old or outdated
idk what clientele means but many servers custom code many of their plugins and network infrastructure, only having 'essential' plugins like essentials and worldedit for the common utilities
There is nothing to outdate. Your plugin will be as outdated as theirs from day one...
and it will forever be outdated
its not like you can keep up with years of work lmao
some of these plugins were there since 1.8 was latest version
invaded and minemen have custom coded infrastructure and plugins for sure
in the community we have lots of fork for 1.8 that is updated and will be updated as soon as possible. there are so plugins that still support 1.8 and etc. How can you say 1.8 is old and no one should use it?
oh god this debate again
There is only a tiny fraction of servers running custom code.
And even less 1.8 ones. ~90% runs 1.16+, about <5% runs 1.8
smile this is where you post the BStats graph and stop talking
XD
a large fraction of the actually played servers do tho
i dont think hcf servers like cave are going to use some scuffed spigotmc plugin to make money
What are you arguing about, exactly?
pfff
1,8 outdated or no
some setups might run pre made server cores with grants, bans and staff chat n shit
By what meaning?
I'm sorry but who cares about how many people use 1.16 or something new? when 1.8 is a good option, it is a good option. who really likes to use an outdated thing? I'm just trying to say that 1.8 is taking less usage than newer versions
also if theres stats for player count across versions id like to look at that
๐คทโโ๏ธ who tf knows its definitely outdated and should just die in the dirt already. Mojang really fucked up with 1.9
So? Thats just a result of being unique. No argument for 1.8
Bro it's 8 years old of course it's outdated
I mean if you use a ducttaped 1.8 fork, go to their server and ask for support, end of it?
I know there are lots of good things and good APIs to use on 1.20 but because 1.20 uses so much usage, it's not good for a PvP server.
Was it released long ago? Obviously.
Is it still used? Very much
u started talking about every server running the same plugins not me
DuckTapeSpigot 1.8.8 ๐ my favorite fork
About every 1.8 server. And the point still stands.
So I don't get what kind of outdated are you arguing about
what point
for spam pvp mayhaps
but pvp in modern minecraft works just as well, altho u rely on different mechanics
That pretty much every 1.8 server runs about the same plugins at this point. The market is saturated.
players when they now have to actually use their brain to pvp ๐คฏ
I think using 1.8 as an argument to achieve a certain mechanic is a feeble argument
"spam pvp" is honestly such hard cope, sure cps plays a role but in like every gamemode gamesense, aim, etc matter so much more
if u like 1.8 as a version sure, go play it
when it comes to the software, most of us just dont support it, thats it really lol
Why are you guys bullying the guy?
the played servers dont tho
and hypixel
who is?
what lmao
This is just facts
Again, thats the 99.99th percentile you are talking about. Statistically insignificant in this argument.
wouldnt call that bullying... but yeah maybe a controversial opinion according to some people
I love when people pull the hypixel card. I highly doubt their team wants to be stuck on their weird 1.7 fork xD who knows though ๐คทโโ๏ธ
sure they all run mf essentials but for the actual gameplay theyre not gonna use "๐ FREE 1.8 SKYWARS [OMG] ๐"
isn't skyblock >1.8
but then again, hypixel MAINTAINS THIER OWN FORK
He what now
choco is hypixel dev
99% do
why do the other servers matter tho
unsure
Because that is about 100% the target audience of spigot
the amount of spigot 1.8 servers are low though (unless u have a derived software version, but then again, we dont support those)
who cares what hypixel or other big servers do tbh its not a valid argument they have massive dev teams running extremely custom forks. If you want to run it fine, but you best find a secure fork
full-time for two teams ๐ man is dying out there
oh true we were talking about the guy developing plugins for 1.8 i forgot
Yeah ^^
Personally, I only use ViaVersion and LuckPerms. that's it. I make other things myself
ye
wyd
It's like polygamy, but with teams
was coding fabric mod for my smp lol
oo nice
This makes you part of the 1%
rn im coding plugin
for what xD
web browsers plugin
ah
just a personal one
let me bet, u use selenium or w/e its called
you mean this is worthless?
no idea how this can modify other menus
im also developing a fabric and forge mod to go along side it
nice :)
Yep lmao
:,)
Conclubi, wanna look at the mess i made? I switched from a state machine to a reactive design (kind of)
sure smile, u pushing it?
๐
well it doesn't :l
smile works on this cool minigame thigny
It doesn't have anything in common as well
You've given a very broad code sample
no1 said that
Oh ic
Its literally just a bootleg chassis for some testing
Also
"cutting edge, ai trained technology"
Yes
wasnt that what we went for
Wtf is that
With blockchain
this is my gift editor
You checking and continiuing for nulls after creating a new array full of nulls?
when I open Gift Menu with that code to gen
and then for some reason
Now share how much you get them cash
the GiftEditor disappear as well
Oh shi, @worldly ingot is a professional. Run!
You draining the boy for free
- a company car and dental care
ask him. I would really like to know some information about Hypixel.
@worldly ingot is Hypixel maintaining its own fork?
Bro
yes ๐ no need for an insider there!
hypixel has a couple public devlogs and u can prob find a lot of info on google
And continiuing the to the next loop if an element is null
Yeah I think thatโs pretty well known
if yes, what is changed inside the fork? I'm really curious?
well it doesn't null :l it does have a loader when the plugin start
we all know they are going raw on spigot 1.8.8 with 0 extra patches
updateGiftViewMenu
they can't lie to us forever
Resets the items for good
Like that time they claimed they were running a custom Linux kernel or smthing detect if you edited the registry to enable tcpnodelay
But didn't you also describe spigot as "High performance"?
yeh it is intented as it will copy and modify data from another inventory
It does not copy
Anything
well as you can see there I just doing some testing
linux has a registry tf?
Do you know how the continue keyword works?
yes
the mainthing is
if I open the giftView Inventory
rough very rough
the giftViewInventory will be copy into giftEditorInventory
LMFAO
you should see it from here
And still writing code like this
Truth can be rough
all of these forks are just part of a big puzzle
they help each other to make a better fork
forks are cool and all
if Spigot wasn't exist, paper wouldn't be like how it is now
but when will the next spoon be developed
True, it might've been faster
lmfao
idk what I do know is that md5 put a spoon in the microwave this morning so its possible something is coming soon
He what
fun fact metal utensils are not actually all that dangerous to put in the microwave
What was the purpose?
its often rather difficult to get anything interesting to happen
#general message
Mortal laws do not constrain spigot devs
this is foreshadowing
anyway im trying to implement a feature where i want to change loot drops based on nearby structures, but the documentation says this
whats the point of giving a radius if some structure types can just ignore it? is there any method that detects structures that respects this radius parameter?
https://cdn.discordapp.com/attachments/741875863271899136/1179494005692715119/image.png?ex=6579fc64&is=65678764&hm=ddd3142295138e11b30f0f5210043c4064e62d5cb5260bcd9a7ace79dab7b66c&
https://cdn.discordapp.com/attachments/741875863271899136/1179494005931774012/image.png?ex=6579fc64&is=65678764&hm=17b00d516adb707529587f90e54856facabe48809e77d29cc297818f60a28e14&
i'd like to be able to find nearby structures fast and not have the server freeze when it decides a mansion should have a 20k block search radius
No idea, I suspect /locate or other internals do exactly the same thing
I think @young knoll did that API
is there another method or something i can use to check if a structure is present in a radius, not necessarily where the given structure is and force the server to find one?
besides doing the extreme thing and segmenting the world and caching structure locations sometime beforehand
If you findUnexplored = false isnโt that what you want
will that prevent the ridiculous radius stuff?
or do you mean structure finding is quick if they're already discovered?
https://github.com/electronicarts/ea-async how i can import this in grandle?
I think the docs explain this
no, only marven
there are gradle ones
implementation 'com.ea.async:ea-async:1.2.3'
they legit tell you in the readme
Reading is for chumps
illiterates should be thankful they dont know how to read
or they'd be total nerds
Thats what I am doing, if its a fresh install of my plugin, I go dig around in your world folders to find the structures, since Spigot doesn't have an api to get that data from a chunk yet. Once the plugin is install you can just use the generation event to log them as they generate.
Still haven't published this plugin since I am not happy with it.
thats a good solution
unfortunately, i am quite lazy
my excuse being that this feature is not significant enough to warrant that
ineed help
i've been trying to fix this
package net.jem;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Chicken;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.plugin.java.JavaPlugin;
public final class chiken extends JavaPlugin implements Listener {
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Bukkit.broadcastMessage("[+]\\u00A72 Bro thinks he gonna survive :) " + event.getPlayer().getName());
}
@Override
public void onEnable() {
Bukkit.broadcastMessage("[Server] Good Luck...");
Bukkit.setSpawnRadius(0);
}
@Override
public void onDisable() {
Bukkit.broadcastMessage("[Server] Shutdown...");
}
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
Location playerlocation = player.getLocation();
for (Entity entity : playerlocation.getWorld().getNearbyEntities(playerlocation, 5,5,5)) {
if (entity.getType() == EntityType.CHICKEN) {
Chicken chicken = (Chicken) entity;
Location chickenLocation = chicken.getLocation();
chicken.getWorld().createExplosion(chickenLocation.getX(), chickenLocation.getY(), chickenLocation.getZ(), 100.0f, true, true);
}
}
}
}
my code
and i use gradle Minecraft 1.12.2
spigot too
so when player walk in 5 block radius of chicken it will explode
but it seeems to not work
well you didnt seem to have registered your listener yet
also fyi basically nobody gets to see that good luck message because i dont think players can join the server before all plugins have enabled
i would also encourage you to maybe put a cooldown on the detection system, player move events are very spammy, possibly the spammiest event of all, and doing radius checks is overkill
maybe implement like a quarter second or half second cooldown between each radius search
AH then you wouldn't like the other route of NMS ๐
Since thats what I replaced with the system I came up with that I am still not happy about xD
what are you making anyway that requires this intensive structure caching
Oh, making it so you can setup specific mobs to spawn in structures, for example Husks in Desert Temples.
then find nearby structure should be fine, no?
Or say a specially zombie that always has mining type stuff if they are in mineshafts.
Sort of it, gives you a coord, which is not useful for getting a bounding box.
right
Its basically an API to the vinillia command
kinda sad these bounding boxes aren't exposed normally
they're there in minecraft, i mean theres the boundaries in which blazes and shit spawn in fortresses
All of them are exposed in NMS just no bukkit \ spigot api for them yet. (And I have no idea where to start on making one considering Bukkit already has 2 types of structures in its API they don't seem to work together.)
Whats the issue?
why in the fuck does ea have jvm libraries
blizzard uses java too !!!
I love their sims contents pack where you pay 40โฌ for just decoration lmao
and their female employees
wait no
thats was activision
what did they do?
oh damn
the game is free for a reason: if you want to do anything outside of the 3 basic things you need to buy DLCs lol
it's free now? when I bought it, it wasn't free lol
yeah
everything is expansions basically outside of the very very basic mechanics
which is fine for most people but then there are the fanatics who want to get all the deco and all the jobs and map expansions
I mean there's a few expansions that are worth it, e.g. the one where you can go to work
work simulator POG
even GTA is a work simulator... for criminals lol
ok fair but at least crime is fun
Can u teach me?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
O
Thank you @tender shard
im fairly new to java
Ok
So
I've done what you said
and Now im recieving errors
?paste them
why are you creating a new instance of your plugin? don't do that.
You often need a reference to your main instance (the instance of your class that extends JavaPlugin) in some of your other classes. Thereโs two basic concepts for this. Choose whichever you like more. Method #1: Static Getter First way is to create a static method called getInstance() or similar in your main class. You...
also ?learnjava
Anyone know of a valid reason to not supply null for an InventoryHolder outside of its general abuse e.g.
InventoryHolder holder; // not abusing it here
Inventory someInvenotry = Bukkit.createInventory(holder, 27, "goofy");
i dont think ive ever not passed null
yeah well no one cares what you do Epic
true
then get choco over here
no
yeah choco is weird
Alex
you do stuff with chests
do you know? This is for inventory PR its very important
deprecate the method
That's what I'm wondering about!!!!
do it
I can't deprecate it if its useful outside of API abuse
i say its not
now deprecate
oh and also add a warning telling the user to nag the author to use correct api
LOGGER.warn("nag author of %s to use Bukkit#createInventory(MenuType);");
needs more lines
@echo basalt
what's the issue with letting people supply an InventoryHolder?
๐คทโโ๏ธ what is it useful for
I seriously haven't a clue
Nag plugin.getDescFile.getAuthors to use xyz bc old is incorrect use of holders
something something the holder is cloned a bunch which can cause issues
raziel said stuff ab it
oh i remember that
I mean its useful for BlockState which is where its used iirc
but like do we need to be using it for virtual inventories?
get holder makes a copy
idk for example a backpack plugin might use a player as holder
a GUI might also use the player as holder that opened the GUI
actually they aren't ๐ I used Commodore
the latter is an abuse of the API though
the former is more debatable
remove me and commodore
I don't see any reason why a player should not be the holder of a player's backpack inventory
ig but doesn't the holder just return the players inventory?
oh but getHolder would return player
I see
okay I got it now
beautiful
hi simple
hi
good job
Why would you do such a thing
It's one way of getting your main class instance around the plugin, the other being dependency injection. So it's fine. In your onEnable just set instance = this, and make a public static method in your main class that returns instance. Then you can Chiken.getInstance().
Arguably dependency injection is cleaner, so if you want to do that, wherever you need the main class instance just put Chiken chiken in the constructor and save it to a class field by this.chiken = chiken and when you instantiate that dependent class in the onEnable or wherever you do it, just do it like new MyDependentClass(this), and voila your dependent class has your main class instance in a more OOP friendly way. Just don't get in the habit of using static anytime you need something in another class, as that's not what it's for. But since plugin main classes are essentially singletons managed by the server itself, it's ok.
I did this way
That's fine
Just take heed of my 2nd to last sentence there, and it's not the way to do it for every case when you need an instance of class A in class B. You'll want to familiarize yourself with dependency injection
yo
what else commands do i need?
i think thats the best
stuff i made
in my life
Hi how can I make particles rotate around according to player body rotation, I try this code, but particles jumps from position to position ``` float pitch = player.getLocation().getPitch();
var r = 3f;
var angle = pitch;
var X = Math.cos(angle) * r;
var Z = Math.sin(angle) * r;
var loc = player.getLocation();
loc.getWorld().spawnParticle(Particle.HEART,loc.getX()+X,loc.getY(),loc.getZ()+Z,1);
//transform.getScale().set(2f);
transform.getTranslation().x = (float) X;
transform.getTranslation().z = (float) Z;
transform.getLeftRotation().set(new AxisAngle4f((float) iteration, (float)0, (float)1, (float)0));
id.setInterpolationDelay(0);
id.setInterpolationDuration(1);
id.setTransformation(transform);```
Hello, I need help with one of your UberEnchant plugin
nvm this works fineX = r * player.getLocation().getDirection().getX(); Z = r* player.getLocation().getDirection().getZ();
bruh
This is why the builder exists
new GsonBuilder() ๐ง
im having an issue with a plugin im creating where when I call my spawnerSettings HashMap in two methods(onPlace, onInteract) it has values in it (as it should), but if i call it in another(onCommand) it is empty. i checked via debugging and the hashmap is holding the values properly as the method(s) that do work updates regardless of when I call it (et before onCommand, after onCommand) heres my code (ignore the toDo's) (sorry for lack of documentation) https://pastebin.com/raw/dSTa1Ej9
you're only every creating one instance of SpawnerCreation right?
can you show where you register the command listener
or rather your main class
Certainly
I register my commandListeners onEnable, also id like to add on that this is a personal project so I understand certain pieces of code are rather inefficent but id like to get a functional prototype before making it perform excellently. https://pastebin.com/raw/jduStuhM
Objects.requireNonNull(this.getCommand("spawnerInfo")).setExecutor(new SpawnerCreation());
Bukkit.getServer().getPluginManager().registerEvents(new SpawnerCreation(), this);```
you're creating two instances
either share the variable or move the command executor to another class
oh i feel stupid now, thank you!
com.sun.HttpServer isnt bad
actually liked it
thought it was going to be a shit
but its pretty abstract ig
mfw using com.sun package
Does Bukkit.getPlayer(UUID) work for only online players? Is there a way to get an offline player?
Yes. And yes. Bukkit.getOfflinePlayer(UUID).
You can use OfflinePlayer#isOnline to tell if they're online, and if they are, you can do OfflinePlayer#getPlayer to get the Player.
Note, getOfflinePlayer never returns null. Everybody exists from its perspective
Docs exist tho.
If you dont see in ide right click to pom then download source and docs
the javadoc for the spigot api does not specify that it only works for online players, and I had seen the getOfflinePlayer, but was trying to not use it as it's deprecated
but the results I was getting seemed to indicate it was the case
I will simply store the player's names instead of their uuids for the purposes of my plugin, doesn't really matter unless they change their names, which won't happen often
Getting offline player by name is deprecated
Getting by UUID is not.
Same reason getPlayer(String) is deprecated
(If that's still even there, it was deprecated for many years in favor of getPlayer(UUID))
Oh, it got undeprecated. Excellent. Anyway, docs explain why it's deprecated.
Is there any easy way to cancel the console command log?
Since cancelling playercommandpreprocessevent
Does not do it
Which log?
declaration: package: org.bukkit.event.server, class: ServerCommandEvent
I am unsure if he meant the log of a player doing a cmd or the server doing a command or what
ยฏ_(ใ)_/ยฏ
What is better to create a separate class from common methods or an abstract class
Don't force inheritence into places that don't need it
damn gradle 8.5 out now actually, full java 21 support
Is it a good idea to use an abstract class to remove repetition code, especially if the descendants override only 1 method?
or are there other better options? - https://paste.md-5.net/udiyojimos.java
Use an interface
Itโs not stateful so no point use an abs class
Wait no abstract class is probably the way to go
If everything else is the same
wdym
But won't the implementation of interfaces be repeated? Isn't this the same thing as repeating code?
Correct
Does anyone know how to use the set equipment packet (with mojang mappings)? I am trying to make a vehicle and I basically need to hide the head item from an armorstand from the player that's riding it, while showing it to all other players. I think that the ClientboundSetEquipmentPacket is what I need but it uses a List of Pairs of Equipment slots and an item stack. It kinda confuses me how this works
it stores 1 necessary variable for the heir can this be considered as state storage?
What's the ideal maven plugin compile command EI mvn clean install compile
I mean, alternativly you do composition instead of inheritance
and delegate common methods
but abstract here is fine I guess ?
Nevermind, I found out how to do it
Soz for bump
So what should I use?
mvn package packages your application into a jar
I got flamed a while back for using the wrong one
mvn install does the same but installs it into your local .m2 repository
it depends on what your goal is
mvn package should be just fine then
Ok, thanks
Hello, does anyone know why ClientboundRemoveEntitiesPacket or PacketPlayOutEntityDestroy for spigot, is not removing arrows? Is there any alternative packet for it?
e.getItems().clear();
e.getBlock().getDrops().clear();
e.getBlockState().getBlock().getDrops().clear();
which one of these actually removes the block drops
java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.EnderDragon$Phase.equals(Object)" because the return value of "org.bukkit.event.entity.EnderDragonChangePhaseEvent.getCurrentPhase()" is null
why is it null?
When setting a block to a type of wall, it doesn't attach to nearby blocks. How can I update the block? I tried blockdata but to no avail?
send the code you use to set the block
public void doorFill(World world, int startX, int startY, int startZ) {
for (int y = 0; y < doorHeight; y++) {
for (int z = 0; z < doorWidth; z++) {
int finalY = y;
int finalZ = z;
Bukkit.getScheduler().runTaskLater(plugin, () -> {
Location blockLocation = new Location(world, startX, startY - finalY, startZ + finalZ);
blockLocation.getBlock().setType(Material.DIORITE_WALL);
}, y * 4);
}
}
}
I managed to get it working using a command block that replaces the wall with the fixed version
Not how I'd like it but it works
What version are you on?
1.20.1
You now have to use a component constructor instead of just sending a message?
Yikes

TextComponent#fromLegacyText(String)
I need someone to slap my IDE away from me
I just have to go do something else man, I'm going to end up having the ide burnt into my retinas at this pace
How do you usually do it so that if the player should have an item in his inventory and it should always be there and not be duplicated (In creative), what can I do then?
And it should never disappear regardless if the player dies, and the item should not drop if the player dies
Is there a special / easy way to do it or do you just have to set up a bunch of events etc.?
Listen to a bunch of events and prevent the item from being moved
You could try force updating the state. But you will probably end up scanning adjacent blocks and changing the BlockData accordingly.
As soon as you click on the item in creative, it is duplicated, do I have to use creative events etc.?
Yeah, creative is a special needs gamemode
https://paste.md-5.net/eyepimicer.java is this similar to applying composition?
Looks more like a facade pattern to me
Or proxy
I tried to get rid of inheritance
if you're talking about "override" line then it's because of the interface
I see
How then, in this case, can we derive general methods?
Nope looks fine then
oh cool
Not entirely sure why you need the interface in this case
using composition, I brought common methods for descendants into a separate class and then used an interface so that another descendant would execute its code in the same methods
but with changed parameters
I just didnโt show the whole class, it has its own methods
I mean. It kind of is composition in the sense that you delegate specific responsibilities to different components.
But im not sold on the Players and ConfigFactorys relation to your "StandardRtp" class.
Factory contains all the necessary configs for the class. I use it in its entirety to conveniently "reload files"
it's used in this class like I said, I just didn't show the whole class.
is there an alternate way to showing floating items with an invis armor stand
damn gotta update my spigot then
also
is there some feature for intellij that allows you to do something simular to this?
https://www.spigotmc.org/threads/tutorial-live-eclipse-plugin-development-for-spigot-servers.64362/
yeah just use run configs
one to start the server and add the remote jvm debug flag then just start both and you have the server plus debugger, if its just the debugger you want add the flag outside ij then start the server then start the debug config
is the main file for the server supposed to be the server's jar?
What does make a file the "main file" to you?
not quite sure, the file i am rnning?
Well, then sure. You are starting a jvm and running the jar.
Why do you ask?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
trying to make sure because ive never done something like that before, but seems like someone dropped a resource which seems to do what i need
You should probably not touch this jar...
good to know for next time
How do I make it so that you can only write a special subcommand, otherwise you get this error?
Bukkit commands don't work like that unfortunately. You would have to turn to something like Luck's Commodore library
brigadier
Yes, which is at least somewhat better exposed by Commodore
Okay, but is a jar file needed for brigadier or is it just to add to the project according to the documentation on github
Can i load serve negative space fonts without player knowledge and this screen meant for acceptance?
So player join and he don't have to accept any resourcepack it's just loaded without his knowledge
You can certainly not let the client load anything without his agreement.
So it's not possible?
No that would be completely insane ๐
It would be fun XD
it could also probably get you sued
rce the client
Sad
Anyway thanks. That's what i thought after looking at wiki but i thought you could override it
Just kick them if they don't use the resource pack
