#help-development
1 messages Β· Page 216 of 1
Hi guys, I have a map I'm using to map uuid to an object of the class I made called "PlayerPlus"
However, more than one listener is gonna need this object
I thought about initializing the map in the onEnable method, on the main class
and distributing It to the listeners, passing the map for the constructor of the listeners
However, I'm not sure if this is a good idea
π€
what do you guys think?
Make a custom event that extends the event you want. Make custom event return your object
A better option might be to put it in a singleton so you can ensure there is only one instance to avoid possible problems in such things. Otherwise what you stated is also fine
If anything I would make it a concurrenthashmap though
but I understand the possible problem
I don't know what a concurrenthashmap is as well π€
sorry π
Simgleton is a class that is setup in such a way that only a single instance of it can exist or be created
Ah, that makes sense
Concurrenthashmap is the same as a hashmap but designed to allow multiple things to access it without running into concurrent modification exceptions
Hope that helps with your questions you had 
Yeeeessss
Thank you a lot :)
thanks you too
i would not do the latter, that breaks the SRP
rather have a repository for the object
if the class on the one side represents a value object and on the other side handles and manages those instances, how does it keep the SRP
and thats where it breaks. first, the instance should not manage itself, second, the instance should not even know that it is managed from a higher being
Hey, I'm watching a video of how to do commands and the guy is making the onCommand method on the main class
however, the main class extends JavaPlugin but not CommandExecutor
How is he using "onCommand"? π€ wound't he need to implement CommandExecutor in some way?
I mean, I'm doing in an exterior class, and I'm using "public class ChooseCommand implements CommandExecutor"
That's because if you go far enough down the chain, you'll find that at some point JavaPlugin extends TabExecutor, which extends CommandExecutor. Therefore it has access to it.
its inherits commandexecutor as well
javaplugin is clever, it implements both 
Terrible tutorial video if they do it in the main class 
99% of YouTube tutorials could be 1 minute quick bites
Be the change you want to see in the worldβ’οΈ
i cant code
We should collaborate I suck at coding but I can teach
I'm thinking making shorts since that's all the time you'd need to teach a core concept
I have made my own class that extends the EntityFishingHook. What I want to do is to spawn a FishHook entity without the player having to hold a fishing rod in their hand. On 1.8 NMS, there's a method t_() that has a check for this exact thing, so I chose to override it. Removing the condition from the if statement, and even commenting out the this.die() method, did not stop the hook from despawning. Once I had overriden the this.die() method to do nothing, the hooks finally stopped despawning. Could there be another reason that causes the hooks to despawn? Note that the fishing hook never despawned when the player was actually holding a fishing rod.
Code used to spawn my custom fishhook (WireKunai):
fun spawnWireKunai(player: Player) {
val craftPlayer: CraftPlayer = player as CraftPlayer
val entityHuman: EntityHuman = craftPlayer.handle as EntityHuman
val world = entityHuman.world
val wireKunai = WireKunai(world, entityHuman)
val location = player.eyeLocation
wireKunai.setLocation(location.x, location.y, location.z, location.yaw, location.pitch)
world.addEntity(wireKunai)
}
1.8 moment
?1.8
Too old! (Click the link to get the exact time)
Aiming to support versions 1.8 and up
I know it's old, but many servers still use it for pvp.
be the reason why she carries a pepper spray
EU moment
be the reason your homies carry a pocket knife
Be the reason she carries an AR-15
murica
With an extended mag, laser sight and collapsible stock
?1.12
hello im currently making a lifesteal plugin however i really need the code line which to add when a player reach 0 hearts to ban
can anyone tell the code for it
..
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Start here ^^
-_-
hello im currently making a lifesteal plugin however i really need the code line which to add when a player reach 0 hearts to ban
can anyone tell the code for it
No we're not going to spoonfeed you the code
If you cannot code or don't want to hire someone
We help people we don't write plugins for people
you can't write only a line?
the line that i cant understand
also its only a dollar π
i tried
if (playerHealth == 0) PlayerGetBanned;
thank you bro u made my day
if you needed help for writing an if statement, you really need to learn java
oh
I hope you're not planning on copy pasting that
5 minutes from now: its red π
?paste the code
https://paste.md-5.net/gukeboqeso.java Home.java
https://paste.md-5.net/hovimiyiya.java Housing.java
https://paste.md-5.net/atikejunah.makefile plugin.yml
show your main class
Housing.java is my main class
all i see is static abuse but no reason to execute it twice
yeah
its not running twice. you are returning false from onCommand so you get the error syntax output too
should i be returning true?
if its the correct command yes
depends if you want to get the set command usage sent
you only return false if you want the syntax message displayed
also when i first boot up the server the plugin has an error but when i reload it it works fine
could be related
line 19 in Housing is causing yoru error
a static field initializes before worlds are loaded
I just told you why
remove the static
if you read teh full stacktrace it would tell you the exact line
move the initialization to your onEnable
but what about the inst
how do i hold an instance
do i srsly have to pass it to every constructor
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
does onEnable not run during /reload
it does
weird cus i moved plotLocations = new HashMap<>(); to onEnable and now it says its null
Hey, ive tried to make it so that piglins wont target you until you attack them, but now they wont target the player even though they hit the piglin. Do anyone know why? This is my code: https://pastebin.com/8cVmBPP1
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
This line if (e.getReason() != EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY || e.getReason() != EntityTargetEvent.TargetReason.TARGET_ATTACKED_NEARBY_ENTITY || e.getReason() != EntityTargetEvent.TargetReason.TARGET_ATTACKED_OWNER) { needs to have && instead of ||, because if the first of the or is true, it will commence
On mobile so I could be wrong, linewrap is making it hard to read
oh yea, why did i not see that π i think im too tired for this. Thanks mate!
A fresh set of eyes tends to help haha
hey guys, is there a way to replace the %20 %C3 to the actual character? I am using JavaScript and I need a function like fixText(text)
decodeURIComponent(text)
thanks!
hi guys, i'm trying to make conveyor belt only with resourcepack and plugin but i don't know how to make entity move smoothly (tp is too jerky and doesn't work smoothly for items and motion tag doesn't work for players) can someone help me?
for information the conveyor belt is a block with unused blockstate and not an entity.
Have you tried Entity#setVelocity?
FREE JAVA LESSONS
yes
what you got for me?
neither do i
ill see how much ram i can jank with unsafe off heap allocations π€‘
Time to use unsafe to edit nms fields π₯³
unsafe::putObject?
wondering what the dif would be versus reflection, probably native code
Idk how unsafe works tbh can you even do that
unsafe.putObject(field, unsafe.fieldOffsetFor(s), newValue)
But I need to edit a specific private static final fields which you can't do with reflection well technically you can but it's a bug and was removed after java 17
JREE FAVA LESSONS**
forgot how field offset method is called
instead do ||FREE LESSONS HOW TO GET BITCHES||
just because you cann crash the jvm doesnt mean you should do it
learnt that one from alex fr π€‘
that's exactly what i mean
takes only one line
well except for getting the Unsafe object
someone should explain me compare and swap
heeheehee
not yet, i'm a noob at making plugin and its difficult for me to search English because my English is trash
Hello, has anybody here an idea how to fix this ?
java.lang.NoSuchMethodError: 'java.lang.String io.netty.util.internal.PlatformDependent.normalizedOs()'
at io.vertx.core.impl.Utils.<clinit>(Utils.java:30) ~[?:?]
at io.vertx.core.file.impl.FileCache.setupCacheDir(FileCache.java:52) ~[?:?]
at io.vertx.core.file.impl.FileCache.setupCache(FileCache.java:31) ~[?:?]
at io.vertx.core.file.impl.FileResolverImpl.<init>(FileResolverImpl.java:67) ~[?:?]
at io.vertx.core.impl.VertxBuilder.initFileResolver(VertxBuilder.java:334) ~[?:?]
at io.vertx.core.impl.VertxBuilder.init(VertxBuilder.java:274) ~[?:?]
at io.vertx.core.Vertx.vertx(Vertx.java:87) ~[?:?]
at io.vertx.core.Vertx.vertx(Vertx.java:77) ~[?:?]
since when is java.lang.String a method
Man shit is is not my code
ask whoever wrote it then
furr
haha yr funny
basicly from where comes a second netty instance?
it's hard to tell without any examples of code
probably one of your dependencies has netty already
What code do you want
vert.x is open source
Has anyone got any clue how to fix this? Cannot read the array length because "<local3>" is null
I'm trying to iterate through an array and see if an element matches a certain value to check if it matches by using a boolean method.
array null?
I need help with some regex
basically, I want to validate the following: <number here> (<some text>) <some text>
The array is created by deserializing a JSON file to an array of the custom data object used.
It works in 1 set of code but not in my boolean method.
I'm doing essentially the exact same thing in a different method but it's broken in my boolean one and I have no clue why.
CustomDataObject[] customDataObjectArray = new Gson().fromJson(new FileReader(fileName), CustomDataObject[].class); (the actual name has been removed)
And fileName is a string argument that is specified.
for (CustomDataObject customDataObject : customDataObjectArray) {
if(customDataObject.getProperty1().equals(theStringThatIAmTryingToCheck)) {
return true;
}
}
return false;```
I'm doing basically the same thing in another method so I have no idea why it isn't working here.
technically it has π
well, the size limit of your storage π
I just checked and it says that the array is null but I have no idea why that's the case since I do the exact same thing in another method.
null checks my friend
my css is confusing too
CSS isn't all that confusing though. :3
my html sucks so applying css to it is even worse
I'm confused as to why the array is null when it's fine in my other method.
But it's soooooooo freaking easy
cant seem to put a margin between indidual li element
I've done some debugging and it's made me even more confused ngl
Wdym by individual? Cause if you want a specific element to have different properties, usually a class is used. Alternatively you could use the nth-child pseudo selector if your have a fixed list.
well those are two li elements, where 2nd has a a elem in it and i cant find to apply a margin-top to the li
That's why you use tools like sass. It makes css far easier.
dunno if this is the #help-webdev channel but anyways
wtf // in css?
ignore that lmao, it doesnt get included anyways
You can apply a margin-top to the li element itself, however it will do it for all li elements. Do you want the first one, the second one, or all of them to have the margin?
You can use // in sass. Not sure if it's what they are using though.
Just use a css comment of /* */
What are you going for then? I can't exactly help if I don't know what you want to get out of this.
i want to put a margin on top and on the bottom of a elements nested in a li
even putting a margin of 100px on my li a doesnt seem to change anything
If you want all the children it's li *
also ur trying to apply margin-top to awhich is inline, afaik u cant do that
Applying margin to a elements is a bad idea
I mean, it depends on what you need. He could easily just make the list a display of flex and adjust the spacing with the gap property, but margin was the old way of doing it.
Aregcraft was right, it's due to it being an inline display. If you change the display to block on your a element, the margin will apply as expected.
"If you change the display to block on your a element" whats that supposed to mean
display: block; or display: inline-block;
You can change any element's display. Generally it's block by default, but certain ones have a different default.
There are also other types of displays. Popular ones including display: flex; and display: grid;
I should also mention that because of this behavior, css reset files became popular so the seemingly random default styling wouldn't be an issue.
Yeah, use a reset file always
only it seems to apply a background color over the whole length now, due to display: block
If you want to get fancy and forego the margins, you can do this instead.
li {
display: flex;
flex-direction: column;
gap: 1rem;
}
Where gap is your spacing between elements.
Ah, css, the bane of my existence
tailwindcss π
Then you can style your inner elements as you see fit.
li a {
display: inline-block;
background: red;
}
I usually use bootstrap/my own, I don't like the length of tailwind classnames
Related to this topic, is there any markdown interpreter for ts?
Im planning to add system similar to github wiki or readme file
So when u upload a markdown file its displayed
i also used bootstrap for my plugins website cuz its fast, but if i want more customization i choose tailwind and deal with class bloat in markup with sveltejs
can someone help me with this https://discordapp.com/channels/690411863766466590/741875863271899136/1039953447476265031 ?
You can add velocity to items. Wouldn't that work?
Perhabs this is what you're looking for? https://md-block.verou.me/
as i said im a noob at making plugins and its dificult for me to search because my english is trash
does velocity works for player ?
Try it, idk
LOVING YOU i have been looking to display mardowk via html for weeks. Really thanks man
Velocity works on all entities
k thx
All it took was a quick google search xD
Honestly, searching is a skill of its own
Yeah
Don't blame you, I learned a thing too haha
Wait keving taking a small look i realize that you can execute native js from the mardown file
π
how can i check if an entity is walking on a block and apply a velocity if the if its the good block ?
Doesn't that protect against that?
someone will come to talk about flex and grid for three hours lol
Listen to player movement, if list of conveyor locations contains player then do stuff
I promise you it's not as hard as you think it is. :3
There are a lot of quirks sure, but for the most part, it's straightforward.
I never actually learned css grid, I ususally do everything with flex, is there a point in grid if I already know flex?
grid's more flexible
Yes, I hardly use grid as well, but there are plenty of cases where grid would be the better option. However, as with all things, it depends on your layout.
i couldnt enter webdev classes cuz i was too late for lesson today lol
rip
i dont have a list of pconveyor locations.
the conveyor is just a block like a grass block or a wooden plank
Flexbox and grid are two fantastic layout tools. It can be hard to know which one to pick, but when you focus on the strengths of each one, it becomes a lot easier.
π Links
β
The easiest way to get started with Grid: https://youtu.be/rg7Fvvl3taU
β
The easiest way to get started with Flexbox: https://youtu.be/u044iM9xsWU
β
Using the Grid ins...
Straight up. Learned most of my css knowledge from that channel.
Oh nice bro its pretty amazing channel
then check if block below is that
thanks
how can i store a location object in mongodb and read it without errors? If i store 0 for example and i try to get it as float or double im getting error that i cannot parse int to float or something like that
is there another way to store or read?
is it stored as an int in your database?
yeah thats not my problem lmao
the problem: how can i store a long/double without the .0 because he removes it
and everytime i want to read a number without the .0 its an integer but i stored it as an long originally
yk what i mean
wait if you write 69L its a long right?
correct
how can i do this with double?
Can anyone tell me how to get the spigot libraries for eclipse? After about an hour of searching I found that the spigot.jar for servers can't be used as a library and someone suggested using maven but I have no idea how to do that.
69.0
the database converts this automatically to 69 - dunno why
I would get into maven, it saves a lot of pain when working with dependencies, and/or even better, use Intellij with the minecraft plugin
This rather large tutorial aims at getting you started with plugin development in Bukkit. It is in no way a complete tutorial of all possibilities in Bukkit, but rather a general overview of the basics. It starts with making sure you understand Java, sets up your workspace in an IDE, and introduces the essentials of most Bukkit plugins. These tu...
Kevia, save it in a document somth like:
Location location;
// For saving
Document document = new Document();
document.put("world", location.getWorld().getName());
document.put("x", location.getX());
document.put("y", location.getY());
document.put("z", location.getZ());
// For loading
Document document;
Location location = new Location(Bukkit.getWorld(document.getString()))
i did it like that but imagine the location.getY() is 69 without a number after the dot the database will automatically convert this shit to an integer and i dont know why but if i try document.getDouble() it tells me that i cannot convert an integer to a double
world uuid pls
yeah
Integer = none decimal numbers
float = decimals numbers
doubloe = decimals numbers
yes BUT i need a double for the location object
Location#getX() returns a double
Please check the docs
u dont get it my friend
?jd-s
READ bruh its not diff
i know how this works but my database is converting every double without a number after the dot to an integer and thats why im asking if i am able to prevent that or store the location object as whole
Send code please
?paste
dont be rude thanks
Sorry im having my days
Can anyone help me with this error?
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because the return value of "org.bukkit.configuration.file.YamlConfiguration.getConfigurationSection(String)" is null
Which is weird because this is the config.
Players:
e454994c-62db-4a45-a469-889d18cd1429:
UUID: e454994c-62db-4a45-a469-889d18cd1429
NAME: PindaKaasGeitje
And this is the code to get the config
file = new File(Teams.getPlugin().getDataFolder() + "/players", name + ".yml");
YamlConfiguration player = YamlConfiguration.loadConfiguration(file);
for(String p : player.getConfigurationSection("Players").getKeys(false)) {
?paste
Sorry for long messag
section being null
oh
Save it as a double and read it as double
bruh the messages i sent last arrive first
I DID
gimme some time to paste the code
Bruh it is not null
@fallow violet sorry for being rude
Mongo document has a way to put and get stuff via double
?paste the full class and the config (on 2 different pastes)
So, which is your issuee?
excptions dont lie
dude T^T let me paste my fucking code
?paste
i get that, but the section is littarly there
hes literally doing that, give him time
if u send me this link one more time >:C
damn
ok
Sorry to all i having my days.... im not with the best mood
is iit in your actual file or just in the file in your plugins resources folder?
that code worked fine for me
Code: https://paste.md-5.net/uhein
Actual config file: https://paste.md-5.net/vufecuhaqa.makefile
1st link isnt correct
yes its the actual file
none of those load lol
@sterile token
Perhabs you could conditionally get it as an int and then just convert it to a double on the java side?
Yes it already does that
this doesnt make sense, new FIle only creates a file object, but ::exists checks if the file exists on disk, if it doesnt, call plugin.saveResource("players.yml") or file::createNewFIle or smth
but sometimes i store a double maybe and then it converts it to int and the double is gone yk?
read it the other way but still doesnt make sense
also new File(fFile, uuid + ".yml")
automatically creates a file with fFile as parent folder
is my internet down again or are people just ignoring me?
im reading
isnt down
not ingoring
But if the file does not exist i create one on plugin disable
why on disable
because its an object created ingame
and it saves it
if its just 1 file for player info, create the file if it doesnt exist on enable then have a getter
and on enables loads it again
I've found a github issue from 2014 regarding this kind of behaviour, is your mongodb up to date?
Well it creates a file per player if they join the server. Then on disable it saves it so when you start the server again all the saved data is still there.
so thats why if file exists
i installed it yesterday so yes
i have a plan
i store it as long and convert it do double damn im smart
same gooes with jsonsimple
what default world? overworld?
You can get all of them with Bukkit.getWorlds(). Then maybe index 0?
Bukkit.getWorlds().get(0) is overworld, 1 is nether and 2 is end, all others are custom
just call ::getUid on the world object
im trying this now
Yeah
you can append an uuid too, it knows how to save it
Then remember to do Bukkit#getWorld(UUID.fromString(document.getString("world")))
it has a dedicated codec
so document.get(" ", UUID.class) should work
verano please stop this this is RUDE OKAY JUST STOP IT I KNOW HOW THE SHIT WORKS
Im not rude
Im just seen that you have problems and im telling you help
So if dont want to get help, look for help via dms or other discord
This channel is public
π
only high
i want help but only HELP not tipps that i dont need like i never asked for
WE KNOW US? WTF
not anymore
haha
Hiya. I'm attempting to implement Teams this into a custom plugin of mine, but I'm struggling to find any documentation for Teams anywhere. I'm attempting to add prefixes, suffixes, color, etc in tab, but I'm not having much luck. I would be extremely grateful if you had any suggestions or snippets of code that you could share. thanks
public void initTeam(ProxiedPlayer player) {
Team team = new Team();
team.setName(player.getName());
team.setDisplayName(player.getName());
team.setNameTagVisibility("always");
team.setCollisionRule("always");
team.setColor(1);
team.setPrefix("test");
team.setSuffix("test");
team.setMode((byte) 0);
team.setPlayers(new String[] {player.getName()});
for(UUID p : connectedPlayers) {
ProxyServer.getInstance().getPlayer(p).unsafe().sendPacket(team);
}
^this Team is net.md_5.bungee.protocol.packet btw
and more specifically, the client is disconnecting with "Connection Lost" when this packet sends.
my premium solution xd
double with uppercase D?
does it even change anything
damn my internet is fast
in this day and age? Not allowed
im sorry that i like using the upperace one if i use the function right next to it
lol
it's normal
(:
u happy now?
Hi, how can I send a message in actionbar at login?
oh so it was a class? the one at the right
Send the actionbar message in the PlayerJoinEvent
Create an eventlistener that check PlayerJoinEvent and then u do Player#spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("MESSAGE"));
Attempting to push Team(defined packet)
Also works with Paper?
yes
you know how to create eventlistener?
Yeah
alright
quick question: does InventoryCloseEvent call when a player is in an inventory but leaves the game without closing it?
no
i forgot about closing game lol
ye so u like alt+f4 when u are in an inv
just test it by yourself
No if you just kill the process the client canβt send any packets anymore
How did you close the game?
alt+f4
that's a good question
Try killing it from task manager
i don't think minecraft should send packets when game closes
terminates the minecraft without informing it
the minecraft
fuck
oh
Alt+F4 still lets the program respond to the termination call
but a playerleaveevent calls right?
Yeah thatβs called by the server
Okay so InventoryCloseEvent is also called by the server, good to know
ye
Probably because the server closes all open inventories once a player disconnects
fuck went back to coding and my commit seems to be undone
rip
all code gone
i did git clean once thinking it will erase git configuration lmao
I would personally never run git clean
there should be a warning when running this command
Is it possible to set a display time?
Yeah, sorry I don't speak English
you can call it in bukkit timer to show it again
i tried to set a time too but i failed xd just make a Bukkitraunnable with .repeatTaskTimer
// send actionbar message here
}, delay, periodInTicks);```
No use BukkitRunnable
why
its better :D
how can i undo a commit from github lol?
This is the same
scheduler > runnable
:C
Thread.sleep() > scheduler
Like a chad
(Donβt use that)
some strong pain incoming : rollback to a previous commit locally and rebase the branch on that. On the paper it's easy but it never goes well π Good luck
runTaskTimer
why is my server not responding
xd
if u wanna cancel its easier in bukkitrunnable with
no
yes
scheduler.runTask(plugin, task -> task.cancel())
i think you can do Bukkit.getServer().getScheduler().cancelTask(id) in sheduler
thats trash because u have to store id and you can cancel it in BukkitRunnable with ONE FUCKING line
Calling #scheduleSyncRepeatingTask basically need a BukkitRunnable so why are you even debating on this ?
thats trash because u have to store id that's true
YES
because. (:
You don't see it because you use lambda expression but you can cancel the task the same way π
dont destroy my dreams now
no need to do getServer i think?
i mean i always do bukkit.getscheduler...
+1
did the same ages ago
but bukkitrunnable is better because its looking more beautiful >:C
accept.
my.
opinion.
and.
i will do the same
It's a little bit complicated for me. I'm new to Java
Wait, how do you run your BukkitRunnable?
so what is complicated for you
new BukkitRunnable() {
@Override
public void run() {
// cancel(); if u wanna cancel it
}
}.runTaskTimer(instance, 0, 0);
Thanks a lot for your help anyway!
oops I quote the docs: "Schedules this in the Bukkit scheduler" π
But just for you: BukkitRunnables are awesome
as well as BukkitSchedulers cause they're basically not the same
wait a second
i prefer never to go into docs because of light theme
this is more beautiful i change my mind
javadocs are so fucking ugly
tru
i use Bukkit.getScheduler().runTastTimer() lol
most of times
Dark theme is boring now, I've all switched back to light theme (except ide)
are you okay
discord light theme :Skull: x10
Just breath, leave your cave and enjoy the sun light
then light theme seems like darkness
at night
@agile anvil i wanna apologise because i just wrote down the scheduler and its way more beautful im sorry :3
STOP REACTING >:C
ok im going (its night time for me)
It takes time to fully enjoy lambdas but then you'll never leave them
Have a backbone
mf is humiliated
(:
If you have an opinion stick to it
still your opinion can change over time
I agree but their opinion changed within 3 minutes xd
this is why you should never share your opinions on twitter
After they got pushback
huh?
my wifi letting that image thro after 10 minutes.
xd
can't wait for twitter to cancel someone what he has done in a preschool as a child
soon you'll get this cool edit feature (but pay eight dollars pls)
I tried to put the delay but the action bar remains displayed
stays until you disable plugin?
Yes
you should set delay to 0 and period to 20 (that is 1 second)
@EventHandler
public void onJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
event.setJoinMessage("");
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, () -> {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("Β§3TEST"));
}, 5, 5);
}
Ye
public Integer timesRan = 0;
public Integer runSeconds = 3;
@Override
public void run() {
if (timesRan++ >= runSeconds) {
cancel();
return;
}
//your code
}
}, 0, 20);```
try this
ah yes spaces
set join message to null
what if u cancel PlayerJoinEvent? Does he get kicked?
it does nothing
sadge
every event is cancelable
isnt
They have to implements Cancellable π
Anyone coded a plugin before that wants to hop into a vc and try to help me?
oh
and still PlayerJoinEvent does not implement it, it's not
i would but im in vc rn sowwy mate
Damn you finger slipped really far on that typo
not a typo :p
I was giving you a chance to take it back
wtf π
damn i will never help u ever
Absolutely Chad energy
Good you'll probably start telling me about your favorite hentai or something
wha
please do not do this on nnn
yeah i also touch grass
are you guys really doing nnn?ΒΏ
im not but he thinks
NNN is probably easy when the only girls you know have two dimensions
my girl has 0 dimensions
what is wrong with u @alpine cairn i wasnt rude to u but why u r rude to me?
same
You said some weird shit to me off cuff Iβm not just gonna pretend thatβs normal
I canβt even get the spigot libraries to work on eclipse Iβve been trying to all day
karma
Are you using the spigot-api jar?
use maven or gradle
Ppl kept saying use maven but o canβt figure out what to download and where to put it
maven is shit
gradle better
This rather large tutorial aims at getting you started with plugin development in Bukkit. It is in no way a complete tutorial of all possibilities in Bukkit, but rather a general overview of the basics. It starts with making sure you understand Java, sets up your workspace in an IDE, and introduces the essentials of most Bukkit plugins. These tu...
Yeah ngl I read that and it didnβt help
maven throws zip header end errors and for some reason this doesn't happen on gradle
+1
if you want to have it done in the easiest way possible get intellij with Minecraft Development plugin
but its a shitty way
Does not work
If you say so Iβm just trying to start coding
fuck
u r rude to random ppl u deserve it
does it throw anything or what
Unjustified maybe, not random
I can send you the error in PM?
Donβt say βsowwyβ to strangers you gonna get bullied
you can send it here
send it here
?paste
i hope u never lean how to code
Lol you got him
πI know how to code itβs just these stupid libraries
skill issue
show da code
doesnt change anything
there is something called google try this
compiler will do that anyways
weird
All the tutorials are outdated been looking all day
i will help u if u say sorry and i will never write "sowwy" again okay
thanks
it works without L for some reason
i mean that code is a piece of shit, no reason why it doesnt work
just use runTaskTimer with a runnable
Ok sorry
xd
Same error
what?
delay is the time before the task starts, and period the time between each repetition
try 0L, 20L
You are using the spigot.jar instead of the spigot-api.jar is my guess
you should show the code
when will people understand that that L suffix doesnt change anything at all lol
this is a great thing for beginners to understand types
Yeah I figured out you canβt use the regular jar after 1.17 but idk how the api is different
it definitly wont solve the error
i wish (Double) 0 was real
Run BuildTools for 1.19.2 and it will produce an api jar for you to use
(Double)0.0 is real
glad you arent using c++ then
i'm glad i don't use c languages
This method is deprecated
microsoft java
lmfao
the cool part is you can easily cast between them if necessary though and I think you mean primitives. There is types such as Number and such
deprecated doesn't mean unusable, but it tells you the appropriate method to use in its place though so I don't see the issue
Not work
Yeah but the UnsupportedOperation clearly means the method is dead π
well i cant cast (Double) to int
only Double.fromValue() or whatever it is called
?paste your code now please with the usage advised
Yes you can, Double is the object form of double, so to cast Double would be to cast it to Integer
we told to use runTaskTimer
but those Classes typically have methods to convert like Integer has Integer.fromDouble or something similar to that effect
Is there anyway to play resource pack's custom sound?
I give up it's too hard for me, thank you for your help!
yeah you can't cast between class and primitive
Why would you give up??
You're almost done
cuz people tell him to use the wrong methods maybe
I'm new to Java and I don't understand everything yet.
at least you are honest
Why lie
some people who come here like to not believe they have limits
so they end up way over their head because they don't understand and refuse to believe their skills are not as great as they think lol
at least you are honest about your skill level and needing to learn more
i was shit at java too when starting this π₯²
Im a shit with java tho
should started at Java's beginning
I didn't know java when I started spigot
would have had so much fun π
Neither me
I started 2 days ago to learn
java 1 π’
java before 1.8 was hell
That why i dont like when ppl wants help without learnt java first
1.6 was so much fun though
Don't ask on here you will get turned away more often then not use Google and look up stuff about Java prior to applying to spigot
lets also not forget 1.4
i started with java 7 or smth
there's too many java versions i don't know on which i started
nice, well I hope you continue to learn. It doesn't take very long to get the hang of understanding it and applying some things
Thanks you!
you can easily learn java in like 3 months time where you can make stuff, not stuff of quality per-say but at least make things π
Can vouch I did it
Java versions feels like minecraft versions to me. Before 1.8 it was slow as hell and now it's way too quick
My first program was a minecraft plugin admittedly a bad one but it was a plugin that ironically enough was somehow good enough that someone wanted to buy it
Well, Minecraft is one of the catalysts that brought Java back on the map
Sadly i cannot say the same about Streams....
Idk what else it's used for lol tbh
Well I meant version release speed
I would say if there wasn't minecraft, Java would probably still be on the road to fully dying out
Not actual performance
What ???
Java is everywhere
Java is everywhere just not in games
android hehehe
this wasn't the case before Minecraft
Mmh everything grows. I would be surprised if a game had such an impact
before Minecraft which is 2010 time frame, There wasn't really much planned in ways of significantly improving java
android π
i'll just ask here what is the best way to make custom items metadata because i use "#{ID}" at the bottom of lore or is it good enough
I'm maybe too young for this, but according to its history it's not the case
Java 1.7 was the version then and had been for like several years, until minecraft came along and development of Java started to pick up because Minecraft hosting became super popular
And then they saw all the 12 year old kids playing Minecraft and decided to go ham further developing Java. True and real
in short what is this?
not sure what history you are quoting
Before 2010 there wasn't many devices everywhere, or at all. It's like comparing an old community of ants with more than 100k bugs and a new one that is just born
^^^
Java is primarily an office program and always has been. Minecraft is the only major game that uses it
This example is shit as hell but I hope you understand me
holy shit
If you are referring to android, it has always used its own version of java
I'm not referring android at all
This did not work
Well, Java wasn't as popular as you think it was. Most of what java might have been used for is some off brand embedded system
Most of the systems rely on Java : banks, erps, hr management, logistic systems, ...
What part didnβt work? Did you get the spigot api jar?
Or just use maven/gradle works as long as you don't need nms
All the systems I have used from the above categories do not use java at all
At first it was mainly embedded I agree
No it just generated more folders
My brother in christ if you can give me a download I would gladly
So they must have been created long ago and starting to die
Maven and gradle are build systems learn them
as I said Java wasn't popular mainly because Java actually sucked and it sucked for a long time. You didn't use Java unless there was just some weird requirement for it lol. Schools typically used Java but only for its web apps which that was shitty in itself too
That kind of studies require a context
Both maven and gradle are good though I am used to maven I have nothing against gradlew
Ngl I don't even know what this means I just need the spigot libraries
I mean idk what to say, if you canβt even get BuildTools to work we have bigger problems. Try a YT video on it
Learn Java learn maven
maven is good for beginners but not for your nerves
Use the internet
Maybe could have been the wrong version?
I know basic java, haven't heard of maven before today
maven is highly customizable
maven does dependency funny stuff
if you know how to make java programs, you can make maven plugins to literally do anything you want it to
still i get zip end header for no fucking reason
i spent a fucking day on fixing it
still havent
https://www.spigotmc.org/wiki/buildtools/ this look right?
And βMinecraft revitalized Javaβ doesnβt? xd
sounds like a corrupted archive then
Just use maven or gradle
i have deleted the archive like 10 times lol
If your against learning new things this won't end well for yoh
Ya thatβs the correct link. You have Java 17/18 right?
it is kind of easier to have lived through it to see it. Especially the ramp up in Java development. Java versions took years to come out with release. Now its like every 6 months there is a new release
Never said that π
i still cant wait for java 1.9
awesome
I would i would prefer to not have to learn a whole new software just to get libraries for minecraft
Oh.. you lived through itβ¦ nevermind then I had no idea. My mistake sir ππΌππΌππΌ
Yes
Welp your on the wrong track in life quit now
Bruh what
Java development picked up traction when Minecraft became popular, it didn't take long from once Minecraft became popular from one year of release that we got Java 1.8
how are you gonna work with java and not know maven or gradle
Totally agree to your point, living it makes it more easy say, but still think we all need more data to conclude on smth
And then, even quicker before Java 9 and then 10 because 9 had too many bugs lmao
some people don't start with maven
uhh idk I really didn't think either was a requirement
He made this same argument on another topic with someone else a day or two ago, just used personal experience as his definitive reason
If your unwilling to learn no reason you should continue programming requires constant learning
Very based
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Agree i dont know why i really get mad when ppl came for help and they dont even know the basis from Java
he uses eclipse i think
I agree it is just an opinion until proven otherwise in regards to me saying that without Minecraft Java would probably have died
loser
Eclipse ππ½based
Why are you lecturing me I just need spigot libraries because you can no longer use regular spigot.jar, why would I figure out how to use maven just to get a jar file if I don't have to
but I believe Minecraft revitalized it
@alpine cairn get intellij
Eclipse π€’ π€’ π
Because it's useful to you in the future
Then say that next time instead of βMinecraft DID revitalize itβ β€οΈ
Learn a skill now that you'll likely need to learn later anyways
@alpine cairn get intellij x2
I just want to make a few MC pluginsπ₯
well thing is, Development on something doesn't just start to ramp up when nothing else is causing it to
There wasn't a sudden need for Java before Minecraft
does anyone here use vscode for java
Me
But since MC is made with Java and the projects like Bukkit and spigot used java for plugins
Java need just skyrocketed
and then it went outwards to other things
not sure if Github provides a timeline in regards to languages being used
I understand your point. And I think it's bad to learn java and maven in the same time. However you HAVE to use maven or graddle nowadays to use spigot. So my advice is just to stick to tutorials when using maven (without trying to understand if you don't want to), and you'll understand it better later. Everything will make sense
but if they did, it probably could show the Java language just spiking between 2010-2012 time frame lmao
how it would look like to mod minecraft in lua
Okay, thanks. In that case does it matter whether I use eclipse or intelliJ?
you would need a plugin to expose API's to lua and incorproate lua to make lua work since lua isn't standalone and doesn't work on its own
π
it kinda doesn't matter but intellj is better in my opinion
Any reason in particular?
new year wooo
better linting, more tools, better theming
4 hours sleep for college again π
i forgor
Just use vscode like me
ill sleep in the afternoon
Lol
gn yall
Die
I wonder what the shareholder meeting was like of the CEO of Oracle trying to rationalize furthering millions of dollars of development because the kids game Minecraft was starting to take off
Vscode only good for web dev
How do you think they convinced the shareholders to go for it
and rust
Still it doesn't mean it's correlated. I have some difficulties to agree this opinion cause to me, Minecraft developers community is mainly a "beginner and young range" (I bet more than 75% of current devs started programming with mc). I personnaly began programming at 12 with Minecraft, and 80% of my dev friends were in the same age range
Also wrong
web development π
what ya using then
web dev is webstorm
hell no
if you got a licence atleast ig
Ive never tried any of the paid ides
it wasn't kids who made bukkit
but im sure thats wrong
we gotta use all the jetbrains stuff for college
stop doing weed
gh student 
Yeah but there weren't thousands of devs on Bukkit, and there impact was nothing on the Java community
gh?
github
Maybe they improved some of Java
You are github studiante?
But the impact is like a water drop
it took a couple of years before Java became popular which is the same time frame for bukkit and mc becomming popular
Leading up to 2015 show me where Java wasnβt Popular
Java was never popular before MC because it really sucked
Can I see some evidence
had memory leaks out the wazoo its web applications sucked as well
Cause everything Iβve seen says it was the most used still
spoiler it's not
not sure what you are reading that says that unless you believe what oracle tells you
every company brags and exaggerates how much their products are used
Iβm on 3rd party sites and theyβre all saying the same thing
Can you show me a site that doesnβt?
3 BILLION DEVICES LETS GOOO
I can tell you areas where Java is not used
Where do those sites get that data all food for thought not necessarily going against your case
But an important question none the less
the US military does not use Java
And a lot of other government places do not use Java as well
So already there is a big chunk of the market gone not using it
js -> ts, java -> kotlin?
What do they use ?
C?
But why would a company buy the language $8B if it sucked and wasn't used?
Java came before JS
RUST !!! 
Kotlin is mid as hell
ik
ah yes companies never make mistakes
xd
Did they a mistake?
Yes but a good one though
i hate kotlin for calling function a fun
Tbh I doubt minecraft was the sole driving factor in the Langs survival. I do however think it was a driving factor as it led to a lot of demand
Java was never popular before MC because it really sucked
they at least call it a function π
ah yes function is method and variable is field
So how do you call f here: f(x) = 5x ?
Had oracle not bought Java, it also probably would have died, also since Oracle didn't see much of a way to profit from Java it remained free for private use to such an extent that once MC made it popular for those wanting to learn a programming language, and then since Java had a much larger following then it ever had, Oracle attempted to make a profit that it created such a backlash that Oracle didn't keep going with that idea for fear of losing their following as quick as they gained it lmao
doesn't android run java
That's math that's dif
Don't do me like that
But computers are basically doing only maths π
Shut up shut up shut up new ideas I can't handle it
No, it implements the Java API but uses a custom JVM
Fine I yield my opinion but I'll continue to call them methods out of pure spite
so why people hate java when there's c# which is kinda the same
C# sucks
Ahah I totally agree, I also prefer methods
c# was created when Sun Microsystems still owned Java
Anyways so how that happened was like so
Why was c# even made its just a Java with a reskin I swear
Sun microsystem allowed creating custom JVM's but to be considered an Official JVM you had to submit it to Sun Microsystems for them to test it and vet it to see if it met the criterias they created. If it passed you got a stamp from them sayings it is an Official JVM
Anyways, so Microsoft submitted one to them
they rejected it
Microsoft decided instead of throwing all that work away, they created C# out of it
so this is why C# and Java are similar π
Now we have gross java reskin
vm languages are great for debugging
Microsoft should just do the right thing and dispose of C#
why hasn't everyone switched to v yet
what the fuck is v
unstable

