#help-development
1 messages · Page 2021 of 1
Kupferzweihänder
Nope all done in code
ah, so the idea behind mine is that it's super duper easy to add more items
no coding at all needed, using some nice placeholder systems
Same goes for our approach. Just something like
new CombatItemBuilder(ModelData.COPPER_SWORD)
.withStat(CombatStat.CRITICAL_STRIKE, CombatStatMod(Type.BASE, 3.25))
.withStat(CombatStat.MEELE_DAMAGE, CombatStatMod(Type.PERCENT_ADD, 25.5))
.withSkill(...)
// and so on
nice nice
nice 😄
ye now that u said it I might have to make it so different people can see different things lmao I want it too
God i just found all the stuff i did back then that never came to live
Mithril ore btw
You reminded me that this still exists. Have to check out whats new...
They got acquired by RiotGames, got a bigger budget and delayed release to work on it more.
Did Rito just stomp it and is trying to build it up from the ground again?
With a lot of salt.
I applied for a job there a couple weeks ago and got an interview but told me they'd reach out if they found another position better suited for my skillset. Very sad.
F
do you think I should store an item as a placeholder and to store data then do the rest via packets ?
Uhm... Not sure what you mean by that. But sure. If the items are not dynamic then you can just create an ItemStack that is used for
display purposes and simply tag the real ItemStack with a String. Then you have a Map<String, ItemStack> and simply send the mapped
ItemStack instead of the tagged one. But again: Only if you want this to be static.
wdym
I for my part had those interfaces that could be registered in the packet adapter:
Its a bit complicated to describe
Didn't really get what you mean, I currently have a base item which is like a template for stuff then when I want to build it I make it use what I called an instance Item
ayy kotlin
gotta love kotlin
indeed
Ive intensively used it now for a week now and i have to admit that im not really convinced. It sure has some nice concepts
like extension methods but it really feels less strict and a bit more like a small project/prototyping language.
does anyone know why my run does not do anything
like the run method
inside it just breaks
after line 68
run should happen
but it does not
_<
kotlin is so sexy if u know what ur doing\
you literally create a thread and do nothing with it
then in ur run method you're sleeping the main thread
anyone?
I do
thread.start();
thats only for 2 seconds
you have absolutely no idea what you're doing
crys
@lime jolt
but how do they start the run method
just read it all
it no say
yes it does
Is it possible to tell that a player is in the middle of editing a book?
I'm worried it's client-side only 😦
I have a problem when opening a GUI for a player, if they are editing a book at the time it gets closed and they lose all their words.
im afraid you're right, its mostly clientside
shit welp my code no longer looks good
That's a huge bummer but not altogether surprising 😭
there is an event for when a book gets signed iirc, but im pretty sure you cannot tell if they are editing a book
Yeah I first tried PlayerEditBookEvent but as you say, that only fires when they finish editing (signed or not)
actually
i might be kind of hacky, but what if you keep track of players with a book open
u can add them to a list on player interact
and remove them on PlayerEditBookEvent
though there might be some issues where the player can close the book without being removed from the list
probably by closing the game is 1
not a bad idea- could also remove them if they change to a different item
I think for now at least I will just prevent the menu if they are holding a book at all
thats alot simpler indeed.
i guess its not that annoying for players, just need to not hold a book
yeah and I admit it's a little weird to open a gui for a player unprompted, I may need to just rethink the idea, it's basically a /tpa GUI, so player 1 chooses a player to TP to from a menu, player 2 gets a yes/no confirm menu pop-up
would you not be better off sending a clickable message?
idk what kind of server you run. but an unprompted gui could mess up gameplay too
for example someone is in the middle of a big jump xD
heh yeah it's been ... kinda annoying tbh XD
clickable message is a good idea, the main idea is to avoid using chat and commands but there may not be a better way.
im afraid a clickable message is best ur gonna get without disturbing gameplay
and, still u can make it look pretty good
yah true
if this was a custom plugin I'd probably go ahead and do it
but as it stands this is within the context of my magic spells plugin, which can't really easily do stuff like that since it would require a custom command just for accepting/denying .. anyway I'll figure it out, thanks for your help!
help my dynmap doesn't have the secure qualification
and not showing because of it
I'm sure the item interaction event includes book interactions
which i stated as well?
the owner of this server literally gave me free nitro to get the 69th boost what a chad
Looking for some advice with npc pathfinding. I would like to create hundreds of npcs on my server and minimize the performance hit. The idea of remotely generating a path comes into mind which would basically have all the same issues that async pathfinding would have. As a solution I would have to check for any world changes along the route, but would remote pathfinding save any more resources than async pathing would?
Really depends on what you are doing and what you are willing to sacrifice
Pathfinding at 1000+ blocks
Why?
thank you very much for ur help bro
Actually you're right, I could find with pretty much ease how to do it with nms
It's really amazing since moj maps; all the methods are soo easy to find, just my autocompleter did the job here
it has ItemStack#getEntityRepresentation and ItemStack#setEntityRepresentation, exactly what I need
The NPC has to travel far in a dynamic world. Using smaller segments may result in dead ends.
could you explain me what u meant with Pull Request-ish tho?
But does the npc actually have to travel there when the chunks are not loaded? You can also just virtually define its movement and place it in a chunk when its being loaded
Just that this sounds like something that should be in the api and someone could write a PR for
I suppose the npc wouldn’t need to physically travel in unloaded chunks… are you suggesting to just keep track of say how long it should take and only spawn and navigate through loaded chunks? Never thought of this
i'm pretty lost
If its only an overworld pathfinding then you should probably use a height map of the entire world (will only be some megs)
For surrounding chunks you can still use normal pathfinding.
Doing a 2D pathfinding lets you find a path over thousands of blocks (pixels) in a ms
Interesting and could possibly only generate hightmap for chunks along route
If my noise would do anything Like that that would be dope
Just give every pixel a value between 0.0 and 1.0 and define how much an adjacent block can differ. For normal jump height and
a world height of 255 this would be 1.0 / 255 -> ~0,00392
Cannot get it to prop work
Asherons call, that brings back good memories
how can i make gradients without minimessage?
Are you aware of any height map utilities off the top of your head that work well with Minecraft before I start looking around? This might be a bit more complex than I’m capable of but will give it a go.
I think you can get a height map from a Chunk
Awesome I’ll look into it. Thanks for the help
Although, despire 99% methods deobfuscated and removed from a version specific name, there are still some of them
https://i.imgur.com/94xV6vg.png
Is there a way to automatically import the correct version (so if i update to 1.18.2 it will fit the R2)
Ask on the dynmap discord
This is CraftBukkit and not nms
Only if you use reflections.
Or modules -> But then you have to write everything new for every version
i do
yo where to find it?
DuckDuckGo. Privacy, Simplified.
hey uhhh, can someone help me in a vc screenshare with something, it's complicated by typing it
Try to describe it first
it's something to do with file configuration
What about it?
so, I'm making a file that stores multiple values to a players uuid
it's a crate keys system
And what's happening when you try to do that?
What kind of file is this?
For starters, you store UUIDs as strings
yeah
Does onClose only run of no inventory is open, or if you run openInventory again on a different gui
for InventoryCloseEvent
I know how to get the uuid
You need to get the path of the uuid and add from there
but I wanna store multiple stuff in uuid
subcategories, right?
under uuid?
yup
You mean something like
playerdata:
someuuid:
emerald_keys: 10
golf_keys: 32
anotheruuid:
emerald_keys: 5
golf_keys: 1
Yes it's in a seperate file
Okay I see what you mean now
keys.yml
exactly
I know how to get to the uuid part but not the subcategories
There are several ways. Do you want to have the cleanest way or the fastest?
uhh what's the simpler way
rn I know how to do
Main.getInstance().getKeyConfig().set(player.getUniqueId().toString(), int);
dead
Want me to send you the code I made to create that?
Its quite simple actually
sure in dms
But credit me please :(
well I'm not copying ur code, im just using it to learn stuff
I will never understand the point of asking for code to be sent in dms, also 
sigh
Then you can just build a path like this:
FileConfiguration config = ...;
UUID playerID = player.getUniqueId();
String path = "playerdata." + playerID + ".gold_keys";
int goldKeys = config.getInt(path);
Oh I see
imagine if every stack overflow question was resolved by saying "send it in dms" and you're trying to figure out an answer to a question but every. single. question. was resolved that way
make sure to do toString on the ID in some cases
but you can never find the answer bc it was sent in dms
no shortage of discords that do it that way ...
String concatenation will always call toString(). No need for that ever.
Really?
so I would do something like
Main.getInstance().getConfig().set(UUID, path, int);
correct?
No idea. I dont know what any of those methods do or return.
ok so
customClassMethod (what i call it)
all that does it return the config
But ive given you the full solution
for his economy yml
getKeyConfig is the FileConfiguration
how can i make gradients in strings without using MiniMessage or lots of ChatColor.of
You go from char to char and change the color
Make a method that takes a string and returns a string using list or arrays and iteration
And use a StringBuilder if you think about creating this in a lopp
kk thanks
How can I save a list of Strings into a config and check if the list contains a String?
- Dont use lists for contains (they are slower than Hash based lookups)
- Dont read configs like this on runtime. Load them once when the server starts and use them in memory.
- You can just throw a List<String> into a FileConfiguration and read it with getStringList() again.
okay thanks
A hash is basically a one-way numerical representation of something
Let's say you have the values 2 and 6
And you want to make a hash for your combination
You can use some simple math
you see, multiplying 2 prime numbers is easy
but figuring out the 2 numbers from the result is not
easy if you know what prime numbers are 
So it's a one-way type of calculation
You can call hashcode() which returns a hash for any object in java
A hashset internally is a hashmap where the value is the same across all keys
There’s more to it but yeah in principle
i want the more into it
ooo
is that actually it
i want the details if possible
Okay so a HashSet encapsulates a HasMap<E,Boolean> and then the HashMap itself encapsulates a Set<Map,Entry<K,V>> as well as a Node<K,V>[]
Its quite a bit to take in. With calculating indices, buckets and collisions...
^
ic
wats the boolean fore
for
just a place holder?
Wait there was a pdf i read when i first started out. Ill go search it.
Chapter 10.
Or more specifically: 10.2 Hash Tables
Anyhow the Set<Entry<K,V>> is of internal inner class HashMap.EntrySet which is used when returning entrySet() for AbstractMap
and it manages the Node<K,V>[] table further
And is used for things like key and value views iirc
ic
Yeah you can iterate maps with it
But i have to admit that this pdf has some flaws readability wise.
A class that encapsulates the hash, the key, the value and the next node in this case
(For LinkedHashMap it might be different but yeah)
i was gonna mention linked stuff
o
and i assume the implementation of it is what differs it
Mhm
how do events run things before the MONITOR methods are called?
like, how are EventPriority.MONITOR methods treated any differently?
afaik there is no overridable afterTask
or anything like that
They are not. Its simply the last priority
oh
damn
makes my job a lot harder x_x
I have a death event,
and it's called before the player respawns.
naturally
However, that is a problem, as something that relies on the death event will also create a big explosion if the killer is using a certain weapon
so, after thinking about it for a second...
i n f i n i t e l o o p
Killstreak: 234
(the explosion does damage)
I could try Bukkit.getScheduler().runTask()
but I'm tired of doing that for all my ordering issues
I dont see the problem in that...
Oh because the explosion is created before the player dies. I get it.
👍
Yeah just run it a tick later.
alr
XD i member

Reminds me of the plugin i did back then that had 2 cat images and the whole bible as txt in it.
2.4MB for a plugin that just hid player names when they joined. Had 200 downloads in 2 days and
nobody cared. Got removed without notice tho.
anyone know how to make a strong regeneration
array.get(0).addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200000000, 20000000));
I have this
but it no strong
s.o.s
That’s
No
Potion effects are bytes
Use like, 100
Past 128 it overflows to negative
It is
so how would I change it
array.get(0).addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 128, 128));
?
what do the last 2 numbers mean
so for duration i just make it insianly high
I try, but I am trash at understanding
Integer.MAX_INT
ok, I understand that
it is till to weak
array.get(0).addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 2147483647, 128));
anyone know how to make regen strong
very, very strong
so that if someone were to punch you, you would not die
errors
but that part is fine
alright thanks
but still though, how does the regeneraion thing work
like how to make it strong
Integer.MAX_VALUE certainly does work
that is for duration
Mhm
Regen does get stronger with each level, but Mojang may have only programmed it up to a certain point
okay but the real question is, how to craft hearts
Good question ^
u can do regen 6, and that is strong enough
❤️
Imma craft you in a minute
idk what to do about the regen thing though
Well, did you try regen 7
Yes but it’s a byte
So 255 overflows
Yes
Maybe
Isn’t a signed byte -127 to 128
Location.getBlock.isAir
Ah right it starts at 0
Java should have unsigned values
Smh
Java doesn't have enough faith in devs
although it technically does have unsigned values
Char doesn’t count
They're not great tho just sayin'
They're mainly wrappers around the i & 0xFFFFFFFF operation iirc?
Still an unsigned value, technically
Just not an unsigned type
So what happens if you pass a number about the unsigned limit
idfk
Magic, got it
I don't use those methods cuz they're shit to work with
u69
That's a big integer
When your number is 69kb
yoooo sweet
Player p = (Player) sender;
List<String> lore = new ArrayList<>();
ItemStack hand = p.getInventory().getItemInMainHand();
ItemMeta meta = hand.getItemMeta();
for (int i = 0; i < args.length; i++) {
lore.add(args[i]);
}
meta.setLore(lore);
hand.setItemMeta(meta);
on the item the lore looks like this
/addlore yes ok no
item lore
yes
ok
no
how to get all the lore on the name line?
Combine all the args to one string
how?
hey i need help with garlic
does anyone know how to check if a specific player is online or ofline
p.getPlayer().isOnline()
Bukkit#getOfflinePlayer
OfflinePlayer#isOnline
thx
Or Bukkit.getPlayer() == null
p == null 
If you have a player instance, yes
alright thanks
But generally if you have a Player they have to be online
@lime jolt command?
True. This might be better
I store it
I am making a small game
what is this for?
and want to see if they are online
if they ofline
other person wins
and there stuff is erases
erased*
tab?
sumo >_<
?
press tab?
I meen I guess
but then the other player needs to erase the offline players data to win
and other stuff
idk
what
I
am doing
ok so why do they need to know if the other players offlline?
if player leaves in the middle of a match
u know
so it ends
NEW QUESTION
does anyone know how to use DeluxeHub and change it so that when you click a item in there menu it will run a command for u
lol
Server and plugin questions that do not involve programming should be inquired in #help-server btw
No worries (:
Player p = (Player) sender;
List<String> lore = new ArrayList<>();
ItemStack hand = p.getInventory().getItemInMainHand();
ItemMeta meta = hand.getItemMeta();
for (int i = 0; i < args.length; i++) {
lore.add(args[i]);
}
meta.setLore(Collections.singletonList(lore.toString()));
hand.setItemMeta(meta);
how do i remove the [ ] ,
I am trying to check if 2 players are online (both arraylists are arrays of Player objects), why does this if statment not work
HelloCommand.array.get(0).isOnline() && HelloCommand.array.get(1).isOnline()
would say dont use a list
I think ths is because u are ussing an arraylsit
whenever u print an arraylist
just set the list as the lore
it prints it with brackets and commas
Yes it’s a part of the ArrayList::toString
[0] + " " + [1] + etc etc
then is like
ok
tyes
potato
all on spret lines
@lime jolt that should work
hm
oh you want it onto a single line?
does not seem to be working
But like, it only checks given the time it was called
idk why
yes
you should really learn basic java, I already told you that yesterday
?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.
lore is a list
Does String.join accept an array
sure, that's what it's for
cursed language to do cursed things
mfnalex do you know how to solve my problem ;-;
I thought it was collections
so should i convert it into a string then back into a list?
Either way, use that
I don't even know what your problem is
this if statment
HelloCommand.array.get(0).isOnline() && HelloCommand.array.get(1).isOnline()
String.join your args
iirc it takes a vararg of char sequences also
I am trying to check if 2 people are both online
learn basic java, the whole statement is cursed
HelloCommand.array
learn basic java
That works
that's all I can say
^^^
killing people with a gun also works but that doesn't mean it's right
it means it works
so convert into string and so string.join then convert it bnack into a lsit?
Let’s calm down a bit, I am sure they’re trying
Just String.join the array
and you’ll get a single string
Which you can just add to the lore
I just wanted to explain that just because something works, doesn't mean it's "correct"/"right", it was the first example that acme to my mind lol
how?
Yeah fair, somewhat of a brutal example but you’re not wrong
but i dont have a string in this command
I understand, it wasn't the best example lol
there are many ways to glue an array/list together
we should really force people to use more threads in this channel
the problem is that discord only shows threads someone already joined
so if you open a thread, you get next to no replies
Myeah, they’re quite intermediate right now
you must learn basic java before trying to do spigot plugins, no offense
lore.add(label)?
like, what even is this? you have a list called "array"? and it's a public static field?
of your commadn executor class and you want to access it somewhere else?
I was replying to someone else
was not talking to u
you quoted me though
misclick i gues
me?
yes
ok
?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.
hehehehe
thanks, quite some useful links in there
Player p = (Player) sender;
List<String> lore = new ArrayList<>();
ItemStack hand = p.getInventory().getItemInMainHand();
ItemMeta meta = hand.getItemMeta();
for (int i = 0; i < args.length; i++) {
lore.add(args[i]);
}
meta.setLore(lore);
hand.setItemMeta(meta);
let me get a pic of out put
okay so you want to append the command args to the currently held items lore?
Like I said, String.join(“ “, args) should work
yes
Returns a single string
yes, as COll said:
im still lost by this
do something like this:
String line = String.join(" ", args);
List<String> lore = new ArrayList<>();
lore.add(line);
meta.setLore(lore);
String.join(" ", args) turns all the arguments into one string
so i dont need a for loop
correct
ok
im still new to java
yeah true, just wanted to show what Strings.join exactly does
Lots of nice stuff to look forward to then
@simple anvil I have a tip for you. Create a new java project WITHOUT bukkit/spigot etc
then try out the basics like turning a String array into a simple string
then you don't have to start up a MC server everytime for basic stuff like this
i made a discord bot with python but of the code was copy and paste(from my own code) making a new command was to easy
not to bad tho
i will.
Myes Cyber, crucial thing to learn (from what I can tell) is the difference between List<Something> and Something[]
yeah if you come from python, then it's really important to understand that an array is totally different from a list
public class AddLore implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player p = (Player) sender;
List<String> lore = new ArrayList<>();
ItemStack hand = p.getInventory().getItemInMainHand();
ItemMeta meta = hand.getItemMeta();
String line = String.join(" ", args);
lore.add(line);
meta.setLore(lore);
return true;
}
}
does nothing
a list has convenient methods like .add(), .remove() etc, while an array is PRETTY STUPID. it can't do anything lol
so when do i use array
Fast as fuck but ye sucks otherwise
that will ALMOST work
Your current code has one problem: You forgot to tell your your "hand" item to apply the new item meta
you will also have to use
hand.setItemMeta(meta);
at the end
otherwise you do change the meta's lore, but you don't apply it to the actual item
it works like this:
yea, i forgot about that
ItemMeta meta = someItem.getItemMeta();
// change the meta now
someItem.setItemMeta(meta); // Apply it to the item
i forgot to add @EventHandler and spent 30 mins trying to get it to work
oh yeah that happens to everyone sooner or later
yes
a week ago i did not know this.
i spent a 2or 3 hours trying to enchant somthing
you use an array if the method you want to use requires an array, OR if you do not need any of the special methods a list provides
so tl;dr: use an array unless you actually need a list 😛
I know it's a stupid explanation
OR if you do not need any of the special methods a list provides
its not and, why not just always use a list even if you dont need the features?
the code works @tender shard @young knoll thanks
arrays are faster. but you don't have to worry about that in 99.999% of cases
ok
you should however understand the difference between the two things anywaya
oh wait
wrong link
also, shoud the command be /addlore /setlore /lore /loreadd
well make the commands however you like. I'd do it like this:
/lore - show help message
/lore set - replaces current lore with the new args
/lore add - appends the new args to the current lore
also
format that shit @ivory sleet
I'll copy it
when i make a new package, the one highlighted, why does it do stuff.more stuff
ClassName[] array;
//from are to list
List<ClassName> l1 = Arrays.asList(array); //fixed size
List<ClassName> l2 =new ArrayList<>(Arrays.asList(array)); //resizable (most likely you always want this)
List<ClassName> list;
//form list to arr
ClassName[] a = list.toArray(new ClassName[0]);
Thanks 🙏
when i was making a command open inv and open enderchest
i put it in the command package
and a made a new packing called openinventory
but then i could not add stuff to the command package
so yeah the basic difference between array and list:
- array has a fixed size. if you have an array with a length of 5, it holds 5 elements. you can't just add a 6th element. in most lists, that's no problem, you can just append to them, etc
- list has nice methods like "add something between 2nd and 3rd element". arrays don't have that, you'll have to create a new array, copy the old content, etc
- arrays are faster though. they are "builtin" to java while lists always have some structures like an array in the background. so tl;dr: a list basically is a "wrapper" for an array that provides so you some convenient methods at the cost of more ram/cpu usage although you don't have to worry about that 99% of the time
proper way is to restart it
lazy way is to enter /reload
lazy way MIGHT cause problems though
spigot was not designed to reload plugins at runtime. while it might work fine, there's always a chance for it to cause memory leaks or other bad things. in the worst case, you get unexpected behaviour. your plugin might bug out and you don't know why. then you spend 3 hours debugging it while it would have worked if you would have just restarted the server
i will remember that
(to test simple plugins, reload is fine most of the time)
also should i make a new classes for all these command or put them all in the same class
also is adding lore smp? or smp worthy?
it depends. Do those commands belong together? do they share any common "dependencies" etc? Are your command classes 1000 lines long or only 5 lines? etc etc
"smp worthy"? wdym?
Let me say something to this again pls
like, if i put it on a smp would people get mad
imagine you have a command /sethome and /home. Both commands obviously have to access some List / HashMap or similar that stores all existing homes. If the sethome method already stores that list in its instance, I'd probably make both commands into one class. (Although you'd normally probably want to have a separate class manage the existing homes).
If however you have one command for /sethome and another one for /heal (so two entirely different commands), I wouldn't put them into one class
ok so all in the same class?
I don't think so, changing a lore doesn't really change the gameplay at all
ok good
If you just want to do lore stuff, I'd do only ONE command, which is /lore
and then it'd have different subcommands
/lore add
/lore remove
/lore set
I'd do all this in one class
how do i make sub commands
you know, if someone enters this:
/say my name is jeff
then args[0] will be "my"
so you can just check what args[0] is
you're*
it's incorrect though
i know
like it isn't even excusable by the laws of Modern English
I don't think Alex owns a "so smart"
?
You are house 
are we talking bad shit about me?
I'm house and I'm proud to admit it
I think your mom is a hoe
someone hold me back
i think you are mom is a hoe?
Your you’re hmpmg
yeah your annoying cyber, go ho'me
p
q
pq formular?
I always used the quadratic expansion because I couldnt remember the pq formular
O
or is it formula?
And then there’s abc
I know gramma, but not the spelling
oh ye btw I learned of this conlang where complex sentences can be expressed in single words
ok im sorry
Oo wanna give me an example? ;0
like saying "thanks" when you actually mean "fuck you, you ugly piece of shit"
Oh
Tram-mļöi hhâsmařpţuktôx
no idea if that's what they meant though

