#help-development
1 messages ยท Page 492 of 1
competing for resources is gonna be harder
that's something, I know, I tried in Github Copilot, and even if he gave me stupid answers, sometimes was good, in beta
then the Ai can basically do the same things has humans
^ in that vid the guy made a rule he'd not write a simgle line of code
even had AI create the assets for him
this should be talked in #general in theory?
yea
blame me
i said chatgpt
yep but we are dead in here so it doesn;t matter
oh ok
general is ok in here so long as no one is asking questions
but isn't it still developer talk right?
it is I guess
theory and computer science
yeah i tried that
``
fail
please revert the changes of the overall size of the ellipsoid
take the size of the ellipsoid and add more space instead
``
and chatgpt fixed it own mistakes
It won;t be long before it interfaces with whatever game engine and just creates what you ask
is incredible how we are creating our sentience being, and ai probably will go with biological machine, there are reports of neurons or idk, that can compute even more than every computer and play pong by themself without problem
Simulates the Humans brain
but teh advancements it's made in 10 years is phenominal
in another 10, well who knows
its already happening, AI helping design AI
once it starts doing shit humans can't understand...
That's a code made by AI
Question: write a java function that prints the nth fibonacci number. provide example usage
public static void main(String[] args) {
int n = 10;
System.out.println("The " + n + "th Fibonacci number is: " + fibonacci(n));
}
public static int fibonacci(int n) {
if (n <= 1) {
return n;
}
return fibonacci(n - 1) + fibonacci(n - 2);
}
i used gpt-4 and its incredible in 3 seconds he gave me the answer
Matrixes are fun
it freaking scary then the Ai becomes cunning and makes it own languge we dont speak
I can see it happening, after all we are complex computers ourselves, just biological ones.
CUDA Cores are highly optimized to run matrix mults I think
Like they are stupidly optimized for that
imagine unify Ai with biological beings created in laboratory, its incredible what can be done
We are ok, until some fool gives it an autonomous body.
I'd be ok staying at home, fed and left to play on teh internet all day ๐
Nah, they would-be superior even to us.
Also fine with being in a zoo or getting killed by AI? Lmao
Yep, I just hope its quick ๐
waifu maid ai
cleans and cooks for you
metoo of waifu time
Some day, AI will be able to do my homework
Ai can already do yoru homework ๐
It can't
I bet it can, unless it's pratical
It cannot scan the exercise from paper, cannot write how I write, cannot actually understand the homework(uses way too different shit we have not used for that in school or just does the completely wrong thing all the time)
Also it cannot draw
Geometry really
One time i made an API with an ai that learned from waifus any information i could find, and the people started using it for sexual things, was really down bad or someone made her understand that the "n-word" was something for his language like Hi, and the ai was customizable totaly with phrase from request no limits, and saved info on mongodb
Once we feed it the sum of human knowledge it can only leave us behind
drawing? have you not seen teh Art AI's?
that vid I linked he used AI to create all teh assets
also there is OCR
they are cool, the picture im using is made by an AI
OCR is old tech for scanning and reading documents
There is no AI that can do all that shit together
not yet
currently no, but they recently put chatGPT on a Spot dog robot
Which has a high error-quote and prints the layout weirdly so that no AI understands it
actually OCR these days is 99.9% accurate
Not with my writing
probably if someone can make a system of "emotions" and make it appear like a human and not detached from who makes the conversation, probably that's a big step to make AI talks to humans
I used to maintain a system for a recruitment agency that used an automated OCR system for applicants CVs
And nah not really, I tried it was really bad
funny how the google api can solve it own "are you a robot test"
You can use it with high accuracy, but a normal user can't rn
are you a robot test are getting harder every seconds, because some ai made by an Indian or Chinese can bypass them
I like the cloudflare bot test. Click this box
it tracks mouse movement before you click teh box to detect automated movement
cloudflare bot test are made by an Ai to catch an Ai
like click the correct picture with "smiling dogs"
I hate teh picture one, I can never get them
I end up going through pages of pictures before i'm able to pass
the problem is that the AI has become so advanced
that the tests needs to be harder
which makes the humans fail them more often
yep
one day the test will be, calculate "x^2-2x-3" and give me x1 and x2
One day the test will be "please insert your Government approved credit for todays Internet usage".
china be like
Coming to a city near you
some of them is already do math to continue
but not an equations
I remember once my credit card got locked because I couldn;t remember how old I was ๐
I knew my date of birth, I just couldn;t math
brain fog moment
brain just making a joke
I was like, do I start at 0 or 1 and does it include the current year. Total brain fog.
I got it unlocked easily. Phoned up and bitched at them for discriminating ๐
scary thing
if someone kidnapped you and ai convince ur family a whole fake story
https://i.kym-cdn.com/photos/images/newsfeed/002/554/505/f28.jpg one day @eternal oxide
lol
sorry for posting the link and not the image
links are better
Im trying to call a new PlayerItemDamageEvent, the event is being called with the correct item, but it is not being damaged. Anyone have any thoughts why this is?
"sorry officer that's my brain"
Misclicks grabs the checks 
If you are raising the event yourself you have to handle all teh logic too
its not being damage because you need to use it the item or just try getting the damage every time
and see when its damaged
a new event would just be a dummy event. returned with a canceled or not state. You have to implement any logic as you created the event.
Oh interesting, makes sense
Im trying to dodge the item animation when changing NBT and figured I could do it by simply damaging the item
but damaging through NBT does not dodge that
or apply digging speed to the user, so the animation at one point is not displayed
depends what exactly needs to be accomplished, you can damage an item without actually damaging it
just hold the damage it has in memory if it reaches its durability kill it
ill try this
I need the actual damage to be applied to the item to display a resource pack animation
try using customdatamodels and not by optifine with damage
customdatamodels also plays the reload animation
y0ou need the item one
that's for entity
what you mean by reload animation?
seems that has interested you as well
when you switch items in hotbar, the item appears to float upwards. Same thing happens if you change the item NBT while holding it
i don't understand that, and if i can i want to help others
neither do I. Was just going to wait for them to clarify at some point ๐
oh, that's but just i think is a behavior force coded in the client side aspect
teh item flash in hotbar is any time the item is updated
it's replaced.
so almost any change shoudl trigger it
I thought that it didnt happen during vanilla operations but apparently it seems to, its just hard to notice when its in use
the only thing i could find on how to remove it is very old
https://www.spigotmc.org/threads/cancel-held-item-change-animation.289246/
and only with packet is possible to achive it
Checked that out earlier, seemed that the guy never got it working but ill look into it more, thanks
if you look down on the first post its written:
"EDIT: Found a way to target inventory updating of a specific item via packets thanks to @Jamezrin
This is the original code, all I had to do was remove the loop statements and just make it search for a slot #, the code shown below will update all items in the players inventory via packets."
oh shit I read past the initial thing and read every reply hahaha
thank you so much ill try this out
Ill have to set up nms
yes
actually it looks like this may just be for the gui
gui's are the same as inventory so this should work if you tweak it
thanks. Might take awhile for me to set up. Have a good night homie ๐
for me its 7:59 AM, but thanks have a good night
lol have a good day
hello how can I cancel item drops on death event?
I made a plugin that puts the items on a chest but the problem is it still drops the items so it gets duplicated
e.getDrops() and then remove what you need
e.getDrops().removeall()
even that does it, clears the array but not sure if stills drops
I'll try
public static void generateCube(World world, Location center, int width, int height, int depth, Material material, double theta, double phi) {
int a = width / 2; // half of the width
int b = height / 2; // half of the height
int c = depth / 2; // half of the depth
// Adjust loop limits to add more space
int xMin = -a - 5;
int xMax = a + 5;
int yMin = -b - 5;
int yMax = b + 5;
int zMin = -c - 5;
int zMax = c + 5;
for (int x = xMin; x <= xMax; x++) {
for (int y = yMin; y <= yMax; y++) {
for (int z = zMin; z <= zMax; z++) {
double x1 = x * Math.cos(theta) - y * Math.sin(theta);
double y1 = x * Math.sin(theta) + y * Math.cos(theta);
double z1 = z * Math.cos(phi) - y1 * Math.sin(phi);
double y2 = z * Math.sin(phi) + y1 * Math.cos(phi);
double distance = (Math.abs(x1) / a) + (Math.abs(y2) / b) + (Math.abs(z1) / c);
if (distance <= 1) {
Location loc = center.clone().add(x, y, z);
world.getBlockAt(loc).setType(material);
}
}
}
}
}
insane i made another shape
and i got 0 understanding with math
but chatgpt made it for me
works @cobalt thorn
nice lol
is there a boolean method for getDrops to check if there will be drops or not
like if inventory is empty before death
check the javadoc
I was gonna say... I hope that's not a cube
trig to generate a cube lol
it is a cube lol
why does it need trig
but it can rotate
ok
cube
that's a triangle
generateEllipsoid
no
it is 230, 65
anyone have the docc for the new paintings logic. I wanna see if theirs a way to know what paitning the player palces
what's is this coordinate?
please dont tell me there is an error
i'm testing rn
brb
not sure if anything is correct rn
i tried 0,0
axies
but it is messed up
String nick = args[0];
Player that = Bukkit.getPlayer(nick);
if(args[1].length() >= 1){
if(SENDER.isOp()) {
// args[0] = p , payam is payam
that.sendMessage(ChatColor.DARK_AQUA + nick + " " + ":" + args[1]);
} else {
SENDER.sendMessage(ChatColor.DARK_RED + "[ERR] : You not have permision !");
}
} else {
SENDER.sendMessage(ChatColor.DARK_RED + "[ERR] : You need enter the pm !");
}
} else {
SENDER.sendMessage(ChatColor.DARK_RED + "[ERR] : You need enter the player nick like [Player]");
}``` Hi , my code is not have problem because when i use in server is work but when args[1] is empty or null or zero is not send else message !
Scan you please send a screenshot
Why I said scan k don't know lol
Why do you want a screenshoty
Also just a small thing mate.
Something that will give you 10x less headaches is calling your variables something that makes sense.
E.g: Player that is gonna suuuuck if you make this class longer .
Player messageReceiver or something would be miles better and save you headaches haha
And Jan wanted a screenshot as context is king.
Seeing the exact issue on screen sometimes revealed stuff describing never can
Also @quaint mantle your second if statement literally says "if args[1] has at least 1 character in it"
Hi md_5 , i know this and i want say "if args[1] is has a 1 character or more"
and you , wait
args[1].isEmpty
and i tested this
Lol code is wrong
it generate a crystal shape
retry
is not work
Also you probably want to join all args together if you are making a pm system.
Also it is likely the order.
Any null check should come first
As I'd it has a nullpointexception before ur other checks... it'll shit itself
this isn't true. Args[0] or [1] will return true if it has a character or even a super long word. Example /command something nothing the length of the args for this is 2. Ex 2 /command s n the length of the args is also 2 here too. If you wanted to check on the basis of a single character you would need to do some more checking.
if you want a screenshot is here
yes, you need length >=2 to accrss args[1]
well
they only have a single arg
so they are probably confused in where to start in accessing the array
arrays start at 0
not 1
so if the length of the array is 1, that means index 0 is the only thing that contains anything
so you would need to use args[0] and not args[1]
xD , because args[0] is nick !
and args[1] is a string like message
then md_5 is correct and your check is flawed
and needs to be corrected
I was only clarifying though the exception you got, literally means there is nothing at args[1]
length of 1 means only args[0] exists. If you try to access index args[1] that means the length needs to be 2, and if the exception is saying the array doesn't contain index 1 then its just not there
i tested md_5 method , is not work but i think may'be my work is not true , if md_5 is says "if args[1] is equals or more than 2 " i tested this
what is the best way to display hp under the users name as Hearts with the number next to it like if i had 10 hears it would be 10 <3<3<3<3<3<3<3<3<3<3
scoreboard or
do you know how to count?
if so, lets count the numbers
0 how digits is this? the answer is simple 1. Therefore length of 1 on an array refers to index 0.
0, 1 this would then be a length of 2, and as you can see we now have index 1 available.
if the index only has 0, and nothing else, you can't access 1 when its not there. Not sure how else to explain it to you.
i know this but i now a found a good method
alright well, hopefully now you can fix your issues and make some progress ๐
thanks
No that's what I meant haha
As in "does it have at least 1 character in the argument...if so.. return true"
Though for record @rotund ravine that's why I asked for a screenshot. Was plain as day ๐ฅณ
Well are more appropriate question would be, "what is the error"
Charged questions lead to back and forths. I've asked that question effort and got "it's.not working"
*question before
spigot be dumb
Spigot developers can be equally as dumb
Lol , i dont like java but because i like minecraft so i just coding java for minecraft !
that was what i meant
Of course i like jda xD
Make it easier for yourself
Spell it out for yourself.
E.g Player that is awful practice.Not
because there are some bs rules. But because putting Player playerToMessage is waaay easier to understand.
Ironically, most spigot devs are dumb... because they are not dumb
A lot of devs try to be clever, and in the attempt make their code so hard to figure out that sherlock would struggle to read it lol
Imo, better to be an idiot, make.your code baby tiers.of simple. That way at least it's clear
i am lua developer and i like fivem and mta developing and in this now i fixed my problem but for answer to you , i just coding java just for jda and spigot but i hate java xD
Okay cool
Really?
lua script (((( is a )) ridiculous ) language
end
Imagine having to close every scope with end
Visual basic vibes
why does BlockState.setType requires Material instead of Type?
Required type:
Material
Provided:
Type
lua best intepreted language
No.
well whether it's "end" or "}", doesn't really matter
but yeah lua sucks
i only use it for my adventure games and that's already frustrating enough
especially that annoying naming, like "tostring" and then "isEmpty()" - why is it not "toString" then
or that you sometimes need :, and sometimes .
game.CutSceneAction:isEmpty() that is annoying
Spigot uses type for Material
Hello, I made an animation of the text over neznamy/tab I wrote the animation in prefix.1.%animation:rank% and the text of the animation lags in the quotes, it can be seen in tabu fine, does anyone know how to do it please? Thank you
skill issue
Does spigot have a method to check if a block in tree was placed because of sapling?
it's an inline method definition. the "end" belongs to the "function()" declared there, the ) belongs to setDelay(
setDelay is declared as "setDelay(time, callback)"
like a lambda
or rather, an anonymous runnable
I already said that its ridiculous... No need to kick it while its on the ground
lol
Blocks have no metadata like that. You would need to track that yourself.
I don't really understand what's so bad about it
i hate many things in lua, but that it uses "end" to end code blocks, is not one of those issues
what much more bothers me, is that by default, all variables are global unless declared local, and that you gotta use the # operator for an array length, while the tostring method is a global method called "tostring(something)" and not "something:toString()" and also that it's literally called "tostring" and not "toString()", and that there's both the . operator and : operator which on first sight, do the same thing, but actually they don't
also My.Object:method() is sometimes the same thing as method(My.Object) and that's just weird
well i like more
public void smth(String a) {
if (a.length() == 5) {
for (int i = 0; i < 5; i++() {
sout("foo");
}
}
}
Then
Sub Smth(a As String)
If a.Length = 5 Then
For i As Integer = 1 To 5
Console.WriteLine("foo")
Next
End If
End Sub
use libgdx or sfml(cpp)
i also like that more, but first of all, in lua you don't have to declare "what" you end, and second, I agree it does look ugly, but tbh who cares
declaration: package: org.bukkit.event.world, class: StructureGrowEvent
that makes no sense
i mean for game engine
but why would I switch to something different if the game is like 50% done lol
just wanted to let you know! ๐ฅ
this probably has to due with the era it was created in. During the era it was created in, it was the standard or norm that variables were by default global unless you specified otherwise. This was due mainly to hardware limitations back then, that are really no longer issues today. But, since the language has a spec or standard, it isn't something that can just at a whim be changed and accepted especially after a few years of people already learning how to use it and being accustomed to its antics
Isn't python like that
idk, I try to stay away from python
hello why do I get this error
Cannot resolve method 'getBlockInventory' in 'Chest'
Location blockLocation = new Location(player.getWorld(), player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ());
Block block = blockLocation.getBlock();
Chest chest = (Chest) block.getState();
chest.getBlockInventory().addItem(Material.WOODEN_HOE);
Probably wrong Chest import
because you used the wrong import
!!!!
can I import both?
- no
- why would you
not without using the fully qualified name for one
you will never, ever need the MaterialData chest
it's been deprecated since at least 1.13
if python had proper lambda expressions and wasnโt slower than a tortoise it would be the perfect language
I personally hate scoping with newlines and spaces.
For me this needs verbosity. But its a good scripting language.
Writing bigger applications with it is out of question.
I need
import org.bukkit.block.data.type.Chest;
and
import org.bukkit.block.Chest;
i have written a couple of larger projects with it, and i do find nowadays that if i can tell a project might be large i start with java instead
for quick and dirty scripts you cannot beat it though
so you don't need the MaterialData one.
Since both that you need are called "Chest", you gotta use the FQDN name for one of those
even for medium sized programs honestly. itโs when people try to make GUIโs with it it ducks tbh
what's FQDN
i donโt think itโs FQDN in java, thatโs the url thing
get the block state and cast it
fully qualified domain name
Chest blockState = (Chest) myBlock.getState();
org.bukkit.block.data.type.Chest blockData = (org.bukkit.block.data.type.Chest) myBlock.getBlockData();
^^
oh
I'll try this
The maintainability of python is absolute horror.
I personally use it for prototyping and scripting only.
But if you dont work in a team then you can probably get away with a bit more
what do you mean by maintainability
i am the maintainer of a python package which is reasonably sized that this point. my biggest gripe at the moment is type hinting. circular imports are a big problem with that
basically DI is impossible
Without type hints i wouldnt even touch a project
Thats what makes foreign code a little bit more clear
I can maintain a 1960's beatle.... don't mean it's a good idea.
yeah i get you, i think you can use these TypeVar things but i couldnโt figure them out
Oh yeah. Python has no overloading so you need to handle multiple possible types per parameter
Step 2: convert your python code to java lol
nah iโm a fan of the language for its features
yep lol, default values for params are ๐ข
I'm a fan of chocolate pudding for its taste. I'd still get diabetes if I scoffed it every day lol
works but how can I get an instance of the doublechest I created
when im typing invalid command in console, its red, when im typing valid cmd, its white, im not sending these commands and these are changing colors, where can i find code for this behaviour in Bukkit source code???
I'm getting confused with doublechests
is this called conversation???
no thatโs in brigader iirc
im trying to find where bukkit is telling to brigader which commands are valid
Check if your Chest is a DoubleChest and then cast.
You don't need code, simply just configure it in config file spigot.yml
i mean the command map is synced to the client
Or if you mean console, then you should mess with jline completions
I think he is talking about how console interprets his command inputs
okay thanks
do you mean the server console or client
what's the event for closing chest, playerinteractevent?
close inventory
server console
org.fusesource.jansi
this is used
InventoryCloseEvent
ah ok i thought you meant the client
i just need to find how bukkit is telling JANSI what are valid commands
Download build tools, run build tools, and check source code
is this potentially a vanilla thing?
?buildtools
Yes, but bukkit also made modifications too it (for plugin commands)
while technically true, it isn't true to say you can't use both. You can specify an object with its complete path in the code so the compiler knows they are different.
public class Something {
org.bukkit.block.Chest chest;
org.bukkit.material.Chest chest2;
this is a valid way to instantiate an object that both have the same name for classes
cant i find something here??
JANSI has nothing to do with the commands
maybe you dont understand question
No, I don't think so, it's an internal thing
don't think it matters because JANSI does not have anything to do with commands let alone validation
Yes, no different then you specifying a color on messages
still isn't JANSI doing it
JANSI is just a console implementation
ugh i cant send screenshot what i mean
do you know how to color messages?
It's jline completions
im not talking about messages that are send
and you are obviously not understanding
I am a fullstack and blockchain, game developer.
I can help you.
Please any problem.
if you know how to color messages, then the same thing is done with commands in regards to how MC colors the commands
you may need to use NMS to access that part
yeah i guess
Check the jline completer class
however it isn't JANSI itself controlling the colors only thing JANSI controls is what colors are available to be used
JANSI use ANSI colors as its a console that implements the ANSI standard hence its name
Just get the console reader, modify the jline completer and set the completer again
that is one way to do it, but you could probably just find in the NMS where MC sets the color too
the @Command annotation isn't putting anything into the plugin.yml for some reason???
Am I doing something wrong?
same with the Permission annotation
Others work fine, but these 2 do nothing
Here's the yes
@Permission(
name="emessentials.*",
children = {@ChildPermission(name ="emessentials.info")})
@Command(
name="emessentials",
desc="Info about the plugin",
aliases = {"emes","essentials"},
permission = "emessentials.info",
permissionMessage = "You do not have enough skill to execute this command",
usage = "/<command>")
so it needs to know which commands are valid and which are not
Nonsense, it's just ansi colours
oh you want it done as you are typing, well then Kalix is correct it seems then
I'm using this btw: https://www.spigotmc.org/wiki/spigot-plugin-yml-annotations/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
well yes, but there is still a mapping in MC to ANSI colors lol
because the way you specify a color in MC isn't the same way you specify a color in ANSI standards
i just want to modify which commands are displayed in console as "not red"/"valid"
show the full class
Well that's a mess, I'm not into it
lol
I will leave it to you in further helping them and attempting to help them understand ๐
since they are wanting it done as they are typing
Idk if the annotations are in the correct spot, probably shouldn't be in main?????
?paste
its far better to use the paste site linked above ๐
The Command annotation belongs into a @Commands annotation
@Commands(@Command(name="firstCommand", ...))
I am pretty sure all the annotations belong into the main class
aight
I'll take that into consideration
can i do that from plugin??? and cant i just edit which commands i want to be not-red?? also im not sure if its about completer, when i used tab complete listener, it was tabbing custom text that i added but it was still red
brigadier controls the whole tabbing stuff. The server already knows all commands registered when it starts up, well usually. Brigadier taps into this
cant i make it think that there is some additional command, that really dont exists??
like while its checking if text should be red or white
when im adding commands to command map, these are non-red in console too
i think that i can add some dummy commands to command map and then these will be white
but i was looking for some listener-like solution
to edit this on runtime
you are probably not going to find a listener like solution for this problem
and are going to need to tap into some internals to accomplish what you are wanting
hmm ok so i guess that adding non-functional commands to command map will work like that
like overall, im trying to do my own command system, i dont like how internal command system works (command map etc), im just doing my own abstraction etc
this is why i dont really want to use command map
but it will work as white text in console
public static void registerCommands(@NotNull String packageName) {
CommandRegistry commandRegistry = new CommandRegistry(INSTANCE);
for(Class<?> clazz : new Reflections(packageName + ".commands").getSubTypesOf(Object.class)) {
try {
Bukkit.broadcastMessage(clazz.getName());
commandRegistry.registerCommands(clazz.getDeclaredConstructor().newInstance());
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
}
}
Im trying getting any classes inside my .commands but it doesn't find any classes after i changed some aspect of my commandRegistry now seems to not work but if i register them normally works fine, any solution on how to take any classes?
I usually use this to get all classes inside a .jar https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/ClassUtils.java#L124
then you could check if the package starts with "packageName.commands" or whatever
the proper way however is to manually register your commands without reflection
Hello people I'm wondering how do you deal with multi version support for spigot plugins. I know how to make it work (the programming side). The thing I'm interested in is making the ide use different versions in different files, for example in older versions you have some methods which were then changed in later versions, but if you only have one specific version dependency then you can't access those other methods. I'm using eclipse mainly but have used intellij before as well.
Maven/gradle
So in maven add all the different version dependencies and that should work?
Why does player#getStatistic(Statistic.PLAY_ONE_MINUTE) return a user's playtime in ticks....
because that is how mc measure time ?
Well, yeah, but one might expect Statistic.PLAY_ONE_MINUTE to return the time in minutes
I expected to find Statistic.PLAYTIME to return a value in ticks,
but then found PLAY_ONE_MINUTE and was surprised when it gave me the value in ticks
just seems very counterintuitive
u guys ever work on sum and need help and get scared to ask bc u know its messy code and probs a easy fix
that is why docs exist
Yes
I know
thats how I saw it gives you the value in ticks
but why is it named PLAY_ONE_MINUTE if the value is given in ticks
?paste
Ok so this works but i am overlooking the spot where i added the extra number bc it shows like 10 &c10 โค๏ธ i cant find where the extra 10 is coming from ik its messy once its working ill clean it up please dont judge me.
https://paste.md-5.net/sapegedaxe.cs
The name matches what Mojang calls it
gets banned
this is one way, however there is ways to do it without needing multiple modules and reflection as well. It just depends what it trying to be done
You can do it this way yes, however you would need to structure the code in such a way that it can't execute methods that don't belong for the version it is being used on
as long as you are not executing the code that doesn't belong for that version, the JVM doesn't care that the code is there because it will only cause a problem if its used, not if it isn't used lol
however most people go the route of multi-module because it is actually easier to keep it organized and more visible to see which code belongs for what version
and then you would shade all the modules into a single jar, or you could just make version dependent jars which ever you want
i still havent found where this extra 10 is coming from i feel dumb
in your plugin:
LineReaderImpl reader = (LineReaderImpl) TerminalConsoleAppender.getReader();
reader.setCompleter(new CustomCompleter());
where CustomCompleter is your completer class which implements the Completer interface of jline
i have a enderpearl. Every time i trow a enderpearl its supposed to replace the enderpearl with the hotbar with a different item. That works. The problem is, at the end of that event the enderpearl gets set to air because thats just what minecraft does. But becaue the item gets set before the event is finished it gets deleted.
Isnt there any method for deleting that entity?
Set it on the next tick then?
?javadocs
.remove()?
i think
?jd-s you mean
well i want the event to be casted tho. I want the enderpearl to work just be replaced with a different item afterwards
and if i use projectile launch event
that happens
Remove then spawn another entity with same velocity
Hence replace on next tick
oh true thx
Unless I don't understand your problem correctly (which I might)
Can anyone help in fixing this?
wrong encoding i suppose
or ur ttexture pack
definitely
But when i start the server in a provided host it doesnt do it
?
Ploudos
show your plugin
show your project encoding
mc version?
all line-modifying methods
Paper 1.8.8
Your config files should be utf8
oh 1.8.8
oh i will try thx very much
This is spigot
Hmm
How should i listen to a player equiping and unequiping armor?
javadocs
Of?
yes im reading
I use bedwars-1058
But idk if its org.bukkit.event.Player or org.bukkit.event.Inventory
Ye its mine
then you probably need #help-server
not the development
Its not only for scoreboard is a full core
Ohk
becareful you might mess things up, you also need to add bukkit's completer implementation, or just extend the bukkit completer class and override that function
i cant find anything related to armors
Unless it is on the dummy stuff
Armor stands only
you should probably use inventoryclick
and check for armor equipped as a result
or unequipped
But what if they shift clicked
Also if right clicked on hotbar
Is like 3 events or more to listen
Yes.
More dependencies yee
I know there was a PR for it too, but itโs either dead or still under review
which version of jline??? i tried "jline:jline:2.12.1" which is in CraftBukkit but it doesnt have LineReaderImpl class
and idk if latest is backwards compatible
server version?
latest
ok
well how do i set the enderpearls velocity now
i do
but how can i set the velocity
ohhh
okay
thx
Wait spawn entity had consumer param?
Damn
I can just every lets say 10 ticks
I check on every player
Theyre armors
And give the effects based on that
That should be enough
what does the arrow stand for btw
->
okay no clue how to use it just tell me what i need to change pls x)
ill learn it later
Why not learn it now
because im ptobally not gonna use it any time soon
and im already busy learning lots of other stuff rn
my list just keeps getting longer
yeah you are
lambdas are used quite often
in my experience at least, and i code often
the syntax isn't hard
well i only had to use them in python until now and i just copied 1 line my friend send me
WE MUST CONSUME
just get the main hand
or well
depends on the version
if its below offand just get the slot hes on
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
you are looking for ?cc list in #bot-commands
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!
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!
brother in god
I think that is something client decides
it would use the item in the main hand first i guess
that makes more sense
but its minecraft so can't say something for sure lmao
Write on a file different variables
getHand?
it does
declaration: package: org.bukkit.event.player, class: PlayerBucketEvent
yeah which is a superclass of playerbucketevent
what is your spigot api version?
maybe this was not a thing in your version
are you sure?
thats weird
can you send your pom.xml or build.gradle?
?paste
ah yeah the method does not exists in 1.19
Hello !
I need to write some variables on my config file, but it don't work i can read but not write
Here is my program https://paste.md-5.net/evakaboyic.cpp. I will get values from other class and write it in a file
and sure get it later
when someone join
i don't how i can write, i try some little functions but doesn't work
what exactly is not working
is the file created?
i don't know just don't do what i want
yes the file exist i can read normally
no error code
the values are in it?
no
just pre-defined
how are they predefined if you only use one save() method
and create an empty file every time
just write on the file
i'm a french people and my english is so bad
nms help
Hi, help to make items spawn asynchronously every second
Is there some way to access the shearing loot tables for an entity so that I can generate the loot since the shear event doesn't actually have any loot with it?
What would be the point of doing that asynchronously?
I'd think you'd want it to be synchronized so that only one loop is running
the following code needs to be executed, and items need to be spawned every second
Doing it async would most likely break or not work, do it sync with the scheduler
?scheduling
You didn't send anything
Not sure if that was supposed to be an image or something or what
well ig not
private Arena arena;
private final DropResourcesRunnable runnable;
private final int millisRespawn;
private boolean isSpawn;
public SpawnerThread(Arena arena, DropResourcesRunnable runnable, int millisRespawn, boolean isSpawn) {
this.arena = arena;
this.runnable = runnable;
this.millisRespawn = millisRespawn;
this.isSpawn = isSpawn;
}
@Override
public void run(){
while (isSpawn){
DropResourcesRunnable newRunnable = runnable;
if (arena.getGame().getGameStatus() != GameStatus.ACTIVE){
newRunnable.cancel();
isSpawn = false;
return;
}
runnable.runTask(BedWars.getInstance());
try {
Thread.sleep(millisRespawn);
} catch (InterruptedException e) {
e.printStackTrace();
Bukkit.getLogger().warning("Spawner thread error");
}
}
}```
Extend bukkit runnable and runTaskTimer an instance
but after that the code below will be executed?
Yes
oh, thanks, i will check it
why thread 
?
There's no point in making that a thread
wow it works ๐
I'm trying to make this only work if the vehicle is a boat, but i can't figure out how i would detect the vehicle type, can anyone help?
Hello lads, I've developed a plugin which spawns falling "meteors". When it hits ground, I calculate player pushback and distance depending on how near the player is to the meteor. Now, I am trying to add a VISUAL fire effects (like Material.Fire), that does not spread or destroy other block, and will eventually go away. Clearly, setting the block to material.fire with metdata "noSpread" and "noDamage" does not work. https://i.imgur.com/9Qv2m77.jpeg any ideas? ๐
My current code:
if you check instanceof Boat it works for normal boats and subclasses (chested boats). If you simply check whether the entity's getType() == EntityType.BOAT, it will only work for regular boats, not any subclasses
thank you, it works
you could simply just use fake blocks: Player#sendBlockChange. That definitely cannot spread
alternatively you could just listen to BlockSpreadEvent, check if the spread block is a fire, and if yes, is it the source block the one you spawned, and if yes, cancel it
Maybe this is the best way! So many options, thanks for taking your time ๐
Is there any way for me to have persistent data for a "ordinary" block? I need to make sure that if the server goes down, while the fire is burning, that it doesn't spread next startup. I bypassed this with a falling black by setting it's name to a identifiable explosion type.
Something similar but for Block would be sweet.
(Just to clarify - what I'm really after would be something like location.createVisualFire(lifetime in seconds))
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
however if you just wanna use metadata (which resets on server restart), you could do it e.g. easily like this
private final MetadataValue isUnspreadableMetaDataValue = new FixedMetadataValue(yourPluginInstance, true);
private final String isUnspreadableMetaDataKey = "isUnspreadable";
/**
* Sets a block to fire and adds the "unspreadable" attribute
*/
public void createUnspreadableFire(Block block) {
block.setType(Material.FIRE);
block.setMetadata(isUnspreadableMetaDataKey, isUnspreadableMetaDataValue);
}
/**
* Returns true if a block is a fire block with the "unspreadable" attribute
*/
public boolean isUnspreadableFire(Block block) {
if(block.getType() != Material.FIRE) return false;
return block.hasMetadata(isUnspreadableMetaDataKey);
}
@EventHandler
public void onFireSpread(BlockSpreadEvent event) {
if(isUnspreadableFire(event.getSource())) {
event.setCancelled(true);
}
}
if you'd use CustomBlockData (which is persistent across restarts, chunk unloads, etc), it will be basically the same:
private final NamespacedKey isUnspreadableKey = new NamespacedKey(this, "isUnspreadable");
/**
* Sets a block to fire and adds the "unspreadable" attribute
*/
public void createUnspreadableFire(Block block) {
block.setType(Material.FIRE);
new CustomBlockData(block, this).set(isUnspreadableKey, PersistentDataType.BYTE, (byte) 1);
}
/**
* Returns true if a block is a fire block with the "unspreadable" attribute
*/
public boolean isUnspreadableFire(Block block) {
if(block.getType() != Material.FIRE) return false;
return new CustomBlockData(block, this).has(isUnspreadableKey, PersistentDataType.BYTE);
}
@EventHandler
public void onFireSpread(BlockSpreadEvent event) {
if(isUnspreadableFire(event.getSource())) {
event.setCancelled(true);
}
}
@Override
public void onEnable() {
// Register listener for CustomBlockData, so that any block data gets removed when a player changes the block
CustomBlockData.registerListener(this);
}
}
"this" obviously is your plugin instance, in these examples
Thanks! Nice resource but I'm trying to work on a self-contained plugin (writing all my code from "scratch"), you'll have to pardon my beginner questions but is there any spigot/bukkit entity that allows me to save "metadata" through a interface directly - but not necessarily attached to a block?
Or am I better off implementing my own infrastructure for this with e.g. a SQLite db?
CustomBlockData uses the chunk's PersistentDataContainer to save data
you could do that too, ofc
Oh cool, didn't know that was possible -- thanks a bunch!
np. The easiest way would probably be, if you don't use wanna CBD (customblockdata) to just store a List<Vector> or List<int[]> with the locations of your custom fires in each chunk's pdc
however that'd require you to write your own PersistentDataType. You could also use the builtin String datatype, and then e.g. just store the locations as comma and semicolon separated, e.g.
"1,2,3;2,3,4;3,4,5" for "custom fire at 1,2,3 and 2,3,4 and 3,4,5"
Is there some way to register a single listener method?
hello i have question and i don't find example on internet to create this graphical type of menu
I have three that the features of will be disabled/enabled and the best I can think of right now is multiple subclasses
Isn't that Bedrock?
If you can't look at that and figure out how it works then you probably wouldn't know enough to get it working even with an explanation of how it works
Guess I have to use the subclasses
pain
getServer().getPluginManager().registerEvent(PlayerJoinEvent.class, new Listener() { }, EventPriority.NORMAL, (listener, event) -> {
// Code to execute
}, this);
Note, this is actually not recommended. Actually the logic should be in the empty listener, not in the executor (the (listener, event) lambda), but that'd defeat the point of using it like this.
The proper way would be to just declare/instantiate a new listener that simply only listens to one event
Only use that method if you want to listen to any general event
while also on startup
You can pass Event.class and do checks yourself
Like if you have a config based event system
idk
So I guess my subclass version is pretty much the best I'll get
it'd be much easier to just register the listener anyway imho, then just check if the feature is enabled, e.g. like this
@EventHandler
public void changeJoinMessage(PlayerJoinEvent event) {
if(changeJoinMessage()) {
// Do stuff
}
}
@EventHandler
public void changeLeaveMessage(PlayerQuitEvent event) {
if(changeLeaveMessage()) {
// Do stuff
}
}
unless you're using it on stuff like PlayerMoveEvent or InventoryMoveEvent, which gets called all the time
Player drop item event for like three different specific instances
It checks if it's enabled and if the person who dropped the item is even allowed to use the feature then schedules a task
My thought process is why check it at all if it's not even on ยฏ\_(ใ)_/ยฏ
i'd just use one listener, then would then distribute it
@EventHandler
public void onDropItem(PlayerDropItemEvent event) {
if(feature1Enabled) {
feature1(event);
}
if(feature2Enabled) {
feature2(event);
}
if(feature3Enabled) {
feature3(event);
}
}
// This does NOT have @EventHandler
public void feature1(PlayerDropItemEvent event) {
// Code for feature 1
}
// etc
because a player could reload the plugin, then the feature is now disabled but you still got the listener registered
so you gotta check if it's enabled, anyway
Oh right
Hello, how can I change the tool needed to break a block ?
me ?
listen to BlockBreakEvent, then manually drop the item, then call BlockDropItemEvent
okay thanks
and, how can I get the level of a pickaxe ?
๐ Welcome!
Here you will find useful resources and tips for developing your own, custom and unique servers, resource packs and plugins, utilizing the most recent known mechanics!
In each topic, please make sure to check out the resources!
You can't, but there's a material tag called NEEDS_DIAMOND_TOOL
And iron and so on
okay thanks
What are you trying to do?
I need to get the level of a pickaxe
A mixin really might be easier based on what you're asking
For what?
to check if the player can break my custom block
that's true, but I think this can be more simple if I get the level
You can't get the mining level
okay
Well, maybe with NMS, but that would be extremely impractical to have just for mining level
thx
what
like for example if i save something to file in onDisable
will it work for crash disable
No
You can't turn your car off right before you crash it, can you?
That's pretty much what a server crash is
i mean does crash just fuck up the main thread
It kills the main thread
Along with every other thread
so generally you should avoid saving stuff onDisable()
and probably onQuit(PlayerQuitEvent event)
onDisable gets called when the server stops
yes you can
not sure what makes you think that is impossible o.O
If you can somehow react quickly enough
you can turn it off any moment:)
modern cars are designed to turn off when they detect crashes
so....
You
me
Accurate
alr alr
its not accurate, o.O
so to my question
It is. When the server or car crashed (hard enough), you are dead and cant turn off the car anymore
Let me know when you can find a human that can react to a car crash and kill the engine half a second before it happens
modern vehicles turn themselves off if they detect you hit something AKA crash
Then it is accurate
no it isn't
But that is after the crash, not before
That's the car turning itself off, not you turning it off
Also this
They dont shutdown befoee the crash. And its also not you turning off the car, but the car doing it itself
before a crash you haven't died and you can turn the key off
help me guys
No, use those
No, because you didnt see it coming
technically, when the server crashes everyone gets kicked
stop arguing over elephants answer
Just have another way to save because onDisable won't get called it it crashes
its impossible to see someone rear end you? its impossible to see someone tbone you or hit the front end?
lmao
couldnt you just listen to the event and check if they all got kicked
Your car is still usable
You dont magically shutdown your car thinking โmight crash in 5 secondsโ. And a plugin wont get notified โserverโs about to crash - wanna save anything to db?โ
isn't another way ONLY a better solution
A server is not still usable when it crashes, at least that instance of it
with no onDisable save
If you really need it then find an event that works where you need it to save
also does client crash cause PlayerQuitEvent
Yes, it counts as a disconnect
I think it does.
then you are obviously not a very good driver
and entire player object would work fine
if you can't see a crash from 5 seconds out
on quit
The only proper solution is to tell people to fix their server. If it constantly crashes, their world will be corrupted anyway, who cares whether it had time to save your 3 new pvp kills to the db if your inventory is gone anyway
I think it does in the event
create a memory mapped file in another thread if this is your worry
What if my 3 new pvp kills make me more proud than my items?
If i could see a crash is about to happen in 5 seconds, the crash wouldnt happen. I think i am a quite that i am quite a good driver that im not regularly in the situation to think โoh, a crash is imminent. Better shut down the engine nowโ lol
memory mapped files are handled by the OS and not the JVM
you can drive through another vehicle in front of you?
obviously you don't know traffic
Yes
Why would i shut down the engine instead of braking? And if you literally know it 5 seoncs in advance, you must be going like three times the speedlimit
๐ฟ
if you have a vehicle on the left and right and in front, and someone hits you from behind you are telling me even though you saw it with enough time, you could move your car out of the way?
No, i did not say that. I said theres better things to do than to shutdown the engine lol
you did say that
For example, yk, just braking
see
you said if you could see it happen in 5 second, it wouldn't happen
How would you know that some drives into you from behind 5 seconds in advance lol
so I gave you a scenario where you could see it happen from 5 seconds or more out
I don't get the whole discussion lol. You can't predict every crash on a server - period. And there's no way to avoid all problems besides saving everything instantly. A memory mapped file is the best you can do. Still won't help in a power outage scenario.
Correct
because its not hard to see it coming closer at high rates of speed
see further proving you actually are not a very good driver and don't pay attention
Yes forstalf, once again you are ofc totally right, everyone knows how perfect sense your argumentation makes
hi
i got problem
i wanted to start write plugins but i think i did something wrong
like when i create base addon and want to extend main class about JavaPlugin there should be snipnet but there is no
any idea how to fix that ?
https://cdn.discordapp.com/attachments/769499994046332928/1101537680438866140/image.png
https://cdn.discordapp.com/attachments/769499994046332928/1101537737728852050/image.png
you said something was impossible which is no surprise coming from someone in the EU
A very mature argument, once again
yeah but like in Java IDE
Step one, don't use Eclipse
If you think so
is easier to use visual studio with maven ?
It only takes about 30 hours of lessons in germany
like im lua dev butt want to switch to java
VS is worse
so visual studio is more common for me
IntelliJ IDEA is actually made for Java development
So is netbeans and eclipse
Use spigot-api instead
You know everything, we all agree on that
well it makes little sense to try to argue with someone who drives more then you do
its like library which i should load ?
Basically use https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.19.4-R0.1-SNAPSHOT/spigot-api-1.19.4-R0.1-20230416.003614-63-shaded.jar instead of your spigot jar
oke got it
I am not sure how you came to this conclusion
with IntelliJ it is common to have to clear caches, this is an issue that simply doesn't exist in netbeans
Not to mention that VSCode is more of an editor and less of an IDE
Also, ignore the others' advise about eclipse being an inferior solution
you need to be clear you are referencing the right thing
VSCode and Visual studio are two different things
I swear it comes down to what you are using/trying to do. I have not had to clear my caches in years.
so that means its not better
I thought he walked talking about VSC
Every IDE is fine. People just joke about eclipse because of its habit to auto-suggest random casts
๐ bruh I use vsc as my main ide you're not using it right if you say that
But I see it was VS though
correct
Does it work now?
let me see
probably, but its like the one thing I see people have an issue with when they come here with IDE problems
eclipse and shit might have advantages in some fields but im pretty sure a company dedicated to making ide's would have better quality
i might be wrong
logically makes sense
but its one I never experienced because clearing caches is just not a thing on netbeans lol
OH FUCK
It's true though. VSCode is just a glorified text editor. It's similar to notepad++
Eclipse also has lackluster Gradle (and probably Maven) integration
Come on spigot, why the hell do you not know how to shade properly
Its at least more fancy than notepad++
yeah thanks
At least Notepad++ is fast
True, it does have a better UI and more languages supported.
At least out of the box.
it actually is pretty good
There are runs and that's about it
And the maven integration is A-tier
Idk its pretty slow for me
There is also task tree, containers and more
Or rather said task "tree"
fun fact, buildtools uses the eclipse compiler if I am not mistaken ๐
Yes
The only place where eclipse's gradle plugin is awful is kotlin gradle
Their JDKs are better than Oracle's
whose?
Well, that's Adoptium, owned by Eclipse, but
And honestly I must scratch my head at how they are still incapable of supporting kotlin gradle
"Competitor made language!!1!1!"
Normal gradle files are already enough pain
Gradle is pain
Eclipse is leagues ahead of IntelliJ. It can't be considered a competitor
Its already sad enough i have to deal with groovy in maven
But Kotlin Gradle is nice
Eclipse ๐๐
Groovy in maven? What the hell are you doing?
Trying to increase suffering
Archetypes use groovy and velocity. https://github.com/JEFF-Media-GbR/spigot-plugin-archetype/blob/master/src/main/resources/META-INF/archetype-post-generate.groovy
Adoptium is just OpenJDK so that's probably part of why it's better than Oracle's shit in most cases
Not the case. Adoptium has far fewer issues compared to stock OpenJDKs
openJDK isn't going to be better then Oracles stuff. That is like saying you could make a better mercedes then the manufacturer of the actual car
No, and it gets worse. Check out this https://github.com/JEFF-Media-GbR/spigot-plugin-archetype/blob/master/src/main/resources/archetype-resources/src/main/java/__mainClass__.java
At that point I'd just abandon archetypes alltogether and start writing IJ plugins
its not gonna work, i dont want Completer, i want to decide about color:
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
do u see here anything about colors?? i dont see, completer is only for completion, i want colors
anyone know the event this fires? i want to prevent people from breaking the powdered snow
https://www.reddit.com/r/Minecraft/comments/nvdquv/found_out_that_u_can_stop_burning_using_powder/
*.java classes don't belong in the resources folder people
:suffering:
Glorified text editor if you don't modify it. I have the same features as a full blown ide by installing 2 plugin packs which takes seconds. Works equally as well too. I mean it's not like I've never used IntelliJ or Eclipse I'm aware of their functionality. I mean super technically speaking it's not an ide but what human uses it like that.
but what if it really is a resource
then you should kill the designer
@quiet ice does Eclipse constantly use 2GB+ of RAM?
No
IDEA moment
๐ I'll do it
it can if you allow it
Nope 1.5 GB of ram
of which at the most 784 MB is heap
Well, it could be Gradle being amazing
Never really paid attention to the difference between refresh, normal use, and building
And if I want to I can run the garbage collector whenever I want
Garbage collector your text editor
you are not really going to notice a difference between maven or gradle unless you got some kind of unique build requirements or you have a super massive project like firefox
ok lemme ask a question once,
do you want to change color for things that don't gett completed in console? (aka non-existent commands?) or anything like that?
otherwise, maven and gradle perform the same
Usually what I use with Gradle is decompiling the game
anyone knows when theyll add the event for powdered snow being broken by burning entities?
https://www.reddit.com/r/Minecraft/comments/nvdquv/found_out_that_u_can_stop_burning_using_powder/
Let's just ignore that FF uses make or some other stupid build tool
Usually it's downloading dependencies and eating eight times the RAM it needs
Look at jira or pr it yourself let's see it happen
yes
is there no other event that can handle it?
somewhere jansi is used for that
I thought Kalix gave you the solution or the place to look at ๐ค
damn wtf
not really, he gave me things related to tab complete, not to color
How'd you get that coloring?
ok give me a sec, lemme check completion codes for 1.19.x

