#help-development
1 messages · Page 646 of 1
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Olivo how do you know so much?
coding i suppose?
i was finding this
ty
🤷♂️ I'm just a fast learner ( when it comes to computer stuff )
all good things come with time
I could code for ages and always forget the two most basic things and remember super complex shit
do you remember how to reverse a linked list?
I never did that as I said I could code for ages, but I don't lol
you'll never a get a job
smh smh
🤷♂️ was a joke often times you have to do technical interviews which kinda just suck
so I think you can probably just remove those methods. Perhaps mention the createBlockState() method in the javadoc for the transformer too, so people know how to create an arbitrary one
I can generally not do interviews at all
I'm just unable to talk to strangers for whatever reason
Same
I can't even drop a word
work on your social skills :P they're just as important (if not more important) as practical job skills
used to be the same way I get you, Lots of therapy and practice helped me mostly overcome my fear of talking to people lol
Like, for me I can somehow sometimes not open my mouth and in other cases I can talk like never before lol
why i got this warning ?
new Text() around the contents of the hover event
new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(...))
my instinct was to blame paper good thing choco is here
I mean that's also possible. iirc they deprecated like... everything BungeeChat-related
yes they did
they have a script for it xD
It’s driven me mad
this is why we don't use paperapi
choco when your bungeechat pr gonna be pulled lol
Yeah, this thing https://github.com/PaperMC/deprecated-bungeechat
Still, has some useful things
Just petty imo
don't they have some reason why its worse than adventure or whatever
They have a replacement, yes, but I still think deprecating the whole of BungeeChat is just unnecessary. It's still components. They still work
depends what you use if you make a jira feature request for it or find one it might get added here eventually
idk what kind API they add though I only ever use spigot and rarely find myself touching NMS outside of some component stuff
am i set my java method here ?
Hm?
I have a PR that completes the BungeeChat API in Bukkit
Just working on getting it merged
What makes me mad is I can’t use Maven with Paper’s remapped NMS
Unless I use a 3rd party plugin
@tender shard would this work in theory?
instead of the link i put the getconfig, i would do this for each song
put("intro", main.getConfig().getString("intro"));
Which could stop being worked on at any time
spigot needs a gradle special sources I want to make one, but I also don't wanna touch kotlin
but I seriously couldn't see myself making a gradle plugin in.. groovy
In a map?
@worldly ingot I'm curious about something, why does spigot take so long to shutdown vs paper I've noticed on my pc atleast spigot takes quite awhile to stop
Well the startup/shutdown procedures of Paper are seemingly more optimized. Probably something to do with chunks, it usually is.
I wonder how hard async chunk load would be to add
I think optifine does it 💀
embed fail
No, we are developers
It was not a fail, it was completely intended
But I regret at my decision and changed it
One question guys, how do I spawn a female?
Have been looking for one of them for too long, but can't find how to spawn them
World#spawn Female.class doesn't work
like a developer minus the man part
and developer part
ofcourse all people are different
I'm just speaking for my experiences
what is this ?
tab complete
in spigot is label ?
Mine is a developer ± the man part.
Where did you find her? Do they have a "known" spawn location, or do they spawn randomly?
I need answers, but you are generating more questions
how do i make tab complete for my commands ? in bungeecord btw i can't found in docs
may be u know coll
TabCompleter interface
Well for BungeeCord I'm not sure but it's probably the same
Yeah a'ight.
The functionality is exactly the same as in bukkit
in australia they sell weird bags full of wine called "goon"
Alex is drunk again, this was not predictable in the slightest.
Alex rn:
also I've never been to australia, i only know those weird goon wine bags from what people told me and from internet pictures
what is the onplayerjoinevent in bungeecord ?
is loginevent ?
There are multiple
Depends on what you're doing
Events fire when the player joins the network, before and after the player switches servers, tries joining a server etc
im trying to create yml file for player on join

:DDDD
well u are experienced can u give me idea ?
i will write
brb
i will store player's friend in yml file
but am i create yml on first join server ?
or do i create when someone adds friends?
but i will store some settings for player
like "toggle dm"
"toggle friend requests"
so i create store file on
when player change settings and add friends
Mhm
hi
You should just use a database at this point
how u do that

