#help-development
1 messages Β· Page 686 of 1
Snippet of what?
of your code
like a single class
or yk what
dont
screenshot your code structure
all the packages
you know, the intellij sidebar
you just post it
can you screenshot af ew lines higher
lets see
Mircrosoft on their way to sue me for stealing their code io io io
Even the packets are diffrent then in minecraft bcs it handle 1.8-1.20
XD
as I already mentioned, you will not be able to sell anything like a custom server software on spigotmc.org - you can only sell plugins on spigotmc that run using spigot
Great
I'll do that
So? U calling Bill Gates?
oh boy I love spigot how could I have gone a week without this type of stuff
never going on vacation again
What?
and why do you want to sell it on spigotmc
Honestly i thought that spigotmc take advantage of being the biggest plugins market and even the name is spigot it allows to sell product not related to spigot
It was mb
can I send you a random .jar and you run it through your custom-made obfuscator? just a tiny .jar that prints sth out or sth?
I'd love to see the result
i dont think spigot wants to be called a marketplace
its not like you need the deobfuscated code to reverse engineer
I don't really want to do that
you will eventually publish it tho
Why?
it doesnt take a big part in the transaction
its just a forum where you can sell your thing
spigot takes no cut
and only verifies if the payment was done / refunded
sad
if you want a real marketplace, use mc-market or however it's called meanwhile
||hes scared that someone in this chat will break his unbreakable obfuscation||
built by bit
i know
as bad as it gets
It might be breakable bcs everything is
exactly
it will be cracked if people are actually interested in it
its a matter of time
But its not rly even obfuscator that system u put your app thorugh and its not only for java but for every other programs too
RN its only for private usage
For friends etc.
My friends actually develops it
And it will be avilable for everyone later
There are still some things to do with this
but is it native
Kinda
then prepare for a wave of unhappy customers
because it doesnt work on their architecture
i hope someone comes around with an actual dev question, because this current discussion is pretty pointless and off topic
why not just code the server in c++ then
how about you help me with the attributes thing
i don't know anything about attributes
fair
maybe ask on the forums
is it possible to send a CustomPayloadPacket to a channel without getting the player? Because I would like to send my payload packet with PacketStatusOutServerInfo (server motd, players etc.)
If someone cames with dev question i don't rly want to answear it bcs its might help someone to crack it
What are we discussing rn? π
obfuscation!
π€‘

