#help-development
1 messages ยท Page 733 of 1
Because some code caused it
I changed the version of my api but it is loaded on the site
?stacktrace
We cannot help without the full stacktrace; Please paste it here: https://paste.md-5.net
Update your server version and recompile your plugin.
And never use /reload
Okay so me.galtap.galtapautomine.settings.MineSettings.loadMineData(MineSettings.java:66) is trying to run me.galtap.galtapcustomranks.core.RankManager.getRankFromId
okay i might shouldve checked the console..
"You are most likely called jarhell. This is a confusion with library dependencies. Most often, this error occurs when the classpath application considers the same libraries with different versions during implementation. Or a group of libraries that should be the same version, but for some reason their version does not match. In such cases, the search class usually helps, which is used by the program throughout the entire project (including) and the analysis of libraries (jars) in which this class appears. We also carefully read pom.xml/build.gradle/where-you-have-described-the-dependencies on the library control object." - find this
i have in repos siteseveral versions my api
cuse not can delete my old versions
Stop with that gibberish pls
Make sure the right version of both plugins are on the server
And make sure you are doing a fresh start and not a reload
reload not fix it?
And dont shade other plugins
If you are having issues
The first step is to read the stacktrace
The second step is to restart the server if you have been using /reload
yes now this work
i just was need off server
its not identical
but somewhat yes
cuz u have like walk speed for instance
and then thats just the velocity at that given time
Does anyone know how I can set the tab executor of a BukkitCommand I don't have registered through plugin.yml? For context, here's what I'm trying private void registerCommand(@NotNull final Command command) { this.getServer().getCommandMap().register("PLUGINNAME", command); Objects.requireNonNull(this.getServer().getPluginCommand(command.getName())).setTabCompleter(command); }
BTW, my Command object extends BukkitCommand and implements TabCompleter
*Depending on your TPS. But it most cases its about 1/20th.
You could also average over 3-5 ticks if you wanted a smoother reading.
it's still a lerp
As long as the tab completer is registered in the Command you don't need to
It's not because I don't know how. BukkitCommand doesn't have any setTabCompleter() subcommand
You shouldnt need it that accurate. Just assume 1/20th
Yeah but at what point do I have access to the PluginCommand instance?
Wait, how are you creating an instance and registering it?
Reflections
?paste
code
rules = (List<List<String>>) plugin.getConfig().getList("rules");
wtf is this
And how is your config formatted
Something tells me that's just read as a string list
im sure it works because i used before somewhere else
I'd just do like
rules:
whatever:
- ...
whatever2:
- ...
and you just loop through all keys
okay but how can i make it work cause otherwise i need to change like alot
like alot alot
there gotta be a way i can get my nested list to work
List<List <String>> correctAnswers = readCorrectAnswersFromYAML(triviaName);
i used it like this before
in a discord bot
that worked just fine
Then copypaste it
i cant
cause
uh
well
i cant just read the yml file myself can i
im kinda stuck using config.getList
Could you pls explain a bit more? I'm familiar with reflection but IDK how it's supposed to help me turn a BukkitCommand instance into a PluginCommand one
you simply don't use BukkitCommand
you make a class that impls both CommandExecutor and TabCompleter
And you make a plugincommand
How do I add a new PluginCommand? It's not there autmatically since it's not in the plugin.yml
The syncCommands method is used when registering commands after the server has started
how can I write JUnit tests for methods that also log/broadcast using bukkit calls
ideally i'd just ignore those methods/use a mock method (like System.out.println) for when its run as a test
MockBukkit might be able to handle that?
ill look into it
is there a way to check if a server is running cracked so that i can purposefully crash my plugin
You can check if it's in offline mode, yes
But:
- It may just be behind a proxy
- That may be considered malicious
if i have to pay so do they
Likely not allowed
Potentionally malicious code != boycotting
i meant my plugin not the server
yea i did say that
why wouldnt i be allowed to be like 'doesnt work, sorry mate'
Yes, if your plugin contains that code then it could be considered malicious.
If malicious, the plugin gets removed and you get banned
i mean i could understand if it's about premium resources but I'm talking in general here
what's considered malicious about a plugin disabling itself?
You're disabling everyone behind a bungee like too
ProtocolLib, what's the right packet for entity movement<
Looking for someone who can make resource packs dm me for recurring commissions (need someone who can put together a resource pack in the next 6 hours) already have all the content and stuff (Need to be able to work with MythicMobs and ModelEngine
?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/
oh hi sean
Is there a way to have custom player heads on block displays? The way I used to modify block display blocks was using
display.setBlock(Material.PLAYER_HEAD.createBlockData());
But I can't seem to find a way to make it a player head with custom texture?
yes you can
spigot's config API is horrifically bad
it is 100% valid to write your own
off the top of my head I seem to remember something about being able to create a player head with a base64-encoded texture
This is from 2018, I have no idea if it still works https://www.spigotmc.org/threads/how-to-create-heads-with-custom-base64-texture.352562/
Yeah I do know that much I can create a custom head that is then added to an Item using ItemStacks, my main issue here is having it on a block display
you need to use an item display, i'm pretty sure?
it's in the same boat as armor
just that it creates an "entity" when placed
Why is spigot configuration api bad?
found another way thx though :)
last I checked it was tedious, finnicky, only dealt with YML, had type erasure issues and didn't support automatic injection
rules = new ArrayList<>();
if (rulesSection != null) {
for (String key : rulesSection.getKeys(false)) {
List<String> rule = rulesSection.getStringList(key);
rule.add(key);
rules.add(rule);
}
} else {
// Handle the case where 'rules' section is not found in the config
plugin.getLogger().warning("The 'rules' configuration section is missing or invalid.");
}```
a bit complicated but it works

ehh it's not complex
rather do this than write a mongodb codec
ehh
it's less issues and more "this feels like a placeholder that was written ages ago and just left in place"
You are about to be a god damn hero and do a pr adding your library to base spigot you say? ๐ค๐คฃ
Don't tell me, show me
nobody uses my damn library
so i have no idea if it's shit or not ๐ but i think it's relatively easy to use
well I judge libs by design, how opinionated it is, how tested it is (integration/unit tests), if others use it and who made it
no, there's just
400 other config libraries with larger userbases
and mine has a bunch of other shit because it's a core for my own plugins
well
if you can offer something other config libraries cant
then that would be enough for someone to use it given their satisfaction
oh
ehm its not that complicated tbf, yeah well its just u write test code to test ur production code
it's so fucking hard to test anything we do to begin with and then there's no testing procedure lmao
it may be hard if the code base is written poorly
well I know a lot of games write data oriented design
which can compromise testability and readability
honestly man
I just want to work in a govenrment job where I don't have to do anything
I don't give a rat's ass about making 200k or whatever
not that you make that much in game dev anyway
i want to be able to do game dev on the side and do nothing at work because there's no profit motive ๐
have any of you ever done 3d printing?
not professionally but i had the chance once
...
hi i need help coding basic hello world plugin!
uh step 1 run buildtools
https://wiki.vg/Protocol#Entity_Animation Send to every player in range.
if your NPC is an actual entity and not packet based you can simply getBukkitEntity and call swingArm
hello, so I just noticed there are 3 Interact Events and I wanna know the difference between the first two ones
InteractAtEntity contains the point on the entity you interacted with
Generally not required
Clicking on blocks, the air, or stepping on pressure plates
isnt preassure plates a different event alltogether
nop
oh i see, Action.PHYSICAL
thanks guys โค๏ธ
@young knoll you play with spigot internals too, right
one thing that just popped in my mind
why tf do event classes need the handlerlist thing
It stores what classes are listening to them
something something performance
right?
Reading this rn https://github.com/lahwran/fastevents/blob/master/src/main/java/net/lahwran/fevents/EventManager.java
i need help with html css, who can help write to dm
if you want help you can ask your question right here. no one is going to dm you just to help you with your website
https://mohistmc.com/ I like gradient on this site, who can help me recreate this in css?
thanks
can anyone help?
Hi
I need help, how can I make a plugin that gives a diamond to a player every 5 minutes if they are in a specific worldguard region?
I don't think, that worldguard has an API like this. But you can do it with your own "regions" by checking whether or not the player is in that specific area
who know why i cannot load price end blocks in config?
the names seem normal
but section not can find
price end blockCount
Why don't you just use a string as an argument instead of a ConfigurationSection?
well, repetition of lines))?
sonarList not like it too
but idk
i think this be long
Well... are you referring to custom.1 in the ConfigurationSection? Because you should
xD
bruuh
- '&f'
What's good practice for keeping multiple commands related to something in one class?
I'm trying to figure out a good way to do so
public class MyCommandExecutor implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (label.equalsIgnoreCase("command1")) {
return handleCommand1(sender, args);
} else if (label.equalsIgnoreCase("command2")) {
return handleCommand2(sender, args);
return false; // Return false if the command label doesn't match any of your commands
}
private boolean handleCommand1(CommandSender sender, String[] args) {
......
}
private boolean handleCommand2(CommandSender sender, String[] args) {
......
}
Would something like this work?
is it efficient?
If you want everything in one file use a switch statement
def way better than having one giant block
qq is there a specific event for tree generation (NOT growth!) or is it just ChunkGenerateEvent or whatever its called?
You can create a folder in your plugin folder and throw your files in there.
JavaPlugin yourPlugin = ...;
File pluginFolder = yourPlugin.getDataFolder();
File nbsFolder = new File(pluginFolder + "/music");
File someNbsFile = new File(nbsFolder, "cool_music.nbs");
You can also list all files in that Folder:
JavaPlugin yourPlugin = ...;
File pluginFolder = yourPlugin.getDataFolder();
File nbsFolder = new File(pluginFolder + "/music");
File[] nbsFiles = nbsFolder.listFiles();
Is anyone aware of a CME-safe variant of LinkedHashMap?
what are you on about lol
Well I'm running a modded server and I've made some big dum-dum and now the server is crashing due to a ConcurrentModificationException in GoalSelector while it tries to iterator over the keys of some LinkedHashMap
While purging all nearby entities will obviously be a good workaround I don't think it is a permament solution
clone the map, and iterate over the keys of the original. Modify the copy, and once you finished, assign the clone to the reference of the original
alternatively you might be able to do something with streams and maps, but idk how that interacts with linkedhasmaps
Thing is outside the stacktrace I have 0 idea what is happening
cant you step through it with a debugger then?
I might be able to idk
mm some mod is playing with async entity manipulation
or might just be removing goals while iterating them lmfao
It isn't just me either: https://github.com/AllTheMods/ATM-8/issues/1170.
Something to do with the wither skelly or something.
how the fuck do u have a cpu with a frequency of 0
the skeleton is just where it crashed i think
It's a PC mainly meant for offices
how do i rotate a player by 180ยฐ?
i've tried both adding 180 to the yaw and multiplying it by -1 but neither of them work. they just force me to look in a set direction no matter which way i'm facing
here's my code
BlockIterator blocks2 = new BlockIterator(player.getEyeLocation(), 0, 50);
while (blocks2.hasNext()) {
Block block = blocks2.next();
if (block.getType().isSolid()) {
Location loc = block.getLocation().add(0, 1, 0);
loc.setYaw(loc.getYaw() + 180);
player.teleport(loc);
break;
}
}
(please ping me when replying)
video?
why are you iterating over blocks if you want to get a player's rotation?
that's just for raycasting
i'm making a teleport wand
also isnt yaw in a double between 0 and 1?
Well, the location of a block never has a rotation. You need to add a rotation relative to the current player ofc.
it's between -180 and 180 if i remember correctly
yea in the display
ah i see
can't wait to have roll in minecraft
guess it depends how you obtain the rotation
is this correct?
BlockIterator blocks2 = new BlockIterator(player.getEyeLocation(), 0, 50);
while (blocks2.hasNext()) {
Block block = blocks2.next();
if (block.getType().isSolid()) {
Location loc = player.getLocation();
loc.setYaw(loc.getYaw() + 180);
player.teleport(block.getLocation().add(0, 1, 0));
break;
}
}
that would snap the player to 'straight', youre not setting their direction
i see
This will always let the player look in the same direction.
You are ignoring the players previous direction again
how do i get it then?
create a location instance, set it to the location you want the player to teleport to
then set that location's direction
teleport the player to that location
Loc loc = block.getLoc();
loc.setDirection(playerLoc.getDirection);
player.teleport(loc);
smile ur up
:)
I've done this before
it's easy
smile has also done this before
Given you're going with the all-nms route
Instead of setting the durability you actually need to set the view in the map meta
Or with nms
private ItemStack createMapItem(MapView view) { // nms itemstack
ItemStack item = new ItemStack(Items.FILLED_MAP);
item.getOrCreateTag().putInt("map", view.getId());
return item;
}
So you can then do the usual
MapView view = ...;
WorldServer world = ((CraftWorld) world).getHandle();
Vec3 pos = new Vec3(location.getX(), location.getY(), location.getZ());
ItemFrame frame = new ItemFrame(EntityType.ITEM_FRAME, world);
frame.setPos(pos);
frame.setItem(createMapItem(view));
No clue why you're sending 71 as the hanging rotation of the frame, it should be from 0-5
in the order of
UP
DOWN
NORTH
SOUTH
WEST
EAST
For spawning the itemframe, easy as
ClientboundAddEntityPacket packet = new ClientboundAddEntityPacket(frame, hangingRotation);
ClientboundSetEntityDataPacket metadataPacket = new ClientboundSetEntityDataPacket(nmsFrame.getId(), nmsFrame.getEntityData(), true);
and sending those packets
You can send the view with player.sendMap iirc but I'd rather set the colors myself as it's much much much faster
@wraith dragon
ah i see
thanks!
Hello i was trying to understand how can i read the spigot javadocs
?jd-s
Like how can i read it and code anything out of it
search for the clas top right, eg ItemMeta
it then shows its super interfaces, so stuff it implements
then it shows what implements it
then it shows the class javadoc
if you want it in your IDE compile buildtools with the javadocs flag, then press ctrl q while hovering over something
then you get the methods, below that inheritied methods
then method details
with the javadocs for the methods
middle click
I'd like to assign 3D models to tools (e.g. Iron Hoe) using meta.setCustomModelData and allow the player to equip them as helmets, can anyone recommend good existing plugins or a good place to start with coding this? I was messing with ArmorMechanics but it doesn't have that functionality
how can i check if worldguard is present on onLoad stage? (i want to softdepend and register flags)
java.lang.StackOverflowError
On this:
private Menu iterateThrough(Menu menu) {
if(menu.getInventory().getItem(44).isSimilar(MenuConstant.MENU_CONSTANT_ARROW_FORWARDS.getItem())) {
return iterateThrough(menu);
}
return menu;
}
...why?
you probably created a recursive method
method calls itself
It should stop actually
Oh no...
Wait im an idiot
It works now! ๐
There has to be a better way to do this for sure
Me with my 1 year experience
hello guys, i've make the config for my class, this creates from folder "resources" in plugin sources
so, when i call the function saveConfig();
all working perfectly, but in the config.yml, spigot deletes quotes
normal config:
example: "hello world"
nickname: "carrot2009"
my config without quotes
example: hello world
nickname: carrot2009
and when im try get the string from config, plugin can't read the key, because the key without quotes
how to fix this?
in the other my plugins, quotes is not be removed from config
what code you need
Your config code
okay
msg_ondeath: "you died" # Is written when the player dies
msg_onalive: "you have been resurrected, and %spawnbacker_spawnloc% has appeared" # Is written when the player is resurrected
msg_trynow: "enter the command again" # Is written when the player is new and his data is written to the config
msg_noargsghome: "you entered the command incorrectly, enter /changespawnloc home (name of the sethome)"
msg_homesetted: "you set the place of appearance on the sethome"
msg_spawnsetted: "you set the place of appearance on the spawn"
msg_noperm: "not enough rights"
msg_reloaded: "plugin has been reloaded"
# vars
menu_title: "Change location after death"
# cmds
onaliverespawnHOME_cmd: "/home " # When respawning, the command that is specified here is written (LEAVE A SPACE!)
onaliverespawnSPAWN_cmd: "/spawn " # When respawn, the command that is specified here is written (LEAVE A SPACE!)
# glass
glass_name: "execnoclass" # The name of the glass, you can make it empty in quotes, you can write the name of the server
glass_data: 14 # Date of the glass, 14 is red, that is, idistekla:Red color, it turns out - 160:14
# items
spawnitem_name: "Spawn" # The name of the item in the menu appears if the player's spawn location is spawn
spawnitem_lore: # Description of the item
- ""
- "After death,"
- "You appear on spawn"
- ""
homeitem_name: "Sethom" # The name of the item in the menu appears if the player has a place of appearance -
sethom homeitem_lore: # Description of the item
- ""
- "After death,"
- "You will appear at the point of the house set by you"
- "To change the point of the house,"
- "Write the command /changespawnloc home (the name of the sethome)"
- ""```
Do you get an exception? How did you determine if your code worked or not.
oh, yes i get at exception, im forgot, sorry
wait a sec pls
missing new line? sethom homeitem_lore: # Description of the item
omg why so hard create gui
i have 7 objects this all just button
with dissimilar inventory decoration
although I would describe it more as a chore
i retranslate the config on english language, original config on the other language
the config is filled in normally, except for the quotes
you are missing a new line after sethom
I need them so that the color code for the messages works, without quotes the labels are not output
msg_onalive: "you have been resurrected, and %spawnbacker_spawnloc% has appeared" # Is written when the player is resurrected
msg_trynow: "enter the command again" # Is written when the player is new and his data is written to the config
msg_noargsghome: "you entered the command incorrectly, enter /changespawnloc home (name of the sethome)"
msg_homesetted: "you set the place of appearance on the sethome"
msg_spawnsetted: "you set the place of appearance on the spawn"
msg_noperm: "not enough rights"
msg_reloaded: "plugin has been reloaded"
# vars
menu_title: "Change location after death"
# cmds
onaliverespawnHOME_cmd: "/home " # When respawning, the command that is specified here is written (LEAVE A SPACE!)
onaliverespawnSPAWN_cmd: "/spawn " # When respawn, the command that is specified here is written (LEAVE A SPACE!)
# glass
glass_name: "execnoclass" # The name of the glass, you can make it empty in quotes, you can write the name of the server
glass_data: 14 # Date of the glass, 14 is red, that is, idistekla:Red color, it turns out - 160:14
# items
spawnitem_name: "Spawn" # The name of the item in the menu appears if the player's spawn location is spawn
spawnitem_lore: # Description of the item
- ""
- "After death,"
- "You appear on spawn"
- ""
homeitem_name: "Sethom" # The name of the item in the menu appears if the player has a place of appearance sethom
homeitem_lore: # Description of the item
- ""
- "After death,"
- "You will appear at the point of the house set by you"
- "To change the point of the house,"
- "Write the command /changespawnloc home (the name of the sethome)"
- ""```
better
?pase error
Post them, pls
?paste
the error you posted does not use the config you showed us
this is the problem, when the config is created, the quotes are removed from it
public FileConfiguration cfg = YamlConfiguration.loadConfiguration(cfgfile);
FileConfiguration cfgget = spawnbacker.getInstance().getConfig();```
I use this variable cfgget to access the config
config created in the resources folder in the sources of plugin
send your exact config
quotes are not mandatory for strings if no special characters are present
The yaml spec doesn't require quotes for some strings.
in the config used the special characters, i think it is the problem
It'll strip them if it deems them unncecessary to save on file size.
this is exact config in use
if there is special char, quotes will not be removed
oh
i need to try this
its not, here you have msg_reloaded: "plugin has been reloaded" and in error msg_reloaded: &cplugin reloaded
the config what i send, used in the resources of plugin, on the exception config on the server without quotes and with special characters and a bit edited
a bit edited
only msg_reloaded is edited
msg_reloaded: &cplugin reloaded
oh
sorry
I really sent you the wrong config
msg_noargsghome: &cyou entered the command incorrectly, enter /changespawnloc home (the name
of the sethome)
you cant write like this
i think i know my problem
when I wrote the config, quotes are removed if there are no special characters, but I would like quotes to always be there, regardless of whether there are special characters there
guys i wanna make a quit vote
โ - Close SQL connection after every request
โ
- Keep Connection open the whole time
cause ive heard people say both and im not sure what to do
Connection to db is extra traffic cost.
localhost db
linter showing only that as a problem
how do i disable an entity's AI?
i'm trying to stop a shulker from teleporting but i can't find a proper answer on the forums
that's the issue
neither of them seem to exist
1.8 moment
i'm using 1.20 ๐ญ
that really depends
but usually you want to close it after the request
Most of the time you want to close it after the request so the connection becomes available for another task. You only have a certain number of connections before your requests become stuck in the backlog and possibly just drop.
If you use a connection pool then this isnt worth a vote. Keeping a connection open is simply wrong.
^ I'd keep it open, but this heavily depends on if youre using something like sqlite
imho it'd be dumb to close your sqlite connection after every request
but with something like mysql you would probably more benefit from using a connection pool
just use apache
isnt that like
Not me using Hikari
a lot of effort
Not really
is it worth 4(โฌ
The pool does most of the work.
45โฌ
Wat?
what are you talking about
its a commission
ConnectionPools are free. They are built in to Java.
is it worth to learn how to use a pool for 45โฌ
?paste
customer ends with a better result
its about doing it right
You need to send an entity metadata packet
You need to send the metadata packet as well as the equipment packet
How to not repeat the description in the @return tag? For example:
public class User
{
private final UUID playerUUID;
/**
* Returns the {@link UUID} of the player encapsulated by this object.
*
* @return Copy paste??
*/
public UUID getPlayerUUID()
{
return this.playerUUID;
}
}
@link or @see exists
or what do you mean
make it
read the code bro
just leave the description away?
Yes. Its just 10 lines of setup and then the same without a connection pool.
You basically just create a pool in your on enable and then call
try (Connection con = yourPool.getConnection()) {
// Use connection
}
"Returns the" -> "@return"
Why do you need description lol
Please don't attack me if I'm wrong, but I was taught that it's the convention even if you get duplication.
aught iโll give it a try
thx
dumb convention
also getters dont need a javadoc
and if they do more then returning the object they are supposed to its not a getter anymore
.
just look at how spigot does it
yeah no dont look at spigot
lol
lmfao
Love comments like those. I would exclusively tolerate those in public APIs.
fuck it let's see how Unsafe does it
well it's just a simple getter and I'm sure the description I wrote is excellent, I just want to avoid the copy paste. Should I just shorten it to be like this?
/** @return blah blah */
thats what we just said
awesome!
and there's the other ones
you gotta think of it, there was no chatgpt to write your docs back in the days
well
whats that? memory api??
oh
incubator?
entity.getEntityData iirc
yuh
pack it dirty
I'm packin' I'm slappin' who knows might be rappin'
pls dont
just leave out the general description
Map#isEmpty:
and put what it returns in the return tag
yeah 1.19 whatever
just packDirty
or getNonDefaultValues
either works

That's the SetEquipment packet
ClientboundSetEquipmentPacket
no clue why they do it with a list of pairs
But you'll need to create that list manually
Or given you're going with packet entities just make a crappy list
List<Pair<EquipmentSlot, ItemStack>> slots = List.of(
new Pair<>(EquipmentSlot.HEAD, new ItemStack(Material.END_ROD))
);

just use the constructor
Instead of Material it's Items
and make sure you have the right import
Yeah so
Items.END_ROD
You can also use the CraftItemStack#asNMSCopy(ItemStack) if you want an easy conversion
took me years to figure out and memorize old nms because we didn't have mappings
Its mojangs code after all... They have docs but they are internal.
Obfuscate it a second time so nobody can help you
obsfucate the obsfucation
how can I do it?
got it. I was also wondering how child commands would work or is this is how you implement them
(like faction create faction remove etc)
I personally dont use the spigot command api at all. Never liked it.
this is how I sometimes do it
?paste
oh really; what other options are there?
the link I gave, I only have really like 2-3 real commands, all the rest are sub commands
hi im trying to use Kraken Tab API and i added it as JAR to my project and added it to maven and configured it as dependency as i should but when i try to start my server it says that class Kraken is not found even though it should be fine as it is shown so on github where that api can be found
whats rhe setting colors part?
and don't require registering but I also keep them organized in their own classes and easily call them when needed ๐
hmm interesting
I'll be sure to take a look
back when I was working with sponge the command API has a nice command executor
Never add jars manually to your project when using maven.
It completely defeats the purpose of maven and can even result in complications,
It's a bit of a pain in the ass
Basically there's a limited color palette
And each color is distributed in 4 shades
With all the colors and shades combined, it's still under 255 so it's represented as a byte array
Of 128 x 128 pixels
there is no maven repository for it
so even in readme.md it is written it should be added as jar to project
Then install the jar into your local maven repository
i did that
https://gist.github.com/IllusionTheDev/b730cdbeba8d022ba83262cc817371ad You can find them here
And you set the scope to provided?
How did you do that, and how do you compile?
can you check paste that i have sent up there if that is what you meant
So you grab your image, you downscale it to 128x128 and loop
which packet do I use for display itemname ?
entity metadata
? huh
Yeah, so you didnt install the jar in your local maven repo...
like the line below actionbar
then how do i do that
And rendering it goes something like this
Ah
Chat with the message type as ACTION_BAR
I suggest convolution
itemname is below action_bar :l
install:install-file
Someone else pls explain intrinsics, im going to play some games nopw
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, ...)
gtg too
meeting a friend that I haven't spoken with for months
(he likes 2km away)
better start walking now, otherwise you won't make there anytime soon ๐
yeye it's about time
called him like 15mins ago and we're down to meet in another 15
leaving fr now
When I apply some PermissionAttachment to a player, I want the tab complete of player's commanding to be refreshed. e.g. I remove a permission from a player, he really cannot perform the command, but the tab complete is still there. So how to refresh that tab complete?
Note, I didn't use any Permissions plugin
Player.updateCommands
Let me try it!
I think I saw a github repo thst had nms itemframes in it while I was searching for solutions and I saw a very similar method here
Thank you!
How can I detect a premium player on an offline server?
cant
You can, I seen servers and plugins doing it, can't find any open sources
Ask them
how may I use this packet :l
ClientboundContainerSetSlotPacket
I tried, many times, haven't got a response or a proper one
Are there specific packtes premium players send that cracked doesn't?
Its technically not possible. Everyone can use any name on offline servers and the UUIDs are randomly assigned.
I guess you could proxy the client request and query mojangs server manually
The server lets me join without setting up a password when I am on a premium account, it says we detected that you are on a premium account, would you like to stop using password verification. If a cracked user joins, with my account's name or another account, they have to go through the verification system
If a cracked player joins thru my username they instantly get blocked
Imagine if they just used legit accounts only.
https://github.com/games647/FastLogin/tree/main
This is the closest thing i found
They would lose 80% of their playerbase
Thanks, I will check it out :)
I have no idea how I missed this, thank you so much ๐ซถ
can i add to inventory id?
how dataContainer
insaide inventory
i nah now i no need
you can't make custom trims with spigot. I suppose its possible you can use a texture pack to edit the current ones but thats about it
a rare phenomenon can be found on the internet among the English programmer girl from Bakkit
what
translate erro
wait a sec
I say it's rare to find a female bukkit programmer in this group.
oh
I was comparing this phenomenon to girl gamers.
so I thought it was rare
bruh wth with translate
when this be normal
One more question guys, how can I prompt the user with a resource pack, as in I want to send them a message when they join the server for the first time, then send a chat message that says Dark Theme and Light Theme which are messages you can click on, how can I make it so if you click on this message, it will prompt the user to install the resource pack, as in like the server resource pack, not them just going out to install it, I only need the prompt part, the others are all set
declaration: package: org.bukkit.entity, interface: Player
Oh thank you
I was on the wrong class ;(
https://www.spigotmc.org/wiki/the-chat-component-api/
^ create a message that runs a command
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
That's alright, I already got those setup, thank you very much though
this is my current project layout, for some reason the build.gradle in ebiclib-nms refuses to pickup the spigot-v1_20-R1 subproject, its registered but no combination of ebiclib-nms and spigot-v1_20_R1 with colons works
GraphicsEnvironment.getLocalGraphicsEnvironment()
I use this code
and some guy just reported it throwing an InternalError
what the fuck
getAllFonts to be exact
[19:54:01 ERROR]: Error occurred while enabling AlixSystem v2.7.0 DEV-1 (Is it up to date?) java.lang.InternalError: java.lang.reflect.InvocationTargetException at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:87) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:318) ~[?:?] at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:75) ~[?:?] at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:139) ~[?:?] at sun.java2d.SunGraphicsEnvironment.getAllFonts(SunGraphicsEnvironment.java:158) ~[?:?] at sun.java2d.HeadlessGraphicsEnvironment.getAllFonts(HeadlessGraphicsEnvironment.java:76) ~[?:?] at
Well Headless environment
Hi, can anyone recommend a plugin allowing tools with CustomModelData to be equipped as head armor?
The tool should be equipped upon inventory Slot interaction, not console command
hi! How i can do:
private static final String PREFIX = "ยง8ยงl[" + MiniMessage.miniMessage().deserialize("gradient:#0040FF:#00FBFFIBW</gradient>") + "ยง8ยงl] ";
dont go because return Component.
ItemEdit
.
fixed by for looping the deps
Using the sun.java2d package with headless servers is always a headache and should be avoided if possible.
Let them start the jvm with headless mode enabled -Djava.awt.headless=true
I don't think they have control over that on their host
Use the PlainTextComponentSerializer and serialize the Component to a readable String.
I would recommend storing this as a Component instead tho.
So
private static final TextComponent PREFIX = ...;
I just turn all my minimessage stuff to strings
Otherwise using adventure/minimessage is kind of stupid
Since spigot doesn't support adventure components, and bungee components only work in like 3 places atm
I tried but it says there is no class.
You are using adventure, right?
I can't really solve it with code, can I?
You can probably use methods which are compatible with headless modes
and what would those be?
I cannot really invoke anything
No idea what you are using a GraphicsEnvironment for, so cant help
@lost matrix is correct?
Not sure if MiniMessage alone has any means to serialize your components to plain text
ok
2d graphics rendering
emmm.......
.-.
but the error is thrown on the very first method, that is:
You are aware that the dataset of GPT is a few years old and wont be helpful for up-to-date libraries at all?
call text() on the component iirc
maan who the hell uses a headless enviroment for minecraft hosting
MiniMessage miniMessage = MiniMessage.miniMessage();
Component msgComponent = Component.text("Some message");
String msg = miniMessage.serialize(msgComponent);
i am stunned
About 99% of all server hosts i would assume.
i know
bruh wat
how do they display stuff?
wym? what do they have to display?
is there like a library I could compile with my plugin and would work in a headless enviroment?
They dont display anything. They have management ports for on-site and provide SSL for their clients.
try it
aight
Without a graphics environment you wont be able to render anything.
Usually the jvm falls back to rendering with the CPU. But this can be
quite tricky depending on the setup. WSL 2 has many such quirks for example.
Same goes for any dockerized environment.
Why are you doing graphics on a server?
If anything the client should handle all graphics related things
I'm rendering 2d graphics
For what?
like why?
and rendering the map
@lost matrix dont go
MiniMessage.miniMessage().deserialize(string) to get the formatted component
I'm makin a spigot antibot
and captcha is necessary
how can I get something like this without 2d graphics render?
maps
Oh he uses minimessage formatting in Component.text ๐ซค
Yeah that wont work ofc
i dont want component but string
formatted?
uhhh i hope you realize
You can render it in a map
That's a 2d renderer
yes
But I've gotta create the graphics first
you need to use the legacy serializer
fack
like a map doesn't have drawLine method
Create the component using minimessage and not Component.text
also I just get those bytes and render it with an async packet send
He wont have that
wdym wont have
I use the MapPalette.imageToBytes
but I need the image first
thats just example code
and it always needs to be random
LegacyComponentSerializer
i try
He wont have that
i want a string and not a component
ah, add the dep for it then
I told you how to fix that. Use minimessage to create your component instead fo Component.text
so, no one knows how to help, a?
LegacyComponentSerializer???? how version of minimessage is it?
its included in adventure platform bukkit
Wait, is only getAllFonts throwing this exception?
I mean that's the first method that's invoked
and the rest is not
Full stack trace pls then
since an uncaught exception was thrown
full
the rest is just yeah so that's why yo plugin failed to enable
Send the full stack trace pls
?stacktrace
We cannot help without the full stacktrace; Please paste it here: https://paste.md-5.net
Why is this in such an abysmal format??
Alright here is my proposal:
Deliver a font with your plugin. Use an open source font.
I have absolutely no idea
maybe the way the console formats stuff
I still need a 2d rendering tool
in a headless enviroment
Should be possible. The only problem im seeing here is that the font manager doesnt have
access to the system fonts.
because in no way in hell am I recreating the whole font drawing by hand
maybe they're absent?
What are the item slots of a campfire blockstate? I've tried getting an itemstack at slot 0, but it returns null
did you put anything on the campfire?
I assume its the slots of the things you're cooking
I can't find any
and chat gpt suggested non-existent ones
A campfire has 4 slots
Why do you need that?
I just explained
I'm makin an antibot
so I need a random map captcha
so I need it's bytes
Then draw using the graphics capabilities
and I get the the bytes from a temporarily created image
its always player
I usually dont check
Myeah, just cast. I dont think there has ever been a plugin that utilized HumanEntity
I made the captcha font customizable in the config file. How can I then check if the font the user has inputted is supported?
You could either scan their system for installed fonts or allow them to use a url that points to a font.
and how could I do that?
equals
then ==
but only if you're absolutely sure
then == is fine
nice
one problem:
This is the method that fails
a java built-in method
And Font uses it for rendering
so uh
help wanted
doubt your system has the fonts it needs
You can always just hardcode the shapes like minecraft does for its fonts
AWT probably won't exist on a general server either
idk I run a standard server on a pterodactyl panel using ubuntu 22.04 and never had any issues
when making a minigames system, is it a good idea to keep a record of all minigames that have happened, including who played in it, the time it was played, individual stats, etc?
i've seen real games do this but i'm not sure if it has a purpose with minecraft minigames
You donโt really need to keep track of each game for that
Youโd normally just tie that data to the players
^
so keep individual stats on a database for each player rather than keep a log of all games
ye
However if you want to have the history and information for the games available you can
unless you need game history for some other reason
Nothing stopping you
like if you actually wanted the player to be able to view each of their games history
which ones they won/lost
i feel like it would only be useful for matchmaking systems
so you can tell what skill level a player is
based on what games they won/lost against their opponents skill level
I mean you can still do that without tracking each game
it'd be easier with it though
Eh, not really
you could match them based on win/loss ratio
When a game ends you can assign the player a score based on k/d, opponents, etc
And then just save that score to the player
Preferable to going through all the players past games and calculating a skill level on the fly
it could be post-game for the last 10 games or smth
If it was me I would do it like the chess ELO system
<dependency>
<groupId>me.boxxing.reviveme</groupId>
<artifactId>reviveme</artifactId>
<scope>provided</scope>
</dependency>
isnt working, im trying to make a pom.xml dependency and im getting this error
Dependency 'me.boxxing.reviveme:reviveme:' not found
provide a version
if i return inside onEnable does it just stop the other stuff from being enabled or does it stop the whole plugin
stop other stuff
alrioght
some1 know what plugin that give more structures easyly to use help me pls
#help-server is hwat you are looking for i think
this is the wrong channel for that kind of stuff
btw, since im using 1.8.8, do I have to use NBT?
hello there..
public class Test {
public static void main(String[] strings) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.version(HttpClient.Version.HTTP_2)
.uri(URI.create("http://localhost:3000/"))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
Exception in thread "main" java.net.ConnectException
at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:573)
at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:123)
at cz.coffee.skjson.api.http.Test.main(Test.java:27)
Caused by: java.net.ConnectException
at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1055)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:198)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:230)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:206)
at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.nio.channels.ClosedChannelException
at java.base/sun.nio.ch.SocketChannelImpl.ensureOpen(SocketChannelImpl.java:195)
at java.base/sun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:760)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:848)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:183)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:185)
... 9 more
Hello, I have a problem with java.net.http.HttpClient JDK17 I can't send a request to a port other than :80 I've tried everything. No effect, address works normally I tried it using Browser and also postman and other APIs all tests were without problem
I have the code above
that produces
an empty map
@echo basalt I tried to follow your solution but it still didnt work :/
Post whole error pls
"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1.2\jbr\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1.2\lib\idea_rt.jar=60418:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1.2\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\nexti\Desktop\Project-SkJson\SkJson\target\classes;C:\Users\nexti\.m2\repository\org\eclipse\jetty\jetty-client\12.0.1\jetty-client-12.0.1.jar;C:\Users\nexti\.m2\repository\org\eclipse\jetty\jetty-http\12.0.1\jetty-http-12.0.1.jar;C:\Users\nexti\.m2\repository\org\eclipse\jetty\jetty-util\12.0.1\jetty-util-12.0.1.jar;C:\Users\nexti\.m2\repository\org\eclipse\jetty\jetty-io\12.0.1\jetty-io-12.0.1.jar;C:\Users\nexti\.m2\repository\org\eclipse\jetty\jetty-alpn-client\12.0.1\jetty-alpn-client-12.0.1.jar;C:\Users\nexti\.m2\repository\org\slf4j\slf4j-api\2.0.7\slf4j-api-2.0.7.jar;C:\Users\nexti\.m2\repository\de\tr7zw\item-nbt-api\2.11.3\item-nbt-api-2.11.3.jar;C:\Users\nexti\.m2\repository\de\tr7zw\functional-annotations\0.1-SNAPSHOT\functional-annotations-0.1-20220407.142433-7.jar;C:\Users\nexti\.m2\repository\com\google\code\gson\gson\2.10.1\gson-2.10.1.jar;C:\Users\nexti\.m2\repository\org\bstats\bstats-bukkit\3.0.2\bstats-bukkit-3.0.2.jar;C:\Users\nexti\.m2\repository\org\bstats\bstats-base\3.0.2\bstats-base-3.0.2.jar cz.coffee.skjson.api.http.Test
Exception in thread "main" java.net.ConnectException
at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:573)
at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:123)
at cz.coffee.skjson.api.http.Test.main(Test.java:27)
Caused by: java.net.ConnectException
at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1055)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:198)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:230)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:206)
at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.nio.channels.ClosedChannelException
at java.base/sun.nio.ch.SocketChannelImpl.ensureOpen(SocketChannelImpl.java:195)
at java.base/sun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:760)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:848)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:183)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:185)
... 9 more
Process finished with exit code 1
i actually did.
it's actually running on 3000 but i tried to many ports only 8080 works.
who has an optimized version of auto inventory generation for List<ItemStack>
i handling that by JSON
I just need to put 1 ItemStack each in my inventory.
oh thenks i gess
this not what i was want
Hello how can I do something that saves the default configuration only once?
saveDefaultConfig() does exactly that
But when I restart the server it resets everything, right?
no?
declaration: package: org.bukkit.plugin.java, class: JavaPlugin
This should fail silently if the config.yml already exists.
it just does nothing if the file already exists
no problem
I need plugin A to unload before plugin B
I'm author of plugin A
Could this be done through plugin.yml?
Plugin B is not hard dependency
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Will try loadbefore, thanks
np
Hi
I am looking for a plugin that makes the
(redstone, buttons, repeaters, etc.), are considered as blocks, so the water flows over them like a normal block.
Just to clarify for future readers. loadbefore will load your plugin (A) before plugin B and unload it after plugin B.
soft depend will load plugin A after plugin B and unload it before plugin B
help please
customer plugin ?
I am looking for a plugin that makes the
(redstone, buttons, repeaters, etc.), are considered as blocks, so the water flows over them like a normal block.
[HELP] Interclass Code Errors
anyone?
Can i change value of played minutes statistic?
New to Spigot. I can set up a command just fine, but I commonly see stuff like /OverarchingCommandName SecondaryCommandName Arguments.
Would I just use arg[0], or is there another method to achieve this?
Yeah, args array would be everything after the command
How exactly do people get the SecondaryCommandName(My naming schemes are bad) to autofill then? Just curious.
There is TabCompletion interface which you may implement
Alright. Thank you.
Hi, do you know an API or a library to display text in an inventory, something like that
I think that requires a texturepack
Yea, I think they do it by putting an item with custom model data in the slots and then making it so when they are clicked it cancels the event.
Yeah but what I wanted to do was change text each time a variable changes text so it's complicated to modify gui each time
well, then you are kinda shat, ig
Hello, what is the default damage (integer) for a TNTPrimed?
Fuse ticks: 80
Yield: 4.0
You can do it with custom item textures. It's not that complicated, you only need to change the custom model data.
so does anyone know
What I could do
to be able to create a temporary graphic in a headless env
Sure, do the usual but provide a fallback font with your plugin
it doesn't need to be displayed so I'm pretty sure it's possible
hoo
hmm
but
hmm
Just create a BufferedImage and use its Graphics2D
would setting the system property of headless help?
to false
because I think that once the class is loaded it doesn't really matter
what code do you want to see?
How you are rendering the images
bruh
if (GraphicsEnvironment.isHeadless()) System.setProperty("java.awt.headless", "false");
I just did this
and the guy says he no longer gets the error
what the hell
and nevermind
List.copyOF can ganarate java.lang.UnsupportedOperationException: ?
This makes exactly 0 sense
No it cant
yeah he got it wrong
he just changed the config to not use maps
some operations upon the returned list can
since it returns an Immutable list
^
private void createStoneWall(UUID playerUUID, Block centerBlock) {
Map<Block, Material> originalBlocks = new HashMap<>();
for (int x = -2; x <= 2; x++) {
for (int y = 0; y <= 3; y++) {
Block block = centerBlock.getRelative(x, y, 1);
originalBlocks.put(block, block.getType());
block.setType(Material.BRICKS);
}
}
}
So i made this wall creation method, now I want the wall to be placed at the direction the block is placed at, how will I do that?
This works by placing bricks on the ground.
why so he not can just copy?
return
i not can remove or add?
but the font manager is headless as well
lol so then the whole point of List.copy is lost, I thought it returns a COPY that can be edited lol
?
You could do this with a rotation matrix. But the simplest approach would be to
get the cardinal direction and use different iteration methods for each.
Alright
lol
You shouldnt pass lists around and edit them
yo, I have been trying to run my server in eclipse using ant builders. Whenever it is starting the server, I get the following error:
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalStateException: JavaPlugin requires org.bukkit.plugin.java.PluginClassLoader
if u rlly want a copy like that i guess Collections.copy(); would work
I would use the ArrayList bulk constructor
yea same tbh
I did List.copy just to get rid of creating a new one
main class must extend JavaPlugin
it does lol
and it also works whenever im really building it, this is an issue with live-testing
but why would anyone use ant
I just use an ant builder to get my plugins running in eclipse
I use normal maven for normal builds
well cant u use maven for this as well?
idk anything about ant and shit, I just followed some tutorial for live debugging
haven't found any documentation about that
im confused, ur just running a mc server in ur ide no?
yes
so all ur doing is building the plugin copying it to the plugin folder and starting the server
i dont see how thats not possible with maven
I want it to auto-compile and then run server whenever I laucnh
eh not sure bout eclipse tbh
but intellij is defo possible
idk if u got something similar to intellij's run configurations
I have a runtime config to run the server, but I wanna build the plugin first automatically
should be able to run mvn clean package in the correct dir then no?
can I do that before the config?
idk dont think i can rlly help with this, i dont know what kinda features eclipse provides
but it does look like it supports something similar to intellij
called "AutoBuilders" or somethn
yeah
there are Builders
but there are only the options "Ant Builder" and "Program"
oooo wait I think I managed to pull it off
nope I didn't
ok NOW I got it. I should probably write a guide for it on the spigot forum?
you press on "launch" and it maven builds your plugin and then runs your server
Should I run this?
yes
looping over teh inventory size and removing elements is not good
yes
I am literally writing a guide for eclipse testing rn