Is there someone who maybe knows what im doing wrong here. I am trying to create like an enum with Location so i created:
public enum Locations {
LOBBY_PROPHUNT(new Location(Bukkit.getWorld(Names.LOBBY_PROPHUNT.getValue()),8.5,-59,30.5,-180,0));
private final Location location;
Locations(Location location)
{
this.location = location;
}
public Location getLocation()
{
return location;
}
}
and i am calling it by using:
player.teleport(Locations.LOBBY_PROPHUNT.getLocation()); break;
but for some reason this created a NULL error, does someone know why?
Enums are not the kind of thing for this
Ah it's not that complex, basic SQL can be learned within like an hour or less.
Using sql in java is quite basic
What is a better thing for this?
can i have some help i am trying to make a plugin this is the second one i have ever made and i am trying to make a report plugin where someone can put in the comand/report then the usernam and then the reason and then it will ping curtain roles in a curtain channel in discord could someone help me with it
A "registry" also known as a facade class
You can have an enum for your keys
But it's backed by a map
That you can load from the config
Here's an easy demo
i have already go a discor bot working all i need help with is how can i make the report command ping a role in a discord server saying that the person whor reported has reported --- for ---
public enum LocationType {
SPAWN,
END
}
public class LocationRegistry {
private final Map<LocationType, Location> locationMap = new HashMap<>();
public void setLocation(LocationType type, Location location) { // Loop through your config and call this
locationMap.put(type, location);
}
public Location getLocation(LocationType type) {
return locationMap.get(type);
}
/*
public void load(ConfigurationSection section) {
...
}
*/
}
You need a way for your plugin to communicate with your bot.
Ohh so you like combine the ENUM with a Map to make it work with enums but the map handles the acual data
So you can eventually do
Player player = ...;
Location start = locationRegistry.getLocation(LocationType.SPAWN);
player.teleport(start);
Make sure you use DI for your locationRegistry and all
There's a number of ways to implement this. Hosting the bot through the plugin, hosting an API that the two can share, etc.
DI?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
i already have the discord bot running in the plugin how do i make a mc command relay info to beable to be used for the the ping of the roles
Oh yeah ofc
Thats no problem
Thank you for helping out and thank you for the quick respond
Generally for lists you store them as rows
Enums are a bit icky and I wouldn't use them with location objects because I've had issues with Bukkit.getWorld returning null
IE a list of homes would be stored in a homes table, with each row being a single home
If you're hosting the bot through the plugin, then you just have a method on your bot that tells it to ping. You call this method when the command is executed.
Yeah i made a few Enums with some have Locations some have just Names but now it generated an NULL exactly like you said
But ill make an Registry for all of them so im not using enums anymore
Yeah your classes are loading before the worlds are
Enums are nice in a few niche scenarios but they're not really extensible
could you help me structure it i am new to java
You need to modify the actual enum class in order to add functionality
Yeah i saw this online and just assumed it worked like i expected it to work
We're here to give you pointers, not to make your project for you
It's a rather complex thing to do for a beginner
I can't go too depth, I'm currently in the middle of something else. It's not difficult though, you just need to make the instance of your bot accessible to your command through its constructor, i.e.
public class MyCommand {
private final DiscordBot bot;
public MyCommand(DiscordBot bot) {
this.bot = bot;
}
}
^ If you're hosting your bot and your plugin in the same instance
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
grr I gotta make a cuboid class that doesn't use bukkit vectors
You could make the method abstract so it gets the world when you get the location
public enum Locations {
LOBBY_PROPHUNT() {
@Override
public Location getLocation() {
return new Location(Bukkit.getWorld(Names.LOBBY_PROPHUNT.getValue()),8.5,-59,30.5,-180,0);
}
};
public abstract Location getLocation();
}```
I think enums are cool
They are but this is not a good use case
So you're storing a mutable value in an enum
it's immutable in this context
but still, use proper database class 😄
and also prop hunt? 😄
i love prophunt
It's not that hard to write honestly
I gotta get writing minigames once I'm done with this skyblock stuff
I got so many ambitious projects
good luck
if i run a task with a delay of 0 ticks will it run the same tick (assuming sync context)
nope
it'll run next tick
minimum is 1 tick
thanks
Even just runTask happens next tick
my objective for this year is to make a competitor for SSB2 and like every single minigame out there
i like that it does, it's awsome in async stuff
you gonna make a tutorial? you thought of doing it a while back 👀
I have one
it's really really basic
and barely covers the phase chain
i might implement states in my minigames where necessary
well the only minigame I've made is kitpvp with like 19471 features but it's not exactly a minigame, it's more of an infinite megagame
You should be. Locations are mutable. Nothing stops you from doing something.getLocation().setX(-69);
true
so if there's anything for me to learn about minigames I'm down
but I'd just clone :p
If you're returning a Location from an otherwise immutable object, .clone()
I'll look into it after I finish my project and also the next 2 projects 😉
Sure
I gotta finish the discord bot, then the kitpvp, then I gotta stop slacking off on underscoreenchants, and by the time I'm done I'll probably have an idea for another non-minigame project
so fucking upsetting
@echo basalt what do you think? 😄
nms 
wait
what'd you censor
how are you gonna do a cool minigame without using nms where necessary?
Depends on the game
You don't need nms in most minigames
meh, nothing important
I won't sleep this night
i go to bed at like 4-5 am every day
I do not have fun
in general I do not have fun
I wanna commit blanket but I have to finish all my projects at first
and I rewatched my favorite anime from start to end yesterday
my sleep schedule checks out
i have this installed on my intellij idea now , but for some reason , i can't send packets ..
yeah
:p looks like enterprise code
I wanted to feel emotions again
I have so much stuff to convert to multi-platform
btw what's the point of creating an interface and then making an abstract class implementing it? never understood it
yeah but I want to understand the point
it's a design pattern
an uninstanceable parent class
The interface determines the logic and what is exposed to the API, the abstract class provides part of an implementation which can still have some abstract methods for each platform to impl
stinky, bet it can all be done in a single line
how do i create inventory i mean gui with bungeecord ?
The idea is that you expose no code while having a re-usable base
You don't
with some api ?
I never understood what "one line" means
magma likes to do shit in a single line
well like simplifying a bunch of code into a single line, maybe using a ton of builtins
Hello, i need to add an other plugin in dépendancy to my plugin form local. I use maven,y just compile the other plugin and add his local folder in my repository ?
knowing magma he might not even be joking rn
to piss me off or something
like, everything is considered one line since `\n' is a symbol
He was writing like his own scripting lang for his plugin and it was all just a huge switch statement
that is based
And I got so pissed we're "enemies" now
and he used to threaten to firebomb my house all the time
this is so nerdy
bro is literally making his own modelengine
he is the epitome of nerdy
But it's ok because I just blocked him and he doesn't show up there anymore
but I admire that
that's not what nerdy is
that just means smart
blockbench does all the math for you
now you're nitpicking
a bunch of super calls
Yeah
well makes sense
It's a pattern that naturally came to my mind when I decided to multi-platform all of this garbage
I would write Implementation instead of Impl
means you're a good dev
makes instancing the class go beyond the 120 character line ¯_(ツ)_/¯
I don't like to think of myself as one
btw what do you mean here by multiplatform? like spigot paper etc?
Industry has an ego problem
I'm a pioneer! I'm an explorer! I'm a programmer, and I'm coming! My code has animations! They're one line, it pumps tons of data through them fast! I like javascript too! I like to avoid exception handling! I like to replace comments with longer method names! I'm here! I've got a codebase! This is a programmer! This what we look like! This is what we program like! This is how our forefathers programmed! This is what I am! I'm a throwback! I'm here! I've got super hot fire repositories! I'm setting servers on fire! And programmers are turned on everywhere!
In theory you can run a velocity proxy, bungee proxy, a spigot instance and a minestom instance
you are well versed in areas of going
and they all work together
coding*
my immature ass after reading "I'm coming!"
😭
- I like JavaScript too!
didn't read further
In a rousing and inspirational call to embrace our humanity, Alex Jones says:
I'm a pioneer, I'm an explorer
I'm a human, and I'm coming!
I'm animated, I'm alive, my heart's big!
It's got hot blood, going through it fast.
..I like to fight too!
I like to eat! I like to have children!
..I'm here! I've got a life force!
This is a human, this is w...
ahh I see
lmao
My whole goal with the Enums is just to have a place where all the locations are stored so it easy to keep track and maybe makes changes in the future.
Ideally I want to make the "networks" system multi-platform too but it's a nightmare
this is a serious development channel, we are all serious grownups with business to mind, definitely not talking the weirdest shit here
I'd just use them as a set of keys and do all the changes in config
Duolingo is based
Yeah right now im redesigned everything to load everything into an HashMap at start of the plugin so everything is ready.
Not more than KFC Spain
ngl turns out that making a match have three ways of counting what wave they are on is a massive pain in the ass
I gotta write like an abstract publishing system or something
I'm scared, tell me more
this is really annoying
Got no clue how I'd do it
can you send some screenies plz Twitter is kinda blocked in my country and I do not wanna use a VPN rn
lmao
I want some KFC so bad
I'm releasing my tower defense plugin today
this took a stupid amount of work to get working
see you in 6 months
?
nice job
somehow I made two different support plugins for it
one for shading and one for acting as an api and in the future an easy and free way of displaying custom models
Now make a premium version 😈
all of it is free
the pathfinding solution that is made to be shaded, the plugin for managing in-game models and the tower defense game
but the td game will have two sets of premium maps on top of the free set and the free tutorial map
and people can just make their own levels
I really love open source development, but If you spent that much time, why don't make it freemium? Like, leave the source code open so people can compile themselves, but sell the compiled plugin
can u know ? any method have for add gui for bungeecord ?
idk maybe with api
n o
how do you expect that to look like
you cannot play BungeeCord
it's not a playable server
it's a proxy
there's no way to create a gui in bungeecord simply because a gui is not a thing in bungeecord
alright but
Is there something that allows me to communicate between the bungeecord and the spigot server?
yep
look it up
You can always create a bridge plugin and create your own inventory API for bungeecord, too much work tho
can i do gui with this ?
send a message from bungee to spigot
and make a gui in spigot
you cannot do it in bungee
But u will v get it sometime
Yes, you will need two plugins
because it DOES NOT EXIST there
god fucking damn it
not sure why you are obsessed with GUI's
people do that
BungeeCord is a minecraft proxy solution that originated because minecraft doesn't have any native way to send you to another server, so bungeecord "acts as a server" and does all the communication making the client think it's been connected to the same server for like 19 years
In your BungeeCord plugin, you will have to make like a GUI wrapper which doesn't actually uses Inventory API (because it doesn't exist), but contains a bunch of information such as inventory title, size and (maybe?) ported Material enum and an ItemStack wrapper with the same as your wrapped inventory
i do friend list in gui bcs better
It has no concept of items, inventory and any more.. convoluted system
Then send that data using messaging channels to a spigot plugin yo uhave, and read the wrapped inventory and items
You can send messages in it because sending a message is as easy as sending 1 packet
if this is a friend list, why are you trying to use bungee or need to communicate from bungee to the server? Just use a DB
I know, I'm just saying it requires lot of work if you want a complete inventory API in BungeeCord
I've seen a GUI on bungee but all it does is generate packets
Plus it won't be complete functional, as it will require a player to be at least on the server
actually u right
but it is complex in mysql ?
i mean storing lists
Storing a list in mysql?
depends on how you design your DB but in general no its not overly complex
How would I check if a player has any type of spawn egg
i will send a pic for example
declaration: package: org.bukkit.inventory, interface: Inventory
How can I create a zombie and store it as a member variable within a class without spawning it
You'd need nms for that
if i do with mysql be like this ?
No like check the item material to see if it is any type of spawn egg
Bukkit entities sadly have to be in the world
kind of
can u give me example ?
not right now no
You will need to iterate through the items the player has in his inventory, using Inventory#getContents and check if the itemstack material name contains SPAWN_EGG (don't) or have a "filter" of materials you want to "return true"
oke
brb
Like
Material[] m = new Material[]{Material.DIRT, Material.STONE}
for (ItemStack stack = inventory.getContens()) {
if (Arrays.stream(m).anyMatch(stack.getType()::equals)) {
return true;
}
}
return false;
Don't know if will even work
But I think you understand
god I love being lazy
I feel like this could've been done with regex
does chatgpt know regex?
but I admire your laziness
ChatGPT knows absolutely nothing
it should, but it's probably bad at it
So probably
honestly easier to build a regex by yourself
ask llama
i don't wanna learn the grammar
or Google bard
I know regex, I often use it to replace a lot of shit that I've done wrong
it was worth learning
I'm no professional ofc
i only know about s+w+e+a+r
but I can build a regex that fits my needs quite often
to block words on my mc server
Are charged creepers seen as EntityType.Creeper
I'm dumb, how do I check the flag
what database to use to save all online players of the server?
sqlite and mysql most likely, but what exactly do you wanna save?
Asking about your attempted solution rather than your actual problem
what exactly are you saving
I need to receive players who are on a proxy server
for example, to invite a player to a group located on another server
my debugger works but now I have to add some formatting and support for fields in nested objects D:
Fancy
is it posible to remove this so it will be like the other screenshot?
is it possible to parse a .ttf font file into a MapFont?
ItemFlag HIDE_POTION_EFFECTS I believe
You might need to make your own parser
I'm trying to think of who's the poor soul that wrote the MinecraftFont class and hardcoded each single value
It does work but I'd rather just use awt and render my own images
That's what I do in my imageboard system and it allows me to have full control of rendering
I skip bukkit's system entirely and it ends up becoming a lot more performant
hm ok I currently actually use java.awt but saw this method but it accepts a custom Font class
so I will just use awt
Is there a simple way to make turn the visual appearance of an iron golem into it's cracked state that happends when its low hp
i know I can just damage it a lot but surely theres a better way
uhh great question
It doesn't exist in the entity metadata so the only other way is packets
You'd have to send a packet saying its health is incredibly low
Stupid but go figure
cant you change its health without packets?
You can but then it dies quicker
ah ok yeah true, packets is just fake data
thas the source code of IRON GOLEM?
Crackiness lmao
Lmao
So yeah it's just a health ratio
because the server wouldn't possibly want to control that

