#help-development
1 messages · Page 1017 of 1
Issue in the code:
If shift is spammed irregularly or simply occasionally, the code doesnt work and player is dismounted
Attempted fix:
Cancelling dismount on both the packet and the bukkit event
is there a way to create a chat input thing easily? like a public api maybe
so like i do a thing and if a player types something i get that one message then no more
when do you set the player uuid on the pet?
I mean there is the conversation api, not sure if that’s what u wanted tho
In the link to the code, it is set in the event PlayerInteractAtEntityEvent
By default when the pet is spawned with /pets spawn, its null
oh mb im just blind i guess
nw
so you want players to not unmount ever?
have you tried setting them as a passenger as well as canceling the event?
Forcing them to mount again
cancelling the event didnt work in any case
Its like it isnt even cancelled when I ask it to cancel
(In bukkit events ^ for mounting)
(In packet I tried it but it was being weird, so I settled for remounting)
yes*
but only if they do a command (in future there will be a gui button)
oh i see
you might have to delay the remount
maybe its not fully dismounted when the event gets called, so add passenger would get overriden right after
that would effect the purpose of it happening before the player gets dismounted
oh?
Give me a bit to process that in my peanut brain
thats just a guess
like they call the dismount event, but in the next line they remove the passenger
so if you add passenger before that it wont matter
check if there is a passenger on the pet in the dismount event
if not then idk
so then I should add a passenger after doing a line that cancels the event
aight I have one more issue which is related to setting velocity of an interaction entity
ill get to it if I manage to fix this
yeah or schedule the remount to be in the next tick
but idk if that looks good in game
doesnt*
and imagine that being as buggy while you are flying a plane
since ill need it to parse controls like throttle
unless you tied some plane control to dismount key I guess
that is to act like a control key, just like WASD
right
The way pet works is that its basically a combination of seat and the vehicle
then its hard to say
so player right clicks to get on it
but to get off must use /pets dismount
but with current code he can spam shift irregularly and manage to get off
But I want to use shift to say do something else
and that something else can require shift to be spammed irregularly
What version of Spigot are you writing this for?
Okay so I tried using event cancel again and just like before the weird behavior occurs
if(pet.getPlayerUUID() != null) {
i.addPassenger(Objects.requireNonNull(Bukkit.getPlayer(p),"Bukkit Player from UUID fetch failed."));
event.setCancelled(true);
}
``` and I also tried
```java
if(pet.getPlayerUUID() != null) {
event.setCancelled(true);
i.addPassenger(Objects.requireNonNull(Bukkit.getPlayer(p),"Bukkit Player from UUID fetch failed."));
}
1.20.4
(actually papermc which brings note to should I be asking this in spigotmc discord)
ok, just there was a bug with dismounting in 1.16 (fixed in 1.17)
oh okay
behavior may differ
I can only record and show you the video regarding the behavior if u want
but fact is this code didnt work atleast
Hey there, I'm currently working on a small MC plugin (it's a gamemode where you collect points) to play with friends and I'm kinda stuck on a problem I can't seem to resolve, could anyone please help me out?
The problem is basically, that when I start the gamemode, I set a scoreboard on the sidebar, when I leave, the sidebar dissapears and I would like to add the sidebar back, I have a listener that waits for the PlayerJoinEvent to then add the sidebar back but when I set the sidebar there, it never shows up, I tried many things already like creating a new instance, delaying the creation a bit etc. but it still just doesn't show up anymore :/
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Of cource! Wanted to wait first 😄
?paste to make it readable and not spam
thanks
and whats not working? gotta keep track of the score somewhere
This is the participant of the game, that holds the player and the scoreboard
And this is the join event where it triggers that
ok I can see one issue
That's kept on the participant
You are storing a Player reference in yoru Participant class
I removed some code in the example to only show the relevant stuff
When a player leaves adn rejoins the Player object is new
Its not the same Player object you had before
conclusion: use an UUID (player.getUniqueId())
Ohhh okay that makes sense
dont even use a name, names may change, an uuid always stays persistent
umm okay so id just like to apologize for wasting yours and elgarl's time all because I mistook what .getDismounted and .getEntity meant.... damn it xd
thanks for trying to help!
I'll try to adjust it with that in mind, thank you, didn't know that! 🙂
after death event, if you set a drops itemstack amount to 0, would that remove it or error?
Btw stefan theres also an OfflinePlayer in bukkit I think
im not sure if my addition to the discussion is relevant but thought I should try mentioning
OfflinePlayer is safe, but its best to use UUID
Thank you, I'll look at that too!
I am facing an issue at the moment
if(e.getKey() == ControlKey.JUMP) {
PetFrame pet = Pets.getInstance().checkPetRider(e.getPlayerUUID());
if(pet == null) return;
Interaction i = pet.getInteraction();
Vector velocity = i.getVelocity().setY(4);
i.setVelocity(velocity);
pet.getModel().setVelocity(velocity);
}
``` (small bit of code so I didnt use paste bin)
Trying to make the "pet" jump but nothing happens
Nothing as in nothing literally, no errors or issue in code not being processed
Ive tried putting a p.sendMessage at the end of the if statement body and it printed just fine
Not sure Interact entities support the use of gravity
^ was wondering, is there no way to get them to?
since they do seem to have .setGravity
Thats just because they extend Entity
oh okay... still question is it not possible to apply velocity on them?
Like setting noAI on an entity stops it applying gravity
oh I see
so I have to use a different entity you say?
I do need the interaction and display item entity moving still...
most likely
Is it a good idea to make my own velocity system for them?
In the form of teleporting them from pos to pos
it may be better than adding more entities
Hmm okay thanks
sorry to ping but think you can help me with making a velocity system?
I figured I need to have a scheduler start/stop whenever I set the velocity of the interaction entity with vectors
The calculations would be hard for me to manage think you can help?
The idea would be to teleport it by a very small distance every tick?
just have a single task running every tick
Hey guy
^ sounds painful to the eyes right?
or would it actually be smooth
how to make monster spawn naturally at daytime like nighttime?
if you do it every tick (if it moved) it would be smooth
one task to handle all your entities
my code?
no he was talking to me
Not possible
I believe you will have to make a new spawning system
As in performing multiple checks and randomizing then spawning your entity
i'm tried to make a fork cuz i can fully access spigot, nms code but i can't found the way to do this
show more
Being a rookie here i cant help in detail but the general idea would be to get a random surface block and spawn the monster if conditions like no water, no lava, biome, etc match up
now the random surface block part sounds like a beating to the performance
The SImplest way (without forking Spigot). Copy your world and set it to alwasy night.
then copy mobs from it to your daytime world
weird it works now ...
good idea but I think the intention is to perhaps make monsters not burn in the day and also to spawn them during day
You would have to track chunks being loaded/unloaded in your main world and duplicate in the dark world
oh thats a good idea. Players have a local time
iam getting this problem now :
what should i add?
also i need this specfic versions ..
Why are you ysing system files?
cuz this versions are not online like i can't use normal way
The system scope is deprecated and shouldn't be used
if you must do it install the jar to your local maven repo
also I don't see why you need to depend on fawe like that
Just use the WorldEdit API
they are for 1.13.2 < and older
and i also have support for newer versions
🙂
so you have no reason?
Hello I'm trying to do a multi language system and I ran into the first problem. When I try to save every supported language then it's only generate the messages_en.yml but not the others. (The files are generated but it's empty except the english one)
?paste
thx
are they empty in the jar
No
show more (actual) code
Main class: https://paste.md-5.net/ubuxedihax.java
Language class: https://paste.md-5.net/uvovohanej.java
Did you remove the old files before testing
Yes
you create your language = new Language before you have saved yoru resources
and yoru Language class saves
Damn, I didn't notice it. Thanks! 😄
is this correct?
yes but why not use the latest version? and also bukkit depends on core, no need to specify both
just only use worldedit-bukkit version 7.3.2
Thank you guys, got it to work with the UUID! 🥳
Does spigot generate a data directory (plugins/{plugin_name}) for all plugins or only for those that create a config or the dir itself
I hope, thanks
what does it do though
Do you want a short or a long explanation
short
Fake plugins inside of real plugins that immidiately get unloaded so the real plugin can get loaded by my plugin without spigot complaining or loading it itself or needing a seperate directory
@shadow night this is correct 🙂
Thanks
I read fake plugins and can confirm that this is indeed cursed
yes
What are we coding in .txt editors now?
what
Sec getting off the plane
you what
What the hell is a fake plugin inside of a real one
Ehh hard to explain
Then don’t I won’t remember it’s been too long of a day
hi alex
and hi cutie
hi Зяблик
hewwooo
how do i approach making leaderboards
why did I see leatherboards
idk bc you're blind?
i would begin mindlessly typing class LeaderBoardManager...
object* 🤓☝️
(i use objects bc i only have one instance)
ok bro
probably abusing kotlin now lol
class Plugin : JavaPlugin() {
override fun onEnable() { plugin = this }
companion object {
lateinit var plugin: JavaPlugin
}
}
how is this abuse
lemme just add @JvmStatic rq
not even JavaPlugin.getPlugin
wtf is lateinit
allows you to delay initialising a variable and be like "trust me bro, i got this" when accessing
will throw if uninitalised
to avoid declaring a variable as nullable and having to initialize it in a constuctor of some sorts
Hi there I have a weird issue with my plugin that I made where it says the libraries field is empty and because of that it doesn’t load on bungee.
The field is indeed not set because I am not using it but why doesn’t it load the plugin then?
Using the latest proxy version with 1.20.6 sub servers
just shout HELP HELP and a magic fairy will come and fix it
I’m no fairy but I do have a wand to wave
Hello friends, do you know if there is a way to mute a goat horn? I haven't seen anything in the docs but maybe I've overseen smth
Deny interact event perhaps?
who even writes MineCraft like this
Bukkit developers from 2011 ish
Isn’t that enum already keyed?
looks like it was wolverness himself
fwiw, Sound should probably become registry based as well
No, Wolverness just made JD changes. The commit I linked is the original
nah thats another commit, i see
I thought they were https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Registry.html#SOUNDS
They are, but the Sound class is still an enum
They're not pulled from the registry
ah
Programming is aids sometimes, why do we do it? Because it’s fun and logical to intentionally hurt our own brains
facts
I have this code for hiding/showing players on the tab list which works well but I cant help but think it looks a bit scuffed so I was wondering if there are better practices :p also hi mr radsteve o/
private fun sendTablistPacket(visible: Boolean, bukkitPlayer: Player) {
val profile = (bukkitPlayer as CraftPlayer).profile
val entry = ClientboundPlayerInfoUpdatePacket.Entry(
bukkitPlayer.uniqueId, profile, visible, -1, GameType.DEFAULT_MODE, null, null
)
val packet = ClientboundPlayerInfoUpdatePacket(
EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED),
Collections.singletonList(bukkitPlayer.handle)
)
val field = packet.javaClass.getDeclaredField("c")
field.isAccessible = true
field.set(packet, listOf(entry))
Bukkit.getOnlinePlayers().forEach { (it as CraftPlayer).handle.connection.send(packet) }
}
I mean, if your brain never hurts then you know it’s not growing cuz no growing pains duh
hello suit
so ominous
why are you using reflection
This is why
this is totally possible without reflection
check mci repo
ill be honest no clue why i used reflection
what are you doing on a developer discord then? haha
I mean you guys are fun 😄
Also I’m bricked in the head sometimes and need guidance
But mainly the former
Gonna get lessons from trooper soon, that’ll be fun
@lean arrow you can totally just ```kt
fun sendTabListPacket(visible: Boolean, bukkitPlayer: Player) {
val profile = (bukkitPlayer as CraftPlayer).profile
val entry = ClientboundPlayerInfoUpdatePacket.Entry(
bukkitPlayer.uniqueId,
profile,
visible,
-1,
GameType.DEFAULT_MODE,
null,
null
)
val packet =
ClientboundPlayerInfoUpdatePacket(EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED), entry)
Bukkit.getOnlinePlayers()
.forEach { (it as CraftPlayer).handle.connection.sendPacket(packet) }
}
🤓 nerds
add the ServerPlayer ig?
tried that but then it doesnt remove it it just keeps it
tried to make a new ServerPlayer instance too
but couldnt get that to work
i could make a new one
but it wouldnt hide
idk why
you could try this https://github.com/PaperMC/Paper/pull/10392
nvm that's paper PlayerProfiles
cold
Bruh
try with packetevents then lol
my reflection worked
it just looked ugly so i was curious if there was a neater way for it
it does what youd think it does
this what the tablist looks like with everyone hidden la wl
idk what it would do
idk this totally works for me on .6
fun hidePlayer(bukkitPlayer: Player) {
val profile = (bukkitPlayer as CraftPlayer).profile
val entry = ClientboundPlayerInfoUpdatePacket.Entry(
bukkitPlayer.uniqueId,
profile,
false,
-1,
GameType.DEFAULT_MODE,
null,
null
)
val packet =
ClientboundPlayerInfoUpdatePacket(EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED), entry)
Bukkit.getOnlinePlayers()
.forEach { (it as CraftPlayer).handle.connection.sendPacket(packet) }
}
who is
good question
variable: says its mutable
i try to add elements
variable: i am not mutable wtfrick
java moment
so relatable tho
its java code, kotlin cannot know if its mutable or not
all java collections are mutable by definition
oh it's kotlin
no idea how stuff works there
but if you can achieve something as broken as this, well, it's not really fun
i assumed it was kotlin, no reason why it would say (Mutable) otherwise
yea it is
item flags are not working
ok
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
look at the pfp of the creator
Yk what that reminds me of?
it feels like
raydan no
Lmao
im gonna kill your child with a fork
wild
libc terms ofc
what
yeayea ofc
One left
ebic?
Ye
Never said it's bad
Hating something generally refers to the feeling of it being bad
It just became a lil meme I'm posting every kotlin time
I sometimes use kotlin too
What do you think python worse than kotlin?
Kotlin is kinda the python of jvm langs
Lol
This is way too subjective to be an "idea"
Ideas are subjective, but this one is too subjective to be an idea
true
but better
Hey, do someone know a resource on making npc for 1.20? I can't find anything useful
Smile really went all in
#help-server next time, and try citizens
tbh kotlin is probably similar to plain java, just basically the syntax is different right?
I mean programming
that's about it?
using nms
less bloat
yea and some qol stuff
fairs
Mmm
honestly probs not even hard to learn
nah
I'd just recognize it from damn gradle kts 💀
p easy to switch acc
I mean I aint looking to switch entirely
just to learn the syntax
then I'll become an android dev! 💀
I feel like you could do this with api, but I don’t know any nms resources related to that
compose is actually pretty nice
just follow the jetpack compose tutorial to become an android dev
yea
i believe it has a native variant too now
I don't think you can create a npc with spigot api
no more css or other bullshit
oh god I aint wanna work on frontend, nvm, backend it is
Ehm it’s rather depends what you wanna do with it
just do ktx.html + htmx
flutter is decent haven't used rnative
wtf??
Fourteen what did that reply mean when I asked about swift btw, I don’t get it
for their home button app list
interact with it move it...
swift where
Entities are rideable are they not
.setVelocity is a method in Interaction entity (or actually what it extends-> Entity) but when I try to set its velocity nothing happens. Is there a way to get around this if its intended or am I actually doing something wrong?
(yes ive asked this before but now I see more faces in this channel so im asking again as its not solved)
Did you see the javadoc by chance?
not ride them xd
Send me an ss if you have it
me?
Yes
i will rn yes give me a second
Do you mean like custom ai
I did just now yes
It doesnt mention .setVelocity thats for sure
but in Entity class which it extends... it did
aaaa sorry
sorry
If you’re using paper, go get help from them haha or else you’ll get bullied here
I mean, I just want to spawn the npc for the moment, but all guides i found are outdated
It’s no worries man haha
bullying people for using paper, damn
spigotmc moment
I guess I need more context kek
If not me it’d be someone else haha
true lmao
And I least I put it in a nicer way
guides on internet are outdated and can't find a properly guide on how to create a npc
so i asked if someone knew a resource
I meant what’s this npc you’re talking about
What’s its function
How is it visually represented, ie: like a zombie or villager or wtv
a fake player?
Oh Breh
Had me thinking you were doing something else
@eternal oxide you should help because I am not gonna be useful here especially not with no sleep 😦
yes please 🙏
Anyways bedtime goodbye friends
There are two ways to create "fake" players. You have to decide which you prefer.
Creating an actual Entity that players can interact with, or a Packet based one.
In both instances you will be sending packets but one is less work (packet based) if you just want a representation that stands there
Both require nms
I was wrong imagine that
:o
Then i would like to learn both ways
I prefer the spawned version as it's easier to deal with and you can listen to Bukkit events for interactions etc
I think the one I'm trying to do is the packet based
Step 1, setup a plugin to use spigot --remapped (special source)
yes
so long as you also have the special source plugin
brb 5 mins. have to make wifes dinner
If you mean downloading from buildtools i do
No the specialsource plugin goes in yoru pom to handle remapping
Oh yea, did that too
ok then with just packets you will need java ClientboundPlayerInfoPacket ClientboundAddPlayerPacket ClientboundRotateHeadPacket ClientboundSetEntityDataPacket
If you write kotlin like you were to write Java I think rad would personally come after you :^)
lmaooo
I write kotlin somewhat similarly to my java I just use the syntax sugar
as you are only looking to spawn ti you can just use a ServerPlayer (as you are doing no more)
I don't like extension functions in most scenarios etc etc
Last time I wrote kotlin it was quite a bit of an abomination
Where can i see existing packets?
?paste
to be fair that is the same strategy I use for writing groovy code at times and noone is going after me
Because nobody mains groovy
i'll be doing more, but if I can see the existing packets i guess I can make an idea on how to make it (i guess)
nonetheless your gifs which I assume is directed personally towards rad
Nobody writes groovy so you don't have to worry about that
well… groovy is a different breed
tbh, I am starting to main it
Nah, it's just a meme that only I understand
well not main main - but I'm getting the gist of most of it
oh gosh
basically begging to get flamed by the entire programming community
but yea I suppose if u dont like kotlin for gradle
groovy it is
I mean it's not that bad
Idk, I’ve had pretty bad experiences w it
or better said, aside from it being near impossible to debug it's a good language
Couldnt say it better
Most groovy users are java users that use gradle
ooh, so i have to send the packet to each player
to any player you want to see it
Can that cause some lag or is minimal?
no lag
yea yea
And to see all the existing packets is there a page?
Not only gradle
its easy to find them when using remapped
just start typing ClientBound...
Your ide shoudl start suggesting
Oh yea, it does
Okay, thank you so much!
I'll try and see what i can make with this
come back when you get stuck 🙂
The way I have remapped it uses ClientBoundPlayerInfoUpdatePacket instead of ClientboundPlayerInfoPacket
Should I change my remap or just use it like that?
probably, mine is still coded for 1.19 so needs updating
And instead of AddPlayer AddEntity
btw using packets like this you have to update for EVERY version of Spigot
It's the same but yea
I don;t think so
Is there other way?
addEntity is different I believe
Not really. You could use ProtocolLib and leave it upto others to update
what version spigot?
1.20.6
uuh
tempting
i don't think protocol have 1.20.6 support still
Yea, that's why I came here xd
also NMSUtils doesn't exist
oh my Spigot deprecated org.bukkit.util.Consumer
finally
why tf does bukkit have its own
old times
Do you have to send the packet every time a player joins?
yes
quick question. datapack I threw together worked fine in 1.20.4, but the loot tables no longer work in 1.20.6. is it a name change issue?
btw elgar, ClientboundSetEntityDataPacket changed as well
It requires now a List with entity data if i'm not wrong
and I don't think a cast as intelijj is suggesting will solve that
At this point i'm thinking protocollib is the way xd
Mojang changes stuff all the time
Datapaxks break quite frequently
yeah thats just a packDirty
what?
ClientboundSetEntityDataPacket entityData = new ClientboundSetEntityDataPacket(npc.getId(), npc.getEntityData().packDirty());
yeah evidently they changed some stuff in the loot tables
annoying but it's fine
@eternal oxideI'm sorry, but tried compiling and it says "Unsupported class file major version 65" even if I'm using java 21 - tried with 17 as well
sounds like your IDE is not running 21
is your JAVA_HOME also set for 21?
Outdated special source plugin?
looks like
What do you mean?
Here right?
2.0.3
yep
I think i got it from a guy with version 1.17 so it makes sense xd
mb thanks
It did compile now, thanks!
man so in my vault plugin i just had the idea that if an admin is viewing someones vault and the person is also viewing their vault how would i sync the changes live
cuz id have to right cuz otherwise the player or the admin could risk loosing items
is there maybe a way that I could store the vault itself as an inventory object and just open it to both people....?
Open the same inventory instance
1.2.2 is like forever ago
well... time to rewrite a heck ton of code
you should use open me
i will use whatever that is im done rewriting a heck ton of code
i have to change how the code is structured almost entirely
would be quite smart to prolly do the same for the vault list menu too
worst thing is that i thought of that literally as i wrote the last line of code for the admin viewing thing
so it works perfectly fine but because of that tiny detail i must now rewrite it all
1.20.6 changed a lot of its methods lol
I think i'll downgrade version, as thing aren't working
just make them a viewer of the same inventory
yeah yeah i will but i still have to rewrite a bunch of code
to just make them a viewer?
well you see i didnt think of this one edge case till quite literally the very last moment
it shouldn't drastically change your code to make them a viewer, its part of the inventory api to do it
well there will be quite big changes because of how my plugin is doing what its doing
but well.
wait one query
InventoryCloseEvent will fire when the last of them closes the inventory right
depends on which inventory it is
but I am pretty sure it fires for every player that closes said inventory
yes
Just implement an inventory and viewer system
also ehm what if theres some specific stuff the admin isnt supposed to be able to view in the inventory
cuz like in my current thingy the admin view allows the admin to see the vault but at the bottom theres a few buttons he may not be allowed to see
but the normal player might be able to see said buttons
idk why you have to over complicate it
well basically they can only view the buttons if they have perms for using the button
its a feature
i swear
so the player might have perms to delete his vault
but the admin wont have perms to delete others' vaults
Well, either they are admin with adminstrative powers or they are not. If they are, don't really see why anything should be hidden from the admin
then just don't give admins the perms
well they are but i want to make sure the server owner can give them only the perms they wanna
who cares if they see the button or not? it shouldn't work if they have no perms
alright ig ill just show the button anyway but instead stop them when they wanna press it
reason i like to do it that way is because if i then send them a message that they arent allowed to do that then they have to close the gui and look at chat to see it and it could also get lost in a busy chat
so i just hide the button alltogether
well, if nothing happens pretty sure they get the idea that they are not allowed to use it 😛
yeah i guess...
welp
still have to rewrite quite a lot of code
better get going
actually.... um... the players can change the names of the vaults so if a vault is open for the admin and the name is changed i dont think the inventory will lemme change the title at that instant
nvm ill just get a viewer list and rename their open inventories
title of an inventory should be irrelevant and not used for anything special other then just visuals
just realised multiple admins could view one vault so ig its useful to have that viewer list
well it is visuals
name
my point is, inventory object will be the same whether the title changes or not
and therefore it makes no difference if an inventory is opened at the time. When it gets opened again it can be updated
ye ye
ill just maintain a viewer list
also whos decision was it to not make inventorycloseevent fire when a server stops
how call event if server stopped
finally block lol
well you could close every player's inventory when the server's closing
you fire playerleaveevent dont you
wait you dont
damn.
cant say i fire any events
why would you bother closing anything in the game if the entire application is going to stop
well yeah
anyway with the new structure i have in mind it should solve theoretically any issue that the plugin may currently have
noice.
so much FRICKIN typing
for a goddamn vault plugin
bit much work for a public plugin but ITS FO DA PEEPLE
if that is what you want
PlayerVaultsX charges 11 USD for less features
is that who you are trying to compete against?
it sounds exactly like competing
I just play some games when I am bored
ye ill play some games tomorrow, and the rest of june
well I doubt it will become as large as this
https://github.com/frostalf/holoapi
oh no way
cant even imagine competing with that
how could i ever compete with a plugin with a poorly formatted .md file
e
anyways, just saying good news doubt your plugin would become as complex as that 😛
fyi, holoapi was the first holograms plugin to exist 😄
the second was holographicdisplays
my most popular public plugin rn is
an older version of whaat im making
my v2 of this is solving all the issues it has and adding some good stuff
lol my highest user base is in China
GM
ngl
earth's highest user base is in china
Interesting its China that uses it
I suppose it didn't help that many people kept claiming GM to be bad and horrible 😦
ayo wait elgar was the one who made gm?
yeah
I still use it 🙂
what exactly is gm because i think i have no idea
I am properly one of the few proud users of it and supporter of it that I recommend people to use it lmao
groupmanager
its a permissions plugin
I mean I transitioned onto my own permissions system
oh i think i might have heard of it
i think some people i know use it but 99% use lp
before LP came out it was teh most used permission plugin. Being the first
yep, had over 2 million servers installs at one point
elgar is a W confirmed
W?
winner
ah
/ win
I think its cool such people like us exist here
woo
im just grateful people liked my first vault plugin and it got 1k+ downloads considering how badly written it was
HoloAPI and then later holographic displays made Holograms so popular that it made Mojang hesitate in fixing the horse age bug, and that is how we got armorstands
lmaoo
Then we have ElgarL with GM and basically bringing permissions to the world
I mean tbh bukkit kinda brought permissions to the world - we just had to figure out how to use it 
in a way
well, not really. The permissions were quite basic and there really wasn't much api for it
most of the functionalities came from plugin
actually GM existed before Bukkit. I forget the name of the API even
oh it existed on hMod?
yeah that was it
oh sick
nice, never knew
please ban this person
this is the original source
oh
main class listener my beloved
I like their synchronized, but thats about all
cs = component to string
sc = string to component
c = component(although not accurate)
dbg = debug```
Charge an absolute fortune. That formatting is horrid
He made a list wrapper that instead of throwing errors it just returns null
lmao
holy fuck
CTRL+SHIFT+F
I'd charge like 150$ just to clean this up
easily
final static Material AIR = Material.AIR 🗿
so now he has to type Conf.AIR. Its shorter 🙂
lmao
XDDDDDDDD
well now i know i definitely do not write the worst code
whenever you do something, there is always someone that can do it better
unless that's me, i write the best code ever, yeah
real
hello, i want to write a spigot plugin which can execute a bungeecord command on the proxy.
just to confirm, i need to register the messenger:
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
and execute it like this?
ProxyServer.getInstance().getPluginManager().dispatchCommand(ProxyServer.getInstance().getConsole(), your_command);
its a bit confusing
you need to send a plugin message
easiest way to do it I suppose
or just initiate a connection to your own plugin
both are easy to do
are you saying the way i outlined is the easiest way or what
or the plugin message
What's the best way of making an entity make a sound when player is near the entity?
I mean, I don't want to create too much overhead.
its just a packet
But I was thinking it would be pretty nice if these made sounds.
schedule it every second
If its loaded, tick it
yeah
You might have to be a little bit more specific how you mean exactly. I might not be familiar with this approach.
Do you mean like bukkit scheduler and loop all entities ?
i would recommend you to store location
just the chunk entities
or via locations
and you can tick the distance to locations
I would get those via player's ? Or is there some way to just get all loaded chunks?
player get location get block get chunk
Right and create a list from those. And then loop all entities which are item frames which contain clock from those chunks.
get the chunk coord entity is in, store that as a key, anytime player moves check the chunk coord compare with the key
But what do you mean by ticking the distance to locations?
that's method 2
you store location in a map when a player puts a clock in item frame
you will want to avoid looping lists in this case as that would be your major slow down
Oh?
exactly
Well, what then?
a hashmap or similar
Oh you just meant the literal List<T>. Okay. Sure.
probably a list would be enough
or a List, but I recall you needed to loop with a list?
yeah, contains is proportional to the size of the list
alternative to hashmap is a hashset
well, you can't really contains it
list is the best
you can loop it and check distance to the player
you can use a map if you have multiple worlds
I'd not bother with a distance
Map world list<location>
if its loaded play a sound at the location
You would just always play?
sounds have a range so only play when a player gets close enough
still needs to know the location of the clock
That seems like the opposite of what you just said.
if you send a playSound packet to a client that is out of range it will not play
oh
Yep you need the location is all
Right so just always play?
Ok, so I'm thinking something like this?
https://pastebin.com/raw/K5wfBv8g
So you would grab the entity when it's placed and store in a database?
yea
if you don;t do the check too often just use World#getEntitiesByClass
Well, how would you detect if it's in a loaded chunk then?
it will return null
will give you a Collection of that specific Entity.
oh it's world, yeah
I'm not sure I understood what the advice was for this last one 🤔
If I store all the item frame-placed clocks in a database - my question was, how would I efficiently check if they are in a loaded chunk and should be playing sounds?
The issue with you storing them is when your db gets out of sync
somethign breaks a clock
Okay ... so you recommend I get all entities by class instead?
just have an event for that
just grab all the clocks every 5 sconds.
And does that return only entities in loaded chunks?
unloaded entities shoudl not be returned
Okay, well that sounds like a plan then.
but it doesn;t even matter if one is, you are only sending a playSound to its location. You are not interacting with anything
so update your list every 5 (or so) seconds, and do a playsound every second for any in the list
I should do a null check probably for them?
if it can be null check for it
In case they have been unloaded in the mean time.
yep
It won’t be null it’ll be invalid
i wanna write this myself
no need to extra process when getting the entities
thats the heaviest part of teh code
just get them and put in your list
Okay, so something like ..
https://pastebin.com/raw/2N5tnBje
Why?
I guess two is ok
Well this way I was thinking I could update it less often and just keep playing the sounds there a few times.
one slow for getting the item frames and another one faster for playing the sound
Yeah, okay. Thanks a lot for the guidance. I'm going to test this out and see if i can get it working.
how do I check if a player is currently holding no item/has their fist out
can check if the item in their main/off hand is empty
get the players inventory and call the methods to get the itemstacks in their hands
Null or air
seems to be null
if its from a player, its not null
...
== null
thanks
hey you think it's possible to add a precreate .yml file in the plugin folder?
[ERROR] Failed to execute goal on project GreenTavernAPI: Could not resolve dependencies for project org.gt:GreenTavernAPI:jar:1.0-SNAPSHOT: Failed to collect dependencies at me.clip:placeholderapi:jar:2.11.4: Failed to read artifact descriptor for me.clip:placeholderapi:jar:2.11.4: Could not transfer artifact me.clip:placeholderapi:pom:2.11.4 from/to placeholderapi (https://repo.extendedclip.com/content/repositories/placeholderapi/): repo.extendedclip.com: Temporary failure in name resolution: Unknown host repo.extendedclip.com: Temporary failure in name resolution -> [Help 1] why i have problem here?
https://jitpack.io/com/github/MrTvistYT/GreenTavernAPI/v1.0.10/build.log
seems to work
^^
Should I then make another release and see if it works?
yes
So got strange problem I am compiling NBTAPI to my plugin
and after I relocate/shade it
on virustotal it is detected as virus
Ikarus
Trojan.Java.GenericGBA
and some windows users get it detected sometimes
if libs are not shaded there is no detection found
Yeah so are a lot of plugins
unless you want to believe everything someone else says then yes its a virus
otherwise, its just a false positive. If it was a real virus they wouldn't call it Generic lol
but why does it behave like that after shading
if I keep original package locations
there is not problem
because virus scanners are not in the habit of checking code of java applications thoroughly
but for example NBT api need to be shaded
Is it after shading or relocating
relocations probably break some hash check or something idfk antiviruses suck ass for java
Those are 2 different things
more likely that relocation modifies the manifest entries
oh true
relocating
is possible to avoid that
so I checked up on the Generic thing
and its most likely related to some kind of fetching from the jar
IE zip code related and something complaining about it in a non-specific way because its not exactly dangerous but can be if used incorrectly
but also not exactly malicious, hence virustotal giving it a generic status
as I said, if it there really was a virus, it wouldn't be a generic virus and would have an actual name for said virus XD
well I will just leave it then
Free Trojan with every download
Bargain
crazy
I am tring to contribute a new method to spigot Bukkit, which obvoisly requires changes to CraftBukkit as well. I have forked both repos, and have both open in intellij, and have made the appropiate changes in both repos. I would like to test it before I pull request it, but I am not sure how I am supposed to test it. The Contribution readme says run build tools, but how does that know where my changes are? Also, they are two different repos, so how do I connect them so I can actaully import the Bukkit interfaces?
Tbf idk how to do it with buildtools
I just mvn install Bukkit and then mvn package craftbukkit
With -P development
Just the command "mvn install Bukkit"
just “mvn install” in your Bukkit project
it do
Okay thanks I am going to give this a go, I thought the docs were saing it should be complied with build tools
Might try and update the contrubutions docs as I figure this out for myself
The docs are probably referring to compiling spigot itself.
Craftbukkit can be compiled by itself.
Although if you want an actual spigot jar, then yes, BuildTools has to be used.
https://paste.md-5.net/ejakajozew.bash
Do someone know why is this happening?
public ServerPlayer createNPC(Player player, String name) {
CraftPlayer craftPlayer = (CraftPlayer) player;
ServerPlayer serverPlayer = craftPlayer.getHandle();
MinecraftServer server = serverPlayer.getServer();
ServerLevel level = serverPlayer.serverLevel();
String translatedName = hexTranslator(name);
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), translatedName);
ServerPlayer npc = new ServerPlayer(server, level, gameProfile, ClientInformation.createDefault());
npc.setPos(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getY());
showAll(npc);
return npc;
}
private static void showAll(ServerPlayer npc) {
ClientboundPlayerInfoUpdatePacket playerInfoAdd = new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc);
ClientboundAddEntityPacket playerSpawn = new ClientboundAddEntityPacket(npc);
ClientboundRotateHeadPacket headRotation = new ClientboundRotateHeadPacket(npc, (byte) Math.floor(npc.getYHeadRot() * 256f / 360f));
ClientboundSetEntityDataPacket entityData = new ClientboundSetEntityDataPacket(npc.getId(), npc.getEntityData().packDirty());
for (Player player : Bukkit.getOnlinePlayers()) {
ServerGamePacketListenerImpl connection = ((CraftPlayer) player).getHandle().connection;
connection.send(playerInfoAdd); // Inform client this Entity exists.
connection.send(playerSpawn); // Spawn this entity on the client.
connection.send(entityData); // EntityData (Packet based Entity) to show skins.
connection.send(headRotation);
}
}```
You need to mvn install Bukkit first
The error line is the first packet
Probably the wrong import.
there's only one
uuh, how's that done? sorry
One question, why does he use the ClientboundPlayerInfoRemovePacket 2 seconds after? Is it to remove him from the tablist?
that packet removes from tablist correct
And why do you add that packet in a first moment? Is it necessary for the spawn?
its midnight
is there something from the spigot api to log to a file, creating a new file each time, compressing the files to .gz files, etc? or do i have to do all that manually
Can probably use log4j
they should just make their own, not like there is plenty of logging libs out there what is one more 😉
is that what spigot uses?
I believe that’s what minecraft uses, yes
Is there any way to detect when a player changes the command within a command block, or edits its settings?
Not that I know of. Command blocks are similar to Creative. The client has full control
You could try https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityChangeBlockEvent.html but its unlikely
yea i've tried that, it doesn't even fire when a command block is updated
Then its not covered in the API
A physics event probably fires when the type of command block is changed
Other than that tho
Having the weirdest issue at work 🤔
I made a little flood fill thing that scans locations, filters them and makes a "surface"
Except it's shifted a bunch and refuses to work if it transitions from negative coordinates to positive
math is hard 😉
I'm not doing anything that'd break like this
legit just changing every axis by 1 in each direction
no reason why it should stop
With no code my best guess would be you are fluffing some max/min calculation