#help-development
1 messages Β· Page 1537 of 1
no your sad forever
you're*
:n: β
fail at everything, huh?
You can still apply mappings if you follow instructions on the release post
too much work
True I just used obfuscated names π
easiest solution: just don't use it
how do you make a for loop, between 2 numbers
but muh cool features
?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.
L
imagine 1.8
That's still true
that sounds like a you problem
Use Prefix and Suffix to extend to 32
im stupid
probably
forgot u could even change the start value
I am
im so used to 0
Time to update then π
NO
but why would u loop just 2 numbers
Update is a big no no
no update no support
no, between 2 numbers.
The Nametag is too long
like setting slots between x and y in a gui
1.8 IS SUPPORTED
it really isn't
it isnt
cap
:)
just stop gecko
gonna cry
1.8 hasn't been updated in half a decade, you call that supported?
You might want to rename your project and class @proud basin
{projectName}-unsupported-1.8
why?
Core - needs to be changed...
onPlayerJoin - why camelcased
Camelcase good
You were editing it a second ago acording to your rich presence
well I don't even have a class called that
stalker
gecko
Not in class names
any way to set multiple slots in an inventory?
dont talk to me scum
without doing 50 inventory.setitem lines
you look like gum
for loop
well its specific slots
you want my cum?
NO NO NO
what?
what do you call your classes?
Thisismyfuckingclass?
._.
for (int i = 0; i < 54; i++) {
if (random.nextInt(3) != 0) continue;
inv.setItem(i, something);
}``` pure genius right there! ^
π€£
Yes, I agree there
camelCase <-- is this i dont think its like this --> CamelCase so is class names even camelCase or are these both camelCase somehow?
yeah but the second is a special retard camel with an ass so huge it looks like another hump
xd
Class names should be nouns, in mixed case with the first letter of each internal word capitalized
thats CamelCase
No
? xD
idiot
Should I use teams for name tag?
i thought you were jtx
yes you are
but i'll call you as you wish to be called, not updating
ThisIsAlsoCamelCase
no idkidk
no its not
YES YOU ARE
it is
Yall can't force me
idiots xD
Camel case (sometimes stylized as camelCase or CamelCase; also known as camel caps or more formally as medial capitals) is the practice of writing phrases without spaces or punctuation, indicating the separation of words with a single capitalized letter, and the first word starting with either case.
Camel case (sometimes stylized as camelCase or CamelCase; also known as camel caps or more formally as medial capitals) is the practice of writing phrases without spaces or punctuation, indicating the separation of words with a single capitalized letter, and the first word starting with either case. Common examples include "iPhone" and "eBay". ...
camelCase starts with lower case then with each word capitalized
we can refuse support though jtx
we can
there is an uppercase and lowercase camelcase
I can refuse to update
we can give you no support at all
well... its also CamelCase
its dependent on what type it is, if its a class or a method etc
stop trashtalking parrot
no
no
I can force you to respond
you are allowed to if you know the how at java
do it
cuz camelCase is like this camelCase
Well either way it's wrong for class names
?
the camel doesnt have a huge ass
π€€
π
wtf
bruh
shut up jtx
okay so it seems like your class names really are thisismyclass
@proud basin update or no support for you forever
no u
camels can have 2 humps
I'm not updating. Simple
lol
?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.
1.8? What a loser
you have to for support
there is a wiki. javadocs could also help
ooo eclipse
first learn java basics, object orientation basics and then get into spigot
π§’
π§’
\π§’
\π
no you
π
π€£
You don't get support anymore
you dont lol
From now on 1.8 is only supported
you wish
it isnt
probably. if you understand how to deal with public APIs, basically yes
but to do spigot you need to do java
MD_5 makes the decisions
and to do java you have to learn java
proof
fork it and do your own
and support it
hitlerspigot
too much effort
nah thats NNy's fork
Will having a conversation in Spanish be easier to understand after learning Spanish?
constant 13 tps, 52 mspt?
no, much harder
write every word in spanish on paper
false comparison, i think it makes more sense to say "will spanish make more sense (even if i dont necessarily learn spanish) if i learn about spanish words' roots"
in either case yes
no one.
with what
1.8
ew
1
gecko what makes you think im using 1.8
you are asking everyday for help
the multiple times you've mentioned both it and not updating?
so
whats your issue?
yeah whats your problem jtx lmao
jtx find out your self
i donβt have a problem
???
so for someones name tag is the max 16 characters?
Yes
yes
Is there a way to go past it?
I told you how; prefix and suffix
Prefix and suffix could be longer
so I have to use a scoreboard
Yes
you could look at how tab does it https://github.com/NEZNAMY/TAB/
So uh, interesting behavior that I can't seem to fix
do you mean the new plugin.yml entry yaml libraries: - com.h2database:h2:1.3.159
in 1.17 theres a new thing to do that but otherwise idk the 1.17 thing pull from maven central
no
I need it for older
versions to
from 1.8
then up
shade it Into your plugin?
@Nullable
@Override
public List<String> onTabComplete(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (command.getName().equalsIgnoreCase("gamemode")) {
if (args.length == 1) {
ArrayList<String> options = new ArrayList<>(3);
options.add("creative");
options.add("survival");
options.add("spectator");
return options;
}
}
return null;
}```
Why in the heck does the `spectator` option not appear in the tab complete?
people judge size of plugin
who
or you have to inject it into the class loader
that is a big problem
its just easier if you shaded it
they think they will get better optimisation
lol
it is already shaded
shading is fine
it is mentality of minecraft server owners
no one fucking cares about plugin size
as long as it works
the people who saying they care are fucking dumbasses
also the libs probs isnt gonna be that big
what libs are you using?
got 600kb
to my plugin
and plugin was like 300kb by it self
then I have that xMaterials
and NBTAPI
HikariCP is a connection pooling thing for SQL
Why do you pass 3 to the arrayList constructor?
is it wrong to set initial capacity or something?
@wary harness well gl of figuring out how to load a jar externally
oh k
thanks
uk
Idk, I've never used it, but if you know that it should set the capacity, then it should be ok.
better look in to it if u need to handel a lot of mysql data
it just runs multiple connections
and close them when there is no need for them
in simple words
Yeah, it just sets capacity on creation instead of using the default. But idk why it's not working as intended. Such weird behavior
IDK if the server just has a cached tab complete somewhere or what
Try it without the initial capacity
I just tried it and I seem to still only get a limit of 16 ```java
public void setPlayerTag(Player player, String name) {
Scoreboard scoreboard = player.getScoreboard();
if(scoreboard.getTeam(player.getName()) != null){
scoreboard.getTeam(player.getName()).unregister();
}
Team team = scoreboard.registerNewTeam(player.getName());
team.setPrefix(name);
team.addEntry(player.getName());
}
Doesn't seem to fix it
And the others do show up?
Yup
Did u try to restart the server?
(probs cuz your on 1.8)
Yup, have restarted a lot since I added it
Are you for sure registering this class for the tab completion and not any other by mistake?
Cast ItemMeta to PotionMeta
ok
Yup, registering the correct class for sure
I really don't know then
Very weird
so nothing is displaying on top of their head```java
public void setPlayerNameTag(Player player, String prefix, String name) {
Scoreboard scoreboard = player.getScoreboard();
if(scoreboard.getTeam(player.getName()) != null){
scoreboard.getTeam(player.getName()).unregister();
}
Team team = scoreboard.registerNewTeam(player.getName());
team.setPrefix(prefix);
team.setSuffix(name);
team.addEntry(player.getName());
}
good
how is that good
Um, I'm trying to code with the Vault API (economy) and the hook doesn't work for me. Anyone have an idea how to get it to work?
do you have it as a (soft)depend?
yes
define "does not work"
By not working I mean this hook is not activated. The class is always null
[22:42:48] [Server thread/WARN]: [VaultAdapter] Loaded class net.milkbowl.vault.economy.Economy from Vault v1.7.3-b131 which is not a depend, softdepend or loadbefore of this plugin.
[22:42:48] [Server thread/INFO]: :(
Thats a warn ur not softdepending
look the code and out put please...
HMMMM
I had this before
Works for me strange
oh i think i know
How can i fix? O.o
vault might be active, but your economy plugin is not
you can fix it by putting it in a runnable so that it activates after all plugins are loaded
Register a dummy economy
Ok, I will try it
Or just Bukkit.shutdown() since that should not happen
not worth to account for this edge case scenario, the user should have an eco plugin installed; Bukkit.shutdown() is the easy way out here
Why is Team#addPlayer deprecated
context?
well im pretty sure they do, it's just that there's no economy plugin enabled when their plugin enables
because you can add more than players to teams
it's in a task
The eco plugin would need to be very, very borked
How?
So should I use Team#addEntry to add a player to a team?
List<Map<?,?>> test = new ArrayList<>();
if (getConfig().isSet("test")) {
test = getConfig().getMapList("test");
}
``` would this work?
you cant use the economy if there is no economy plugin
Ok, thanks
hm
interesting then
Im not too sure then why nothing is being added to their name tag
if it compiled, maybe
should i try it?
However just note that defaults can be set and #isSet might behave unintended here, but you have to read the javadoc to be sure in that case
yes, why not?
it says isset "Checks if this ConfigurationSection has a value set for the given path."
Am I required to use packets when changing a players name?
okay, then I was right; but chances are that you do not use that feature
oh wait its probs gonna be null first time f so should i catch the IllegalArgumentException?
i suck at analogies anyways
why would it be null of all things?
because i havent set it yet
path is a literal string
nvm
You would need to mess with the internal string cache to get it to be null, not worth catching the exception
the file is empty lol i just want to check if it exists or not
lol
Youβve enabled HTTPS-Only Mode for enhanced security, and a HTTPS version of hub.spigotmc.org is not available. ffs
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
You could just get the map list directly
No need to have the isSet shenanigans
The https issue is a browser issue and likely has to do something with spigot's DNS entries being messed up
I will however complain about it every time I click on that link until it has been solved
so move to the US where the dns is fine lol
I am on linux, I could just switch the dns server
?paste
paste!
@IGNORE_ALL
but wouldnt it be unsafe to just ignore it?
@DELVE_BLINDLY_INTO_THE_WONDERS_OF_PROGRAMMING
idk
the IDE doesnt know everything you do
what is the cast
most likely just add a suppression of unchecked
@SuppressWarnings("unchecked")
like for example casting Entity to Chicken when you only checked Entity.getType == EntityType.CHICKEN would probably give you a warning
im casting a Map<?, ?> to a Map<String, List<Player>> XD
Β―_(γ)_/Β―
not that you can store a player in a config anyways
you cant?
kek
can you store a location ?
well players are different in a sense
welp i guess i store they uuid instead
does it implement configuration serializable? no it doesnt afaik
store UUID as string
but does Location work in a config?
yes
thing is you can easily reconstructor a location as opposed to a player
we dont want a fake instance of a player right
do i have to store the x,y,z,world of the location or can i just put it in?
Isn't there a save location method and get location method for configs?
ye
in newer versions yup
correct
im also casting a Map<?,?> to Map<String, Location> aswell XD
and its giving me a warning π
it'll do that
yeah because u cast generic type params
exactly
but as long as you know it is what it is, you'll be fine
just ignore it or suppress if you know what you're doing
it just gives me a unchecked cast warning
im probs gonna keep it with the warning
hopefully it will actually be the values i want in the config file lol
lol when running minecraft and a server maven is slow
probs cuz i have barley ram left
and its probs making me use 100% ram
so its using the page file
and my hard drive is slow as shit
Does anyone know the best way to get a job for spigot modding?
get a job for spigot coding
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Im trying to connect to my mysql, but this error pops up:
fuck
you prob fucked up the settings
Are you using the default passwords and are you sure you the host, address and port are the correct ones ?
Are you using xampp ?
yes
I'm pretty sure there is a way to reset the MySQL, but your best bet is to reinstall it since you haven't actually done anything.
f i just got this massive error just for nullpointer XD
?pasta
nah i know why it happend
i was calling size() on null XD
Yes, if you haven't done anything that needs to be saved
Nah i just installed it before and ran it
like the tutorial wanted me to
i just didnt restart my pc
tho it wanted me to
xampp should be ready to run, not sure why you're getting the error, maybe the port is busy?
The xampp wanted
XD this message is funny
[22:44:30 ERROR]: [Essentials] There's a good chance you're reloading your server right now. If that's the case, why do you hate yourself? Expect no support from the EssentialsX team when using /reload. im using /reload cuz to lazy to restart the server
Don't use reloads, it breaks a lot of things
ik
essentials just throwed a error at me after i used it lol
Its weird that im getting it but noone else lmao
but iM using it cuz im to lazy
@earnest sonnet now when i try to install it it warns me with some User Account Control bs
and that XAMPP is restricted cuz of that
accept, it's about if you're using public internet or something along those lines
It wants me to disable it or smthin
Im using my phone internet rn
cuz my home wifiis shit
is this changing anything?
Nope, I don't think so
Idk ill just try to google or smthing
it still throws the error?
Somebody in a forum had the same error and somebody just told him to run it as administrator
Ill try to use my main wifi
after im done with installing
Just try running it normally without administration perms and if it doesn't work, proceed with administrator perms, though xampp doesn't need it
actually xampp does need it
last time i ran xampp without as admin it throwed errors at me
Nope, you can use xampp normally without the admin perms, it's just going to run in a non-standard port
I can run it normally without admin permissions though
it doesnt for me
No clue π€£
can i change the texture that a projectile uses
like change the texture of a thrown snowball to the texture of a potateo
can i detect which inventory slot the player is using
getHeldItemSlot?
Full release, though, I would wait a while for dupes and bug fixes before using it
okie
hey there how would i go about "resetting" a world for a minigame that im making?
World edit copy & paste or schematics, most likely the second one
private Object colorIfString(Object object) {
if (object instanceof String) {
return MessageUtil.color((String) object);
}
return object;
}
public static String color(String msg) {
if (msg == null) return null;
return ChatColor.translateAlternateColorCodes('&', msg);
}
sender.sendMessage(MessageUtil.color(msg));
This: ΒΊaYessir is what comes out
prefix: '&aYessir'
why the former function?
no i mean like a full world
im using reflection
π¬
Backup the world and replace it when the mini game is over
know what chunks should be deleted and then create a worker system to progressively remove all the blocks?
assuming you wanna reset
ensure the chunks are completely unloaded and then copy/delete/replace the underlying region files
the api, of course, does not provide any way to do this
sussy
oo does that work?
sounds like an unsafe operation to a certain extent
well i mean
if they're not in memory, then they're on disk
and if you change what's on the disk, you change the thing
it's perfectly safe as long as the chunks are fully unloaded
which is the part that the api doesn't have any way to do
you need to unload the world, wait for a few seconds to a minute, and then pray it actually got flushed to disk
hmm yeah was more thinking of other stuff depending on that chunk like maybe redstone (tho a trivial fix but just for the sake of an example)
provided that you don't fuck up the files you're writing, it is fine
Wouldn't replacing the map as a whole be less troublesome?
you can for example copy an existing world's regions
that will guarantee that the actual data is good and proper
but, you can mix and match regions from different worlds or from different points of time as well
oo fair then
the worst that will happen is ugly chunk borders or stuff like fences on chunk borders not connecting properly
which would be fixed with a block update
how would i go about replacing it?
unload the world, replace the files
Yep
aight thanks
world/region in particular
I was thinking of recursively deleting the said world directory and uploading a copy of the backup? Never tried it though
yea thinking kinda the same thing. once the game is over delete the folder and then copy and paste the world folder from the backup folder
there is little point in deleting the entire directory if you just want to change the map
just copying and replacing the region files is sufficient
Oh, yea, I forgot, in minecraft they're called regions too, not only in the uuh plugin
a region is a span of 512 by 512 blocks or 32 by 32 chunks
each region is its own miniature filesystem and resides in a x.z.mca file
Oh! Wait, I have a question for something outside of development
Forget it, saying it loud just gave the answer by itself π€£ π€£
lol for some reason im on the server and the tps on the scoreboard keeps going above 20
whatever scoreboard plugin there using must be wrong on tps
due to tps catchup the momentary tick rate can exceed 20
20 is only the goal average
k
I made a Inventory and Fill it up with items. I want now to cancel the draging and Getting items from there... how I can do that? I Tryied it with InventoryClickEvent and ask If e.getInventory().equals(myInv) and e.setCancel(true) it but I can for some Reason move the items from there... 1.16.5 spigot
the real question is why the fuck you are using .4
Ehmm sry its 1.16.5
ensure the equals check works as expected, and listen to inventory drag event in addition to the click event
Ok thx I try that
I try that too but it is not working and there is no error
Sure but I wrote it without copy the Code
you aren't giving multiple elements
your list contains just 1 string
and that string is "SELLER, FARMER, LUMBERJACK, FISHER, SORTER, BUILDER"
Yeah... been sitting here for like 10 mins thinking WTF!
If you are just do contains you should use a set
Yeah was just testing
i'd like to introduce you to the concept of enums
i got an empty pom atm
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.imaginedev</groupId>
<artifactId>DiscordJava</artifactId>
<version>1.0.0</version>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
</project>
how do i get that build JAR button
Old code but yeah lol
I Created potions and a command to give me the kit right it works but why do the potions look like regular water bottles even thought its a splash and they do splash right its just they look like regular water bottles? is there any way to change this

i like dogs
so
did you use PotionMeta#setColor?
god damn gecko you beat me
Is gson running on a spigot server or am I schizophrenic
It is shaded ye
motivos
I hate to be that guy but can someone point me towards a Java 16 download? I tried googling my way through it but my efforts have been fruitless, on the Java website it's only throwing 8 at me
adoptopenjdk is the key word
thanks
You need to change them to String, and then you can get them back using UUID#fromString
you store it as a String, fortunately you can just use the toString() method to do that easily π
Am I becoming more and more dumb or is fastasyncworldedit api and worldedit api an absolute pain to work with?
Whatcha mean
I wish there was some sort of Region region = editSession.pasteSchematic(File file, Location location);
or something, this would be so much easier to work with.
I am taking about n tier architecture
I'm using PrepareAnvilEvent for my custom enchantments, but I can neither get enchanted items to appear in the result slot when the first slot is unenchanted nor can I obtain the item in the result slot by clicking it
one question, how can i check if the player move to another world, example /mvtp
well a teleport event is going to get thrown so listen for that
wait
i remember
tthere is
public void onTeleport(PlayerChangedWorldEvent e) {
that works too
86_400_000L is 1 day correct?
are you measuring in ticks or what?
in ticks its 1728000 ticks
in milliseconds
then you are correct
that's odd then
24*60*60
1000*60*60*24
how is that odd
1000 milliseconds in a second * 60 seconds in a minute * 60 minutes in an hour * 24 hours in a day
it is literally even
yeah not sure what is odd about it
pretty straight forward lol
unless they are being confused about the miliseconds they are grabbing using the API which in most cases will grab you the milis from what I think 1980 to now lol
which ends up being far larger π
okay
i already know that but thx
not talking about that
What I was doing but its fixed
would someone be able to help me with my plugin?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
alrighty
so basically I want to set up my plugin like this
ShowCommandSettings:
Enabled: true
ShowTabCompleteList:
- 'ping'
- 'hours'
- 'bells'
ShowArguments:
#these are added in afterwards
ping:
Enabled: true
Input: 'ping'
Output: '&7[&6Show&7] >> %player_name% has %cmi_user_ping% ping!'
permission: 'show.command.ping'
hours:
Enabled: true
Input: 'hours'
Output: '&7[&6Show&7] >> %player_name% has %statistic_hours_played% hours!'
Permission: 'show.command.hours'
?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.
so like a custom command alias?
so the command is /show and ping and hours are arguments
but I don't know how to set it up like that
you want that to be configgable?
have you made a non-dynamic command yet?
ShowCommandSettings:
Enabled: true
ShowTabCompleteList:
- 'ping'
- 'hours'
- 'bells'
ShowArguments:
ping:
Enabled: true
Input: 'ping'
Output: '&7[&6Show&7] >> %player_name% has %cmi_user_ping% ping!'
permission: 'show.command.ping'
hours:
Enabled: true
Input: 'hours'
Output: '&7[&6Show&7] >> %player_name% has %statistic_hours_played% hours!'
Permission: 'show.command.hours'
deaths:
Enabled: true
Input: 'hours'
Output: '&7[&6Show&7] >> %player_name% has %statistic_hours_played% hours!'
Permission: 'show.command.deaths'
what do you mean?
like, not something you put in the config
oh yea
that was how I had this set up before
But I wanted to set it up with the config.yml stuff
if (sender instanceof Player) {
Player p = (Player) sender;
String nopermmessage = "&7[&6Show&7] >> You don't have permission to execute this command";
//if player has show.command permission they can execute all show commands
boolean showenabled = plugin.getConfig().getBoolean("ShowCommandSettings.Enabled");
if (showenabled) {
//checks to see if there are any arguments
if (args.length > 0) {
//if there is an argument, it then checks to see what the argument is | Let's use ping as an example
//checks to see if argument is ping\
String playerinput = args[0];
String PingInput = plugin.getConfig().getString("ShowCommandSettings.ShowArguments.ShowPing.Input");
String Input = plugin.getConfig().getString("ShowCommandSettings.ShowArguments.inp").replace("inp", args[0]);
if (args[0].equalsIgnoreCase(plugin.getConfig().getString("ShowCommandSetting.ShowArguments.inp").replace("inp", args[0]))) {
boolean showpingenabled = plugin.getConfig().getBoolean("ShowCommandSettings.ShowArguments.ShowPing.Enabled");
if (showpingenabled) {
String pingpermission = plugin.getConfig().getString("ShowCommandSettings.ShowArguments.ShowPing.permission");
if (p.hasPermission(pingpermission)) {
//Then creates a string for an output
String TXT = plugin.getConfig().getString("ShowCommandSettings.ShowArguments.ShowPing.Output");
//Then, it runs through the placeholder checker to see if there are any placeholders in string.
//Then, it converts the placeholders into what they are supposed to be
String placeholder = PlaceholderAPI.setPlaceholders(p, TXT);
//Then it broadcasts the message after running through a color code checker to see if any color codes are being used
Bukkit.broadcastMessage(Utils.chat(placeholder));
} else {
p.sendMessage(Utils.chat(nopermmessage));
String consolemessage = "%player_name% tried to execute /show ping \n Missing permission: " + pingpermission;
System.out.println(consolemessage);
}
}
some of this needs to be changed still
but what I need to know is how to set up this so that it works
String Input = plugin.getConfig().getString("ShowCommandSettings.ShowArguments.inp").replace("inp", args[0]);
I want the "inp" to be replaced with whatever the argument is
and then, I think that in theory, that would allow me to be able to actively set up new arguments and all that
better way to do that is to use enums
you can pull information from the config and stick it into the enum
makes it easier to do some dynamic stuff too π
would you be cool to show me how?
I can show you examples
yea, don't show me directly how to
https://github.com/hawkfalcon/ServerTutorial/blob/master/src/main/java/pw/hwk/tutorial/enums/Permissions.java
This class I use for permissions. As you can see it has a way to check for dynamic perms π
sorry lol, I can't learn if others do it for me, right
basically for your config stuff it would be something similar
that plugin is open source, so feel free to borrow code from it
oh sweet
just make sure to give credit where its due is all π
also in that plugin, it utilizes the conversation API
probably one of the few plugins where you can look at it for examples on using that API.
So for instance, the way I had setup that plugin you could modify the config in game without the clutter of everyone talking π
it puts you in a conversation with the server and the server asks questions in relation to the config π
you can do a lot with the conversation API
you can put 2 people in a conversation easily
hmm
or however many people
interesting
just have to remember to at some point let them escape the conversation and you can set hot text for that. which my plugin there has if you want to leave the conversation in the middle
but yeah, feel free to look through it. I am not hawkfalcon, he created the plugin originally but I am the owner of it now since the majority of it is my code anyways. But my name on github is frostalf π
hmm
that's pretty cool
but yea, if I do end up using this, I'm gonna have to make sure to give credit when needed
yeah not hard to do
XD
not like it has to be some elaborate thing to give credit
that plugin is under the MIT license, so you only need to give me credit in a place where people can see it, but it can be out of the way
IE, you could just make it a command thing
./credits
How can I get a players full argument?
hmm
and then it lists all the different organizations or people you give credit to π
what do you mean?
in the onCommand() args[] is an array
so that array will contain all the arguments the player used
or it will be empty if no arguments were specified
which you need to remember to handle as well if you are expecting arguments π
wait
yes
can I use ${} in java or is that just javascript
that is just javascript o.O
oh gotcha
bro I really gotta sleep
sleep
then go sleep π
for some reason I thought I had to put in a integer the array
not like I won't be here tomorrow π
if you want a specific thing from the array you do
Yea I know that
otherwise, you can just loop over the array for all of its elements
for(String arguments : args) {
arguments //do something with this, changes every time it loops to the next element
}
we all hope oneday this will come π
it won't
how can i get the location of the head of the EnderDragon? getParts seems to return a Set<ComplexEntityPart> but i don't see a way to distinguish between the parts.
and no, getEyeLocation doesn't work
there is 9 parts to the ender dragon, if you manage to figure out how to distinguish between the parts, just remember the rotation of the head is opposite of what it faces
so that means the face of the ender dragon is actually the back of its head technically and hence why if you ever put the ender dragon in a mob spawner it faces the wrong way π
I don't see any Set in enderdragon class π€
getParts?
and parts is an array
this.subEntities = new EnderDragonPart[]{this.head, this.neck, this.body, this.tail1, this.tail2, this.tail3, this.wing1, this.wing2};
Sounds like version might have to be given?
1.17
oh we talking bukkit api
is that how the code looks in the class?
be pretty meme to convert from an array to set but lemme see
if that is the code, then you know which part is the head
it will always be at 0 in the array
yeah it'll most likely be 0 in the set too
issue is.. set doesn't allow index grabbing
sets dont have indexes
maybe you can iterate over the set, and find one with a certain property
or a certain type
or something that differentiates the parts
doesn't necessarily need to be exposed in the API
dimension is tho and it is available from the API
new EnderDragonPart(this, "head", 1.0F, 1.0F);
head is 1, 1, with fixed as false
just grab the nbt data
find the one that says head
π
once you have your entity, its a matter of doing getLocation() π
what is the best way to add items in gui with config file?
never working with ender dragons again
but it seems like all i personally needed to do was use getLocation instead of getEyeLocation
How can I get Blocks(enum) by String? for example, I want to get Beacon Block by "BEACON"
(For your information, Blocks enum doesn't have valueOf() method)
Material.BEACON.getBlock() I think
sadly, Material.getBlock() method doesn't exists π¦
where is Blocks(enum) in the API?
nms1.15R1!
oh 1.15
Block.getByName(t)
sadly too, Block.getByName(), Blocks.getByName() doesn't exists π¦
do it when creating
That doesn't create anything besides a variable.
Its not even initialized
Hello! How do I copy and paste the section? I didn't find the tutorial. (via Google.)I knew I had to use the Schematic file.
public class MainMenu implements InventoryHolder{
public Inventory mainmenu;
public MainMenu(){}
@Override
public Inventory getInventory() {
return mainmenu;
}
}
now please guide me, where do I create?
.
?
To create any object instance, you can first find its constructor, if none is public see if there are factory methods
Bukkit.createInventory(null, "Name", <size>)
Like the above
public class MainMenu implements InventoryHolder{
public Inventory mainmenu;
//Inventory Items
public MainMenu(Object player){
mainmenu = Bukkit.createInventory((InventoryHolder) player, 54, color("&7gui"));
}
@Override
public Inventory getInventory() {
return mainmenu;
}
private String color(final String message) {
return ChatColor.translateAlternateColorCodes('&', message);
}
}
Isnt player an inventory holder
if you have a reasonably-sized screen, it should be visible without even scrolling down on the site i sent you
you literally made the class implement InventoryHolder lmao
why are you setting the player as the holder
I asked here before that's what I was told :/
yep
that's correct
but you're using the player as the holder of the inventory
not the object you just made the holder
I made it null
don't make it null
then?
you made the object implement InventoryHolder
was that corrent?
?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.
._.
Who suggested main menu implements inventory holder
someone
I can use SmartInvs library
you can
but then all the Smart that you could have gotten from doing it yourself would be transferred to that library, wouldn't it?
mainmenu = Bukkit.createInventory(null, 54, color("&7gui"));
But then wat does that even mean design wise
holy fuck
For it to implement holder
you can easily detect the custom inventory by checking the holder on click
Ah ok
mainmenu = Bukkit.createInventory(this, 54, color("&7gui"));
```?
yep
Then why is it taking in player as an argument for constrcutor
that will set your MainMenu class as the holder
well it should be Player player
but probably to open that inventory for them after it's been created?
at the end of the constructor, player.openInventory(mainmenu)
speaking of which, your mainmenu is capitalized incorrectly
but player will be null?
you pass in the player when you create the gui
sure, if you pass in null, the player will be null
Player player = null;
mainmenu = Bukkit.createInventory(this, 54, color("&7gui"));
player.openInventory(mainmenu);
}
why did you take out the argument
you were closer before
the constructor public MainMenu should take a Player object in so that it can be the target of the inventory
public MainMenu(Player player) {
//create inventory and stuff
player.openInventory(mainMenu);
}```
some bad coupling going on here :3
?paste
Very much over engineered π
Why is it that when I try to parse placeholders for an offline player, I get an empty string? π€
Because the player is offline π§
Ok.
Is there any way to solve the problem?
it depends on the placeholder
But PlaceholderAPI supports OfflinePlayer instead of Player as an argument
it depends on the placeholder
some accept OfflinePlayer, the majority accept only Player
Well yeah, it depends on the placeholder, just what gecko says.
java.lang.NullPointerException: Cannot invoke "net.milkbowl.vault.economy.Economy.depositPlayer(String, double)" because "com.elunar.bitsforbump.DiscordSRVListener.eco" is null
``` getting this
while in other plugin I still able to use Economy Eco when it's null
you can never use something thats null, other than make it not null.
public class DeathGhost extends JavaPlugin {
public Economy eco;
public EventListener eventListener;
@Override
public void onEnable() {
eventListener = new EventListener(this);
if (!setupEconomy() ) {
System.out.println("Disabled due to no Vault dependency found!");
getServer().getPluginManager().disablePlugin(this);
return;
}
}
private boolean setupEconomy() {
return getServer().getPluginManager().getPlugin( "Vault") != null;
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
the other plugin that works
I don't remember why I didn't set eco to something
You never set eco
Yep, you haven't set anything from the vault API here xD
you're just checking if the plugin Vault is null or not and disable this one if it is
no it doesn;t. You will not be able to do anything with eco in that
public class EventListener implements Listener {
public DeathGhost deathGhost;
public EventListener(DeathGhost deathGhostClass) {
this.deathGhost = deathGhostClass;
}
deathGhost.eco.withdrawPlayer(player, 1.0);
I like making getters than putting something public I think it looks ugly
used this method
Shouldn't work.
One last time. You never set eco. Its impossible to use eco when its null.
I can give the source for you to check and the plugin
Yes, it's also suggested to do that as it's an OOP concept
maybe Im missing something
?paste
if you don't initialize the eco, you will be unable to use it.
maybe I pushed an old version or something
Any ways, the code you uploaded will not run, because you never initialized it
Yes I think I pushed on accident, I found a commit where I removed the rsp for some reason
The isBlock() checks if it's place able, if you mean it that way and not texture wise, yes
?tryit
I don't suggest you to run it this command too often though
It's better to cache all the items you want, also you have named your variable incorrectly xD
Nope, only PersistentDataContainer is kept after restarts, but when you place a block it gets removed
Blocks with TileEntities have a PDC
Oh? for real? I didn't know that π thanks for correcting me
Oh yeah I meant Server#getOfflinePlayer, but anyways why a StringBuffer also reuse the Gson instance but else I guess fine, also not really over engineered 
Spigot 1.17 Can used on Kotlin?
No clue
Can you give me kotlin gradle script code?
No
no
Just google it
ok
I googled it But all of codes are not working with "Could not find org.bukkit:bukkit:1.17-R0.1-SNAPSHOT."
you did not declare the repository
What it means for you is up to you, it you are already using kotlin gradle you should know what that means
you should be depending on spigot-api not bukkit
I if the error is: org.bukkit.plugin.RegisteredServiceProvider<?> required java.lang.Object
Does that mean there is an library error or what?
What should I use instead of Material.GLISTERING_MELON_SLICE in 1.12.2?
How would i make a server read and write for players inventory? with a sql database!
elaborate a little
hi i have a littel question
how can i make the snow ball throw auto
i mean i make an event if this event works
the plugin throw snowball
Can you load a plugin from a File in Bungee?
uuuh spawn the snowball and give it some velocity ? not sure never tried it
Im in bungee and there is 2 servers i want to work with - The main server and the secondary server! i want to bring the loot from secondary to main but not from main to second - if i needed to share loot between servers easy i know how to do that but i want them separate instead!
just invoke Inventory#clear whenever a player join the secondary world
no because they earning the loot from secondary
You see, there are issues with your idea
What if the inventory is full? Merging two inventories will often not go as planned
true
Im using maven but I cant import javaplugin or anything related to spigot
I followed a tutorial
IDE?
Intellij
Did you refresh the maven project or no?
ctrl + shift + O to refresh the pom.xml
?paste
your pom.xml here
π€£
when a player is banned, does it trigger a PlayerQuitEvent or a PlayerKickEvent?
Its my first time using spigot in intellij, i just changed to intellij cuz there were 0 tutorials for eclipse
interesting
quit should be manual and kick by operator
People always complain how there are no tutorials for intelliJ
The best plugin tutorial in existence is for Eclipse
there are more tutorials for intellij than for eclipse
it's just an IDE, it doesn't matter
but the quality of the eclipse ones is better
How do I make a snowball throw when I click the left mouse button?
i wanna just the function name or something like that
only once you figure out how to enable dark mode
also i would guess it's playerInteractEvent
just beware that it often is cancelled by default
What should I use instead of Material.GLISTERING_MELON_SLICE in 1.12.2?
Tried using Material.LEGACY_SPECKLED_MELON but both trigger a java.lang.NoSuchFieldError
so ignoreCancelled = true
anyone knows why /help <plugin here> cuts off the description of commands when they reach a certain length?
you would need to bind with 1.12.2 bukkit
it is false by default, that is, the handler fires even if the event is cancelled
I thought it makes it ignore the cancel state
Vanilla limitations
ough, I always get it wrong
no the name is dumb, it's backwards
well /help <command here> does not cut it off hence why im asking
event handlers process cancelled events by default