alright thanks i'll try packets
Actually, what's sending packets to make something not actually there make seem like it's there called?
Spoofing? Or is that different
Yeah spoofing
"Why is this opening a furnace tho?"
Plugins:
Hey client, this is a noteblock
Okay server, but why does it open a furnace menu?
Because it is a workbench actually
But server?
And now it's a dispenser
It’s actually a block that doesn’t exist on the client
menu animations be like
But the client doesn’t need to know that
"yo new menu now, same id and contents tho"
In fact the client gets very upset when it receives a custom block
And then it cries like a little bi**h
I fucking hate windows
why cant i just replace the plugin in my plugin folder
who gives a shit if the server is using it
How cna i cange the direction of a furnace
i have the block
block.getState().getBlockData()
or
that works a bit to great lol, i still want to see "Coast Armor Trim" just not the other stuff
am i store player's friends with name or uuid ? for offline
uuid
oh hi elgar
hi
i have a question for u
im doing friend plugin for bungeecord
i will save player's friend to yml file and get player's friend from this yml file
but i can't do GUI in bungeecord
do u have any idea for do gui ?
or i need do non bungeecord plugin so i need do with db ?
don;t, its annoying and version specific
Storing data in yml's was never a good thing, atleast that's what I've been told
no
yml bad for storing data
is good for config
its nice
but for storing data go with something like a db, json or binary
Storing data you could do json
But there is chance of corruption with json
not only store friends
So I always make backups
will store friend settings like
toggle dm
toggle friend requests
but i wanna do this with gui
but i can't do gui in bungeecord
There is also a chance that the sun is going to fall on our head, hasnt happend yet
@quaint mantle Look into plugin messaging channels
Well, the json corruption has happened
the you can have a spigot plugin handle GUIs
Atleast one time
btw for to store list in mysql will like this ?
no
that
mother of jesus
Use an Array
for the friends
dont save under playername
save there UUID
How will it look in mysql?
the playername can be changed, the UUID cant
nobody cares what it looks like unless ur a data analytic
Does somebody have a idea of a plugin?
A plugin that blows up your server
hm?
: D
irl
Imagine it actually blowing the hardware
get wiener schnitzelet