how should I distribute my maven multi-module project, not really set this up before
knagesrage wrote an awesome almost uncrackable obfuscator but they don't wanna show anything of it
dist module
Ah, a classic i see. Im pretty sure everyone has already stated this buit let me throw in my two cents:
- Dont bother
you shade all module sinto one .jar
do you need one? I thought that seemed dirty
have you read my blog post?
Hi there! Today Iβm going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...
im asking about attributes
it's pretty long lol
if using gradle you can look at antipopup
for maven ou do im pretty sure, the main reason i dont like using it
Could you send the dc msg? Couldnt find it.
a fork for a more recent version would at least be more unique
that's the common way of doing it. you can also use the maven-assembly-plugin in your parent put that's much more annoying
but theres a bazillion random ass 1.8 forks out there that markets way oversaturated with mostly useless crap
I don't think you need a dist module specifically, as I'm able to build directly off of my core module.
I'm referring to this one
did you know that when you buy one a creeper spawns behind u irl? anyways gn
W
sure, that's possible if the NMS modules don't have to depend on the core module
they do
you shade in parent module instead
you cannot shade in the parent module because the parent module does have pom as packaging
but we talk about maven
Also Alex, why is your cookie banner broken? It won't met me view the cookie settings. π
i mean u wna avoid that if possible
but ye its possible
also I'm curious. Why don't you use the versioning plugin for changing versoins vs ctrl+f and replacing them
which browser?
Vivaldi
The ItemStacks attribute modifiers are applied to the players attribute modifiers while he holds them.
So if you want to make an axe swing quicker, then you need to modify its attributes.
If you want to increase the attack speed accross the globe by a percentage, then you should add a
multiplicative modifier to the player (0.0 - 1.0)
shadow hows ur javadoc update coming
what is that
Read whole thing maybe u will understand its not a fork
well cookie banner works on chrome, firefox and safari, I haven't tested any other browsers
so my options are 1) item shenanegans 2) percentual multiplier dependent on axe held?
https://vivaldi.com
It's a chrome fork.
Chrome fork that borked smth
i really dont care if its completely self coded anyways if its for 1.8 server jar market is oversaturated and useless for most people
idk, I haven't written the cookie banner plugin, just used an existing one
Depends on what you are trying to do
Then you need to modify every axe that comes into the game
Great bcs its not 1.8 its just support version 1.8+
So players can join on multiple versions
what features does it support tho
does it have the nether update stuff and caves and cliffs stuff
What does it do better than ViaVersion
well for one player, not for all
id just smack it onto the axes otherwise
but keeping track of items is incredibly difficult
Why is it paid and forced to use your server jar
runtasklater. i have the delay set to 180l i forgot how many seconds this is
Then i would detect when a player changes to an axe and add a modifier to the player, not the itemstack.
9 seconds
yea thats been my original idea, then it didnt do squat
but with you pointing out the percentual multiplier being the requirement i can probs do some shady math and use that
if it supports latest versions and its features maybe it would be remotely interestinf but if its just going to let you play ancient features ehhh
180 / 20 = seconds
It's pretty much done. I've combed over it several times and I've caught quite a few things I missed initially.
I was thinking of making subsequent PRs that improve things like method descriptions and better consistency.
This PR is really just fixing the typos and grammatical issues that have piled up.
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/891/overview
thank you
nice, looks good
Its support basic things needed for working World, Some entities etc.
w some1 is doing this
Its basicly a proxy
proxy to what version though
So ViaVersion
1.8
one discrepancy I noticed on enums:
- Represents ...
- An enum representing ...
some enums use no 1, some no2 - I think the "An enum representing..." could be always replaced with "Represents" instead
or something recent
I mean it's obvious that it's an enum
That's something I've kinda wanted to do for some time now but felt it wasn't urgent enough for me to actually do it
No
1.8 to 1.20
What's the difference then?
so it supports camels and shit
when is 1.20.2 supposed to come around
It was bound to get done by someone at some point. π
ViaVersion does not have anty-bot anty every anty- thing u can imagine
does your server software have camels yes or no
my local zoo does have camels
It doesn't it's your classic 1.8 fork
my neighbour smokes camels
With builtin plugins
It does this
Like captcha where u click to verify
seen before
nobody wants to play on a server that doesn't have camels
So it's basically a proxy with captcha
ok im just tryna figure out what version it is and you said 1.8 to 1.20
You know that exists already
camels are the essential essence of minecraft
im glad we know you dont have camels now
It's called nanolimbo
exactly
What's what it looks like
and goat horns ofc
Just another limbo
everytime I play survival, my only goal is to find a goat horn
Not even Minestom based limbo
and a camel
Your captcha will be easy to break with AI btw
Next to this captcha wall will be hanging cammel
Good potential user has 3 or 4 captcha modes to choose
4
4 modes
It can be random for every user
Yeah AI is already better at breaking captcha than humans
Then mod can handle all of them
You don't need captcha if you use online mode
Mod for something no server uses?
make a captcha where you have to know which images are camels
captchas be like "Click on every wildebeest" - wtf is a wildebeest
ITS CALLED GNU
Gnu project?
We will see if no server use it
Not every server use online-mode
Even after changes
Unfortunate
Honestly after changes i thought i will change up myself
But to my very suprise not every server implemented this
Because it's not efficient
It is but u need a lot of mork work then if u turn online-mode. If u turn on online-mode u can have UUID as primary key and they can lick your balls
If u have online mode off u need to fuck with this
Sounds like a simple solution to me. Just do online mode. π
yeah then you also don't have to deal with 90% of bots and cheaters
online mode is such a blessing
oh also all those 11 year old wannabes don't join anymore because well they cannot afford the game and/or daddy doesnt allow them to use their credit card
so online-mode is a win/win for both devs and admins
funny story about online mode: Had this in my log 2 days ago
[16:52:47] [User Authenticator #3/INFO]: Disconnecting /198.199.72.162:53202: Failed to verify username!
[16:52:47] [User Authenticator #3/ERROR]: Username 'Herobrine' tried to join with an invalid session
[16:52:47] [Server thread/INFO]: /198.199.72.162:53202 lost connection: Failed to verify username!
There was another bot that joined like 3 minutes later, said 'your ip is exposed', and left
why could this could be not working o.o
it's ProxyServer.getInstance() but yeah
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
which library is that even? Protocolize?
ye
show how you register it
UPSTREAM
not DOWNSTREAM
Client -> Proxy is UPSTREAM
isnt that what you wanna catch
eah that looks like it changes actionbar messages sent from spigot to chat messages on client
random thought, how slow/fast is Tag.ENTRY.contains(Material) compared to a fall-through switch? I might have to register numbers for every type of a particular tagged item
thank you as well @remote swallow π
a switch is faster but a tag respects datapacks
also the tag will be working on all versions
uh mind elaborating what that is? a datapack i mean
e.g. imagine you wanna check all items an enderman can hold
you could do it like this
public static boolean isEndermanHoldable(Material mat) {
switch(mat) {
case GRASS_BLOCK:
case ...:
return true;
default: return false;
}
}
Now there could be a datapack that allows enderman to also hold diamond blocks - your plugin will assume it's not "enderman holdable". If you'd use Tag.ENDERMAN_HOLDABLE, it'd work
also in a new version, there could be a new material that enderman can hold - tag will work, your code will have to be adjusted
a datapack is like a "resource pack" for the server - it can add new biomes, new advancements, or e.g. change existing behaviour like e.g. the enderman example
im an idiot
i knew that
english is hard
i thought you meant a programming thing lol
a tag internally always uses CraftMagicNumbers.getBlock(Material) to turn the material into an NMS block so it does a lookup from the huge Material,Block HashMap
you can however easily avoid that by turning the tag into a set yourself that only contains what you need:
Set<Material> endermanHoldables = new HashSet<>(Tag.ENDERMAN_HOLDABLE.getValues());
could even use an EnumSet in current versions
I'd go for this solution instead of using Tag.isTagged(...) and preferrably use a method that returns an EnumSet if the thing is an enum, otherwise a normal HashSet
when will minecraft have an official documentation for using their system (real no scam)
https://github.com/JEFF-Media-GbR/Daytime/blob/master/src/main/java/com/jeff_media/daytime/WorldTimeTask.java#L33C13-L33C27 I wonder if using == could cause an NPE - i guess so right?
You won't get much benefit out of enum collections for Material anyways
A hash collection would probably be better for few entries
The universe is just too large
if you do == Boolean.FALSE it's fine
It should also just be fine to use boolean operands if you don't care about the unboxing. Game rule values shouldn't be nullable, right?
if you do == false it'll try to unbox it
wouldn't you like to know, weather boi
Weather boi? 
minecraft worlds can be 60,000,000^2 * (64 + 256) blocks in size, so 1152000000000000000 (1 billion billion) cubic meters. the obversable universe is roughly 4x10^80 cubic meters. So roughly 347222222222222222222222222222222222222222222222222222222222222 minecraft worlds would fit into the universe.
he calculates it π
yeah true, I already use the boxed boolean so it should be fine, thx
i just threw in 4x10^80 / (60 million)^2 * (64+256) into wolfram alpha lol
i always hate math
plus another 2/9th world
imagine if every minecraft world we built becomes reality in a parallel universe - minecraft is just a portal in the matrix
is this a bug, my interface is annotated with @Nonnull, but it suggests @NotNull
When creating a recipe with ExactChoice, clicking on the item in the recipe book would not recognise I have the items. Is that how it's supposed to be and if so, can it be fixed or would that be hard on the server side to compare all item stacks in the player's inventory?
is it a shapeless recipe?
No, and the recipe itself works if I manually place the items, it just doesn't detect that I have said items via the recipe book.
then it should work - it always worked for me, at least on 1.17+
Hello
Bye
I'm having a problem making teams from a Queve. It only makes me teams of 1. Could someone help me?
Hello. How can I give group to unregistered (player that never joined) user in luckperms ?
Or otherwise how do i register user in luckperms or something with code?
How do I define an itemstack? I just want to drop certain items on the ground. I tried using material. Name but that isn't an item stack
Probably by UUID. I'm sure there are some methods to get or create User objects
How are animations like this created?
I understand that showing the item is just an Item, but the other objects dont seem like that
Is it armor stands or something
Yes, armour stands
In modern versions you can use display entities which will give you a lot more power with your animations
Im on 1.20 so ill do research on this
https://www.youtube.com/watch?v=6bg3O6u-ZzQ should give you more information in display entities
Here's a quite wild snapshot for map makers. 23w06a has new display entities, data driven damage and a new damage command, among a lot of other changes and fixes. Check it out! #minecraftemployee
slicedlime works as a Tech Lead for Minecraft at Mojang, but the YouTube and Twitch channels are personal projects run entirely in his spare time. Thi...
And Bukkit has Display entity classes, one for each type of display entity
Display entities are amazing
Is there documentation on it already
From what I saw on the video its a huge improvment from armor stands
Thats forsure
I cant seem to access them. Is api version 1.20 sufficient?
Intellij is telling me the classes dont exist
Yes
Yes
yeah intellij is being dumb
it cant find the class
nvm i see the issue, spigot versions too old
yep its fxied now, which also fixes my issue of me not being able to access armor trims
Sorry for the delayed reply. I'm on 1.20.1 but the same occurs in 1.19.4. Are you sure that it works when clicking on the recipe book itself? It works perfectly fine when it's a MaterialChoice, just not with ExactChoice. So as a test, these two planks exist in my inventory but it doesn't detect that I have them in there. Manually placing the items works fine, even when it's shapeless too. Any thoughts?
Can you send a picture of you hovering over your regular planks?
Bigger issue now.
After reloading intellij, all my package files are gone.
I only see pom.xml, and dependancy reduced pom
but If i check my system, the files still exist\
these ones?
Is it really possible to craft without putting blocks in it
No
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
All I did was change 1.19.1 to 1.20.1
Thatβs the ghost recipe
why does things need to break aaaaaaa
it should auto populate if you have the required items, otherwise it just shows you what you need
org.bukkit.plugin.InvalidPluginException: java.lang.NullPointerException: Cannot invoke "me.workwolf.timetovote.TimeToVote.getConfig()" because "me.workwolf.timetovote.utils.Messages.plugin" is null
Messsages.java:
private static TimeToVote plugin;
public Messages(TimeToVote plugin) {
Messages.plugin = plugin;
}
TimeToVote.java:
Messages messages = new Messages(this);
we dont even see where u called getConfig()!!!
also why is the TimeToVote field static
Because if I don't make it static It give me an error
package me.workwolf.timetovote.utils;
import me.workwolf.timetovote.TimeToVote;
import org.bukkit.configuration.file.FileConfiguration;
import java.util.List;
public class Messages {
// private TimeToVote plugin;
private static TimeToVote plugin;
public Messages(TimeToVote plugin) {
Messages.plugin = plugin;
}
public Messages(TimeToVote plugin) {
Messages.plugin = plugin;
}
public static String getPrefix() {
return plugin.getConfig().getString("prefix");
}
public static int getTimeToVote() {
return plugin.getConfig().getInt("time-to-vote");
}
public static int getVoteDelay() {
return plugin.getConfig().getInt("vote-delay");
}
public static boolean getDisableChatWhileVoting() {
return plugin.getConfig().getBoolean("disable-chat-while-voting");
}
public static List<String> getDisabledWorlds() {
return plugin.getConfig().getStringList("disable-worlds");
}
public static String disabledWorldMessage() {
return plugin.getConfig().getString("disabled-world");
}
}
seems like u called one of these methods before initializing the class
thats why u shouldnt use static like that
Non-static field 'plugin' cannot be referenced from a static context
ye cuz u have to make all methods non - static
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
You're supposed to access all these methods through instance. I'd make everything non static, and in ur main class u make one field with an Instance for that so ```java
private Messages messages = new Messages(this);
public Messages getMessages(){
return messages;
}
What?
Why static?
ye idk u could also use the instance
but then it would be much more complicated to acces it
Not really.
edited
I want to create a Messages class where plugin is passed in and I create functions where I take messages from the configs
now that is an exaggeration if i've ever seen one lol
It's still not right.
Hey, I'm using MongoDB and I have a database made on MongoDB Atlas and it looks like my server is making a lot of connections to it when it should only have one to it
whats wrong?
new
whoops. too much used to kotlin
how would i get a player's name using their uuid
because
player.getName();``` just gives me the uuid
can someone explain what setting something as persistant does
Entity.setPersistant to be exact
Bukkit#getPlayer(UUID uuid)
Player#getName
player.getName just returns the uuid
also .getPlayer() wont work on offline players
only online
hm
check the session server?
or create your own cache with uuid to username
wdym
the mojang session server has a route to get a username from a player's uuid
if it still exists idk if microsoft took that down
To be exact:
ItemDisplay#setPersistant
the docs just say it makes it persistant or not
but i litterally have 0 clue what that means
i just realized that my response was removed
and im 90% sure the definition of the word doesnt mean the same thing in this case
when i sent it
nice
i sent a question of mine and answered yours
pretty sure it means it persists, which would mean it would probably be there on restart / next server boot if the entity is still alive on shutdown.
ohhh ok
i dont want that lmao
i dont even know the correct termonolgy for this... how do i go about making a list of materials? a list in which i can use Random var = new random(); on it.
well it depends, what context is it
you making a daily rewards thing or smth
getting a list of materials so i can drop a random material on event
does each item have the same weight (chance) or does it vary
same chance
make an arraylist<ItemStack>, add the items you want into it
then, use new Random().nextInt(arr.size-1) to get the random item
i havent make my double jump yet, is it possible by any way to make it work without using flight in any way
okay thank you
if your making a double jump just apply velocity to the plaayer
but you need to detect player double jumping
which is usually
done with
flight
hm
thing is, the best way i can think of is having a physical item called double jump (a feather or smth)
and right clicking midair to use
obv you can use flight to detect that
but hn
the way its normally done if you allow player to flight but then cancel it etc.
what id do in that case is use the move event
and if the player is on air
enable flight
then do your flight checks, add a 10 second cooldown for enabling flight inside that move event
I added a plugin as a dependency, and I am trying to use a method from it now. However, I am getting a null argument exception when the method tries to create a NamespacedKey by grabbing the plugin object.
NamespacedKey materialKey = new NamespacedKey(TWClaim.getPlugin(), "material");
NamespacedKey key = new NamespacedKey(TWClaim.getPlugin(), "reinforcement");
NamespacedKey ownKey = new NamespacedKey(TWClaim.getPlugin(), "owner");```
So the plugin calls the cancelBreak method, which belongs to the dependency, and the method involves calling TWClaim.getPlugin(), which is supposed to return plugin but returns null. Does anybody know why?
public static Plugin getPlugin() {return plugin;}```
Hey guys im trying to generate a tree at the location of a sapling with block.getWorld().generateTree(block.getLocation(), treeType); and its not doing anything. Does anybody have experience using generateTree and know why that might be?
I've confirmd the method is being called. Do I need to make the sapling an air block first?
Iirc it won't work if the block below is not dirt
what about grass?
Yeah should also work. And yes you could try to have an empty (air) block instead of a sapling
im testing this with a jungle sapling on grass using SMALL_JUNGLE
0h ok
let me try setting it to air first. Should the location be the air block where the sapling was? or the grass block below the sapling?
velocity
the block where you want to spawn the tree (in other words where the sapling would be)
ok ill try setting it to air first rn
Why is that method static? Also when are you calling it? Did you set your other plugin as a dependency in your calling plugin so they are loaded in the right order?
Omg it worked! LOL thank u sm!
Is still 5MB limit for the plugin size? If so is there option to download dependencies while plugin is awakening?
Is there a way to get an entities rotation? (yaw and pitch)
Cant find a method for it in the docs
getLocation().getYaw() I think
or getEyePostition if normal entities have it, I know player does
You can use the libraries feature that was introduced in 1.17 iirc
Thx
Ah ty
it's normal that it doesn't work on shapeless recipes, but it should be working fine on shaped recipes. check e.g. my video for the angelchest 5 update: https://www.youtube.com/watch?v=_McDGk9DcdM
oh wait the example recipes spexifically NOT use themselves as ingredients lmao, but I'm sure I tried that later too. One second, I'll open 1.20.1 and IJ
me need to implement some sorts of camera interpolation
Hey can anyone help me?
I just want to remove all commands that start with /. but it doesn't work.
Version: 1.19.2
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, PacketType.Play.Client.TAB_COMPLETE) {
public void onPacketReceiving(PacketEvent event) {
if (event.getPacketType() == PacketType.Play.Client.TAB_COMPLETE && event.getPacket().getStrings().read(0).startsWith("/")) {
event.setCancelled(true);
}
}
});
PlayerComnandSendEvent
and for the Bungee Commands?
yeah indeed I also have this issue on 1.20.1 - very weird because it definitely worked fine around ~ 1.17 or 1.18 :X
I'd bet on a client issue
yes definitely, the recipe itself also works fine, just the client won't suggest to put any NBT'ed items into the slots at all
although it does understand that it requires a custom item, SHINY DIAMOND in my case, it will only show/suggest that if you don't have any matching non-NBTed item of the same item. But if you don't have any non-matching item, it correctly shows the actual ingredient, but then claims you have none
Yeah client issue
i'm pretty sure that it used to work fine some time between november 2021 and may 2022 (so 1.18 or sth)
Chat.isConfigurationSection("Channels." + args[0])
Why does this not work?
ChatManager.getInstance().getChatchannels()
so "Chat" is an object and hence should be called "chat" and not "Chat"
also:
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
FileConfiguration Chat = ChatManager.getInstance().getChatchannels();
if(args.length == 1 && Chat.isConfigurationSection("Channels" + args))
& it is a static methode
(No Console errors)
imagine args[0] is "asd" - does your config actually look like this?
Channels[asd]:
because first of all, you're missing a dot between "Channels" and the sub-name, and second args is an array
Channels:
~~
global:
Channelname: "Global"
and as I already said, it must be called "chat" and not "Chat"
well then you would have to check for "Channels." + args[0]
and if the configurationsection that you happened to call "Chat" instead of "chat" is already the whole "Channels" section, then ofc you must not prefix the parameter for isConfigurationSection with "Channels." again
Delete really fast
Why do you have a bunch of line breaks
But why u have another forEach inside?
what is that even supposed to do? your variable names are so weird too
and why do you loop over all players inside the loop where you already loop over all players
what is finalWorld2 for
what is "paa"
Wtf
also there is no method called getplayers()
the whole code is cursed, idk what the goal is in the first place
Yes π
Well that's not getplayers() that's getPlayers()
code doesn't care if it's the same word it needs to be exactly the same
no, p and P are not the same
I already told you not to nest the loops
you loop over all players and then loop over them again in the loop
why?!
You haven't given us enough code to help
just set the scope correctly? compileOnly vs implementation
Weirdest code π€
We did point out the error in the code code you sent
but you decided to get mad instead
I'll just skip helping you
same
your code is a horrible mess, you seem to lack basic knowledge about java, you didnt even properly copy/paste your current code but instead typed it again here without a code block
and you keep describing your issue with "not working"
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
good luck π
He will get the same, i'm sure.
Yeah, thats it, im just dumb XD
Honestly it depends on what the class is used for
how can I make every entity with a specific tag glow?
iterate over all entities, check for tag, give glow
with a foreach?
I don't think it really matters in what way/how you iterate
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
How to remove autocompletion of commands like /pluginname:command, and leave only /command?
Or disable them in spigot.yml(?)
something like this?
@EventHandler
public void onCommandSendEvent(PlayerCommandSendEvent event){
Collection commands = event.getCommands();
Collection filteredCommands = commands.stream().filter(command -> !command.toString().contains(":")).toList();
commands = filteredCommands;
}
or just keep it enabled because that's the intended purpose for when two plugins register the same command
it's ok but i need to do this
Yet again, things like muting the chat and being able to bypass it with /me, there are some exceptions.
What
yes
The collection should be modifiable. Instead use Collection#removeIf
anyone knows why this keeps happening everytime I do Git -> Share project on Github?
it created repo fine and if I then commit again, it also works fdine
oh thx
click the down arrow
what does it say the
then
event.getCommands().removeIf(command -> command.toString().contains(":"));
Yeah but it didn't work
Do what Coll said and just disable them
#help-development message it didn't work
That's not what I meant, in the spigot.yml you can just disable all namespaced commands
commands.send-namespaced: false
unfortunately I already commited manually and can't reopen that msg
I'll check next time
oh
ok
damn
So i did something and now it works..
is there some event called when a plugin sends a title to a player or would i have to read packets for that? i would like to use titles/action bars to display certain information, but not interrupt such messages from other plugins
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if(!(commandSender instanceof Player)) return true;
Player player = ((Player) commandSender);
for (Entity entity : player.getWorld().getEntities()) {
if(entity.getScoreboardTags().toString().equals(BlockDisplayer.getInstance().getConfig().getString("converter.tag"))) {
entity.setGlowing(true);
}
new BukkitRunnable() {
@Override
public void run() {
entity.setGlowing(false);
}
}.runTaskLaterAsynchronously(BlockDisplayer.getInstance(), 20*3);
}
return false;
}``` Why is nothing happening when i execute the command?
Debug your code
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
im pretty sure that doing getScoreboardTags().toString() does not output what you expect it to output
hey <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.26</version>
</dependency> - this need for hibernate ?
i know but the only issue that i have is that it isnt working.. so what should i tell you?
getScoreboardTags() returns a set of strings, calling toString will simply output a set object without any actual info
so it will basically never match your config value
if(entity.getScoreboardTags().contains(BlockDisplayer.getInstance().getConfig().getString("converter.tag"))) {
entity.setGlowing(true);
}``` so that would be better
Try it
Hey is there a way to see when a player used a specific item on a specific block ?
(Create Mod) I'm trying to see when people use a water bucket on an item drain
Thank you!
Interactevent
Yeah but I don't see any methods that could help me out
Player ucket event or smth for buckets
Getclicked block and player get inv get item in hand
Interact wprks too tho
Create mod?
Tried, since it's not emptying it on the floor it doesn't work
Sir this is spigot
?whereami
Then just interact
tell me I donβt understand why when creating dependencies for the plugin you need to download jar and in other cases you donβt need to download jar supposedly everything happens through maven
the same worldguard api needs to be downloaded, but hibernate does not
wth
What
what
what ?
what
hibernate is shaded into your plugin jar. worldguard api isn't, the classes exist in the worldguard plugin that you run alongside your plugin
can anyone confirm if PrepareItemCraftEvent#isRepair() recently decided to stop working all of the sudden
Hibernate can be downloaded by the library system because its a library
WorldGuard is another plugin that needs to be loaded as a plugin
this one method is now outputting false even if its literally a repair recipe, at least 1.16-1.19
if it is in the core, then maven is not needed no?
i mean why i need add hibarnate in maven if this exists in core java
It doesn't
.
hibernate not core yes?
not in core
if it's not in the core why then you don't need to download the jar itself
worldguard api not in core too
but this need in server
I was told if the api is in the core, then you do not need to download it. Hibernate is not in the core, so in theory it needs to be downloaded?
yes
what
yes it needs to be downloaded
as a jar?
kinda? downloading it as a JAR by itself isn't going to do anything for you. They already gave you two options, use Spigot's Library system to download it or shade it into your plugin with maven
here is a simpler question why do we need a worldguard api in the form of a Jar if it is in maven
yes i mean this
and you let maven download the api you use
what
hibernate isnt a plugin, so you shade it
worldguard is a plugin, and loaded by the server
so you dont need to shade it
i have two locations (big dots) that build an area of rectange, what would be the formula to get the length of dotted line?
always the shortest one
Math.min(length, height)?