That is Ithkuil for "On the contrary, I think it may turn out that this rugged mountain range trails off at some point."
looks like a drunk swedish talk bad stuff about their neighbour
Very neat language
Incredibly hard to speak though
Apparently nobody speaks it fluently
Mye
lol
Well we don’t look down on mini modding that much
to get banned here, you must behave really bad
^
like you have to want to get banned
Mini modding is a retarded thing to get banned for
wtf does mini modding mean?
staffing people around like your a staff
aaah
i almost posted the n word here once
nautilus shell?
it was for a n word chat filter
🌝
we don't talk about nautilus shells here
rule 1 of the nautilus shell club: do not talk about the nautilus shell club
?ban @simple anvil
?userinfo @simple anvil
nigeria
But yeah cyber, generally it’s fine to approach off topic given that no one here is asking for help or so, if someone does I’d appreciate if they can be prioritized (:
indeed
we go off topic here all the time
August 27, 2019 7:26 PM
(3 years ago)
i was on discord every day when i first got my account
i know
it was joke
No worries
I guess it's fine to go off topic all the time as long as you're not interrupting actual questions
?userinfo @lavish hemlock
Custom: I lurk so I may enact righteous judgement against spelling errors
<t:1464564509>
(<t:1464564509:R>)
<t:1646215566>
(<t:1646215566:R>)
<@&695824786605080576>
Maow but spooky, craft, Maow 🐝, Maow, Colin ;, Cοlin, Puro
maowcraft
But to clarify for anyone who might wonder
;)
BUT IN THE GOOD WAY
shit
I wanted to write "NOT"
bad stuff
what MC version are you on
zak a class that supposedly interfaces the data that gets synchronized with the client iirc
uugh okay
1.8 bad :<
HAHAHA GET DUNKED ON
CraftPlayer, getHandle() etc is all part of the internals
If you want to access stuff that is NOT part of the spigot API, you need stuff like CraftPlayer, getHandle() etc
That looks cursed
my code?
it basically works around the SpigotAPI and accesses CraftBukkit and "mojang code" directly
yup
I don't know what the watch method does
Probably registers a data id with an initial value
Minecraft works in mysterious ways
But like, I scarcely remember 1.8
DaddyMd5
yeah it provides the fromBaseXX and toBaseXX methods
it's part of my Stepsister lib
pagoingus
I wanted to do create the most cursed library without any bukkit imports
but also not let anyone know what classes actually get accessed
Oh
so it also uses DaddyMD5's BaseXX
Oh god
sometimes I am bored
Is it fast tho
if (args[0].equalsIgnoreCase("set")){
Player p = (Player) sender;
List<String> lore = new ArrayList<>();
ItemStack hand = p.getInventory().getItemInMainHand();
ItemMeta meta = hand.getItemMeta();
String line = String.join(" ", args);
lore.add(line);
meta.setLore(lore);
hand.setItemMeta(meta);
}
its adding set to the lore
any question?
I don't really understand
what exactly is the problem?
oooh
I understand
easiest but dirty solution would be to just remove "set " from the string
like, just remove the first 4 characters from your string
apend?
line = line.substring(4);
will remove everything before the 4th character
the "proper" solution would be to ignore the first array's element or to "shift" your array
but tbh that's just making things more complicated
I'd just substring(4) the string
how
^
lol thanks
Note to myself
//resizable
Array and list
how do i remove all the lore?
tl;dr: array = fixed size, no convenient methods
list = dynamic, and has lots of convenient methods
danke
?
you said thanks and I said youre welcome
bitte????
yes?
what is that
guys
"danke" = "thanks"
"bitte" = "youre welcome"
how
when you teleport someone why do you go to the side of the block
new Location(Bukkit.getWorld("world"), -190, 36, 722, 180, 0);
I used that to specify where I want to telport them
but they are like on the edge of the block
the middle of the block is X + 0.5 and Z + 0.5
Y is the height
oh I thought it was width :/
X is left/right, Y is up/down, Z is forward/backward
when i do
/give
it will show me my options for players
how do i do that with commands
TabExecutor
you mean stuff like @s etc?
because normally the player names always get tab completed
even without a custom tabcompletion, it should show the name of online players
event?
are you trying to make a custom tab complete
yes
It’s called language
implement TabExecutor
in the same class?
doesn't matter
in your command class or main class if u wanna use it
how?
public class AddLore implements CommandExecutor
you have a command executor class and you registered using setExecutor(). you can do the same thing with a class that implements TabCompleter or sth like that
yes
Mhm
how do i even use that
intellij should generate the methods for u
let it
just implement TabExecutor and look at ur warnings
basically you just need to override onTabComplete, like you did with onCommand. Here's an overcomplicated, incomplete, dirty example:
@Override
public @Nullable List<String> onTabComplete(@NotNull final CommandSender commandSender, @NotNull final Command command, @NotNull final String s, @NotNull final String[] args) {
final List<String> list = new ArrayList<>();
UUID uuid = commandSender instanceof Player ? ((Player) commandSender).getUniqueId() : Main.consoleSenderUUID;
if (args.length == 1) {
for (int i = 1; i <= getChests(uuid); i++) {
if (String.valueOf(i).startsWith(args[0])) {
list.add(String.valueOf(i));
}
}
if (commandSender.hasPermission(Permissions.OTHERS)) {
for (final Player player : Bukkit.getOnlinePlayers()) {
if (player.getName().startsWith(args[0])) {
list.add(player.getName());
}
}
}
}
// ...
return list;
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
return null;
}
```now what
now you return a list with all the tab suggestions
using the arguments provided you do some logic and return a list of strings, being the tab complete suggestions
no problem
e.g. if you a return a list "a" "b" "c" it will suggest "a" "b" and "c" as tab completion
and stop saying "danke" if you don't understand "bitte"
thanks
dankes
danke
i know a couple german words cause they sound like english
english is like the better version
bitte explane this
which ones?
I did explain it to you twice
your german is worse than my parent's bulgarian maid's german
and she doesn't speak a single word of german
I'm getting a lot of internal errors while performing commands but I literally cannot find the issue, and I copied some of the code from my other plugin and in that plugin it works, can someone help me in vc
That’s
show the error message
Oddly specific
so
then show the first one
one could fix all the issues
I really don't understand why people just don't send the error message immediately
[00:45:20] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'balance' in plugin MrIndiaCore v1.0
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(sender instanceof Player){
if(args.length == 0){
Player player = (Player) sender;
int money = MrIndia.getInstance().getEconomyConfig().getInt(player.getUniqueId().toString());
sender.sendMessage(ChatColor.AQUA + "Your balance is " + ChatColor.YELLOW + "$" + money);
return true;
} else {
String playerName = String.valueOf(args[0]);
Player target = Bukkit.getPlayer(playerName);
if(Bukkit.getPlayerExact(playerName) == null){
sender.sendMessage(ChatColor.RED + "Player is not online.");
return true;
} else if(!target.isOnline()){
sender.sendMessage(ChatColor.RED + "Player is not online.");
return true;
} else {
int money = MrIndia.getInstance().getEconomyConfig().getInt(target.getUniqueId().toString());
sender.sendMessage(ChatColor.YELLOW + target.getName() + "'s " + ChatColor.AQUA + "balance is " + ChatColor.YELLOW + "$" + money);
return true;
}
}
} else {
sender.sendMessage("Console does not have a balance!");
}
return true;
}
}```
send the full error message
need to make it a txt
?paste
paste it there
what's BalanceCommand line 22?
lemmie check
getEconomyConfig() returns null
int money = MrIndia.getInstance().getEconomyConfig().getInt(player.getUniqueId().toString());
it's a file config
is the players UUID set to an int?
getEconomyConfig() returns null
didnt read
lemmie check
show getEconomyConfig()
return economyConfig;
}```
the field "economyConfig " is null
do you ever, anywhere, assign a value to "economyConfig"?
economyConfig = YamlConfiguration.loadConfiguration(economy);
where do you do that?
that's just the declaration
if (!getDataFolder().exists()) {
getDataFolder().mkdirs();
}
File economy = new File(getDataFolder(), "economy.yml");
economyConfig = YamlConfiguration.loadConfiguration(economy);
try {
economyConfig.save(economy);
} catch (IOException ioException) {
ioException.printStackTrace();
}
}```
ye I sent wrong line
do you actually ever call economyConfig()?
if so, when/where?
btw "economyConfig()" is a pretty bad name
it should be called "loadEconomyConfig()"
anyone know how I can make a sound, so that the entire server can hear it
there you go 🙂
loop through all players, then use Player.playSound
ty
yes, but PLEASE rename it to loadEconomyConfig()
how do I do it will all players; ALL
I have told you this 3 times already:
?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.
it's a basic for each loop
Bukkit.getOnlinePlayers();
like a single one
out of all
can i do
Bukkit.getOnlinePlayers().get(0)
i know basics I just dont know minecraft ;-;
Bukkit.getOnlinePlayers.contains(ur player);
and you were judging method names...
lmao
someMethodThatReturnsAnArrayOfStrings LMAO
KLMAO
String[] someStrings = someMethodThatReturnsAnArrayOfStrings();
for(int i = 0; i < someStrings.length; i++) {
System.out.print(someStrings[i]+ " ");
}
yeyeye
https://mystb.in/ParisUserSecret.java
should i be using a switch statement
i feel like this is alot of if statements
You can use a switch for args[0]
Yeah if you had more cases then you'd want to use a switch, only 2 though, doesn't really matter tbh
ok
u lied to me
Type mismatch: cannot convert from Collection<capture#1-of ? extends Player> to Player[]
;-;
He didn't lie to you 
my names jeff
Area