#help-development
1 messages · Page 660 of 1
He did just say why he can’t
where?
Which is that he isn’t the owner and the owner refuses to update
well bad luck for the owner I guess
1.19.4? why? that's outdated since 2 versions
Make your own better server
Agree, too much
yes but they are also the people that give money
Hope that's a joke
I'm trying to set a block's type to GRASS. It works, but instead of spawning grass, it spawns a dead bush.
for (Block block : floorBlocks) {
final Block aboveBlock = block.getLocation().clone().add(0,1,0).getBlock();
if (aboveBlock.getType() == Material.AIR) {
aboveBlock.setType(Material.GRASS);
this.grassBlockLocations.add(aboveBlock.getLocation());
}
}
i think it's something else @tight bison
use interact and click a grass block to see its type
ofc not?
Yes, but there's nothing bad on using 1.19.4, I mean, it's not that old
is there a way to check if a biome is a "rainy" biome?
Idk
if there's actually rain coming down
maybe like humidity or whatever
as in "player gets wet"
idk how much spigot exposes
basically, nothing on biomes D:
biome only has getKey() lol
I don't think that's spigot, I think minecraft doesn't have a rainy biome check, as it rains in the world, not at the biome, the game just ignores (client-side) rain if the biome specifies it
The server has no idea that X biome is not "rainy"
BiomeBase has a method getPrecipitationAt(...) which returns NONE, SNOW or RAIN
but using NMS for this is ridiculous
Pr spigot
Meanwhile I guess you will have in fact, to use NMS
Or...
You might have a set of known "non rainy" biomes
And check if the biome is in that set
Had someone got floating pets working with display entities?
Instead of armorstands, these entities don't smooth transition whenever they teleport
yeah but that's annoying, I don't really wanna do that lol
also it'd require me to look up the wiki in every new update etc lol
Unless you pull request spigot to add the API you need
It's still possible to smooth transition through transformations but I'm not sure if players will stop rendering these entities if they get in new chunks (like, the entity's location would freeze)
what even is a "websocket ip"?
Do you mean domains like example.com?
I too often use words I do not fully understand to sound more quantum entangled
I don't find any official stuff about eaglercraft, only a ton of websites that say it's dead
Yeah
Mojang Targets Repositories of Browser-Based Minecraft Copy 'Eaglercraft' Mojang is cracking down on the browser-based Minecraft copy Eaglercraft. The company removed 92 repositories from GitHub, claiming that they infringed the company's copyrights and trademarks.```
Are you aware we cannot promote piracy and such type of activities?
😢
its like RE3
the same fate
i dont see how playing obselete version is "piracy" which loses money for the company
its literally the port of 1.5.2 and 1.8.8
?nms
They want people to buy the game. If you like playing the old versions you'll loveless the new versions type logic. And tbh if I was a game dev I'd do the same thing it's my game I'm in control of distribution not some other website even if it's distributing some old ass version it sets a precedent that I as a game developer am okay with such behaviors
I got a question, is it possible to change the color above someones head in Spigot? Like now everyone has their username in white but i want to make some people have it red above their head. Already got it fixed in Tab and Chat, but not above the head. Does someone know how to do so?
Scoreboard Teams
And that doesnt create problems when trying to reach the person name? For example, if using player.getName() im not getting the changed name but still the original?
In the prefix, can i only put the color or do i also need to put the name? Like does it fully overwrite the name or set the value before the original name?
Does anyone know how to make support for multiple versions of the game?
depends
on what you are doing
generally setting the API version in the plugin.yml is enough, and build for the lowest api
get teh same scoreboard
Already found it haha
ok
I changed name and forgot to change it everywhere, silly mistake
also, all players need to use the same scoreboard to see eachothers names
Yeah i just want only one person to have a color named
same scoreboard, just different teams
So i also need to do player.setscoreboard(scoreboard) for all the players online? but just add the player that i want to have a color to the team?
yes
Hmm it seems like its not working,
public void changePlayerColor(Player player, ChatColor color)
{
Scoreboard scoreboard = player.getScoreboard();
Team team = scoreboard.getTeam("Owner");
if(team == null)
{
team = scoreboard.registerNewTeam("Owner");
team.addEntry(player.getName());
team.setColor(color);
team.setPrefix(color.toString());
}
for(Player players : Bukkit.getOnlinePlayers())
{
players.setScoreboard(scoreboard);
}
}
I am using this, but am i forgetting something?
no need to add them all in that, If you are using teh main scoreboard you don;t even have to do anything
I am not following you there sorry, what do you mean?
just add the one player to the team you want
no need to setScoreboard as you are using the default
Oh so i can fully remove it
yes
Still a white name
one mistake though
if your team is not null (which it won;t be after first use) you never add teh player to the team
Oh yeah ofc hahaha
Let me fix that real quick
But if a fully restart the server, shouldnt it also reset all the teams?
so literally just move the last 3 lines out of the if null block
no teams are saved
Alright seems to be working now!
One more question
if you have time
I add this when the specific player leaves
Scoreboard scoreboard = player.getScoreboard();
Team team = scoreboard.getTeam("Owner");
if(team != null)
{
team.removeEntry(player.getName());
}
is this nessesarry or is it not needed?
Like i remove him from the team when he leaves the server
not really needed but it is nice to cleanup
Alright then i leave it here. Thank you so much for your help!
If i want to make multiple colors for example for staff members, can i still use this methode but give the team another name? because you were talking about the main scoreboard.
you can create whatever teams you want, but a player can only be in one at a time
Ah thats perfect. Good to know, i wasnt planning on setting a player in multiple teams but thank you for the information
Hey everyone this does not work but why?
MoveEvent Listener
package at.spawn.listener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
public class MoveEvent implements Listener {
public static boolean cancelSpawn;
@EventHandler
public static boolean onPlayerMove(PlayerMoveEvent event) {
var cancelSpawn = true;
return false;
}
}
Command which should be canceled if the player moves
the event shouldnt return a boolean
oh my
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
NEVER Thread.sleep on the main thread
and the event you posted does absolutely nothing
you never need to use sleep as a beginner is better said
and when i see this
i can't help but think, this guy must've decompiled the code from somewhere
Where can I download the paper api?
lots of IDE auto suggests
?whereami
Netbeans does not suggest this
neither does Eclipse
maybe the text editors with language support?
guys be careful when minimizing during shading
like visual code
its intellij
wait why?
not all libraries like that
that makes no sense lmao
yeah generally
weird
highly unlikely
sounds like a weird problem specific to you
no its specific to a library
because I background compile and shade all the time
not sure how minimizing something that doesn't really have a GUI component to it by default
minimize breaking shit is rather common
well
not common
but like, any form of string based class lookup just tends to fail
which is a somewhat common thing, e.g. slf4j logger implementations
just exclude smaller dependencies
:c
for what
cool events
such as
the ones I need
and that is?
I know you are not my usual delivery driver but I'd like you to go get me some fries and a burger.
you do know they have their own discord and website?
just you know google them
lol what is that
didn't know that
yo no way
look at that
i found it from googling
yeah I don't use maven
click the link
nor gradle

done already
then what
my consolences to you lol
ant?
you should use one if you cant manully browse a repo
javac?
yes of course

I don't know what you're suggesting?
for that specific case
Well, people that don#t use a proper build tool usually end up with like
i still demand gradle java
There seems to be a really hacky fix LOL
Make the display entity ride another entity instead of using display's interpolation
Maven builds 2 minutes and Gradle is decenlty difficult to operate
using some scuffed IDE feature to manage their dependency
the built-in IntelliJ gradle compiler is much faster
collaboration:
Hello
To send a plugin message from bungee, do the following
player.getServer().getInfo().sendDataMeassage()
And in the plugin to retrieve the message, it looks like this
onPluginMessageReceived(String channel, Player player, byte[] bytes)
{
The "player" function parameter seta a random player?
its not gradle
lmfao
its javac probably

pretty much
Not that the paper docs have like, a near copy paste gradle example 
rare paper moment
anyway, epic already linked you the maven repo. Manually download the jar and suffer while downloading new api jars whenever you find out you cannot use a recently merged feature 
no, the player which connection was used to send the message
He made it to the paper discord
what?
I have a command that begins a Conversation with a player, how can I cancel that conversation whenever the player issue the command again?
Who does that?
does what
hm ?
is the link not direct enough for you
use unstable features
unstable ?
Is sended from the bungee to the spigot server so there are no player ?
what
I just told you
there is a player
idk if bungee api selects a random player on a server
Looking for a config developer, if you're interested shoot me a DM
you use a player that is on the server you wish to send the message to or from
plugin messaging requires a player to be on the server you wish to communicate to
probably should have let them browse on their own
at this point they just want to be shown everything let alone from the spigot discord lol
thanks
i-
Yes, so the proxy sends a message to the spigot server only it needs to send it to a player, so it picks a random player on the server to send it to, right?
no
you have to pick a player to send it through
so it wasnt direct enough for you, got it
In the examples they do player.getServer().getInfo().senddata()
So i don't pick a player but the server od a player
I think I misunderstood something
you can send a plugin message using any player you want
|| wait for them to find out, they need to download the transitive deps||
just as long as they are on the server you want to send a message to or from lol
and the proxy will respond using the same player connection you used
you can use multiple plugin message channels as well
but each one is different to the player connection
Hi, Im trying to get the name of the item I've renamed in an Anvil Inventory but the item is always null:
private void anvilRenameClickEvent(InventoryClickEvent event) {
org.bukkit.entity.Player player = (org.bukkit.entity.Player) event.getWhoClicked();
if (event.getClickedInventory() == null || event.getClickedInventory().equals(player.getInventory())) {
return;
}
if (event.getView().getTitle().contains("Pet rename")) {
Inventory clickedInventory = event.getClickedInventory();
Inventory anvilInventory = (Inventory) clickedInventory;
ItemStack resultItem = anvilInventory.getItem(2);
if (resultItem == null || resultItem.getType() == Material.AIR) return;
ItemMeta clickedMeta = resultItem.getItemMeta();
Player playerInGame = game.getPlayer(player);
if (playerInGame == null) return;
Bukkit.getLogger().info("item: " + clickedMeta.getDisplayName());
event.setCancelled(true);
did i miss something ?
Inventory clickedInventory = event.getClickedInventory();
Inventory anvilInventory = (Inventory) clickedInventory;

https://www.spigotmc.org/wiki/sending-a-custom-plugin-message-from-bungeecord/
In sendCustomData()
Imagine player = Toto
My proxy is like this:
Survie server:
- toto
- tata
Lobyy server: - zozo
- zaza
If i exécute my function. The message data will be send into the server of toto (survie) but chose random player into the survie (Toro or tata) ? Or chose tot o?
Message:
Proxy -> survie
Yes deadCode because I've tryed to cast it into an AnvilInventory
mb
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
or use the anvil prepare item event
@wet breach see here
Yeah, if you dont want dynamic editing while using the anvil but static behavior when
adding ingredients then use the prepare event
Oh your right ! I'm trying this
anvil prépare event is when a player put his item into the first anvil slot ?
no its called when an item is modified and the server is now creating the result
eg renaming an item
I already told you it won't choose a random player
not sure why you are not understanding that
you have to choose a player that exists and is online to use their connection to send a plugin message. Neither the proxy or the spigot server will choose for you. That is something you supply. In regards to listening to plugin messages you don't need a player as its just listening for a specific packet type, but anytime a plugin message is sent or when the server or proxy automatically responds it uses the same connection it came from
Help, how to check if the item is in the hands? I can't understand how to check it even using InventoryClickEvent
InventoryClickEvent fires before the item is in the slot or vice versa, it will not be in the slot
There are multiple events you need to cover in order to check if someone equipped an item in his hand.
One of them: PlayerItemHeldEvent
how would i change the color of someone's display name so it works in chat? chat color was working in previous versions but now only seems for work for me in tab
Actually, this might be fired on pickup and inventory click as well.
Test it out. Maybe you only need this event.
The player will be the one specified in player.getServer().getInfo().senddata?
it doesn;t matter which player the message comes in on.
PMC from bungee to the server has data. thats all you shoudl need
The anvilPrepareEvent doesn't work when the inventory is manually created in code :/
Correct it's just an inventory if not backed by an actual block
as you can see from your method chain, there is a player object
it comes from somewhere
you have to obtain the player object you want to use for the plugin messaging
So how can I get the name of the item renamed in anvil ? :/
I've tryed with Inventory click but the item slot 2 is null
A fake anvil has no logic. you have to do everything (I believe)
So the player specified here (player.getServer.blabla) is the player Who the message is sent to?
No it doesn't working when the player changing item in held slot
that's why he said that it's one of the events and not the one and only
That is the only use for this event. Did you register it?
oh really
This event mainly covers when a player scrolls between slots or uses 0-9 keys
Oh i didn't finish writing sorry
does anyone know how to change a display name's color? chatcolor was working in older versions but since ive updated to 1.20 ive been getting errors when typing in chat
No it doesn't working when the player changing item in held slot in inventory or by picking up/dropping item*
I have problems only with changing item in slot by using inventory
and what's the error?
everything else like dropping, picking up, swapping i have already done
chain link failed
i can send more detailed in a sec
let me run it again
You need to cover the drop event as well.
And the InventoryClickEvent.
It's too difficult for me to check if item in hand was changed using this event ,_,
How did you detect the scrolling/0-9 switches?
I was trying something like
ItemStack item = event.getCursor();
if(item.getType().isAir() && clickedSlot == chosedSlot) {
clearTimeMark(mainHandItem);
} else if (!item.getType().isAir() && clickedSlot == chosedSlot){
addTimeMark(item, "time");
}
But it's working too weird
Oh by PlayerItemHeldEvent
Alright. How scalable do you need this to be?
In what sense?
I just need to change item's meta if item is in hand/isn't in hand
Amount of players using this concurrently. If you dont need to support hundreds of users
then i would do a simply check which is a bit more expensive but easy to implement.
Why?...
I don't know, i'm just trying to do some difficult plugins in order to learn everything, now i have this task
Ok but what is the purpose of changing the items meta when its in a players hand?
I want to do something like if player get item in his hand and he has in other hand other item then the information from main hand item's custom tag written in lore
I would just go the simple route and always check the slot after a player clicked anything...
@EventHandler
public void onClick(InventoryClickEvent event) {
Player player = (Player) event.getWhoClicked();
ItemStack currentItem = player.getInventory().getItemInMainHand();
Bukkit.getScheduler().runTask(this.plugin, () -> checkHeldItem(player, currentItem));
}
private void checkHeldItem(Player player, ItemStack previousItem) {
ItemStack mainHandItem = player.getInventory().getItemInMainHand();
if(mainHandItem.equals(previousItem)) {
return;
}
if(mainHandItem.getType().isAir()) {
return;
}
PersistentDataContainer container = mainHandItem.getItemMeta().getPersistentDataContainer();
// Do some PDC tag checks and apply changes
}
Then spam click around and check if it comes up in the timings.
Should be fine.
Its not too hard covering all actions for main hand item swapping but it is
tedious to implement.
One moment
Sorry i don't know how to get plugin from the main file
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Sorry i'm too stupid
Wait is this method in your JavaPlugin class?
doing this: meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier("NoProtection", 0.0, AttributeModifier.Operation.ADD_NUMBER));
causes this:
how can i remove those texts?
just clearing the lore?
EntityMetadata packet and data watchers
You need to specify the slot
how
isn't there a HideFlags attribute thing for those?
^
thanks
yeah
Then your JavaPlugin instance is referred to as this
so i can change this.plugin just to this?
if you hide those you lose the armor actual bonuses
I think he wants that
yea
Oh no sorry, it's the other class
Then look at the dependency injection tut
i don't have "PlayerStatsPlugin"
no one knows why an idea consumes so many resources and lacks it? every day I have an idea that hangs 5-10 times, saying that it has little RAM, and constantly rolls back when restarting
Sooo i got "Variable 'plugin' might not have been initialized"
omg i'm too stupid for this
don't make it final
oh ok
don't make it final i'm assuming you put plugin = this in the onEnable method in your main class, do use final if you're putting your plugin variable somewhere else
ok thanks
mcdev plugin
If something's broken step 1 is to remove mcdev
I got an error
constructor events in class org.warrio38.mc.myproj.events cannot be applied to given types;
required: org.warrio38.mc.myproj.MyProj
found: no arguments
reason: actual and formal argument lists differ in length
It's the case for all Jetbrains IDE, needs lot of ressources
idk my IJ only uses 2.3 GB and I got 5 projects open or sth
with mcdev plugin disabled ofc
did you call your class "events"? o0
you declared your constructor to take in one parameter of type MyProj but you didnt pass any parameter
can I use brigadier on BungeeCord?
oh i got it yeah sorry i added it but then accidentally removed
sorry
Is there a class that freezes things? aka makes snow and freezes water
wdym "is there a class"
It's called World#setblock etc.
oh yeah it's working thank you very much
How would I go on getting a circle of blocks around a point?
it's actually terribly difficult in 3d
but I hope they mean a circle on a flat surface (spanning only across x and z)
and not an angled ring of blocks mid air
or the lazy way and get all blocks in a square / cuboid and then use distance or distanceSquared to only get those that are actually within the circle/sphere
?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.
Material.WALL_TORCH
This bot really has answer for every situation of life 💀
Well we see a situation where it is needed
then ping the hell out of the guy who makes the commands
then he adds em
is anyone familiar with DataWatcher? i'd like to ask for help #1138204701658206259
Hah cool
I gave up on datawatcher ages ago
isn't the bukkit scheduler like... decently unoptimized?
why do you think so?
cuz like
bukkit scheduler is fine
i don't think it reorders tasks everytime
yup!
and then the cancelTask method creates a new task
it most likely has a treemap
What I want to do is basically freeze water (yes on the y axis) and make snow on the surface (only x and z)
whatever
it creates a task to delete some leftovers
but it looks fine to me
yeah, but is all of this necessary?
I mean hey, if you want to improve it, go ahead
I mean, yeah I'll try
But threading is complicated and the scheduler is pretty carefully designed to provide strong guarantees about how threading behaviour works
if you do wanna improve it make sure you don't create new bugs
Particularly in respect of sync tasks and their interaction
like wouldn't simply synchronizing on a lock object make it thread-safe?
Why does locking make it better
it locks for the first to get access to it
https://paste.md-5.net/vuduwavoyi.java I made a little something
Entire things such as ConcurrentHashMap (which is a beast - check out the source) exist to prevent locking
i know, all hash maps be wildin'
like how the hell the devs even tell what's going on
Can't you just synchronise on a lock object 😉
the "devs" deobfuscated entire minecraft back when mojang didn't do it for them, you're doubtful xd
Is there a way to make a entity stop moving its head without turning off the AI?
modify the pathfinder goals or cancel move events
Does InetSocketAddress returnt the IP address of the server?
didn't test it and never used locks, I was just researching some source code and thought to myself if it can't be done in a simpler manner
ok thanks
also why not?
Which method?
Doesn't it prevent any interaction until the other methods have finnished?
getAddress()
What class....
but from the Server?
Nevermind it returns the IP address of the player
Gets the socket address of this player
Returns:
the player's address
yeah that was decently obvious
you can't really get the server's public ip address without making a request to external service which will tell it to you
I still have no idea what's going on
like what is thisssssss
to get the server's ip, as already mentioned, you gotta query some whats-my-ip api, e.g. amazon or whatever. after all you can never know the IP, the server could have hundreds of IP addresses
@Nullable
public static String getIp() {
try {
final List<String> answer = downloadToStringList("http://checkip.amazonaws.com");
if (answer.isEmpty()) return null;
return answer.get(0);
} catch (final IOException e) {
return null;
}
}```
Through this article, we are going to take a look at the data structure called Hash Table.
the reason you dont understand it is because all you see are some random letters instead of approaching it like a logical program
you start by the parts you do know
also understanding programming
and then go from there narrowing down what each line does
granted some comments would have sped up the reading process but maybe this isnt the actual source code but just a reconstructed version of it
idk
like if you don't understand progamming in depth, you can't really dive into mutlithreading expecting to magically simplify something lol
well thats true
but saying you dont understand something because of a lack of trying doesnt help either
oh md_5, maybe you'll know (cause you like created all of this): Is there a way to perform a teleportation asynchronously? If not, is there a way to set (not change, but rather set) the main location the players will spawn in by default when it's in another world?
yeah if you want to learn it or understand it, have to start somewhere I suppose
probably a good place to start understanding this is trying to find out where the function is called and what the arguments mean
depends what you believe async to be. Most believe this to be multi-threading and the methods in the api do treat it like this. But this isn't what async really is. But regardless I assume you mean in a multithreading fashion in which case it is indeed possible but only if chunk loading was also multi-threaded
Im searching people to test my plugin, what channel is correctly? this channel or help-server or general?
just load up multiple clients
and test it
but what if the chunks are already loaded?
Yes, but I'm looking for other ideas for my plugin...
Maybe I should have clarified, chunks would need to become thread safe but if you set out to do that might as well make them load in a multithreaded fashion since its about the same amount of work
its not about if the chunks are loaded or not, its about the objects in the programming
so you can't teleport a player async?
hi, im OP of a aternos server, and i cant break blocks....
all was working until i installed a skin plugin
d
https://prnt.sc/FmkIemxQ4_9A plugins
Register plus
seems
to be the issue
@grim hound How do you know that based on that message?
simply guessing
but im already logged
give no answer rather than a wrong one
Also keep it in #help-server
try to remove SkinsRestorer
it's probably not the issue
but try it
ok
no you can't just arbitrarily do this without making other things thread safe first
why not?
can you please stop this "i cant break blocks" discussion and move to the correct channel
especially after you asked this question in 3 different channels
yes
I'm looking for people to test my plugin, is this the right channel to ask?
no
why not test it yourself if your confident it works release it publicly and have a place for bug reports
ok
I look for ideas from other people to finish fine-tuning it before publishing it.
well when you release it people will probably give you feedback
and u can just update it
because then you will get Concurrent Modification Exceptions
there is no easy way to answer your question in a way that you would really understand
I just thought the same thing.
this is one of those where you need to learn more about programming
to really understand
okay I am sad because of that last clarification
I have like 3 years of experience
also isn't the main issue of teleporting a player async the PlayerTeleportEvent being invoked async thus throwing an error?
No, it has to do with the objects. Like entities to include players, locations, chunks etc
those are all not thread safe
which list is modified at teleportation?
You probably need to research more into multi-threading and the issues that arise from it
it may solve some problems, but it will introduce new ones as well
somehow i doubt this, just a bit
I never claimed I was a quick learner
I do understand how such things work
I'm just asking whether it's possible to execute a teleport asynchronously
it isnt
if you want to tp someone asnyc you would need to do the same thing as folia pretty much
well paper also has async TP and paper isn't folia
so it is possible?
no
confused.
it's not possible on spigot
so does paper
can you even do that on paper?
yes
so teleportation on paper & folia > on spigot
ig if your definition of better is being able to run it async yes
is it because they have asynchronous chunk loading I assume?
paper has a method Entity#teleprotAsync or sth
as it's not executed on the main thread I would say it's better
that's a slippery slope of logic
no it's not
multi threading everything is not good for the server
teleport is not a task that must happen immediately
but its done on something that is single threaded
and it's not always a light action
feel free to rewrite spigot to use async chunk loading (and PR it), then you can also do async TPs on spigot
yeah, not gonna happen
yeah in that case this discussion is pointless
Papers isn't instantanous though
It's just max priority on chunk loads
and tp once everything is laoded
how can I invoke the async tp on paper? Does paper create custom entity objects or something?
well it'll never be instantanous if chunks need to be loaded
no they patch bukkit classes
@grim hound go ask paper 😜
just use paperlib https://github.com/PaperMC/PaperLib/tree/master
on spigot it uses normal spigot stuff and on paper it uses their async stuff
oooo, that's nice
who can help mee
I always wondered how hard it would be to write in async chunk loading
inb4 chunk system rewrite
💀 ya'll did that
just one insane rat
who wrote that lol
Imho chunk loading is already blazingly fast on spigot if you dont run it on a potato
i wouldn't call it "blazingly" fast but sure
I do think async chunk loading is beneficial I mean you should use what's there if you can
it certainly won't stall the server thread (unless something else is awaiting for a chunk to load ofc)
i thought it was a leef
leaf*
yes
nope it was a rat :|
the rat king
a leaf rat
I have never really had too much of issues with chunk loading except when I was handling like hundreds of players
if your server doesn't handle hundreds of players its a non-issue
where's the frostalf async chunkloading pr :P
I would rather not mess with mojangs code
their world generation stuff is a pain as it is
ok it's not "instantaneous" but the chunks also weren't generated
I wanna see that same test on paper I'm curious
here's a TP into an unlaoded but generated chunk, it takes like 0.1 seconds
ok lemme try
not really isn't accurate test. The moment you teleported is when the chunk was loaded. What you are seeing is rendering which isn't part of chunk loading in regards to the server rather that is specific to the client
It says that if (weaponType.name().equalsIgnoreCase("§aSTICK")) { will always be false, but how do i prevent that?
Player victimPlayer = (Player) victim;
Player attackerPlayer = (Player) attacker;
ItemStack attackerWeapon = attackerPlayer.getItemInHand();
Material weaponType = attackerWeapon.getType();
if (attackerPlayer.hasPermission("vagt")) {
if(weaponType != Material.STICK) return;
if (weaponType.name().equalsIgnoreCase("§aSTICK")) {
first tp is ungenerated chunk, second one is generated but my bad, also already loaded
don't use names for comparison I'd use PDC
?pdc
a material will NEVER be formatted
you have to use the display name
you were told this yeseterday
brah
but once again you refuse to listen
here's tp into unloaded chunk
got to love these new people who don't like listening XD
i mean async chunk gen or not, the difference is that it won't halt on the main thread
async does not mean fast
ironically means the opposite
it can make certain tasks faster, I do feel like chunk loading would be one of those as you're spreading the load vs handling it all at once in a queue
given you have lots of players ofc
it'd be less beneifical the less players you have
that is what it does on spigot/old versions of paper
given that there is no api for async teleportation
what's the obsession with async teleport anyways
what what
what what what
no clue
I NEED it
I mean you can easily just join to the mainthread when you're done
for what?
its your average "Lets make everything async"
by not comparing the item name but rather using a PDC tag
that's a secret
no you dont, you want it
a secret?
nononono
indeed
the beginning of all bad ideas "that's a secret"
not very good one it seems
have you signed an NDA over it
is there a way to get the Player Time Zone?
no, but async teleport will lead to the next hypixel just you watch
man shut yo
it's a great idea
totally
more or less a cop out instead of saying they are wrong and want to claim they have some kind of need they have yet to be able to actually articulate
hi, when im trying to update scoreboard:
public void updateScoreboard(Player player) {
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
objective.setDisplayName(ChatColor.AQUA + "" + ChatColor.BOLD + scoreboardTitle);
SimpleDateFormat dateFormat = new SimpleDateFormat("E, MMM d");
String currentDate = dateFormat.format(new Date());
objective.getScore(ChatColor.GRAY + " " + currentDate).setScore(11);
objective.getScore("").setScore(10);
objective.getScore(ChatColor.AQUA + String.valueOf(ChatColor.BOLD) + player.getPlayerName()).setScore(9);
...
player.getBukkitPlayer().setScoreboard(scoreboard);
}````
new lines appeares on prvious ... How to update totaly the scoreboard ?
im taking this as a no, so no it isnt a secret
you could probably estimate given their IP, but granted that could be inaccurate and be really inaccurate if they have a vpn.
my problem is :
Was about to say...
you can get their ip, make a request to proxycheck.io, check their country (if they're not using a vpn) and from that country get the time
or use other parameters or another api
Just put a timezone in the lore
don't do it man dates are the worst thing on earth to work with when dealing with multi-player just do a countdown and save everyone the pain including yourself
or you could just do an ip lookup in the DNS
that's pretty inaccurate though
since all IP's have geographic info attached
<_>?
please help
as I suggested though that coul dbe innacurate
how so?
stop coming in this channel and bugging us for help you're seriously annoying
stay in #help-server and wait
yes it wouldn't be super accurate but without user input not really much can be done
You can get longitude which is directly associated with the time zone
except maybe querying the mc client in regards to locality
it claims i'm on the other side of the country. some geo IP dbs even used to tell me I'm in another country
but some countries (like China) have one time zone for example, despite how large they are
because the geographic info for the ip is for the DC that controls it
it says similar for me, but at least it can be somewhat accurate
iam not trying to get the ip of players.. what iam trying to do is simple i guess
it can be but it could also be just wrong
like no more than +/- 1 hour
just put the time when player bought a item from shop
yes and hence it's inaccurate
Yeah I don't think I disagreed with that lmao
however without user input there is not much else that can be done except querying the client locality to help further estimate XD
you need to have user input if you want accuracy
I'm going to give you some advice and I do really hope you take it. Dates suck, they suck really bad. If you want some kind of expirey system use a countdown like 1h 5d 12m 30s etc that ticks down when they look at it. Using dates is horrible. If you're worried about performance of such items use a date and provide a timezone too, but for gods sakes stay away from trying to make accurate dates you will be coding this until the day you die. And the day you die you're code still won't be good enough to cover all scenarios
why not just use a bossbar / actionbar / toast message to display when the item expires
make like: Expires in "1h 30min 51s" instead
coll did that for a placeholder
wont work very well for items
cuz of constant item meta updates?
love this explaination lol
yea dates suck
iam not updating it anymore.. its final
@worn fern do you agree?
they're not
Long timeLeft = manager.getTimeLeft(BoosterType.SKILLS);
return DurationFormatUtils.formatDuration(timeLeft, "HH:mm:ss", true);
they are :P but you seem to just be really provocative with that one
The server just uses it's local time, which can be different from the player's time
then explain me how tf china can fit into one timezone
yes that's the problem
It's a country and it has decided to use just one time zone
I'm begging you to not solve this and to just slap on a timezone. You will thank me later
nobody's stopping them, cuz why and how would they?
but that doesnt make sense in logical terms, since daylight differs from region to region
I'd just only display "3 hours left", "~50 minutes left" etc in the lore and for the final countdown use a bossbar or toast message
Yeah it does. That's why date and time also differs.
?_?
why they decided to have just one: no idea
did you use toString()?
am gonna go sleep
im going to bed, whoevers here later if <none> comes back tell them to learn java and dont give them support bc they just refuse to listen
ya also from europe?
they keep having the same problem lol
ye
Nice
and its the sme answer every time idk what they expect
well its getting the machine time zone
It's 0:31 am for me
they get help, it doesnt work so they delete what they were told and come back the next day
so iam trying to make it get the time when player click on item in shop
lord have mercy yes the code isn't broken time is
Goodnight
😭
imma go to bed now, gn8 everyone
gn
sorry you're just bringing back my trauma
😨 timezones there's nothing scarier in life than timezones
Did ur gf say gn once then not repsond for 9 hours
every fucking time man every fucking time I hate whens he does that smh smh
when he
either make an ip look up request to determine the timezone of the player when they join
I also said this 😭 but i'd prefer he prevent all the pain
but the countdown will not work , after server restart will it now?
Y2ks gf is secrelty bf real
:p oky
you'd save it on the item pdc as t he actual server time
and then translate it for the player to "their" time hopefully maybe probably not
my IP rn is from a timezone over lol
Is this 3 stable relationships in the spigot discord
no she's gf. She could be bf though I wouldn't mind
NBT still exists in 1.8
so he could persistently store NBT on the item
Nbtapi
one would assume that 1.8 is so ancient, it didnt even have any animations so there'd be no problem in updating the lore every tick
did 1.8 have animations? its so long i forget
It didn't have models
i think so, otherwise he could just update the lore every second to say "03:39 minutes left"
Thank you friends , yes i got the idea and iam working on it , will give you an update when i finish
It might be 4
Way too many
Yo alex I might need your financial support
huh
where's all your spigot pr's been slacker get back to work
i wanted to go to bed lol
some idiot decided to throw a water bottle at my face and my glasses brokey
anyways I just burned like 95% of my savings on some new ones
And I got a bunch of stuff coming up next week

there is the animation bug in 1.8.8 tho :p
if i update the item lore every second uhh , it kinda of weird
oh yeah it flashes
yeah
it was full
of rocks
yes and its the same thing , iam trying other aproches
iam in the future now :
xDDDDd
Im trying to make a tablist plugin but the server isn't seeing the plugin, I pressed the green arrow in Intellij Idea and it compiled the plugin i think, and I put the jar file in the plugins folder but it doesnt see it
package figstablist.figstablist;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
public final class FigsTabList extends JavaPlugin implements Listener {
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
event.getPlayer().setPlayerListHeaderFooter("Welcome to My Server", "Have fun playing!");
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
What do you want me to add
name: Fig's TabList
version: '${project.version}'
main: figstablist.figstablist.FigsTabList
api-version: '1.20'
authors: [LitNotFig]
description: E```
idk 🤷♂️ lol I'm just bugging you for the sake of bugging you
There must be some errors in console, look for them
1.20.1
That would not work, as yaml would then be parsed as double
[WARNING]
[WARNING] Plugin validation issues were detected in 3 plugin(s)
[WARNING]
[WARNING] * org.apache.maven.plugins:maven-compiler-plugin:3.8.1
[WARNING] * org.apache.maven.plugins:maven-shade-plugin:3.2.4
[WARNING] * org.apache.maven.plugins:maven-resources-plugin:3.3.0
[WARNING]
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING]
that came after the compiling finished
Console when you start mc server, not when compiling
fair, very fair
ur not verified
hold on
?paste stuff if its text
!verify
Usage: !verify <forums username>
Don't send file, look for error on your plugin startup and send it with pastebin
?paste
Try reading error
I'm sure you would come to solution yourself
i didn't think to read that file, i thought it was the same as what console shows during startup
ty
Why am I getting such an error, can you help? Needless to say but I'm new btw =)
registerEvents
🤦♂️
I'm trying to use placeholder api and it says to replace {VERSION} with the version at the top of the github, but its not working, it just keeps saying its not found.
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.3</version>
<scope>provided</scope>
</dependency>
Did you add the repo?»
yeah
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
why are you still trying to fix this
so if for example i bought it :
and the time was : 2:45 am
and in the item shop.yml config file the duration time was 1 hour , it should be added in lore as :
expired at : 3:45am ..
is your local time your server time?
then it won't work no matter what you do unless you query IP's for general location
why do you keep trying this?
Why bother even doing that? Timestamp comparisions are all you need.
I thought we were over this a hour ago
any idea then??
should i do countdown , but countdown will reset when i restart the server ..
why are we not using NBT?
Timestamps...
iam using it
NBT persists unless 1.8 clears all NBT (which would break items)
Does this code add a item or modify pork https://hastebin.skyra.pw/yikinecidi.java
adds an item
Ok thank you
can you not code?
All you have to do is store the timestamp, and then compare it when the player uses the item.
Or make your comparisions in a scheduled task (this would be less performant, but would be a bit more accurate if you wanted to remove the item at that time)
already have a way to remove it . if player join , use item , damage item ..
What's the problem then? You have everything you need.
?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() {
}
}```
If it's really large
Sweet
?paste it
what theme are you using?
I sent it via DM.
How does broadcastMessage and sendMessage differ?
I know one sends to a player and then one sends to the server
the problem is I cant seem to broadcast an Entities location(x,y,z)
hey! im looking for someone interested in working with my to continue work on my op prisons server. im not sure if this is a good place to ask but i thought i would just try :) i had a developer but she quit before we had a polished product. i have the skript files of the unpolished product, so its half of the work done. we did a day of beta a month ago and had a solid 30 people playing and already wanting more, so theres money involved :) just let me know, dm me. serious inquiries only please!
"developer" "skript"
Wtf is a skript
minecraft skripting language
the language she used, idk im not good with code
w
thats why im looking for help xD
i was front end she was back end but she just decided to stop lmao
wouldnt call it a language
Send a small screenshot of a bit of it. I wanna see this 🤣
skript is also really unperformant
exactly my point, im illiterate with code
you'd be much better off using java
I wanna see what this looks like lol
^
i cant send pics
Can't leave us hanging now. I need pictures of spider skripterman
i cant send pictures :(
Copy and paste some of it
function view_Crates(p: player, t: text):
if {_t} = "bronze":
create a gui with virtual chest inventory with 3 rows named "Bronze Crate":
make gui slot (all integers between 0 and 44) with black stained glass pane named "&7"
make gui slot 10 with paper named "&2$&a100M&f-&2$&a1B" with lore ("&7&o50%% Chance")
make gui slot 11 with paper named "&2$&a250M&f-&2$&a2.5B" with lore ("&7&o30%% Chance")
make gui slot 13 with sunflower named "&e10K&f-&e25K Tokens" with lore ("&7&o10%% Chance")
make gui slot 15 with sunflower named "&e25K&f-&e50K Tokens" with lore ("&7&o8%% Chance")
make gui slot 16 with tripwire hook named "&7Silver Crate Key" with lore ("&7&o2%% Chance")
open last gui to {_p}
thats a single crate code
I should apologise. No, it isn't bad. It is just that Skript, to my knowledge, isn't something widely used? At least not in spigot AFAIK.
We use the spigot api, which allows us to write plugins in java which is vastly different to what you have there.
This is closer to what we write.#help-development message
that looks like gibberish
LMAO
the only coding ive done is basic html and the tiniest bit of java(to make easy things like blackjack and battleship)
and that was like 2 years ago xD
I know next to nothing about skript. But you had the guts to roll into a server like this and ask for help after ur dev left u high n dry.
So whilst I'm legit to busy to help ya, and it goes against the norm in this channel, I dunno, I got a gut feeling ur a good kid.
So with that in mind:
First person to help this kid get an MvP of whatever functionality his prison server idea needs, I'll buy em a month of intelij ultimate 🤣😁
if this isnt allowed ill stop
just thought id throw the rock in and see the ripples 🤷
It isn't, but I dunno I've been here nearly a year and u give off a good vibe. So yeah legit someone help this poor kid out 😅😁
just get an OSS licence
dont get anyone anything xD
OSS licences are free for the user if they have an open source project
why not just use a crate plugin
My team does private comissions
Or is it legit one singular open source needed. That sounds waxk
i tried getting her to use a crates plug in but she was hellbent on coding everything herself
you just give them a link to a repo and say what it is and they'll give you one
maybe they discovered how to use skript and wanted to make something with it
well what she did is way less effiecent and at that scale will probably cause your server to lag since skript is highly unoptimized
it should only be used for simple command imo
no its her like 10th server
interesting
not prisons, the one she pours most of her time into is a gen server
gen server?
yeah
im dumb whats that
like a idle tycoon type thing
with other aspects but
Hey Guys, Im working on 1.20.1 And WIth NMS Reflection.
And I want to spawn a armorstand with my reflection code
But I don't know how create a constructor of it.
The reference is below
https://mappings.cephx.dev/1.20.1/net/minecraft/world/entity/decoration/ArmorStand.html
Below is a normal code without reflection
CraftPlayer craftPlayer = (CraftPlayer) player;
PlayerConnection playerConnection = craftPlayer.getHandle().c;
Location location = player.getLocation();
WorldServer worldServer = craftPlayer.getHandle().d.D();
EntityArmorStand entityArmorStand = new EntityArmorStand(worldServer, location.getX(), location.getY(), location.getZ());
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(entityArmorStand);
playerConnection.a(packetPlayOutSpawnEntity);
And Here's My reflection code
Object nmsPlayer = p.getClass().getMethod("getHandle").invoke(p);
Class<?> test = ReflectionUtils.getClass("net.minecraft.world.level.World");
Object minecraftServer = nmsPlayer.getClass().getField("d").get(nmsPlayer);
System.out.println(minecraftServer);
Object plrConnection = nmsPlayer.getClass().getField("c").get(nmsPlayer);
System.out.println(minecraftServer);
I want to know how to get the method from this nmsPlayer.getClass().getField("d")
And I wonder is it the same thing between (This returning entity player from reflection) Object nmsPlayer = p.getClass().getMethod("getHandle").invoke(p) and CraftPlayer?
version: 1.20.1, hash: eb240e8ee5
im trying to make a bungeecord motd plugin for my server which shows random motds & accurate player counts. the plugin seems to work fine with no errors in the console and the correct motd information comes up when i ping my server with minecraftpinger.com. but, when I use an actual client to view the motd, it says "Can't connect to the server" in dark red instead of the motd. i can join the server just fine, just cant see the motd. if someone can look over my code to see if any of it is breaking clients that would be much appreciated 🙏 https://paste.md-5.net/tivuxanocu.java
rubs hands together we just found a whole new niche of player to exploit lads lol
Jk
You have classes inside classes? 0_0
bros never heard of an inner class
It says "Dependency 'me.clip:placeholderapi:2.11.3' not found", did i do this right?
looks good, did u refresh the pom in ur ide?
how do i do that
if ur on intellij theres a Refresh icon that normally pops up when u edit pom.xml, otherwise press Maven in the right side of the screen and press the Refresh icon (above the projects name)
if ur on eclipse-- idfk, havent used it in like over 7 years
yeah normally this little buddy pops up when u edit pom.xml
huh
or u can use this one :P
i meant you don’t have to pay them anything
ok so if i use a 1.20 client i can see the motd just fine, im only getting the error with a 1.8.9 client
u could do Method getWorldMethod = MinecraftServer.class.getDeclaredMethod("D"); and invoke it with getWorldMethod.invoke(minecraftServer);
if im not mistaken
or however ur getting classes, thats how u would provide MinecraftServer.class
I have but I seldom find a reason to use them.
Case and point, that code be looking hella painful to read lol
sometimes it just makes sense to do inner instead of a whole new file :P
Hukkit? Sounds like Bukkits southern cousin
LOL
You hurt my soul
its my library for my plugins :v https://github.com/winnpixie/hukkit/
Huh neat
Is there documentation for this, idk if I would search paper, spigot, or maven or smth else to find it
nothing fancy :P just to not have a shit ton of boilerplate for myself
for wat
theres docs on https://spigotmc.org and https://papermc.io for making plugins yes
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
?jd for spigot javadocs
Yeah we just finished the package of our in house library to wrap sql tables.
It's god tier to write 10 lines kf code and have a fully complete SQL table 🤩
Hello there. Not sure if this or help-server is better for this question. Ive found alot of mixed answers about this question and figured here is the best place to ask it. I was looking into mixing my bungeecord network with forge and vanilla servers. Is this a supported thing or no? If its not is there a way to actually do vanilla and forge?
Hello there. Not sure if this or help-server is better for this question. Ive found alot of mixed answers about this question and figured here is the best place to ask it. I was looking into mixing my bungeecord network with forge and vanilla servers. Is this a supported thing or no? If its not is there a way to actually do vanilla and forge?
Sorry mb I just thought I'd also copy your message like how you copied it verbatim from ur other post in server help
Just be patient and someone who knows well help u out
ok, only reason I copied was I wasnt sure which channel to put it in
if its related to code you wrote, or are trying to write-- #help-development
if its related to a plugin (or just general server config) on spigot or bungee-- #help-server
ah so #help-server is better thank you
Is it possible to force the client to open the advancements menu
I can't believe mojang ticks signs just to check if there is a player who is allowed to edit it 💀
public static void tick(World world, BlockPosition blockposition, IBlockData iblockdata, TileEntitySign tileentitysign) {
UUID uuid = tileentitysign.getPlayerWhoMayEdit();
if (uuid != null) {
tileentitysign.clearInvalidPlayerWhoMayEdit(tileentitysign, world, uuid);
}
}```
bro legit could do this in the getPlayerWhoMayEdit() call muh CPU cycles 😭
Thank uuu I'll try it later!!!
PR a performance fix 
probably will eventually, but I have other sign PRs I'm doing in the same class and I don't feel like fixing merge conflicts
they were probably like hm this ticker method would look ugly empty what to put here 🤔
im quite new to java and i've googled and done all that so i thought coming to spigot might be of help
Could someone give me an idea of what could be causing this java.lang.StringIndexOutOfBoundsException: begin 76, end -1, length 108
the code is trying to get an index in the string that doesn't exist in this case ig you're trying to get a -1 which wouldn't be an index as indexes start at 0.
why are your classes like 40,000 lines long
its uh
not
oh it might be cus my obfuscator
or smth
lemme try the non obfuscated one rq
why are you obfuscating
don't
its pointless and a waste of everyones time
always wonder why people obfuscate their code are you affraid someone is going to see how poor your code is
Yes

