#development
1 messages ยท Page 51 of 1
no offense but how long have u been learning java for lol
yeah hang on ill get an example
record Person(String firstName, String lastName) {
Person(String firstName) {
this(firstName, "no last name given");
}
}
enough but most theoretical and where I learn the terms are at school which is mostly sadly in french
just like method overloading, except with a constructor
ah french moment
yeah xd
Luxembourg sucks in that sense
but ty for the example, will add that term to my dictionary
np
class Person {
final String firstName;
final String lastName;
public Person(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
public Person(String firstName) {
this.firstName = firstName;
this.lastName = "no last name given";
}
}
``` can do it with a normal class too
you know what method overloading is?
yeah, several methods with same name but different parameters right?
yeah makes sense
I wish java had better overloading for methods
how else are you supposed to do method overloading ๐ญ
unless you mean like default arguments
after running buildtools is there supposed to be nms inside the .m2 folder
o ok ty for that, whats the difference tho
paperweight doesnt take 10 fucking hours & you get deobfuscated source code
plus it integrates with your IDE so you dont really have to do anything
and its a gradle plugin
no maven then?
yeah no but maven sucks lol
just setup a gradle plugin and one dependency thing, easy peasy
thanklord, maven was hell, was hoping there was an easier way
so real

based
more so than maven sucks is just xml sucks
does gradle have pom.xml
it has a build.gradle or whatever it's called when you use kotlin instead
o nice
no because it was made in this decade
.kts
ye
tysm, got way more help here than the spigot server
Xml is just hell
i'd like to think we're better than the hellhole that is the spigot server
a lot better
Ofc, we bully people for using maven ! /s
helpchat is lowkey one of the best help servers for programming in general
speak for yourself
ofc with the exception of dev den ๐ซฃ๐ณ
isnt helpchat more active than dev den?
or i will have to get involved
sure because it's got like 10x the users but also most of those users are for generic minecraft things
different niche
we're not direct competitors
at least i hope we're not
โน๏ธ
yeah but helpchat is too big and impersonal
way too many people talking and stuff, i just want the homies yk
thats more what matts server is for lol
well yeah but dd is a nice middleground
epic
where every once in a while some interesting characters pop in, but it's not like massively out of control if some random person interrupts the convo to ask a silly spigot question
but silly spigot questions are fun sometimes
Case in point #dev-general
wouldnโt get conversations like that anywhere else
Question ab paperweight, I guess it can only be used if you target paper?
as far as i know yeah, but to be fair you probably should just be doing that anyways
yeah is the api binary compatible otherwise?
cause the paperDev() thing in your build.gradle is also a compileOnly(papermc.1.20.1-SNAP) or whatever
might get a little funky
Yeah idk exactly what it does, thats why I asked
try it and seeโข๏ธ
Fair xD
what's paperweight again?
gradle plugin
typically 80 g/m2 (0.26 oz/sq ft) for office paper, so about 5 grams (18 oz) for A4 sheet
no he was obviously asking by the ream
It also didntt work so weird
paper and paper forks that publish dev bundles to their maven repos like
https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
https://repo.papermc.io/service/rest/repository/browse/maven-public/dev/folia/dev-bundle/
https://repo.purpurmc.org/#/snapshots/org/purpurmc/purpur/dev-bundle
etc
btw you probably could've assumed this but paperweight doesn't support spigot - if you want to make plugins that support spigot, paperweight could cause issues
hello, I have a problem, i had a code that was working well, i don't have it anymore, can someone tell me why my code isn't working ? There's no error in the console
public void setNametag(Player p, String prefix, String suffix){
Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
Team team = scoreboard.getPlayerTeam(p);
if (team == null) {
team = scoreboard.registerNewTeam(p.getName());
}
team.setPrefix(prefix);
team.setSuffix(suffix);
team.addEntry(p.getName());
}
why there should be an error
whats your problem
why you do xy problem
the prefix isn't changing
yes it wont
why should it change
its static
not dynamic virable
achieve it via packets
so it can be per user
how can i do that please ?
i dont spoon feed but
in general i had same problem
because the bukkit one
is like u cant make per user prefix and shit
or diff prefix and suffix for same group
per player
i had a similar code that was working
it wont
usiing what tu use
once few players join in
it will be same for all
not matter what custom prefix suffix u set to the team
ah
so u need packet and send packets to every player
make a bulk packet
so not sending many in once
Does someone knows how to check if a section in a yml file exits
boolean isConfigurationSection(@NotNull
String path)
``` Cant find a good tutorial about this lol
and how to add the path like i see on the javadocs that i need to rename the path to the pathlocation
but it will give a redline
under it ^^
First time writing java?
first time using this ^^
and alr learned alot of java myself & watched alot of tutorials about it but cant find 1 tutorial about this sadly
boolean isConfigurationSection(@NotNull String path)
```this is just saying info about the method
`boolean` = **return value**, feel free to google that for more info since online prob has better explanations
`isConfigurationSection` = method name
`@NotNull` - don't worry about this, it's completely optional
`String path` = a parameter named `path` of type `String` (text)
So, if you want to *use* this method, you have to call this method on whatever class you found this on, then you can use the parameter to fill in the value (ex `"Reload_Files"` as the `path` parameter)
For more info, check out https://www.w3schools.com/java/java_methods_param.asp (also covers return values)
ohh thanks, found out haha
how to make url links clickable in normal chat
so if chats has 2 links it will be seperate
im using PlaceholderAPI#setPlaceholders(Player, String) in my plugin but since i have the player expansion, using %player% as my own placeholder will just cause it to parse to nothing
nvm i was just using my own api incorrectly ๐
Thanks mate, That sounds promising could you elaborate on how I could achieve that?
Hi!
How I can unload from player server resourepack?
is that possible?
impossible client side.
u can only override.
r u new to coding?
No
then it should be pretty simple
u rewrite all damage events
and re calculate accordng to existing mc formulas
Ah yeah I considered that
its not alot to do
But to rewrite EVERY enchantment is really not a good way about this
its a lot to do
u dont need every enchantment lol
in sword u legit got like 4
sharpness , knockback , fireaspect , unbreaking
rest are C+V
also other effects are C+V
the armor
its not just sword though?
its easy code
u write protection
and then the rest
by c+v
and later to listen to event where entity get damage
and do switch case
of damagecause
and calculate the final result
knockback is difficult to replicate I've tried before
and I don't know of where to get the exact values and methods for each enchant
then you have to think about how the blast prot and regular prot all coalesce together
whats the problem
exactly to the functionality of vanilla?
1==1
it's just a lot to do
u want complex tax
else send packets
but player will always see his item enchanted
and its even more heavy task on system also
many packets to send
on every tck
and connecting the server pipe line is probably something u wont be able to do if u think option A is hard
since player with server pipe to modify packets before they are send is a really complex thing to do
It's not hard but it's long and tedious
and there no tutorials or chat gpt that can help wiith iit lol
so what did you think you just write sharp=1 smith=2
and boom it works
nah those are the options
else its client side to display item as enchanted
u can try disable it via nms i dont think such option exists how ever
also you will need o write enchant algorithm
you could prob just remove the enchants via packets
i feel like that'd be simpler than rewriting the whole damage system...
using ProtocolLib/similar
it'd still be some work since you have to remove it from all of the packets that contain items but
he hae to connect server pipe line
.
it's a library for sending/receiving packets
why would u use library for it lol wtf
and you can look at PacketWrapper to see examples of all of the packets
...because it makes it much simpler
well u can depend on an library as dkm suggested
yeah I've been playing with the protocollib method but it's still a bit of a roundabout way
I Would rewrite damage system and even customize the game
that risks changing other vanilla stuff
like?
anything related to damage
i have rewrote damage system
whereas protocollib literally lets you do it in a couple lines since it also has get/setItemModifier
rewriting vanilla stuff - especially for one thing like this is not good
i rewrote it to work diff
because it creates lots of places to mess up
ik i gived him both options
modify the server packet / rewrite
also not sure maybe there option to make enchant not disable
like the texture
but u have to preset an nbt compound
not sure 100% i just remember there was such a compound
wait
ItemFlag
how'd i forget about that
you were right TonyFalk
although it's built-in to the spigot api
ItemFlag.HIDE_ENCHANTS or smth
oh yeah but u have to preset for everyitem
yeah true
so on enchant modify t
to output item with flag
also on anvil
should be short and efficent
but at least if you're using packets it's even simpler
that only hides the lore doesnt hide the glint
Oh
it hides the glint
nvm then
No it doesnt
did u try?
in the past I've used it
@vagrant yoke do u know what packets u need yet
besides set slot packet
wdym
he want so no one see them glint
yea
and always sendng packet like the item is default with lore of enchant
like modifyItem(ItemStack) it's very easy with the help of PacketWrapper
headache.
I've found this online so reading it nowhttps://www.spigotmc.org/threads/how-can-i-hide-the-enchantment-glint-effect.435688/
the hardest part is figuring out what packets you need
I've not editedd packets before
EDIT:
it will be better and easier to simulate the enchantments
#3cris1343, May 22, 2020 Last edited: May 25, 2020
HAHAHA
lol
anyway told u the best option in first place
gl
I was reading protocollib javadoc and it doesn't tell you which is which lol
feel free to do that, but I would recommend packets, but maybe that's just because I have a bit more experience with it
yeah I'd do packets too
would reccomend to rewrite damage system packets are too heavy task for server
Lol
Those packets are getting sent anyways
ye I don't mean adding any new packets
just modifying outgoing/clientbound packets
yeah thats what protocllib does
yeah you'd have to change the item to remove enchant but keep lore
by adding lore manually
theres much more heavier tasks going on in the server
this would probably take like <1ms
which are already sent
maps/lists are pretty efficient
^ good point
that WrapperPlayServerSetSlot doesn't come up from my protocollib dependency is it from something else?
ah I just use that repo to help out
ex look at lines 89 and 98 and copy those two
Jokes on you I have a custom list impl that calls Thread.sleep(1 million) on every method
๐ฎ
๐ญ
let the thread wake up
oh nice thank you
also you'll have to look at https://github.com/dmulloy2/PacketWrapper/blob/master/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerWindowItems.java and prob a couple other packets
like set equipment maybe
how do I know what each of these do?
https://wiki.vg/Protocol
The names are kinda different
ex WindowItems -> Container Content
also plib calls it Server but wiki.vg calls it Clientbound
both meaning server -> client packets
is kotlin good for plugin developement?
yes
do many people use it
Any ideas. Basically I want remove resourcepack when user switches server
also yes
1 last question, would copying the paperweight test project and using it as a base project be an easy way to get nms
just apply a new, "empty", one
altho i feel like there's a more proper way
I found same solution but it feels sketchy ๐
you'll never guess the answer
is it a big nono to make my plugin's logger static? ๐
not necessarily
good cause its really annoying me having to supply my plugin class when i just want to log an error if there even is one ๐ฉ
Is it possible for a 1.20.1 papermc plugin to display a custom bar on screen like this https://prnt.sc/jn-tBoC7B96P or not?
can always make a logger per-class rather than using plugin logger
how to create multiverse core world with datapack?
?
what is the equivelent of ChatColor.translateAlternateColorCodes for Fabric? I want to give a message formatting but I am not sure how to do so. Couldnt find anything in the docs.
its possible, but very difficult
I've looked on google and spigot pages but I can't find anything about it, they just got replies saying its forge only but I need it for every player who joins the server, the server isn't forge its papermc
use unicode image replacement stuff
it takes a ton of experiance though
there isnt any documentation on how to do it
you just have to know
there are some experienced people here like !SilentTail who could probably achieve the result you are looking for (for a hefty price).
anyone know of a library or just code that has the equivalent functionality as DurationFormatUtils#formatDuration(long, String, boolean)? if code, must be MIT
i'd just implement commons-lang, but i literally only need this one method, so i think it'd be silly to package the entire library (and i cant just use it's code cause its not MIT, i'd have to use their license)
yeah i found that while researching, but would it still work well with durations?
found this: ```java
public static String formatDuration(long duration, String format, boolean padWithZeros) {
StringBuilder formattedDuration = new StringBuilder();
// Extracting the duration components
long days = TimeUnit.MILLISECONDS.toDays(duration);
duration -= TimeUnit.DAYS.toMillis(days);
long hours = TimeUnit.MILLISECONDS.toHours(duration);
duration -= TimeUnit.HOURS.toMillis(hours);
long minutes = TimeUnit.MILLISECONDS.toMinutes(duration);
duration -= TimeUnit.MINUTES.toMillis(minutes);
long seconds = TimeUnit.MILLISECONDS.toSeconds(duration);
duration -= TimeUnit.SECONDS.toMillis(seconds);
long milliseconds = duration;
// Formatting the components based on the format string
boolean containsDays = format.contains("d");
boolean containsHours = format.contains("H");
boolean containsMinutes = format.contains("m");
boolean containsSeconds = format.contains("s");
boolean containsMilliseconds = format.contains("S");
if (containsDays)
formattedDuration.append(padWithZeros ? String.format("%02d", days) : days).append("d ");
if (containsHours)
formattedDuration.append(padWithZeros ? String.format("%02d", hours) : hours).append("h ");
if (containsMinutes)
formattedDuration.append(padWithZeros ? String.format("%02d", minutes) : minutes).append("m ");
if (containsSeconds)
formattedDuration.append(padWithZeros ? String.format("%02d", seconds) : seconds).append("s ");
if (containsMilliseconds)
formattedDuration.append(padWithZeros ? String.format("%03d", milliseconds) : milliseconds).append("ms");
return formattedDuration.toString().trim();
}
Implemented like this: ```java
public static void main(String[] args) {
long duration = 1234567890L;
String format = "HH:mm:ss.SSS";
boolean padWithZeros = true;
String formattedDuration = formatDuration(duration, format, padWithZeros);
System.out.println(formattedDuration); // Output: 10:17:36.790
}
i like DurationFormatUtils's ability to have custom words in it, ex:
public static void main(String[] args) {
long duration = 1234567890L;
String format = "H 'hours' m 'minutes' s 'seconds' S 'milliseconds'";
boolean padWithZeros = true;
String formattedDuration = formatDuration(duration, format, padWithZeros);
System.out.println(formattedDuration); // Output: 10 hours 17 minutes 36 seconds 790 milliseconds
}
ah
i might just end up packaging commons ๐
for that matter just copy the formatter class?
wouldnt that be against license? or could i refactor it enough to be ok
a) why would that be against the license?
b) how is distributing the whole library any different than distributing a portion of the library?
a) wouldnt my project have to use the same license as it? at least thats what it's license says
b) true ๐ค
does it say that tho?
yes
You must give any other recipients of the Work or Derivative Works a copy of this License; and
that does not say your project has to use the same license
huhhhh
in fact, if you keep reading, it says you can keep using any license you want in your project
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
i hate licenses
so it should just be fine to do?
if not, i dont think apache will care tbh (if they do ill just remove it
)
alr imma do it and if something goes wrong im blaming u and making u pay for the legal fees :D
:(((
Do not pay your taxes
This is legal advice
what license
lmao
Will folia support be added for DeluxeMenus?
offtopic go to #general-plugins
@sonic nebula
i noticed u can now change fonts on text in mc, does that require texture packs or are there extra default fonts built into vanilla?
(has multiple classes just so you know what each class does including the util ones)
I've been troubleshooting this and can't figure the issue. Whenever you RTP, in world "desert" or "sandbox" it does nothing but send you the "generating safe location" message. It just stops there. Whenever you try to do /rtp stop it says you aren't RTPing.
I need the root cause of the issue, I can implement the fix easily myself.
I feel like the issue is the RTPCommand class, however I can't tell.
is the world loaded
yep
it is on the server and it's loaded
desert, sandbox, world, world_the_end, world_nether
other that, any ideas?
Might be that youโre using OR here, try &&
if (!world.getName().equals("desert") || !world.getName().equals("sandbox")) {
return;
}
lemme check
nope
didn't change anything
You do || in a couple of spots and it should be &&
where specifically
isInAllowedWorld(), getRandomSafeLocationAsync()
ty
I changed those spots to && and nothing changes, it's still the same
all that happens when I do /rtp is sends me a "Searching for a safe location" in chat and action bar (which is intended)
but nothing else
maybe its not finding a location ๐ฅด
try hard setting the return value of getRandomSafeLocation to like X0 Y100 Z0 and see if that does anything
yep still not tping me there
could it be the callback?
Maybe I should try using bukkit task scheduler instead
this should also be &&
because if it's desert, it's not sandbox => returns, and vise-versa
if it's anything, it's not desert and not sandbox => returns
alr
aha I know the issue
i've changed to the bukkit task scheduler
it's definitely something with my use of completable future
@river solstice
i've fixed it
lemme show u just in case anyone else encounters the issue
where on earth is the doccumentation for actions types in deluxe menus?
I have a multi-module project
Parent (root)
| - src
| build.gradle
| settings.gradle
| - Child
| - - src
| - build.gradle
| - settings.gradle
When I build the Child project with shadowJar, dependencies are shaded correctly (shaded from Child.build.gradle dependencies), but when I run shadowJar for the parent, it only compiles the sources in its src and no dependencies are shaded. Anyone knows why is that a case?
How much do you think it would cost?
fabric uses adventure though, you can use mini message or the legacy component serializer
Edit: it doesn't have native support, you have to use adventure-platform-fabric
I have no idea. Maybe upwards of $500. You can dm or ping !SilentTail to ask though.
youd probably have to make a custom font (i.e. resource pack) and use that
i wanted something similar but we're on our own with that sort of thing, there is no definitive instructions on how to do it
no it doesn't?
I thought it has native support?
Or kyori has just made an implementation for it, like for bukkit?
adventure-platform-fabric, yes
ahh
im back
maybe with world
get world via integar pos / player world
since via string it not always works
why dont u just use a Consumer<Location> ?
theres no way to cancel hand movement break block animation right?
uh if u give haste like 9999
for a second
then i think u can but
the client plays the animation before the server actually gets the packet i believe
no doesn't matter, the client still plays the animation before the server i believe
oh ok
i might be wrong tho u can try
instead of doing break u can do the BlockDamageEvent
so thats when they start to hit the block
not actually break it
I'm making a plugin which randomises block drops, but I want containers to still drop their original contents. However, I'm finding that if I do InventoryHolder.getContents() on an InventoryHolder from BlockDropItemEvent.getBlockState() then the slots with items show as a stack of 0 air and the empty slots show as a stack of 1 air (so I can see which slots had items, but not what those items are). How can I get the contents from a BlockDropItemEvent?
Would PlayerInteractEvent not be called first?
Yep
It might possibly be correct, I havenโt tested it lol
But like I said the client does it before the server. But maybe you can do something to then stop the animation
Yes, but the sooner you respond to it the less likely the client is to have already started the animation
what are you trying to do
if you already have nms working then just call new EntityZombie()
in 1.8.9 how do i go about doing somthing like .help that will toggle somthing but wont send it in chat or server side(this is mod wise)
wouldnt happy hud be good for this?
It's supposed to be server side
Not exactly sure what happy hud is, will look into it
There is
Hecky way how ever
i do not care how hacky it is i am DESPERATEEE
U set player on ga on specific condition u get then u connect server pipeline and listen to the packets using them u know if player is trying to break the block so you can send him back an breaking block animation (block cracking for example) from here everything is very understandable and simple
Easy.
U get it?
100% will work
this will change the block itself breaking but not the hand movement
Player wonโt be able to break blocks
U just listen to his packets so u know he is trying
But letโs say it will require u sort of rewrite survival game mode from scratch lol
Implement all rules manually
If that animation is so important for u
i do not mind having to rewrite survival, i am making a minigame
So I told what u to do
alright
No matter what you need a mod for that
No
What?
No
?
Adventure game mode
what is ga
U dumb fuck why u donโt read what I said
๐ณ
Is game mode adventure
Player canโt break blocks
But still sends packets to server
In adventure
You can't break blocks in adventure
Correct but u still send interact packets
Ok?
How does that let the player break blocks
You can't hold down the button to mine
He recreates the break
That isn't possible
And how will he know the player is holding down their mouse?
well right now i am putting a rose over the players head
There is packet men
Learn how to not be rude when you're wrong
What packet
U just talk bullshit
Hit
He make blocks break insta anyway
If u didnโt get it
That doesn't make anything you said correct
If you have to insult someone to defend yourself, you're definitely not winning the argument
Can you show it to me?
Without any animation
And you realize the animation is sent when punching even in adventure
Is so
I look forward to it

https://youtu.be/YG7e9ENkBMU?t=32
Haven't really read context so sorry if this is irrelevant but @sonic nebula @leaden sinew
What is Adventure Mode in Minecraft? Watch and find out!!!
Minecraft adventure mode tutorial.
BOOKS I'VE WRITTEN! โบ https://www.stingrayproductionszone.com/my-books
CREEPYPASTA CHANNEL! โบ https://www.youtube.com/c/RayGloomCreepypasta
EXPERIMENTAL V...
it should automatically set you to it but if not then go to ~32s
sec imma code what i said
Thank you, that proves my point
second test
if my manipulation to client works
lets see
if it does eat light bulb.
What do you mean by manipulation to client
Are you talking about editing the client that the player is using? Because that's a completely different argument
Too bad
No daily for you!
nah no player side effects
no 3rd mods for player
should be handled via server .
now ill test
took long to compile that server jar
What is that link? I'm not clicking that
ibb is free pcture hosting
40s build time tho ๐
how long do cached builds take
i just opened up intellij, and on gradle it took me 20s for a clean build and then 455ms for the next
I know maven's a bit slower but I didn't think it was that much slower..
that's even worse then
40s for each build?
yeah
I'm not trying to start a whole argument or anything but I'd consider looking into gradle sometime soon
Not worth it, you aren't arguing with a reasonable person
Shocker
i just said i dont want to start one :(
just giving a suggestion
since I had just learned that maven is slower than I thought
Could always use buildpath ๐
Fisher wait
As you said to me
eat light bulb
I look forward to seeing it
waitt compiling again
going send gif now if works
k test time
works
lol yikes on u
dontt be afraid to join my links also IPv4 is nohing special
like ;l pretty sure u r still a child then that also considers him self senior level java dev
;o
???
welcome to a toxic #development
i also can disable other animation lool
but its a packet send to user when item updattes so itt plays animation
sec gyazo uploading
I just have no idea what he was talking about lol Didn't read the convo
now can u share the code so that OP can use?
you all forgot the whole point of this
there was someone requesting help
he already did it on how i told him
just that junky fisher come and said that im fool and its impossible
._.
you're not being much better right now
I guess this argument resulted in this being completed? but not in a nice way
Can't see the embed
how u do that lol?
tier 2+ perks :))
he thinks im gonna grab his IPv4 via gyazo link like ;/ thanks aloot dkim โค๏ธ
for giving a trust in me
i can make an block crack too but i mean to proof other thing fisher
Nah I'm just to lazy to open it
u dont have to open itt
i mean tbf gyazo would just gonna be getting discord's ip if i post it in chat
Nope
also
I can't say here
it uses my utility..
so code is pretty much garbage without the utlity
i do shortcuts using my utility to save all headache on boilterplate code that i have to rewrite everytime
I'd assume it's similar though
And I'm also assuming you're using packets, so if they have some ProtocolLib experience, they should be able to convert the code
if no experience then uh
๐ฅฒ
Does that work with an empty hand?
it will work on anyway
dont continue arguing please.. i just wanted to proof u that its possible
yeah sometimes we are teached else
Lol
Just show me it working with an empty hand and explain how it works, and I'll say you're right
You're the one who's been uncivil this whole time
what the difference?
Wdym what's the difference
One is with an item and one is without
It will literally take 5 seconds to record and send it
i think ur github page is full of other people resources wtf lol
And explain how it works
Lol what are you talking about
Okay explain to me how it works
i explained many times
No you didn't
sorry not wasting time on u anymore

idk what that is but I agree with Emily
It can't take more than a minute to reopen the server
Then explain how you did it in 1 minute
what?
i assume you are an troll now on ill ignore u
Sure because I'm asking for an explanation
i gived u already
xy problem
u never read anything
complete idiot teacher would kick someone that rude after 10 min i explan you and you say nah impossble
cant re write ur brain
Lol
You're spending more time arguing than it would take to just explain it
~out , learn to lose
ill send opensource towards the guy who needed it
but not for u
specially beecause u said im an idiot
I never said that
You're the only one who has called anyone names
If you don't explain how it works how am I supposed to learn?
It just looks like you're right clicking there
or can you still post the code, even without the utility stuff? (although that would be a bonus ๐)
Could prob still figure a lot out from that
Exactly
https://i.imgur.com/ziBlTar.mp4
@sonic nebula I'm very interested in how you did it, I tried cancelling the animation packet (the only packet sent) and that didn't seem to work?
If you can explain to me how you did it I'll pay you $5 because I want to know, and you apparently aren't willing to just explain it.
this knowledge should be distributed out for free to all ๐
I agree
The only logical conclusion that I can come up with for you not explaining is that you faked it and you're actually right clicking.
So you can get two things out of posting an explanation, you can prove me wrong and help everyone who wants to do this.
What do you want to know how to do exactly?
How to cancel a punch animation clientside for the player who punched
Ah. Yeah all I could see would probs be swing arm then use item.
Wdym?
the thing is that animations are clientside, then serverside
Only thing I can think of is forcing the player to do a different animation, if that's possible
although that wouldn't work for higher ping anyways
Send the swing arm packet then send a use item packet
he wants to cancel the animation entirely
Only thing I can think of is forcing the player to do a different animation, if that's possible
Yeah use item should cancel the swing
ah is that what u meant?
Itโs the player sending it to the server though
although in his local test server he has 0ms ping
but with someone with higher ping it might look weird
I don't think there's any clean way of doing this
Even with resource packs I doubt it
Ok so when the server receives swing send use
I'm trying right now
I just got kicked from the server lol
I don't even know the packet to send
I'll look into it later
Dawg do you not realize I already fixed it and got my help
I'm trying to create an 'ability' so when the entity is attacked they produce particles in a set location. While this is happening, the entity would remove air bubbles (in land or water) for the players within 20 blocks and while this was happening it would damage the players half a heart. every 5 ticks. (2 hearts every second (5 Hearts total))
int number = random.nextInt(100) + 1;
if (number <= 5) {
Location location = event.getEntity().getLocation();
for (Entity entity : event.getEntity().getNearbyEntities(20, 20, 20)) {
Player player = (Player) entity;
player.sendMessage(ChatColor.GRAY + "Get out of the way! Your starting to drown!");
if (entity instanceof Player) {
for (int i = 0; i < 10; i++) {
new DelayedTask(() -> {
location.getWorld().spawnParticle(Particle.WATER_BUBBLE, location, 1000, 20, 20, 20);
player.setRemainingAir(player.getRemainingAir() - 30);
player.damage(player.getHealth() - 1);
Bukkit.broadcastMessage(String.valueOf(player.getHealth()));
}, 5);
}
}
}
}```
Am I using the remaining air wrong? I couldn't find much on it at all.
I'm 90% sure I'm using the player.damage() wrong as well.
Anyone able to point me in the right direction?
so that code would technically set the player's health to half a heart
also i dont see that youve actually scheduled the task
Do you mean the delayedTask? I have that set up on another section.
Thanks Iโll give that a try
also i dont see the point in creating the delayed task object when you can just use runTaskLater and lambda
Itโs been working for everything Iโve used it on so far so I havenโt branched out into different solutions yet ๐ Iโll look into them ways though
you may want to use for readability or reducing boilerplate
also whats the for loop for?
your scheduling 10 tasks that probably run on the exact same tick
or atleast thats how it looks
The particles are short lived and from googling I couldnโt find a way of make them live longer. So I decided to just spam it a few times.
but you are spamming the whole code in there
๐
also why tf no reaccs in #development
Oh yeah ;-; I had it working when I was trying it out. I just wanted to get the โdrowningโ part done for now. I was going to rewrite it after getting that part down
if your trying to show the drowning bubbles in the hud i dont believe you can trigger them clientside without the player being in water
When using the set remaining air it does trigger them. It shows them at least but all it does is add bubbles for some reason
What the code was trying to do was repeat setremaining air (what airs left - 30 (which is 1 bubble)) 10 times
i believe it worths to check this
tbh id use runTaskTimer, and create a bukkit task object instead of lambda and store the current ticks and max ticks for it to occur then cancel it after it hits that
Thanks ๐ youโve been very helpful
^
something like this
Bukkit.getScheduler().runTaskTimer(this, new BukkitRunnable() {
int counter = 0;
int maxTicks = 10;
Player player = ...
Location pLoc = player.getLocation();
@Override
public void run() {
counter++;
if (counter > maxTicks) cancel();
pLoc.getWorld().spawnParticle(Particle.WATER_BUBBLE,pLoc,1,20,20,20);
player.setRemainingAir(player.getRemainingAir()-30);
player.damage(1);
Bukkit.broadcast(Component.text(player.getHealth()));
}
},0,5);
tho im not sure why the runtasktimer using BukkitRunnable is deprecated, not entirely sure how to go about doing it with the consumer method
since im not sure if you can define variables outside of the loop
ohhh im a bit dense
it's not deprecated tho
'runTaskTimer(org.bukkit.plugin.@org.jetbrains.annotations.NotNull Plugin, org.bukkit.scheduler.@org.jetbrains.annotations.NotNull BukkitRunnable, long, long)' is deprecated
ah you mean inside runTaskTimer
because it is meant to be used by calling the methods directly in the bukkitrunnable rather than passing it to the scheduler; or if you're using the scheduler you'd use the consumer methods
yeah i just figured that out when i googled it
it would actually be
new BukkitRunnable() {
int counter = 0;
int maxTicks = 10;
Player player = ...
Location pLoc = player.getLocation();
@Override
public void run() {
counter++;
if (counter > maxTicks) cancel();
pLoc.getWorld().spawnParticle(Particle.WATER_BUBBLE,pLoc,1,20,20,20);
player.setRemainingAir(player.getRemainingAir()-30);
player.damage(1);
Bukkit.broadcast(Component.text(player.getHealth()));
}
}.runTaskTimer(this,0,5);
ofcourse when it comes to this runnable i dont expect to be completely right but id say im on the right track, getting the particles to stay awhile is a clientside problem rather then server side, also the offset for the particle doesnt really make much senmse
why would you want it 20 blocks away
you cant make them live longer or shorter
also
wtf is that terriable code u made
learn java
What the heck Tony?
Why are you always such a bitch saying rude stuff and putting yourself above everybody?
Sorry I realized it was the wrong chat
Put in depends: PlaceholderAPI in your plugin.yml
Are you going to respond to my message?
Lmao blud learn java big L
did you see his code? ~edit: is code was like we took different codes and mixed them up into 1 piece its not about using poor performance or something it just look like gpt code i often encounter those gpt guys who ask for help with the bad code the gpt provoided them im not here to spoon feed people im very happy to help people and suggest them the best ways to solve their problems but nott when someone sends a non working code and he gives an explanattion of what code should be and was the cod does is not the same so. ~~edit2: tthat was legit XYProblem what do you expect me to oh man sec ill recode you the entire thing from scratch just paste it and later he will ask why it dont work when he dont int the class in main class ;/
what msg??
@sonic nebula
as long as it's not made from AI, you don't just say oh your code is terrible, learn java
You tell them why it's "terrible" and what exactly to improve...
Exactly
this is HelpChat, not MakeOthersFeelBadChat
Lol read their #1113758470689263616 message
All they know how to do is insult people
Yeah, they put themselves over everybody else
Must be a painful sad and lonely life tbh
Nobody was supposed to rewrite that
Just you weren't supposed to absolutely insult other people?
Do you have like a public repository I could look at to prove that you have the qualifications to even say that it's bad code?
Heโs ignoring my message again
what have i done
Lmao
dkim his code was made from al
Why aren't you responding to me?
if that is true then I don't mind, but you didn't even ask him, you just assumed immediately, and so if he didn't use AI, it's not very nice
intt number = random.nextINtt(100) + 1 <why like it? , loook att if eniy Intsance of player location in he code block , Delayed task for no reason, and look at last loop
now tell me its not an Al code
sorry Fsher what
but you didn't even ask him, you just assumed immediately
still shouldn't assume
look i cant assume human wrote it ok? tbh
yes
if you wanna make an AI comment like that, ask first
im always giving lightt for the people who take rightt path
its an Al they never admit those are xy problem guys
@sonic nebula
then discuss in #dev-general
What?
wat
hes just asking for an explanation
actually that fits in #development
dkim we are here to help correct? you want to help the guy who tries to take shortcuts in life?
Do you even know what an xy is?
the guy who asked why thng dont work just wanted someone to rewrite code for him today
Lol how am I taking shortcust in life
not u
i speak about the guy who send the ugly code here and i was angry because its an al written or someone who never learn java
and asked for help
An xy problem is asking for a solution that doesn't fit the actual problem
sorry for the misundersttading Fisher u r greatt witth java... i ttatlk abou someone else
or someone who never learn java
ok then if that is true, then tell them what's wrong so that they can learn
also ur t key is a bit uh
interesting
๐ฅฒ
dkim correct but tthose peopel say man i know java shut up and etc
its like listen hobo sits outside will you give him a fish everyday or once you will teach him to fish?
then you can respond with smth like "How long have you been learning for?"
he wont learn to fish he will lie he knows how the lazy guy
Why don't you just explain how you cancelled the punch animation? Because I have never seen anyone able to do that, so if you actually figured it out that would be helpful for a lot of people

i already gived u an answer on that ...
there always first time
send the message link
No you didn't
what message
your answer on that
that kid code?
i already gived u an answer on that ...
send the message link where you gave the answer
on the explanation on how you cancelled the punch animation
its some where up it was because he called me an idiot not directly ii just told guy how to cancel it , and he saidimpossble and i had to waste 40 min coding it to proof
send the message link though, because we cannot find it
i remember i explained in few words what he had to do
i dont remember it was 12 hours ago
or more
If it's only a few words, explain it again or send your code
my code uses my utility
Then send the code without the utility
I'm sure we will be able to figure it out
just send it in a paste
^
https://ibb.co/1nYRcHs i already deleted that project
IntelliJ has a Local History feature where it saves the file changes including deletions
i dont have extra memory to waste
unless you deleted your whole utility project...?
there no file because i deleted the self project from the computer its not deletion via the software
nah the project
utility is sperate
it detects it as External Change or smth
why should i waste my time on it
but in logs it was same, why would you send logs through utility?
i always delete useless things
nah man i just wont send anything here because the guy called me monkey
I gave you the benefit of the doubt before but now you're just sounding like a troll
also i deleted it already..
Ok link a message where I called you any name
won't even give an explanation, something like that is hard to completely forget
At this point it's obvious you just faked your video because you couldn't figure it out
here
you was wrong
now deal with it
i did all of it to just proof thatt u was wrong
You didn't prove anything
No you didn't
u can keep asking for code because u r not able to achieve it
u even dont know the names of packets probably

All you did was print a message saying that you left clicked, but without code and/or an explanation, you didn't prove anything
its just a debug
https://wiki.vg ๐คฏ
Yep I know nothing about packets
then you share knowledge to the public
nah its uselss stuff
It's only useless if you faked it
i dont know why someone would want to make the animation to not work
Really
faked how lmao i legit send u an video
you could've faked it by right clicking
Because yesterday you were saying how you had made it before and used it
Exactly
@sonic nebula I am going to have to ask you to stop
๐
anyways back to the topic
^^
Anyone knows about this "Fairy" library?
never used it but looks quite interesting, unsure if I should use it though.
I haven't, but a little bit of a warning -
Fairy is currently in a very early state
Some parts are not fully completed or optimized, And wiki isn't fully finished yet
ยฏ_(ใ)_/ยฏ
so far doesn't seem to have a whole bunch
wait
what is this for
is this a bukkit framework?
ah
it mainly built for minecraft server plugins in mind.
I skippsed over this part
yeah xD
Well, overall it is nice to have a centralized framework instead of using like ACF, Configurate, then some sql or mongo library, then triumph-guis, and whatever
PS: would use triumph-cmds if it wasn't in alpha.

how can i make mobs "follow" a player? not target, but follow
i want them to kinda trail behind the player, sorta like a pet (wolf/cat/etc...)
- spawn a wolf server-side and make the player its owner
- hijack the spawn packet and replace entity type with desired mob
- ???
- profit
just no.
write custom pathfinder what emily said is so wrong some mobs also fly and etc
it depends on the mob
you can create custom goals with the api anyway
could do that
also
its gotta be a skeleton/pillager tho cause i need them to be able to shoot
custom path finder and goals.
can you tony hawk on out of here please
there are other ways
spawning projectile in air
common wtf is this
also charge animation on those mobs 
๐
i seriously cant tell if ur a troll or not
They are
goals api will probably suffice, just, gotta write your own
Paper has a pretty nice path finder API
i hate paper api, it makes me use audience thing and adventure
maybe an api/library already exists for it ๐ i hope so
Why would you hate adventure lol
its just too complicated and confusing for me
i just wanna be able to go ChatColor.translateAlternateColorCodes('&', &a&lbold green)
boy have i got just the thing for you
a little thing called LegacyComponentSerializer
ikik but its still annoying
but also &x&f&f&0&0&0&0i &x&f&f&3&3&0&0l&x&f&f&6&6&0&0o&x&f&f&9&9&0&0v&x&f&f&c&c&0&0e &x&f&f&f&f&0&0r&x&9&9&f&f&0&0a&x&3&3&f&f&0&0i&x&0&0&c&c&3&3n&x&0&0&6&6&9&9b&x&0&0&0&0&f&fo&x&1&e&0&0&c&dw &x&3&c&0&0&9&bt&x&5&a&0&0&9&2e&x&7&7&0&0&b&3x&x&9&4&0&0&d&3t
equally annoying as having to call translateAlternateColorCodes every 2 lines
but also ^^
me when I &x&f&f&0&0&0&0i &x&f&f&3&3&0&0l&x&f&f&6&6&0&0o&x&f&f&9&9&0&0v&x&f&f&c&c&0&0e &x&f&f&f&f&0&0r&x&9&9&f&f&0&0a&x&3&3&f&f&0&0i&x&0&0&c&c&3&3n&x&0&0&6&6&9&9b&x&0&0&0&0&f&fo&x&1&e&0&0&c&dw &x&3&c&0&0&9&bt&x&5&a&0&0&9&2e&x&7&7&0&0&b&3x&x&9&4&0&0&d&3t
well i usually use ChatColor.GREEN.toString() + ChatColor.BOLD + "bold green" if its hard-coded