compute the height and the width of the rectangle defined by the two points
choose the smaller one
for the first two points, its the height, for the second two its the width

- CROSSBOW 1 rarity:3 cost:1
- ENCHANTED_BOOK{StoredEnchantments: [{id: "minecraft:sharpness", lvl: 3s}]} 1 rarity:100
- EXPERIENCE_BOTTLE 12 rarity:1 cost:1
^ this is my list of items in an item pool of a hunger game plugin
how do i make the enchanted book usable in anvils?
i tried {Item:{id:"minecraft:enchanted_book",tag:{StoredEnchantments:[{id:"minecraft:blast_protection",lvl:1s}]}}} putting the whole thing but it doesnt seem to work
im now using intellij idea, but im trying to make an artifact and include mysql-connector in it , how ?
Get rid of "minecraft:"
ok ill try
what build system are you using
the one with the huge elephant
the normal one
ah yes , maven
maven with java the both
i didnβt mean to write java lmao
what should i put here
https://cdn.discordapp.com/attachments/1037448142175617024/1143905440095277106/image.png
Just use maven
It's static because I want to call the method without creating an instance of the class. The plugin being called is a dependency in the pom and the plugin.yml
amm how /
Hey does Somebody know why this Import import net.md_5.bungee.api.plugin.PluginMessageListener;Doesnt work on the 1.20
Are you depending on spigot or spigot-api?
how do i use BLOCK_DUST but spawn the specific breaking particles of a block?
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.github.waterfallmc</groupId>
<artifactId>waterfall-api</artifactId>
<version>1.20-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
</dependency>
</dependencies>
These are my dependencies and Repos
Someone get the whereami thingy
?whereami
what is like the difference between the paper and spigot api?
paper more optimized ig?
paper has changed a bunch of stuff from spigot because they could
as a result its a bit more performant yes
paper bad
So i Should Use the original bungeecord and Its Been solved?
What exactly is your issue ?
This Import isnt accepted
I mean, that just doesn't exist on either bungee or waterfall `
Is spigot the only successful bukkit fork?
I think it's the most used one and most active one for now.
There are other ones?
probably
yes
- spigot is bukkit now pretty much
the same person maintains both
nvrm
Can I somehow prevent the server from saving a player's file?
Call #setPersistent on the player
Mhhh Strange than i have to overthinker my plugin
is this the only way to register a commandexec with multiple commands, or is there a better way (within the plugin, not like commands.yml)
getCommand("cmd").setExecutor(new CommandClass());
getCommand("cmdtwo").setExecutor(new CommandClass());
plugin.yml
aliases: [ghj, whdjk, whdjkw]
np
doesn't that only apply to entities?
a player is an entity
yeah I know that
but he's a different entity
Entities don't disappear when they're set to Persistent
players... can't really disappear
and I guess the entities are additionally saved
wait until i log out

