#help-development
1 messages · Page 1266 of 1
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Read the tutorial
Same problem
Send your new pom
is there an easy way to dynamically update a gui that a player is looking at? (like updating a list of player heads or removing a specific item)
is there a way to check if the server is running on a localhost?
every server is running on a localhost
are you asking whether the server listens to connections on the loopback address?
yeah
a server is always on localhost
you want to check whether its not public
there's Bukkit.getIp() but i have no clue what that actually returns as it's a string
yeah
It’s whatever is in server.properties
ipify?
Which is usually blank
just checking whether it's listening on 127.0.0.0 or whatever is probably enough
and if blank, it doesn't necessarily mean that it's non-public, right?
that doesn't mean its not public
not 127.0.0.1?
like what for example?
Correct
so what apis can I use?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
So what's the goal, why do you need to check this
The client provides the ip they're using to connect
For most cases you can use that
Do add a config override ofc
Other than that I believe aws has an api that returns the ip of the caller
You already mentioned ipify so use that ig
oh yeah
yeah but its weird
on my localhost it returns my ip
but my client cannot connect to it?
for (Player target : Bukkit.getOnlinePlayers()) {
if (target.equals(viewer)) continue;
List<EntityData> metadata = new ArrayList<>();
metadata.add(new EntityData(15, EntityDataTypes.FLOAT, scale));
PacketEvents.getAPI().getPlayerManager().sendPacket(
viewer,
new WrapperPlayServerEntityMetadata(target.getEntityId(), metadata)
);
}
is this wrong for making other players scale to the scale for my client?
the opened port must only allow local connections
or something
I don know
Some routers do not like you connecting with your own public ip
Mine for example does not allow that
That means I cannot connect using my public ip but others can
*Not actually sure if it's a router thing
private void setScale(Player viewer, float scale) {
viewer.sendMessage("§aStarting set scale");
for (Player target : Bukkit.getOnlinePlayers()) {
if (!target.equals(viewer)) {
viewer.showPlayer(plugin, target);
}
}
viewer.sendMessage("§aPlayers are visible");
for (Player target : Bukkit.getOnlinePlayers()) {
viewer.sendMessage("§aStarting players packets");
if (target.equals(viewer)) continue;
List<EntityData> metadata = new ArrayList<>();
metadata.add(new EntityData(15, EntityDataTypes.FLOAT, scale));
viewer.sendMessage("§aAdded entity data of 15 as " + scale);
PacketEvents.getAPI().getPlayerManager().sendPacket(
viewer,
new WrapperPlayServerEntityMetadata(target.getEntityId(), metadata)
);
viewer.sendMessage("§aSent packet to the player");
}
}
it prints all the things so i assume my packet thing is wrong
👀
tbh i think the packet id is wrong ill ask in packetevents
???
can you send me that page
sure did
did they even have scale as an attribute back then?
NO LMAO 😭
still cant get it to work my brain is fried
how am i supposed to send it to the player
send this
Would you mind giving me an example?
Yes sir, sorry I try to solve the problem but I failed
Boats, when given a boosted velocity, will move faster until the boost stops being applied. They then go from full speed to 0 in a single tick, instantly halting without any collision or anything unusual. This is infuriating. Is there another way to give a speed boost to a boat without causing it to then lost 100% of momentum to nothing?
Motion is usually handled client-side
I know that input is handled client-side. The boat has to sync with the server though, and I know boats have issues with syncing. Makes me wonder if it has anything to do with that, but the server doesn't at any point run behind, and there's no "moved too fast" issues in the console.
Was just wondering if maybe whatever was causing it to stop could be client-sided?
Oh, wait a minute
Do you mean that the tick you stop applying the boost, the boat’s velocity drops to zero?
If so, are you certain that there’s nothing in your code that would set the boat’s velocity to zero?
Also are you sure it’s not friction with the ground causing the slowdown?
?mappings
Compare different mappings with this website: https://mappings.dev/
If someone came to you and said "why don't we make an API for guis that functions like standard markup langs, as close as we can to simulating such a system we can then create sub sections in a gui and style it how we want, for instance we can make a header object and reuse it all over the plugin"
what adjective would you use to describe that person?
Is there a way to serialize and deserialize a Sign in one go without having to store it's location and lines manually?
I need to store it in a SQL database
whats the best way to make an variable that stores how many players have joined my server? and how do I make it so it will still be there after an restart?
What a strange roundabout question lmao
Can just store it in a config file
Pretty sure theres an inbuilt thing for that tho
would it be too crazy?
abstract GUIElement
abstract container extends GUIElement
abstract button extends GUIElement
Thats how a lot of gui libs do it
Thought you meant an actual markup interpreter
It’s just not really practical to have layout elements like that since it’s a tiny grid
I scoured the net and didnt find consensus on which gui api is best
that's the biggest issue yea
Plus Thats another level of abstraction which might be annoying for users
only necessary abstractions
hmmm
I still want to reuse layouts around my plugin tho
I cant imagine placing each button individually for each menu
does spigot offer a way to show the progress bar of a custom merchant interface or do i have to use nms for that
How would I do that
You can get getOfflinePlayers then size of the list
Not sure how efficient that is thi
So long as you don;t wipe the cache yourself offline player count is accurate. They expire in teh cache but are still counted
hm but will the offline player count add 2 when someone joins, leaves and joins again?
and I get this error when trying to join
In my join listener file
@EventHandler
public void onJoin(PlayerJoinEvent e) throws InterruptedException {
Player player = e.getPlayer();
e.setJoinMessage(ChatColor.DARK_GRAY+"+ "+ ChatColor.WHITE +player.getDisplayName());
wait(10);
e.getPlayer().performCommand("sb");
}
?paste
It just counts all players
No duplicates
Hm but I like want duplicates, I want the total joins
How would I do that?
Okay thanks
this is my main file currently
package de.constt.idleeClicker;
import de.constt.idleeClicker.commands.OpenScoreboardCommand;
import de.constt.idleeClicker.listeners.JoinLeaveListener;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
public final class IdleeClicker extends JavaPlugin {
public FileConfiguration config = getConfig();
@Override
public void onEnable() {
// Commands
this.getCommand("sb").setExecutor(new OpenScoreboardCommand());
config.addDefault("joins", 0);
config.options().copyDefaults(true);
saveConfig();
// Listeners
this.getServer().getPluginManager().registerEvents(new JoinLeaveListener(), this);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
how would I now add 1 to the joins value in the leavejoinlistener class when someone joins?
Get the value, increment it, then set it
How do I get the value in the other file?
I may have found out how I could do it
yup works now, thanks for the too
what's a NodeClickContext?
Is that even a spigot thing?
Somebody clicked on a node
Or a node made a click sound
im tryna use this GuiAPI and the documentation looked alot simple than in practice
Are you just making this up lol
every button trigger needs a NodeClickContext() with like 10 parameters
no idea how to fill all that up
Where did you find that api
what better use? pdc in chunk for save block data orlocaton and data file?
Has 2 stars and last commit was 11 months, wouldnt trust it
Depends what data
do you have a favorite?
Im trying to find a decent one
Chunk pdc then
ok
I use an in-house one so wouldnt know
I make a plugin for a mini game something similar to mario kart and would like to know if there is a way to make it so that if the player goes outside the road (void) the plugin will recognize it?
i think about marking blocks but not all air blocks should be marking points
there are places where the player can fall down and there's another road.
maybe I should use air from the void?
where player can get damage i gess?
listen to EntityDamageEvent and check if the cause is void damage maybe
yea thenks
This is my current code for an scoreboard. How can I make it so it will update every second cus right now the join count doenst update
https://pastes.dev/gQHucaOmBM
Guys this limiter does not seem to be working
And the server gets crashed. What were you guys trying to achieve?
Flamecord
Its the packet limiter recently added from bungeecord
is there a way to increase all mobs health by a certain percent
or do i have to do onEntitySpawn ... etc
Seems to be the tick after, I've not confirmed one way or the other. If I have the boost applied on a timer so it's repeating each tick it keeps going smooth.
Ground friction is extremely unlikely, since the boat is on ice during all tests.
There's only one line of code affecting the boat in any way, and it's the line where I am setting velocity.
iterate over all entities in a world?
hhhhmmmmmm alright
And in that line, I get the boat's direction and multiply the velocity by that vector and a factor of like 1.1
Seems to be kicking everyone when someone spams packets
okay, any anticheat nerds here?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
hi olvio
🤓
so I was wondering if there is any way to patch f3+s exploit
What's the exploit
Wtf is that
what is f3+s
it causes a game reload
like F3+T but not for textures
so your client freezes for a moment
basically that
why would anyone use this
Ok but what's the exploit
Dumps contents of dynamic textures and font textures to screenshots/debug/
because client motion
from wiki
there is no knockback
yeah so
An noknockback anticheat will be as good as it gets then surely
That (was?) a big thing hackers would do on hypixel
If they got knocked into the void they would cause themselves to lag and then they’d get warped back by the anticheat
Btw the upstream bridge is the connection between the player and the server right? I am wondering why the packet limiter even if closing the channel, the packets are still being received
Maybe some isClosed checks are required when processing packets
Does anyone know how spigot handles exceptions such that when a plugin throws an exception It can still resume execution? I'm designing a service module system and want to implement similar so when they fail or throw exceptions my entire applicaton doesn't die with it.
I understand i can just try catch somewhere but is there a proper design pattern to this?
semantics, but they're not really "hackers" if it's built into vanilla minecraft
Some anticheats take control of the player’s movement after a second and simulate the player’s movement
it try/catches in relevant places
then logs the error
A standard antiknockback will not fix this since the player is just freezing their game. You could probably modify Grim to achieve this though
No, in the event calls, command execution, onEnable, etc
Basically just where you'd expect, nothing fancy
Yeah
man this is so aggravating. i can't come up with a scalable concept for my GUIs
how does hypixel do it for example
they have buttons that decorate other buttons, changing meta data, paginators and player lists
a layout for each gui
all of those sound like complete different things
but they're all GUI related.
sure
but, how do you know hypixels design is scalable
maybe they hardcode every menu
that makes my GUI system so large and forces me to consider all the customization options for every single GUI element
usually the way to make it more scalable is to remove it further from the inventories that they actually are
abstraction
if you have a class like a button, window, window section, paginated window, etc
yes
then the challenge becomes implementing those things for minecrafts system and having them work together
but idk what your goal is
but I'll have to force all my inventories to be the max size or else I'll also have to consider laying out all those elements and adapting them to the inventory
I mean..
I mean I guess
there would just be a function to determine how to fit a layout into an inventory
like normal ui frameworks do
I'm making a mingame plugin so almost everything from a main menu, lobby page, personal settings, paginator to browse through all online players to invite
picking abilities
oh man
and what are you stuck on exactly
I am stuck on the very beginning.. the core component relationship diagram
how is everything gonna fit together
I wouldnt worry about that
I would single in on a single menu
implement that
and then look at the next menu and determine how you can refactor it to get reuse of your first one
determine what things can stay the same, what things you would want to move around, and what things are specific to the actual menu in question
right now I have a PagesManager that has InventoryGui objects mapped with a PageEnum (PageEnums.MAIN_MENU and so on)
and each InventoryGui has its Bukkit Inventory and a map of slot integers InventoryButtons
each Inventory Button has its Itemstack
so the issue I ran in is that to implement a Menu, I will need handreds of lines for making each Itemstack with its MetaData
and set them manually one by one for each page
okay
this makes my Menus ultra static and not dynamic
so then can you identify what parts are unique for every item and what things are the same
So I got this as my scoreboard command currently. Is there an way to make it not an command and make it like just add the scoreboard to the player when someone joins? Like without the command
I have OpenInventoryBtn which extends InventoryButton
do the command in the join event listener?
Im already doing that right now but I dont want it as an command
yeah
for it
So I just put all the code into an function in the class and then when someone joins I pass the player and then just set the scoreboard?
yeah
whats the static part you are referring to
Okay Thanks!
I just pass the inventory I need to open. but it's more about the Item Stacks for instance...
in MainMenu.class
https://pastebin.com/sLX3Pn5Q
and in LobbyPage.class
https://pastebin.com/SL2eNmnD
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
you mean like the positions and text of each button?
I reuse the same buttons but I have to instantiate them each for every page
If I want to reuse Buttons, then I'll have to consider all my plugin's worth of logic into that button class which also is not a clean way
cant you just use consumers for the button?
like you have a button itself
and then the function/consumer its gonna call
consumer?
I never heard of a function/consumer btu I know what lambda functions are
hm
its basically the same thjng
so the buttons logic would be page specific
a consumer is an object that takes a lambda that has a single argument
not plugin wide
yeah in this case the win is that you dont need to setup your button each time
if the button has the same consumer logic then you dont even have to use different functions
you can have buttons have a default function
like a new CloseButton(menuToClose);
that calls menuToClose.close() when the button gets pressed
I never did smth like that before. is there a documentation I could use?
ways to turn your menus into compositions of simple actions
but I get what you mean structurally now
documentation for what
a Consumer is a functional interface
but yes, you can use functional interfaces with lambdas
?gui
I saw this before here
I think the last snippet is exactly what you're mentionaing
but I didnt really understadn it at the time
yes
you can see that InventoryButton has an eventconsumer
what it does it consumer.apply(event) which calls the consumer function with that event
its a way to create your objects without the button itself knowing what its gonna call
Im currently using the showScoreboard function in an join and leave listener class so that when you join it will show the scoreboard. How do I make the scoreboard update the join count cus right now Im trying to use the Bukkit.getShedular to like update it but it doesnt work.
In my plugin there are certain trigger blocks, crossing which cause certain events, but I don't know how to check if the player who rides on armor stand entity (mtvehicles plugin) has crossed this block.
Does anyone know why player.getAttribute(attribute).getDefaultValue() returns 0.7 when the default value actually is 0.1?
I mean don't know of an optimized version how do it
For which attribute
just check playerMoveEvent on blocks, and check only if int has changed, don't check doubles
if you have a list of blocks which you want to detect, just check it through the Map or List
Maps are better because you potentially save up alot of compute power to get the needed block
compute power
the list or a map needs to be final and static anyways, cached. does not make much difference at the end to be honest
I mean depending on what exactly you need - perhaps some sort of graph or tree scale even better than a hash based map or array based list
🙏
depends on what kind of scaling you need. In the worst case scenarios tree and hash are the same in time complexity. Space complexity they are both the same. Really the difference between the two is that tree is sorted where as hash doesn't have a particular order
and with that, I am off to bed
my hot take, a method should take only parameter type it really needs, unless its part of an api contract and the implementation isnt known (like event listeners)
if method parses usernames it should take either a value type for representing username or string instead of fat Player objects
movement_speed sorry should've said that
Entirely depends on what design pattern you use, and how you wanna compromise on different aspects in your infrastructure, it can definitely be worth to pass the explicit dependency at times, but just as much, if you’re using an observer pattern as example, chances are you wanna bundle a context type to provide reusability
for that, yes, but what i want to emphasize that only public contracts should expose types in more generic ways, if your interfaces exist just for the sake of internal representations only, you shouldnt waste time either making dtos or passing player objects where you could just pass what you need
That’s if you only care about theoretical scaling, there’s much more to it, for example spreading the hash map keys, spatial neighbour access etc - not the only real difference
Define public contract
depends a bit on the impl and data set, the java stdlib hashmap will only have the same time complexity properties as a tree if every member of the key set hashes to the same bucket
public interfaces which are used externally
other hash map implementations don't use tree buckets at all and degrade to O(n) time complexity in the same case
externally do the degree of? Module? System? World?
lets say public interfaces whose implementations can only be retrieved through some kind of factory classes
but can be only exported through modules as well
likewise other implementations can be quite a bit lighter in terms of space complexity, e.g. fastutil linear probing hashmaps store all entries in a pair of flat, associated arrays rather than spawning Entry objects for them
a better rule of thumb when deciding between map vs. list or others, like i've talked about before, isn't really the complexity properties of the collection but the properties of the data set
I mean maybe, I kinda disagree, I do think segregation and aggregation is a lot mote complicated- it simply cant be boiled down to some principle
Sorry if it's the wrong area but anyone know the max number of map images in 1.16.5? Wiki says in 1.13 they're "no longer limited to 32,768", which is vague.
should duplicates be eliminated? use a set; do you need order? use a linked map; do you need both order and must allow duplicates? use a list; need duplicates but not order? use a multiset
for example in Craft craftbukkit prefixed classes you should use stricter types since those interfaces wouldnt need to ensure ABI compatibility after changes but for bukkit api intefaces you should use generic types since those types would be accessed externally and you cant predict what user of the API contract would need
Eh I mean bukkit with its interfaces is a bit special, since like 90% of them don’t allow extension as per api specification
i feel like stricter types can enforce better abstractions since in more generic types, you can have implementations of the same functionality which wouldnt use specific objects from the parameters per se
Is this the place to look for people to join the team for plugin development?
but you lose ABI if you change something up in method signature
what do u mean w stricter vs more generic types?
probably int max
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
generic: passed Player object, where in method body i just retrieve username via Player.getUsername()
strict: passed string object, which represents username
i believe you should prefer stricter types for internal representations which are not used in public contract
32 or 64 bit?
but for public ones you should prefer generic ones
ints are signed 32bit numbers in java
int in java is 32 bit
Sometims you wanna enforce the consumer to pass a Player object tho, that guarantees invariants that a String type itself cannot support tho @mortal hare
Alright thanks 👍🏻
too bad java doesnt have std::size_t
not about size
yes, but that's mainly happening from public contract side
for example allowed characters in such string objects
not from internal classes or code
you just pass a second parameter
sure it can get out of hand, but if your method requires lots of params, something is wrong either way
why should I pass a second parameter when I can be given the invariant for free by simply passing Player instead?
because you're tying the algo to the player object where it can be decoupled from it
As said, it entirely depends on situation when to use the aggregate type vs some explicit type- on the invariants, the modules scope etc
But everything isn’t about decoupling
yea fairs
the bitter truth
"we should always do things according to this paradigm/principle" is at the peak of the dunning-kruger graph
120%, think frost mistook me for the literal time + space complexity; which rarely ever is the entire story, data structures may scale in other aspects nonetheless
anyone know how to check if the inventory that a clickevent is in is the inventory that you need?
why is your pfp you showing your titties
its not me
im really confused
[17:55:34 ERROR]: Error occurred while enabling CrazyGenerators v0.0.1 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "info.sokobot.crazygens.Main.getCommand(String)" is null
at info.sokobot.crazygens.Main.onEnable(Main.java:140) ~[Crazy-Generators-0.0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-388]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:665) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:432) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1164) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
getCommand("crazygensreload").setExecutor(new Reload());
have you put the command in your plugin.yml
no... I just added it and it worked.
yeah i havent done plugin development in a minute
nice tan line
damn bruh 62 hours in the eclipse ide
insane hours
idleing
Hello quand j'ouvre le GUI buildtool j'ai cette erreur:
java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source) java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source) java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source) java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source) java.util.concurrent.ForkJoinTask.doExec(Unknown Source) java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
what the heck is this spam message in the console
i dont want that in the console
just process this stuff without broadcasting it to the console??
which idiot decided this was a good thing
apart from that, message like this .. everything it wrong with it
1: "in this world" - can there be multiple end worlds? can you end the game multiple times?
yes and yes
that said the message is still ass since "this world" is ambiguous
unless perhaps there is a preceding message naming the world
i don't remember if there is
How can I send a generic scale attribute as a packet to a client so the scale only changes for them?
I tried with protocollib but it says generic.scale nor scale exists
I used the latest stable build as well as the latest dev build both didn't work
Sure as soon as I'm home
where exactly does it say that?
oh okay
dont know which plugins are popular today as development APIS
Which ones I should know in general?
For example, I want people to be able to select specific areas of many maps as arenas and set player spawn points. I've done this before using start.bat files and nbt
when each minigame ends server will load other map that people vote most
im developing this atm
im planning to use worldguard
for designating areas, worldguard is industry standard
spawnpoints or other points of interest i don't think there is any popular framework for, you typically just load those from a configuration file
i sometimes use marker entities for points of interest but that is kind of 🤡
i did this before btw but i used start.bat for loading maps for each starting. replacing folders after shut down and restarting it again.
when minigame ends i was shutting server down in my plugin
and bat file was restarting it
i have script
but im not gonna use that
i want to refactor my minigame
loading a new world and unloading the previous is generally sufficient and much faster than fully restarting the server
yes prob. but in that time i wasnt able to develop this.
there was no ai
like chatgpt & stuff
what
my learning resources was limited
yep
i mean this
what
There are billions of free java learning resources
yeah
anyway i dont want to debate for this
one of my old bat files
@echo off
setlocal EnableDelayedExpansion
set "source=D:\MinecraftDev\mc_server\mc_maps"
set "destination=D:\MinecraftDev\mc_server"
:loop
echo Deleting existing world folder...
rmdir /s /q "%destination%\world"
set /a "n = (%random% %% 3) + 1"
set "folder="
set /a "count = 0"
for /d %%a in ("%source%\*") do (
set /a "count += 1"
if !count! equ !n! (
set "folder=%%a"
goto :copy
)
)
echo There are not enough directories to copy.
goto :end
:copy
echo Copying %folder% to %destination%...
xcopy /e /i /y "%folder%" "%destination%\world"
java -jar spigot-1.16.5.jar --nogui
goto :loop
:end
using chatgpt to make a batch script to copy worlds is crazy work
I don't think chatgpt has existed since 2012
ai make it perfect but we was using this
"perfect"
server names was baskentcraft, aclikoyunları, i spoked with their admins
type to youtube, you will find videos
schizophrenia
real
bro yeah
look at the history
are you idiot or smthing
why you debating this
there was no ai
in that time
we was using their discord channel
to talk
and they said they also used bat script similar to this
and helped me a bit
I don't really care
can you guys take this to a dm
then why you call me schizophrenia
literally the worst method of doing this
yes i know
but you guys call me liar in help section of this discord
i just want to improve my methods
Is there any API method to get current moon phase?
World world = p.getWorld();
int days = world.getFullTime()/24000;
int phase=days%8;
So how do I set the phase I need?
something like this
switch (moonPhase) {
case 0: player.sendMessage("The moon is new."); break;
case 1: player.sendMessage("The moon is a waxing crescent."); break;
case 2: player.sendMessage("The moon is first quarter."); break;
case 3: player.sendMessage("The moon is waxing gibbous."); break;
case 4: player.sendMessage("The moon is full."); break;
case 5: player.sendMessage("The moon is waning gibbous."); break;
case 6: player.sendMessage("The moon is third quarter."); break;
case 7: player.sendMessage("The moon is waning crescent."); break;
}
I want to have an variable that every player has that is called clicks and when you right click an specific Item it should add 1 or more to the variable.
1st: What is the best way to do these "variables" per player?
2nd: How do I then add e.g. 10 to the count?
Like an count or variable that every player has
you can just revert the operation and set the time of the day
weird flex but ok
if it is specific to the player/item, you can use PDC either on the item or the player itself
^ it depends on your specific structure
If you want it in-memory use some sort of Map<UUID, Whatever>
if the count is supposed to reset if they lose the item or something, then I'd recommend on the item
So I want it so that every player has an count and when you right click e.g. an stick it will add 1 to the count. When you lose the stick, wich you can only by putting it in the trash via /trash and that you will always keep the count even if you die
BossBar supports ItemsAdder emojis?
I guess try?
if you keep the count regardless of whether you have the item o not, then it's probably better to use the Player's PDC
i try to use :sun: and it literally says :sun:, i don't know what else to try to solve this problem
what are ItemsAdder emoijs
ah if it works this way then it wouldn't work by default, no
you'd have to use some method to parse the namespaces, but I doubt ItemsAdder provides API for that
😦
i'll check
I'm using player#launchProjectile, but I want the projectile to launch from 1 block below the player's eye level. does the launchProjectile method do that by default? The two locations/vectors I've modified in my code dont seem to have any affect on the projectile.
https://paste.md-5.net/howiyubera.cpp
https://paste.md-5.net/imenihoquq.cpp
Do I need to set the location of the projectile after I launch it?
the vector parameter of the ProjectileSource#launchProjectile method is for the velocity, not the launch position
if you want to launch a projectile from a specific position, it'd be better to use the World#spawn method and then just set the entity's velocity to wherever you want
you can also do what you mentioned and teleport the entity after launching it but that'd probably be visible as the entity is already spawned, though it depends on the player's ping
How do I use Players' PDC?
and what is that
?pdc
Okay thanks ill try that
works thanks!
private void setScale(Player viewer, double scale) {
try {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.UPDATE_ATTRIBUTES);
packet.getIntegers().write(0, viewer.getEntityId());
WrappedAttribute scaleAttr = WrappedAttribute.newBuilder()
.attributeKey("generic.scale")
.baseValue(scale)
.build();
packet.getAttributeCollectionModifier().write(0, Collections.singletonList(scaleAttr));
ProtocolLibrary.getProtocolManager().sendServerPacket(viewer, packet);
viewer.sendMessage("§aSet scale to " + scale);
} catch (Exception e) {
viewer.sendMessage("§cFailed to set scale.");
e.printStackTrace();
}
}
This gave the generic.scale error
You summoned me my master ?
do you know where you are
Does anyone know why player.getAttribute(Attribute.MOVEMENT_SPEED).getDefaultValue() returns 0.7 when the default value actually is 0.1?
What Minecraft version are you on
1.21.4
The wiki says it’s 0.7
I have set scale
Try without generic.
Did, I tried minecraft:scale minecraft:generic.scale and both without minecraft:
when I set the base value to 0.7 the player speeds asf but when I put it on 0.1 he walks normally...
¯_(ツ)_/¯
Do you have any modifiers set
It’s probably different for each entity, but the generic default is 0.7
not as far as I know. I tried this on multiple players and it was same with all of them and they had no effects either... What other modifiers are there?
Should I use one of the recommended versions or latest build?
I tried it in a singleplayer world without any plugins and 0.1 is still the normal speed
Well that worked thanks tf
Just tested scale works fine
If you weren't using scale before then it's that
[ERROR] Failed to execute goal on project BukkitGamesRefactoring: Could not collect dependencies for project me.erano.com:BukkitGamesRefactoring:jar:1.0
[ERROR] Failed to read artifact descriptor for me.erano.com:Core:jar:1.0
[ERROR] Caused by: The following artifacts could not be resolved: me.erano.com:MinecraftPlugins:pom:1.0 (absent): me.erano.com:MinecraftPlugins:pom:1.0 was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigot-repo has elapsed or updates are forced
[ERROR]
ProtocolLib just wraps the vanilla registry and therefor uses its names
is my usage wrong ?
or need systemPath
how do you make an item stack with a blaze head as the item?
You'd need to find someone with a blaze head skin and use that. I don't think there's blaze head in vanilla
MHF_Blaze maybe?
has anyone heard about Head Database?
could I just shade it in?
or is that a stupid idea
did someone ghost ping me smh
last i tried the headdatabase plugin/library/whatever it ended up taking like half a gigabyte of heap to cache the profiles or something equivalently inane
That’s why you just use the ones you need :p
the idea was to have it around for players to grab heads from, for decoration
Ah
while you could achieve the same result by telling the player go to minecraftheads dot com or whatever and have them paste the texture base64 in, nobody ain't got the time for that
I did make a system that displayed all the heads they have available
Seemed to work fine tbh
is it public somewhere? i'll grab it 🤡
I don’t know how I didn’t hit the Mojang rate limit creating that many player profiles
I did mb
can anyone help i registered commands in the onEnable and in the plugin.yml and it still doesnt show up
no errors in console
?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.
can you show both yml and your code registering it
mb its been a while before i asked for support
screenshot or codeblock?
screenshots are impossible to copy over and check
okay im not sure if i do anything wrong so lmk what i can improve on
This is the onEnable
getCommand("rule").setExecutor(new rulecommand());
getCommand("buildmode").setExecutor(new buildmode(invManager));
getCommand("info").setExecutor(new infocommand());
this.getCommand("bbreload").setExecutor(new configreload(this));
this.getCommand("report").setExecutor(new reportcommand(this));
name: BlockyBoxCore
version: '1.0'
main: me.dean.blockyBoxCore.BlockyBoxCore
api-version: '1.21'
authors: [ Paasdag ]
commands:
rule:
aliases: rules
buildmode:
permission: BlockyCore.buildmode
info:
usage: /<command>
report:
bbreload:
yml file ^^^
usgae string? like usage: /<command> for example?
They don't
lgtm
Are you calling that onEnable or somewhere else?
Does the plugin load?
Funky question time
Does it show up if you decompile it
(straight off the plugins folder)
Send it over I'll take a look
okay just dont judge my coding XD
I'll do it silently
alright both appear btw config.yml and plugin.yml
So by 'dont show up' do you mean it doesnt command complete?
or does it no execute at all either
none of these do anything if you're running it as console
it doesnt complete idk if if it runs but when i do ./blockyboxcore:report it also doesnt popup
and yeah this code is pretty ass but I could tell it before even receiving the .jar
oh 😭
well im trying my best atleast
Lmao mean
Just nitpicking-
packages should always be lowercase and calsses should always be UpperCamelCase
You have some tips in pins when you eventually get it working
alright
I'm surprised I never mentioned naming conventions
wdym
But anyways- unless I'm missing something the command registration looks fine
I have a million little guides and none of them cover conventions
your plugin isn't shutting itself down without you knowing
what if I just run this myself
hm
paper moment?
with paper you don't have to put commands in your yml
pretty sure registration should be the same though
oh didnt know
is there still an option to get support here or do i join paper's discord server?
Tbh if you wanna skip headaches i would recommend a command library which would solve all of this
but if you're determined, yeah I would recommend their discord
ill take both tbh which command library?
Theres quite a few out there-
I use ACF (Annotation Command Framework)
hm
i would prob need to rewrite a little bit of the code right?
most of it, yeah
But do your research on frameworks before hopping in
will do
I'm a fan of CommandAPI myself but I've found a couple weird issues w it
cloud's decent if you can get it to work
ACF's full of tricks imo
Because its annotation based?
Not that
We use cloud with annotations at work
and I'm certain CommandAPI has an annotation parser too
it's more around how many undocumented annotations you have to use
like wtf is a @Flags
tbf I also don't like how cloud needs me to @Arg everything
Maybe I don't really use commands in depth enough to run into those issues
Yeah the problem I have with other frameworks is how verbose they are
Eh
I do find CommandAPI's lack of consistent factory methods ugly
having to pass new Whatever as a param instead of Whatever.create
I don't like seeing orange in my params
do your command builder statements not get extremely long?
I feel Annotation enforces OOP a lot more than a builder method like that
albeit a bit more jankily
Separate classes
I don't really like making my lambdas big
tbf my commands also get pretty big
also my commands being ran async kinda trips me off but ig it's fine to let it be default behavior
no it doesn't
bro doesn't compile with -parameters
smh
did I spot light theme
screenshot from github, blame their readme lol
ts errors out for me I might be using an old vers
the issue is of skill
but yeah I don't mind code getting verbose either
I wouldn't say you need an ultrawide but you def need an ultra tall display
What would be the equivalent of a ContextResolver in cloud?
to deserialize a string to an argument type
ArgumentParser
why would you do that if it trips you off lol
it's fine in most cases just annoys me when I want to test something rq
Do you use cloud emily?
Sometimes I write commands that do IO and those times come more often than not
yeah i use cloud
throwback to my kt days where I could just sync {} anywhere
I should make an extension of lombok for minecraft fr fr
lomblock
🤔 is there any way to subtract a text component
wot
like remove part of a component?
if I know I added some gold text at the beginning of the name
and I know the new name
how can I get the old
You can with util methods in kyori, not sure about bungee components
yes
I'm looking for a plugin that can equip additional necklace orbs
necklace orbs?
gem
My English is very poor and I can only rely on translation
Want to equip additional necklace jewelry plug-in
Do you have any good suggestions?
i can pay
I don't know of any and It might be a bit niche
:(
D:
Hello. I want to know how to give a fake potion effect to player's client through ProtocolLib, i didn't find any tutorial or wiki about this.
You don't need to use ProtocolLib for that
declaration: package: org.bukkit.entity, interface: Player
Wow, thats really cool, thx
then what about fake gamemode? for example, actually survival but display creative mode
i saw that shortcut in my lecture's pdf in college
it was referring to Urinary Bladder
My brain glitched the moment i saw you write this
yeah that's not what I was referring to
Ye obv lol
Man i love this
https://simply-the.best/en/entries/gradle
Why Gradle is simply the Best
You have summarised what i have been trying to say to my friends (maven users)
I have armorstands i have circling an entity, except when chunk unloads it duplicates them
Despite boss being on left the ones on the right somehow dup
hey when im placing entities the server is crashing .-.
without error: [09:01:34] [Server thread/INFO]: Stopping server [09:01:34] [Server thread/INFO]: [SaberMC] Disabling SaberMC v1.0 [09:01:34] [Server thread/INFO]: Saving players [09:01:34] [Server thread/INFO]: ItzYami04x lost connection: Server closed [09:01:34] [Server thread/INFO]: ItzYami04x left the game. [09:01:34] [Server thread/INFO]: Saving worlds [09:01:35] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld [09:01:36] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether [09:01:36] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end [09:01:36] [Server thread/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved [09:01:36] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved [09:01:36] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved [09:01:36] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
just tried to create a custom wolf and spawn it on EntitySpawnEvent to spawn it naturally .-.
You have code you could show ?
running out of memory due to an infinite spawn loop
you will have a stackoverflow error in teh log somewhere
LF someone that knows how to code in Skript or Java for an SMP plugin! DM me for more info!
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
ik but I don't have 20 posts
You can look at people offering their services
I want to make the base version of my server 1.8.8 and I want it to be supported up to 1.21.5, what can I do?
I am installing via version but the file is not created, I think it works with java 17 .However, I need to use java 8 for minecraft 1.8.8
use 1.21.5 with viabackwards
probably won't work 😦
how so
but I'll try
is there a direct way I tried some versions and 1.8.8 can be 1.16.5 at most via version plugin
But whyy
Please stop making abominations
? what
plugins are made for java 8, there is no new version, can't I make the base version 1.8 directly, so that players between 1.8 and 1.21 can enter the server
?howold 1.8
Minecraft 1.8 is 10 years, 7 months old.
why do you want to support 1.8? its only really for pvp and 1.8 pvp can mostly be recreated in newer versions
in most cases it will just be hassle you dont want to go through
no
it's pretty different
?howold 1.21.5
Minecraft 1.21.5 is 1 month, 1 week old.
?howold 1.21.6
gotcha
?howold 1.8.9
Minecraft 1.8.9 is 9 years, 4 months old.
only 9
older than most people playing it
is there anyway to make Mount turn faster ?
like horse, boat
I want to increase turning speed
?howold 1.0.0
Minecraft 1.8.8 is 9 years, 9 months old.
damn
?howold 1.7.10
Minecraft 1.7.10 is 10 years, 10 months old.
the best version
older than some people in this discord
?howold Beta 1.0
Minecraft 1.0 is 13 years, 5 months old.
There we go
I have special block markers that should display a particle on it for certain players passing the filter. I'm thinking of doing this through ProtocolLib which blocks the particle packet so that the player doesn't see it if it doesn't pass the filter. Or make a false particle that is displayed if the player sees it at a certain distance. Which is better? I don't really understand the rendering process
If you simplify the options, the question is whether it is better to have the particle displayed by default but blocked or no particle and displayed falsely to players via packets.
just use the API Player#spawnParticle method, no need to use packets or aything
packets are needed anyway so that only certain players can see these particles.
which is why you should use Player#spawnParticle
so only the Player you call spawnParticle on will see the particles
as opposed to World#spawnParticle
Player#spawnParticle will show the particle only to the Player you call the method on
speed attribute for living mobs
boats ? no way I know to change turning speed or moving speed
Does the particle spawn if the chunk is not loaded for the player?
the client will ignore it at that point
nice
ah fuck I gotta make a menu component system
no you don't
it's the logical way out
I'm making a plugin for 1.21.4 and trying to create items with CustomModelData, but I can't get it to work. Can someone help?
I done that type shit
Hmm do you just need a custom model ?
If so then use the item model component
I made it because I needed to modify a menu from another artifact
what's the point of inventoryOwner in Bukkit.createInventory
if not null value is set, it will be set null afterwards by internal classes anyways.. so
will it?
I need CustomModelData for my custom item in a plugin. I've already made a resource pack and it works, but I don't understand how to set CustomModelData for my item in the plugin.
Use this method to get the custom model data component, set the values you need and then set it back to the item meta
where do you see it say inventoryOwner?
It’s used for “Owner” of the inventory, so a chest for example will be the owner, or any other type of tileentity with inventories should u open them
ty 😸

am i wrong to think that you shouldnt create lazy fetch implementations for various persistence implementations which uses getters to return data lazily instead of storing it in memory like:
public class DatabaseFoo implements Foo {
public void getBaz() {
// lazily fetches `foo.baz` from database
}
}
instead you should opt in using records and load data to them explicitly, like Foo foo = DatabaseFooLoader.Load()
when you think about it, getters seem like a terrible idea for performance considerations you should prefer storing it in memory always instead of lazy fetching on each getter call
also if you would want to optimize for database calls, you will need to lookup implementation details. sounds terrible
Depends on what the data is, how urgent it is, and what's involved with fetching it
Sometimes you just don't need data immediately, so a CF is fine
yes but but when you implement lazy fetch like this, you're essentially creating a situation where due to how blocking database operations are getters would be slow, you should optimize the code externally by looking up the implementation of interface type
which defeats really the purpose of polymorphism if you think about it
explicit operations via Loader class of lazy fetching is more verbose but more clear in terms of how they load the data
Why not have two separate interfaces then?
public interface Database {
public String getThing();
}
public interface AsyncDatabase {
public CompletableFuture<String> getThing();
}
public final class ConcreteDatabase implements Database, AsyncDatabase {
@Override
public String getThing() {
return getThing().get();
}
@Override
public CompletableFuture<String> getThing() {
return CompletableFuture.supplyAsync(() -> "some value");
}
}
Or maybe I just don't understand your concern
One way or another, you need to make a call to a database. Whether that call is lazy is up to its urgency
as well as design methodology
Of course
How do I add an custom header and footer to the tab list?
I am one for designing around in the absence of data which goes in hand with lazy calling/loading
You've gotta put in at least a little bit of effort
https://hub.spigotmc.org/javadocs/spigot/ for future reference
?jd
hm okay thanks
Hi can someone help me to understand what plugin cause this crash and why ?
https://paste.md-5.net/qajonuwume.md
Because i have lot of custom plugin dev by myself but this is the first time i see that i didn't understand 😦
because i don’t know where should i look in that dump
when i do
Chunk#getEntities();
i get a set of entities
but when a chunk is LOADED and i do
World#getEntity(UUID uuid);
i get null
why?
i mean i do entity.getLocation.getChunk.isLoaded
and it always returns true
even if i get far away because .getchunk loads the chunk?? idk
yes cause i save it
i mean i do Entity.getWorld.getEntity(Entity.getUniqueId())
im not really sure what is happening
there
Worth noting that chunks and entities are loaded separately
cool
So if it's a freshly loaded chunk, it won't have entities yet
so when i do Chunk#getEntities thats why it owrks?
and yes getChunk will load the chunk
There is an EntitiesLoadedEvent if that's what you're after
As an "alternative" to ChunkLoadEvent
Yeah, as Olivo mentioned, getChunk() loads the chunk
Synchronously, at that. There's just no guarantee that the entities will load in time for your follow-up getEntities() call
so what do i do??
What are you trying to do? :p
Yeah cause it could unload. UUID is more useful. But I guess if it's not urgent to remove it, it's probably best to kill it in that EntitiesLoadEvent
Try and get the entity in the world, and kill it if it exists. If not, save its UUID somewhere so you know to remove it in that event
id would be better to kill it right away
Why? If it's not loaded then it doesn't exist
yeah but someone could remove the plugin i guess?
That's true, that's always a concern
i dont know if i should think about this case
But there's really not a lot you can do to avoid that. Any plugin mutating the world has that issue
i wanted to remove it onDisable or after an hour
I mean even if you add like a scoreboard plugin - it's probably going to create a bunch of scoreboards and teams on the server. If that plugin's removed, those scoreboards and teams are still there
So it's one of those things you can't be reasonably expected to clean up
Sure, but the only way to do that is to load the chunk you know the entity is probably in (I assume you have coordinates for it saved somewhere too)
Which is fine, you can do that, but you're going to create some load on the server for loading a bunch of chunks
no,actually 1 chunk
in a long time
Yeah but what about when you restart the plugin. You don't have an Entity instance anywhere :p
Yeah that's what I'm getting at is to make sure you save its position to disk somewhere too
Then you could load its chunk with getChunk(), get its entities, and kill it
okay then i guess ill just despawn it when loaded
Why do you need to kill it that way
what way?
Grabbing it from an unloaded chunk
^ but I honestly don't think it's a huge concern imo
and killing it
i dont know i just wanted to kill it onDIsable or something
but
it doesnt really make sense
i gues
How about not making it save in the first place
Also a valid option. Good shout
??? whatt
no it has to be there for an hour or some long
some period of time
If I have a duels mode, should I create all the arenas in one void world away from eachother, or should I create the arena world when it starts?
someone could load it
Yeah when the entities are loaded you just spawn it again
if you still need it to be there
That's up to you, the server resources you have available, and whether or not you're connected to a proxy
how do you make more worlds
With the WorldCreator
i never undrestood
No it's part of the Spigot api
I meant all in one server, should I have one big void world, and spawn arenas in it.
Or should I create the arena world
oh
declaration: package: org.bukkit, class: WorldCreator
i think he answered you
What would be more efficient
olivo
where do you learn al that
Olivo what would be better for performance and efficiency
All arenas in one world, or an arena per world, all under one server
Best for performance and efficiency would be something like Minestom
Use one world
Alr
if you want you can use a couple worlds, but one per arena is a bit overkill
Would your answer change if it was a bigger mode like bedwars / skywars
Not really
Alr I'll just load them into a void world away from eachother
I'm just worried about the loading time if I pasted it as a schem for example
It depends. If it is very lightweight have multiple per world, otherwise 1 per world
But in terms of performance it is still all in the same server
Please note that the former one is A LOT easier to implement
worlds do add a little bit of overhead
it's not particularly noticeable for a dozen or so worlds, but if you're intending to scale to 100+ arenas each in its own world, it will definitely become noticeable
however discarding a world and loading a new one can be much cheaper and faster and easier than pasting/resetting an arena from a schematic
the world overhead is mostly memory, which you can always add more of, while for the paste/reset operation in a single world you are cpu-bound which is much harder to scale
at the point you have 100 or even 50+ arenas you're thinking of having a server cluster to host these arenas anyway
worlds do not scale in any sort of way at that point, so you just end up running more servers
Yeah excatly
It's already on a proxy I just can't expand to sub servers currently
Is there a limit to the runnables I can run? Like should I also do a runnable per arena
runnable is an interface, wdym
if you're asking about whether you should have one per area or global for all I would say it's easier to make a global one.
debatable
yeah tbh I said that from my own minigame
I totally imagine some other codebase could be different
I'd say each game instance should be contained
Does anyone know how people managed to assign abilities to 3D weapon designs? Is it done through a plugin, or how does the whole system work?
add NBT tags to item and track the actions with that item
for 3D, u need a custom texture pack
(sure, you need a plugin)
itemsadder?
for example
I don't know all the functionality of this plugin, but I can say for sure: plugin required