Raw Chicken + anvil
is there anyway to get gradle to nicely redownload a dependency instead of annoyingly cacheing it
as of right now I have to clear my entire gradle cache every time I update my dependency
That entire point of gradle is to cache the stuff so you dont have to reload it every time
the*
so you're saying there's no way to reload a dependency without nuking my entire gradle cache
as if I needed a reason to switch back to maven
There might be
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}```
anyway to target a specific dependency with this
it fast, but i no understand
My entire life
it is
oh ig its not but shouldn't matter with my repo the way I have it setup
it works fine replacing on maven
🤷♂️ I'll add -SNAPSHOT into the end and see if that does anything magical
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onMove(PlayerMoveEvent e) {
Player player = e.getPlayer();
int networkId = UserDataHandler.getNetworkId(player);
if (networkId <= 0) return;
NetworkClient client = CurrentPlugin.getPlugin().network().getPlayer(networkId);
UserSession session = client.session();
if (session.isLogged() && session.is2FALogged() && session.isPinLogged()) return;
Location from = e.getFrom();
Location to = e.getTo();
Block source = from.getBlock();
if (player.hasMetadata("flySpeed") || player.hasMetadata("walkSpeed")) {
if (to == null) return;
Block target = to.getBlock();
if (source.getX() != target.getX() || source.getZ() != target.getZ()) {
e.setCancelled(to.getY() > from.getY());
}
return;
}
//Other non important code that does not affect this issue
}
(Yes, player has flySpeed and walkSpeed metadata values)
Why does this allow me to move? even though I'm telling to prevent the player from going to another block?
(PlayerMoveEvent event) { event.setCancelled(true); }
Is there a way to get a persistentdatacontainer belonging to a different plugin?
There is only one container
PDC is bound to item right?
find the namespace they use to get the keys
You can get the values stored by another plugin using the appropriate key
That would deny all movement 🗿
would be easiest to work with raw NBT if you're reading other pugins keys though
So
Aint that what he trying to do?
That’s cool
No, I want to allow to move only on his current block, I don't want the player to be able to move to another block other than his current one
Also I want to allow him to go down, not up
private final Location source = new Location(1, 1, 1);
public void onPlayerMoveEvent(PlayerMoveEvent e) {
if(e.getLocation != source) event.setCancelled(true);
}
You can always readd that with lore
No, this will prevent all kind of movement, is the same as calling to event.setCancelled without any check
It wont
this is an well interesting solution
it will prevent the player from moving from the source block
No, because you are checking exactly x y z values, not block x y z
Compare from.getBlock to to.getBlock
No, I already have the method to check if the player is not in his source block, the problem is that is not working
ignoring the numbers after the .
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onMove(PlayerMoveEvent e) {
Player player = e.getPlayer();
int networkId = UserDataHandler.getNetworkId(player);
if (networkId <= 0) return;
NetworkClient client = CurrentPlugin.getPlugin().network().getPlayer(networkId);
UserSession session = client.session();
if (session.isLogged() && session.is2FALogged() && session.isPinLogged()) return;
Location from = e.getFrom();
Location to = e.getTo();
Block source = from.getBlock();
if (player.hasMetadata("flySpeed") || player.hasMetadata("walkSpeed")) {
if (to == null) return;
Block target = to.getBlock();
if (source.getX() != target.getX() || source.getZ() != target.getZ()) {
e.setCancelled(to.getY() > from.getY());
}
return;
}
//Other non important code that does not affect this issue
}
tada
hi, how do you set a player completely invisible (not even the username is visible) ?
player.hidePlayer(target)
oh
loop through all online players and hide the player you are trying to hide
and does it reset after death?
I actually did that for another project before
Also remember to hook into PlayerJoinEvent to hide the player to new joined players
im not sure
No
and after rejoning?
Yes
i see
alright
After rejoin you must call the method again
I've had a plugin that added pants that would hide the player fully and other armor that had cool abilities, but it broke for whatever reason and I didn't even try to find out what broke and why
Fixed it, I just had to change
if (source.getX() != target.getX() || source.getZ() != target.getZ()) {
e.setCancelled(to.getY() > from.getY());
}
to
if (!source.equals(target)) {
e.setCancelled(source.getX() != target.getX() || source.getZ() != target.getZ());
}
(I still think it's the same, but...)
Is there a server restart event so if i want the server to stop and start every day at 5 pm
Uh what?
you don't have toY > fromY, is this intended?
I don't want to allow him to jump
am i get variable from my bungeecord plugin with plugin message channel ?
Like this
It depends, which kind of variable do you want to "transport" exactly?
from yml and arraylist
You could, in fact, dump the yml file into a raw string, and send the whole yaml through the messaging channel
Then load the yml string
?
There's no way to detect if the server has been restarted. Restart means shutdown and start again, so there's no way to identify if the current start is a restart, a crash, or an intended shutdown
i watched some videos for this they only do connect command 😄 i don't understand how do i get variable from my plugin
can u give docs or guide for this ?
actually
which one ?
Well, I don't really understand what are you trying to do
Like, you want to read a variable from a yml file in your BungeeCord, and send it to a spigot plugin instance?
Or vice-versa
Or you just want to send a custom message through BungeeCord messaging channel?
this one
I just want so the server auto restarts everyday at a specific time so all the plugins are getting enabled if any new has been added
im trying to do friend plugin for bungeecord
but bungeecord plugins doesnt have support for inventorygui
Do you already have loaded your yml file?
so i get stored datas from bungeecord playerdatas.yml and send my spigot plugin
yes
It's better to use a cronjob for this
wydm for that ?
Or a task scheduler if your host allows it so, (for example, pterodactyl has something that allows you to automatically restart the server and do what you want)
Doing it from a plugin... It's possible, by scheduling and calling to Bukkit#getServer#shutdown
Like, have you loaded the yaml file into a YamlConfiguration object?
Is it possible to change the main thread? Like, let's say I have 3 threads, one of them is the main thread. Can I somehow tell it it's a secondary thread and tell another thread it's main now?
yes
uh sanity check
if I'm registering events and I have code that reloads the plugin do I need to unregister events?
hey, Im trying to make a command that allows the player to spawn in a dog with a custom name. two questions, 1: How do I allow them to make a custom name, and 2:in the listener I want the dog to die when they quit/get kicked. How would I do that?
If you want to send the whole file data, then I would recommend this:
File fileToRead = /*get the playerdata file*/
StringBuilder builder = new StringBuilder();
try(FileInputStream stream = new FileInputStream(fileToRead); InputStreamReader isr = new InputStreamReader(stream); BufferedReader reader = new BufferedReader(isr)) {
String line;
while ((line = reader.readLine()) != null) {
builder.append(line).append('\n');
}
String rawFileData = builder.toString();
String base = Base64.getEncoder().encodeToString(rawFileData);
//To send messages through bungeecord, you need a player unfortunately
ByteArrayOutputStream baos = /*Create the ByteArrayOutputStream*/
baos.writeUTF(base);
player.sendData("mycustom:channel", baos.toByteArray());
} catch (Exception ex) {
//Log the exception
}
This (is an example) would send all the data from the file "playerdata.txt" through BungeeCord messaging chanenl to the spigot plugin listening on channel "mycustom:channel"
event schedule.txt
Then you would need to "un-base" the raw data, and write it to a file (or load it directly)
How do I schedule events in my plugin from a file called eventschedule.txt which contains the time of the event, thanks
What do you mean by "schedule events"?
I have it to where it'll do the players name and then dog but I just want it to be fully custom
I have custom event object
The part I need help with is reading the file for the time
I would do so, some data that you store persistently may have changed due the restart, making an event not working properly
so your goal is to restart the server every day at 5pm?
Yeah or at any other time, 5 pm was just an example
I know that there is Server.Spigot#restart
Doesn't it get called automatically even if you just shutdown the server?
Sure? i dont have the option or it could be because its the api for 1.8
1.8 💀
Server server = Bukkit.getServer();
server.spigot().restart();
```?
yeah it should exist in 1.8
Way better to just stop it and have your panel or script auto restart
basically thiss
what all exists for bungee docs
?jd
yes the javadocs exist but what outside of that
Yeah i know it would be better but i just want it to be in a plugin
Im not trying to get spoonfeeded or anything but i have forgotten how to do this right, it says that time isnt a int
@EventHandler
private void serverRestart(){
String time = String.valueOf(getConfig().getInt("Time"));
Server server = Bukkit.getServer();
switch (time){
case 1:
}
}
What specifically are you after
Can anyone help
whats the intended way to communicate data between servers
Best way is a third party message queue
Or database
If you're desperate, plugin channels
Bukkit.getWorld(HubSquared2.mainClass.getConfig().getString("hub_world")).playSound(event.getPlayer().getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.5f, 1f);
this doesn't work for some reason, anyone know why it doesn't play the audio?
Such as websockets
Such as redis, rabbitmq, etc
wouldn't it be better to replace HubSquared2.mainClass.getConfig().getString("hub_world") with Player#getLocation#getWorld?
the whole point of what im doing rn is to not use a database 😛
oh true
so ill have to write my own netcode i guess
Well the whole point of databases is to do what you're doing 😉
also question, why do people use # instead of . when talking about code on forums and here?
In javadocs notation class#method is an instance method, class.method is a static method
I think anyway, who cares
ah
its just faster term to show it
literally the whole point of my project was databases are overrated and hand made solutions are better
guess that includes networking too
I recommend using Nats easy to use
or java sockets if you are tryhard
Nats?
oh i was just going to use sockets
if bungee didnt already have anything
looks way overkill for what i need
redis
i am 😉
.
?
time is a String
Do you need the time to be a string?
You can also switch on numbers
- just set display name of an entity to whatever the player writes in the command
- make a Map<Player, List<Wolf>> (not exactly, but something like that), remember the player's wolves and then kill them on player quit event, or store the player uuid somewhere in the wolf entity and then loop through all entities and kill wolves with his uuid on quit
how do i check server ? in bungeecord ?
I'm gonna do the quit event. How would I do that. idk if that sounds dumb but I'm not good with commands
e.getServer().getInfo().getName()
why don't you read the spigot wiki?
there's some ?help things in this discord that I don't know but maybe someone does
Yea
Is there an event that checks that it is connected to the proxy?
You can ping the servers using self BungeeCord API
no i mean
i wanna send message on connect to proxyserver
not below server in bungeecord
So you want to send a message when a client connects to server "lobby" for example?
Or when the client connects to BungeeCord?
this one
LoginEvent and PreLoginEvent might be what you are looking for
How pathetic
But those events won't allow you to send a message to the player, as he doesn't exist yet, he's not connected to any server, but the BungeeCord proxy
aight ty
FAWE uses a different technique entirely to change blocks.
It skips bukkit
Writes to the block palette directly
And then sends packets to the player
And then everything breaks
and then it tries relighting the chunk
let’s just say there is a reason it is known as Fast Async World Exception
This ^
well they are modifying the world state asynchronously which is bad
it isn’t designed to be
so i am trying to make a plugin where i can report someone in game and thaen it will ping in a curtain discord channel but i am struggerling to figure out how i would do it could anyone please help me i have googled it but i am not getting the result that i am after
Break it into steps
.
i have brock it into steps
unfortunately
i have got the bot running but i am struggerling on how i would get the results from the report command and using jda make it ping in a discord channel
client? yes
Convert your result to a string and then just send the message?
How pathetic
Do you have anything useful to say
You should quit
wel your helpfull
XD
Guess someone woke up on the wrong side of the bed
Look I’m just trying to keep it real
well you were proberbly like this at 1 point
No I wasn’t
You asked the dumbest question which you could have solved in 30 seconds by googling
not in my case
How do you know how to get a JDA bot running but don’t know how to do anything else
That’s just outright stupidity
cause of the way the program is in different files also i dont i googlee dit and after 5 days of work finerly found it
Learn English then you can come disturb my slumber.
but i am having problems with just making it into a string and sending it
sorry that i am not a "professer " like you
siemka memexurer
You must be joking
😂😂😂😂😂😂😂
Dude, calm 🗿
How can i make an armor stand follow a player as precisly as possible, because teleporting the armorstand makes it fall behind the player
if you think that you are so funny let me send you my code and then you make it work then
This channel name is help-development
Make it a passenger.
I don’t owe shit to you
If you are not gonna help him, shut up
He’s being an idiot
You are
He just needs some help, stop being so rude
Aren't there better ways?
The best way is passenger
how do i do that
But you can’t have an offset if you do that
Next time don’t speak on my name
Well, not unless you chain multiple armorstands together.
That only works vertically though
can i put my code in chat so that you can help me undersand what i have to do better please
i am not a professinal programmer
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
?paste for big code blocks
i have only just started learning
?paste
What are you good at in life @dire oyster
You’re not good at coding or English
What are your skills
fucking your other
Man really did wake up on the wrong side of the bed.
Haha that one was funny
Yeah that one is nothing like I’ve heard before
Crazy how you couldn’t answer a simple question. You must be worthless
Yo, fr, if you are not gonna help, go away, shut up, and live your life, let others be
You’re web developer skills are seriously underwhelming
You should polish up a little
You couldn’t do anything better either way
Let’s face it
@worldly ingot This is entirely silly
minecraft to discord report plugin
Bro's targeting everyone at this point. Do me next. xD
You were looking at my message history that’s funny
Either way I wasn’t serious
What are your accomplishments slokxoxo?
Hm your GitHub looks dry
Not much progress for 2 months
I remember this 🤣🤣🤣
@quaint mantle 👋
What do you want
Hi
uh real quick how do you remove a scoreboard again?
I think it was by setting the scoreboard for the player to null
player.setScoreboard(null);
How can I import NMS into my project?
?nms
There is no specific maven dependency
I got it, just have to set it to be a new empty scoreboard
You can also set them back to the main scoreboard
I have the problem that when joining the Server the main world, which is being reset at server shutdown, is getting loaded, tho the player is teleported instantly into a lobby world. How can i stop that behavior or preload the main world?
you can't stop the main world from loading
Can i get the status of loading the main world so i dont let players join the server yet?
whats the non api package name and version for bungee called
ServerLoadEvent
Thanks!
that event is thrown once the server is finished loading
so it should work for that 🙂
I'll try that 👍
so what you can do
is in the server.properties
whitelist the server
in the code, unwhitelist server in that event
this prevents players from joining until that event is thrown
Sure just forget to write Async 👼
why when you can let the server do it for you?
just use the whitelisting
🙂
that sounds hella jank
yes
how is it jank?
you can disable whitelist from in the code
its called using what is already available
Its fucked when the properties are wrong
why produce code to kick players when it already exists?
yes but players can still join with a whitelist on
only if they are in the whitelist
what happens if you actually want to whitelist tho
unless you have something overriding the functionality
might be annoying
that isn't the scenerio presented
Im actually using a whitelist rn
but, anyways I am never a fan of duplicating functionality that already exists
hikaricp supports mongodb ?
It should support anything that implements the JDBC API
since hikari doesn't do anything specific with sql, as long as there is a jdbc connector yes
btw i can't fix my problem
if we take it from the beginning, it can give me an idea in a clean way, wrong?
You can even use it with databases that don’t support multiple connections
Yknow, for the luls
im making friends plugin but this will need be for bungeecord and i wanna gui for this plugin but bungeecord doesnt support guis
u suggested to db
but u know any idea for store player's friends to db
The gui would have to be done on the spigot servers
I waited like 2 minutes, the event is not getting called
ServerLoadEvent should definitely get thrown
if it isn't then its a bug
@EventHandler
public void onServerLoaded(ServerLoadEvent event) {
System.out.println("Server loaded!");
Game.getInstance().setLoaded(true);
}```
I dont get console output
did you register it? 
gotta make suure
Its right under the Event that stops the player to join. Im pretty sure
It works on a reload tho tf
The event gets fired on reload but not on server start
It should get called as soon as startup is done
hi , i have a problem in a guild system , its kind of weird problem haha
it happend every time a user create new guild and there are users on the server with guild:
it will add the other users to the guild that just created
.
that does sound like a bug then
seems like it 🤷♂️
alternatively you could possibly use WorldLoadEvent
should be called when a world is done loading
well there you go
Btw for deleting a world the best way is to delete the dir right?
I only see the option to unloadChunks...
declaration: package: org.bukkit, class: Bukkit
Ohh its not on the world object i see
you can't remove a world that is loaded especially main world
You can’t unload the main world as well
for all other worlds, unless you use some hacky reflection you can't remove them
Any other world should work tho
Oh i have to reset the main world tho
yeah should probably have some script that does that
I have scripts that control my servers for starting, restarting and detecting crashes etc
so upon shutdown, you could have a script that removes the main world
before starting it back up
why does it have to be the main world exactly
Use your plugins logger
you could also make the console run the command say with the message as well
well you weren't specific so we were just tossing all the various ways you could send a message to console
or make console send a message XD
don't worry there is still many plugin devs that still do that for some reason 😛
long time ago, it didn't
but, we are in modern times
Its honestly just muscle memory at this point.
I need a fully capable survival world, so you would suggest to use the world as lobby and create a second game world?
this is what I would do because it is easier to remove worlds that are not the main ones
then it is the main ones
so if you need a lobby, then the main world works for that
stupid question but do portals still work then?
and t hen you can reset your game world without shutting down 😉
yes
are they refering to world_end and world_nether?
to good to be true haha
I believe they go to the default nether and end
But i can easily remove them?
If it’s in plugin.yml spigot will load it
You can change the executor in onEnable with getCommand(name).setExecutor
Otherwise your main class is the executor
than if its in your plugin.yml itll work.
itll be loaded.
you need both. you need to set the executor of your command, then add it to your plugin.yml
What do you think creating the world right after deleting it shortly before server shutdown or creating it when starting the server?
the only time that isn't true is when you are doing subcommands