I mean automatically
It works on players too
The persistent flag on players controls whether or not to save their playerdata file when they quit. If a player is directly or indirectly riding a non-persistent entity, the vehicle at the root and all its passengers won't get persisted.
wait until i timeout
This should not be confused with LivingEntity.setRemoveWhenFarAway(boolean) which controls despawning of living entities.
wait it's that simple
nice
Yes :)
yes
daaaamn, nice
well let's say. And I can make it so that I donβt have to download the worldguard api to the server, but at the same time I can safely use it through maven
I mean you could do that, but why? Most servers already have WorldGuard or have absolutely no problem getting it.
is there a way to completly disable join and leave messages? Excluding packet blocking
does Map have a method similar to getOrDefault except that instead of giving a default value you give a supplier (i.e. lazy)
it doesn't right
Well, it does, but this method also puts a the default value in the map if its not present.
yea not what I need sadge
Myeah then there is none
Write your own map impl that wraps another map π
way too overkill
what would you need that for?
you mean like ```java
Supplier<String> www = () -> getWhatever();
map.getOrDefault("zet", www);
Set the messages to null i think
I'm pretty sure that would still send the messages, just blank
That would be a logic flaw. Try it out. If it still sends something then this needs an update.
it doesnt send blank messages
okay I'll try it out
Is it better for performance to create a static final for funtional interfaces?
It should right?
ye
PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(bukkitPlayer, joinMessage);
cserver.getPluginManager().callEvent(playerJoinEvent);
if (!entityplayer.connection.isAcceptingMessages()) {
return;
}
joinMessage = playerJoinEvent.getJoinMessage();
if (joinMessage != null && joinMessage.length() > 0) {
for (IChatBaseComponent line : org.bukkit.craftbukkit.util.CraftChatMessage.fromString(joinMessage)) {
server.getPlayerList().broadcastSystemMessage(line, false);
}
}
from playerlist
Will be JIT optimized pretty quickly.
oh nice!
Oh right, jit does make some stuff pointless i guess
I have to study it a bit someday
So null and empty strings will prevent the messages either way
What about blank
One space (" ") will result in a message being sent.
yeah good luck with that :') https://wiki.openjdk.org/display/HotSpot/Main
pain
Just do what all good Java programmers do and write whatever you want. It'll probably get optimized and if it doesn't, who cares? 
for the most part it's true, lol
You mean the collision box of a block? What do you mean by size...
Not really, but that does kind of make me want to finally tackle non-cubic bounding boxes for block states
I'll write it down and maybe do it when I get back from vacation
Yes. I want to make a bounding box for custom blocks.
Yeah there's no API for that at the moment and a list really isn't sufficient
There is Block#getBoundingBox() but that's just a 1x1x1 cube no matter the block
On my TODO list now
what about collision shape ?
Block#getCollisionShape is a thing no ?
Is it?
like on the API layer
pretty sure it should be ?
yes
wow, choco not even knowing spigot api
So regarding not being able to call TWClaim.getPlugin(), using Bukkit.getPluginManager().getPlugin("TWClaim") worked.
A great question π
It shouldn't though
Canβt you just set the message to null
ehh, aren't there some blocks that change collision based on blocks surrounding ?
bamboo shoots iirc
Does anyone recommend a resource on how to do good counters?
@Override
public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
return context.isAbove(LiquidBlock.STABLE_SHAPE, pos, true) && (Integer) state.getValue(LiquidBlock.LEVEL) == 0 && context.canStandOnFluid(world.getFluidState(pos.above()), state.getFluidState()) ? LiquidBlock.STABLE_SHAPE : Shapes.empty();
}
LiquidBlock
stupid
Yes XD
why does recaf add random casts to CharSequence lol
Just being safe
String.join() takes a CharSequence so
Decompilers tend to be overly cautious when passing in values
yeah but surely it must know that strings extend charsequence
or implements
or whatever
It does. But again, just being safe
that's probably why people sometimes have these random casts in their code - they copy/pasted it from some decompiled .jar lol
Use fixed points in time and then check them periodically.
Absolutely that's why. You can often tell when code is decompiled code if someone's asking for help on the forums
There are some obvious signs that decompilers frequently fuck up
Naming variables as the name of the class is usually a big giveaway too. e.g. SuperLongClassName superLongClassName;
var1 var2 var3
btw is there a reason why the Tag class doesn't have a getByName() method? I just checked the code and unfortunately the field names don't always match the vanilla tag names so if I'd pull request it, I#d have to add an additional constructor field and that'd look so ugly
Yeah another one
or o1 o2 o3
I have a PR waiting to get pulled into the experimental branch that completes the Tag API
oh great
But you can get them by name now via Bukkit#getTag()
Yeah is that not what you want?
Hello, how can I change a sword's damage ? (editable when there is sharpness or any other enchant)
It's not pretty, but yeah. Something like Tag<Material> tag = Bukkit.getTag(Tag.REGISTRY_ITEMS, NamespacedKey.minecraft("axes"), Material.class); would work
What the hell even is a tag?
epic
I currently have stuff like this:
materials:
- "#BEDS"
- RESPAWN_ANCHOR
- etc
then people they can look up the tags on the javadocs, hence I use the bukkit tag names with reflection
#BEDS is not the vanilla tag name
What do you mean by that? You can edit an items base attack damage by changing its attributes.
Adding sharpness will add additional 0.5 * (level - 1) + 1.0 damage on top of that.
Oh right i forgot, it's for pdc
so yeah I currently would like to see a method to get a tag from the actual bukki t name lol
I think that's a really bad idea. the "bukkit name" is meaningless
look at a grass_block with f3, you'll see #enderman_holdable
that's a tag
I seen a plugin where enchanting with sharpness doesn't modify sword damage
Vanilla tag names are keyed just like other resource locations
They also don't expect the # in front of it
Oh i see
That's just a delimiter
So extra information
Need help one more time,
FileConfiguration chat = ChatManager.getInstance().getChatchannels();
FileConfiguration playerdata = PlayerDataManager.get();
String permission = String.valueOf(chat.getConfigurationSection("Channels." + playerdata.getString("Channel") + ".Permissions"));
Error: It will not be a Configpath ^^
console errors: None
mojang implementing tags after oredict has been around since forever for modded
You can listen for the EntityDamageByEntityEvent and subtract 0.5 * (level - 1) + 1.0 damage from
the attack if sharpness is applied on the sword.
yea but it's always funny to see vanilla copying modded features
speaking of which, recipe book is absolutely terrible if you're used to any NEI/JEI etc mods
Why not afterall if it's a good idea
okay thanks
I think you have Stash, Alex. This is the future API https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/878
playerdata.getString("Channel")
This need to get a channelname but without ""
who doesn't have stash π₯²
PR access to stash I mean
so what is Permissions? a string? or a configureationsection? or a list of strings?
So yeah, at least for the time being, my example above would work
Tag<Material> tag = Bukkit.getTag(Tag.REGISTRY_ITEMS, NamespacedKey.minecraft("axes"), Material.class);
configureationsection
I would recommend not tinkering with FileConfigurations on runtime.
Load a players data into proper classes and use them while he is online.
Then save them back as soon as he disconnects. (And periodically for safety).
Working with FileConfigurations can be really error prone because of the arbitrary
String keys.
In the future it will be Registry.ITEM.getTag(NamespacedKey.minecraft("axes"));
I'll update my TagUtils class to be able to use both to be on the safe side lol
I never got any problem with data files
you had at least 2 problems with data files just today
yeah code problems
Yes im talking about code problems.
Dont use FileConfigurations on runtime. They are error prone and
can be deceiving in terms of their current state.
Player joins -> load all data of that player into an object
Player leaves -> save the data back.
For this you can use FileConfigurations. But dont randomly use them
during runtime. Accessing data by String keys in different parts of your
code is bound to cause problems eventually.
ahhh okay
I cache my configs nowdays
I do this, but also save every once in a while to make sure
Is it possible to create an inventory with a title with a font specified / passing a TextComponent instead of a string?
it will be soon
How so? big changes coming up?
guh not soon enough. I reccomend using NMS I can share the NMS code if you want
Can any one help me
I like your pfp
waiting for a pr to get merged
I idk how to give normal player just one plot
?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!
In the meantime, that would be great π
Bro
Thanks π
you won't be getting help with this atttitude
go to #help-server and wait
that's not a development question
bro
https://github.com/Y2Kwastaken/Suketto/blob/master/v1_20_1/src/main/java/sh/miles/suketto/nms/v1_20_1/InventoryHandleImpl.java this code will work as long as you don't do poor Inventory comparisson using titles
Bruh
suketto deez nuts
He's not wrong
'helper' deez nuts
my favorite field of all time
private static final MethodHandle handleHandle;
handleHandle
kekw
@autumn cave I should add if you'd prefer to stick with opening with Bukkit's API just use sendTitleChange
and change the title on open
Bukkit has a sendTitleChange? I can't seem to find in which class it is
InventoryView iirc
Its not there, unless it got added very recently to Spigot (I'm on 1.20.1 jar from June)
Should be in 1.20
Also did not know this class existed!
Oh, that's awesome
setTitle
that's my own method I'm referencing
InventoryView#setTitle doesn't support components
Do you guys know how the lifetime of an inventory works? Can I keep a reference to an inventory that has no viewers and if so, how do I delete it?
hi im gc
Hi gc, I'm dad
Hello, how can I get the xpRepairRatio of a ItemStack (the cost of rename in an anvil)
Hi dad I'm dad
isn't the cost to rename always 1 level
could be wrong, but iirc that is constant
no
if an item has enchants, this will not be 1 level
are you adding a name and enchants
just want to get the xpRepairRatio
okay thanks
@young knoll I can check if a ItemMeta is an instanceof Repairable ?
Repairable doesn't extend ItemMeta so I don't really know...
What?
it should be in prior versions
i would be surprised it it hasnβt since the dawn of time
then how can I get the repair cost in 1.17 or below ? x)
it does not extend ItemMeta until relatively recently. another big issue with ItemMeta is all this stuff
just cast it to Repairable
and i am surprised
CraftMetaItem extends it
ALL item meta is "repairable" all item meta is "damageable" all item meta is "BlockDataMeta"
Is there any more efficiente way for doing pagination for this?
so I need nms ?
no
just cast it anyway
all ItemMeta is also an instance of Repairable, Damageable and BlockDataMeta
Yes, iterate over the loop with for instead of making a sublist and for each it
wut
But if the code will look ugly afterwards i'd recommend to keep it like this
It'll be less work that's why
Less space and less computations
Uhm?
What's wrong with my approach then?
I am using my approach just fine
Why create 3 extra objects to the gc to work
You're micro optimizing for a problem that doesn't exist
Trading readability for those 3 objects
who can help me to understand the schedule?
like the wait time from an action an another
I don't really mind 3 extra lines
the gc doesn't really mind 3 extra objects
Are you talking about TimerTasks/BukkitRunnables?
I am having issues calling methods from a dependency.
ye i want to make like after 10 second of placing a block delete it
A repeating task runs the code every x ticks. If you want to have a block deleted 10 seconds after placing, you could have a hashmap of blocks and timestamps. Every 10 seconds, the task runs and breaks all blocks in the hashmap older than 10 seconds.
which would be 10s * 20 ticks/second = 200 ticks
ye but i didn't find the code i have to write
Bukkit.getScheduler().runTaskLater( block -> {block.setMaterial(Material.AIR)},200);
Video above covers what you need to know about tasks and scheduling.
hi @lilac dagger
200 mean 10 sec?
yea
Hey
then how can i make a block replacing after 10 seconds
So I am trying to call this method from a dependency. https://paste.md-5.net/ofazopixuk.cs The method involves getting an object from a hashmap inside the dependency. For some reason, PlayerData playerData = PlayerData.player_data_hashmap.get(player.getUniqueId()); is null, which never happens when the dependency calls this method inside itself. Does anyone know why?
PlayerData playerData = PlayerData.player_data_hashmap.get(player.getUniqueId()); This is the only part to focus on anyway.
Looks like pythonn