#help-development
1 messages · Page 1909 of 1
?jd
ty
declaration: package: org.bukkit.event.entity, class: EntityDamageByEntityEvent
Serious question, Is it best to know Plug-in development as a server owner? ik it sounds dumb
I mean it's a good thing to know if you're solo so you can verify code but most servers have a dev on team to handle this kind of stuff.
It is always cool to take full control of your server
i think this should work...
@EventHandler
public void onPlayerDamage(EntityDamageByEntityEvent event){
if(event.getDamager() != hunter){
event.setCancelled(true);
}
Ay my favorite. Another error, but I think I solved it.
could someone help me with a little problem I have?
why do i take damage from zombies and stuff?
@EventHandler
public void onPlayerDamage(EntityDamageByEntityEvent event){
if(event.getDamager() != hunter){
event.setCancelled(true);
}
How can I change a large amount of blocks quickly without any visual lag?
I used nested for loops to iterate through the blocks -> delete them
but there's just a small visual delay. Would I use nms to send the packet at once or
my problem is that the metadata seems to change when durability goes down
Maybe for the detection set durability for the metadata of the one you are comparing the shot bow to the durability of the shot bot.
hm, ok thanks
https://paste.md-5.net/abamokokur.bash What is wrong now. D:
Current code is: https://paste.md-5.net/tiwayogala.js What is wrong now. D:
Did it work?
it helped inspire me to find an alternative solution
i did and i dont get how to use the method, so can you just tell me how to use it?
what's your issue
also you left your mongodb details in the code
and your bot token
might want to delete that link
I don’t see it?
well you just edited it
I fixed that to be the error message.
Oh.
iirc u can do something like
String json = EntityUtils.toString(resp.getEntity(), StandardCharsets.UTF_8);
JSONObject object = new JSONObject(json);```
i also just recommend using the java wrapper for discord
Java wrapper for the popular chat & VOIP service: Discord https://discord.com - GitHub - DV8FromTheWorld/JDA: Java wrapper for the popular chat & VOIP service: Discord https://discord.com
anyone have a link to where I can learn about sending block breaking packets to the player
Either using NMS (thread unsafe) or using protocollib
thanks
I need that ?packets
can i ask something about nms here?
yes
so i want to see how vanilla minecraft handles damage by attacking
i have net.minecraft.server sources now but i don't know where it handles it
who damaged by what
oh i was typing that
any potential event it fires?
player -> player
^
if you know what event it fires, you just have to search the repo with that event
to see where it is fired
ctrl F
?jd
lol
wot
heh?
?jd-bcc
lol
?java
?
?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.
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
whoa
?links
bro just... add to your favorites
well since i use paper i have paper-jd linked
How do I create a Skull ItemStack that uses a custom texture ID.
How can I get this strings and add them to an ArrayList ?
is that yaml file?
yea
?jd
wait a sec
YamlConfiguration#getStringList
getStringList
thanks
All I am seeing is SkullMeta.setOwningPlayer("name") but that is for heads that are on actual skins... right and I want actual custom heads? Another one is using GameProfile variables which I don't have?
It’s part of NMS
you need to add craftbukkit as dependency
Or just spigot...
All I can find on the web for the dependency of it for 1.17.1 is <dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot</artifactId> <version>1.17.1-R0.1-SNAPSHOT</version> <scope>provided</scope> </dependency>, but it is saying Could not find artifact org.spigotmcpom:1.17-R0.1-SNAPSHOT in papermc-repo (https://papermc.io/repo/repository/maven-public/) .
Did ya run buildtools
The repo is mavenLocal
Does anyone know the offset between the armor stand location and the armor stand head location ?
but is that the head loc?
are ur eyes on ur head?
bruh, there's more then one location on a head
...
is it in the middle of the head ?
the eyes are a little above center of head i think
actually isnt there like a getHeight method for entities
or am i yet again thinking of client methods
There’s a getEyeLocation
im aware
Can anyone point me to a good place to find Minecraft plugin developers for a big project?
I want the exact offset of the head location from the stands actual position
?services
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/
what I could do is use a loop till I get the right loc
How can I get player from PrepareAnvilEvent ?
thanks
so how i can check permission for that ?
its not cast able to player
Inventory#getViewers returns a List<HumanEntity>
HumanEntity is 100% castable to player
than why HumanEntity exists?
Yes
I suppose it’s to emulate the class hierarchy in minecraft itself
oh so there will be Player2 not just Player XD
btw HumanEntity is made by spigot not minecraft
I suppose it’s to emulate the class hierarchy in minecraft itself
pretty sure its client sided so you need the effect for it to work
give the potion effect without particles ig
or a resource pack
probably not possible then idk how it works
can’t see any mention of it on teh wiki so yeah must be client side
I've registered the tab completer in the Main class, and blockedNames in Main class is a ArrayList of String
but does not work
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

🙏
its a tab completer
That much even I could tell
so when i press tab with 0 arguments, the plugin should return some thing a told him
Did you register the tab completer
no error was found?
it just does not work right?
i told him in tab completer class to return a list of string
but plugin returns nothing
.
so ?
the command is an arg. the length cant be 0
ow, right
well, not the command but everything after your space* so if you do a space, its an arg.
yea, thanks
Player p = e.getPlayer();
String msg = e.getMessage().toLowerCase();
e.setCancelled(true);
for (Player player : Bukkit.getOnlinePlayers()) {
p.sendMessage("s");
if(player.getName().toLowerCase()==msg) {
p.performCommand("d add " + msg + "");
p.sendMessage(Color.fix("&aYou added&6" +msg + " &ato yout plot!!"));
GuiClick.chaton.put(p, false);
GuiClick.addremove.put(p, "brak");
return;
}
e.getPlayer().sendMessage(Color.fix("&cPlayer is offline!"));
}``` And always this send Player is offline
how can I teleport a player to a specific location on another server in same bungee network?
use .equals(msg)
the reason for that is == compare obj, which they are not the same, while the equals in String compare the actual string, not the object itself
okay, thanks
i think you should go for like Bukkit.getplayer or something, then check if they are not null (and they are online, though i think you should not do that, i feel like it would be better to support offline players too) instead of that code
okey, i'll try, ty
uh any idea to my problem? it seems like I need a solution which can communicate across different spigot server in some bungeecord network (without player online in target server)
Use bungeecord to move them then teleport them from there? You can even send plugin messages if you need to using bungeecord
bungee plugin message need at least one player online in both sending & receiving server iirc
so if no one was online in target server when teleport happen, the message will not delivered...
How do I add weapons to custom mobs?
You could create an external socket Server-Client system that allows sending stuff to other servers
Does anyone use Ant on top of Maven, to do some specific stuff?
Oh btw I know this was literally like a week ago
But there is no difference
The above just makes that initializer apply to all constructors
Wow!
Not really. If i want to do specific stuff then i write a script or use gradle. What specific stuff do you have in mind?
You can also write a maven plugin
for me intelij pre-installed ant
I need to learn how to deploy my plugins directly to the plugins folder
Assuming that works when the server is on
You would have to shut down the server for that. Luckily spigot has a folder where you can add plugins
which will result in older versions being updated on the next server restart 😄
Just build directly to plugins folder, and then you can reload in game
If you code your plugin correctly it shouldn't cause any issues for testing
sometimes doesnt work because of file locks
Yes but then I have to hardcode my plugins folder link into the build.gradle
how to set theme in cwm?
The only time I've had a problem with this so far was when I was running jar with gui
What is cwm?
code with me
I’ve decided to yeet json and properly use relational databases for my plugin
I think
I mean... if there is a reason for that then sure. But then dont dare to just use the db for persistence.
I mean there isn’t really a reason to not use it
Means I can easily set up a baltop if I want to
Yeah because MongoDB has no selective queries
Or do you just want to use sql and support nothing else
Probably just sql
ok then it makes more sense
I doubt anyone has a real need for something else
Especially since sql has like 10 different options
nosql is growing now I think
actually I think it is more flexible for minecraft plugin data storage, compare to sql option
most of time minecraft plugin data just need a key-value style storage, instead of heavy features from sql xd
Yeah
You mean the other way around, right?
Non-relational scales earlier and further than relational ones.
Thats the whole premise of non-relational DBs. They scale better.
I mean I’d totally go for that if it was accessible to people
But it isn’t, compared to relational anyway
table data representation is simple af, no?
I guess I should avoid stuffing the uuid in every table
And instead have a single table that connects a uuid to a simple integer I can use a foreign key
Gotta look at how to do that
- use columns BINARY(16)
- Serialize/Deserialize uuids to byte array with 16 length
- statement.setBytes and resultSet.getBytes
depends on the use case really. If the data being stored is not related to each other, might be better to go with a non-relational setup. But, since most people here are not storing data in capacities where they are hitting some limits it doesn't really matter too much which people go with unless they are just simply doing things purposely in the most unefficient manner possible
Agree. I dont think any minecraft server will have enough data flow to really justify going for either DB. Everything will be handled on one server
and features like sharding are not even a consideration. DBs in spigot are just used for persistence 90% of the time.
What if someone wants to sync the data on two servers :p
then the db will still be on one server. And nobody will have lets say atomic operations over distributed tables.
And if you need live syncing then those DBs are not up for the task anyways. If you want high availability + high consistency then you need
something like Redis or Hazelcast between the minecraft servers and the databases.
Database is capable of synchronizing in some cases; LibertyBans is a great example
Although, that requires asynchronous non-blocking design, data is stored almost in database
You need to poll databases if you want to get notified when changes happen. Redis has several techniques for this which are event driven.
you could actually implement data sharing capabilities in your plugin between servers as long as your plugin is aware of multiple servers. You don't necessarily need a SQL DB server for this and in fact for most people having SQL DB server is most times over kill.
Ahh decisions
Like... with sockets? Hm. I guess if you have a single plugin and are not designing the whole infrastructure there is not much you can do otherwise.
Json would probably make this nice and simple, although I don’t actually know how to operate it the same way I do yaml
well would have to be sockets unless you planning on communicating on a lower level? lol
most data needing to be shared isn't a large amount
Although with json getting the balance of all players would require me to load each file
unless you decided on a master server, IE Bungee
basically you can make it a config option as well as your plugin can detect which type of server it is being loaded on. If they enable multi-server option, then in the code you know you need to pull from the master
you are not going to have a player on more then one server at any given time at least not with current server implementations 😛
How would that solve having to load each file to get all player balances
thought you were referring to on each server.
you would just do it on server load and I would recommend binary storage
use memory mapped file to aide loading it super fast
if (targetblock == blocklooked) {
Bukkit.getScheduler().runTaskLater(plugin, () -> {
packet.getIntegers().write(0, new Random().nextInt(2000)); //entityid
packet.getIntegers().write(1, 3); //stage
try {
manager.sendServerPacket(player, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}
blocktouched.setType(Material.AIR);
}, 20);
}I dont understand what is wrong with this, both targetblock and blocklooked share the exact same values but the schedule doesn't run, no errors show up
essentials only keeps track of the top 10 or 20
nothing more
and in fact it isn't super accurate all the time either 😛
Copying stuff somewhere local, executing stuff via ssh. And I was told Gradle is evil.
I believe everything I'm being told.
if you get a player knocked off the list completely, and lets say then afterwards all the rest use up their balance and the one that got knocked off is supposed to be in the top list again but said player never rejoined the server. Essentials won't display them in the list until they join again 🙂
a very unique scenario but point is, essentials does not look through all the player files to find who is supposed to be in the top
it could have changed since I last remembered
but that would just be dumb if it did that given there can be literally thousands of files and now spending time using up File handles for this process
there is a limit in how many files can actually be opened at any given time 😛
I guess I could just cache baltop to a single file
most people don't come close to that limit. I have hit that limit before XD
and once you hit it, everything in the server plugin wise, tends to start crashing since they typically are not designed to handle such events XD
how cancel all damage except from arrows?
?jd
yea so heres what i have:
@EventHandler
public void onPlayerDamage(EntityDamageByEntityEvent event){
if(event.getDamager() != what goes here for arrow){
event.setCancelled(true);
}
}
would use instanceof
hmm ty
@EventHandler
public void onPlayerDamage(EntityDamageByEntityEvent event){
if(event.getDamager() != instanceof Arrow){
event.setCancelled(true);
}
}
:/
that isn't how you do it
o
if(event.getDamager() != instanceof Arrow) needs to be if(event.getDamager() !instanceof Arrow)
And Arrow I don't think would be correct since its name changed I think
don't quite remember, should look in the javadocs
?jd
lesgo ty
if (!(event.getDamager() instanceof Arrow))
yay ty
hmm
skeletons damage me maybe skeleton arrows are counted as seperate entities
Anyone more familiar with Gson than me, can I desterilize into an existing instance of an object?
what do you mean?
like are you asking if you have to create a new Gson object everytime?
if so, not necessarily, but you would require multiple Gson objects if you are going to receive multiple payloads from different sources
I know I can do this, Foo targetObject = new Gson().fromJson(json, Foo.class);
But can I deserialize into an existing instance of Foo
Possibly, depends how Foo is setup
ideally you would want that kind of setup as that is the premise of OOP
wish more developers would practice object reuse
No.
immutable objects are cooler anyways
Yeah I just made an object within my object that will be deserialized
hello everyone, so i'm a bit new to plugins. but i was wondering why my latest essentialsx gives me errors, sometimes i get access denied for typing a command.
Does anyone know, why changing GENERIC_MAX_HEALTH doesn't work anymore?
CreatureSpawnEvent:
AttributeInstance attr = event.getEntity().getAttribute(Attribute.GENERIC_MAX_HEALTH);
attr.setBaseValue(3);```
the method you are using is a getter, not a setter
oh wait nvm looked at it wrong
Does anyone know, how I use skript-variables in a plugin ?
(@me please)
np, every forum says, that code should work
Try setting it back
setting it back to what?🙈
Setting in back in to the map. All though this appears to be not intended
So just ignore that
Anyways that should work. You could try delaying it until next tick
oh you mean, because the creature isnt spawned yet, i cant change that value?
Yeah
but than a error should be thrown, shouldnt it?
but ill try
and still, delaying it, still shouldnt fix it, because the creature wouldnt be spawned yet still. but nevertheless, ill try
I am assuming you are using an older MC version?
nope, newest one
because I am not seeing in the Javadocs for getting an Entities Attributes 🤔
the only thing that has getAttributes is items, entities I think require you to use metadata instead?
well, let me phrase my question different: how do i change maxhealth of any entity if not like that xD
Well the metadata api should let you do that
ok, ill check that. thx for the help. if it still wont work, i check in again 😛
declaration: package: org.bukkit.metadata, interface: Metadatable
Entity extends that
what is the name of the max health of an entity. so by what key should i get/set the value?
so, what todo now xD every forum sais, i should do it that way. but it doesnt work. you sure delaing setting attributes will fix it? because shouldnt the entity spawn, when the event has finished?
Event is before it has spawned
so delaing shouldnt work, right?
Why not?
Hello, does anyone know, how I open my Gui's with skript-reflect, in skript?
My guis in plugin:
https://pastebin.com/gisgbFkh
https://pastebin.com/sPZ4K920
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.
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.
because as you said, it isnt working because the entity isnt spawned yet, because the event hasnt finished. so delaing it by one tick just delays the event and delais the spawn of the creature. therefore the creature still isnt spawned when i change the attr. or did i get smth wrong?
The event won't be delayed
You put your code in a BukkitRunnable and run it next tick
?scheduling
yep, thought it would work like a sleep, buit now i see what you mean, thx
this works right?
?tryandsee
You should be using Attributes
Probably 1.8
did you change their gamemode in the properties?
are you wanting them to join always on spec
nope
oh
your doing something wrong... i can leave in spectator and when i join i am in spectator ... same for each gamemode
a good way to keep potion effects would be coding it ^^
Plugins like Essentials will often force all players to a certain gamemode on join
Does gson not support remembering the type of objects between serialization and deserialization
what do you mean / whats the problem ?
For example, Genson can store the class name with the serialized object so it can be converted back to that class
someone who makes plugins and speaks Spanish and English?
noo
Exception in thread "main" java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
at java.util.regex.Matcher.reset(Matcher.java:309)
at java.util.regex.Matcher.<init>(Matcher.java:229)
at java.util.regex.Pattern.matcher(Pattern.java:1093)
at org.spigotmc.builder.VersionInfo.hashFromUrl(VersionInfo.java:62)
at org.spigotmc.builder.VersionInfo.getShaServerHash(VersionInfo.java:51)
at org.spigotmc.builder.Builder.checkHash(Builder.java:731)
at org.spigotmc.builder.Builder.main(Builder.java:400)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
kep getting this error with bt
?
you cant just store an obj and its class ^^ iirc this would need some extra code
Ideally, you should know what object are deserializing. There's registerHierarchyAdapter on gsonBuilder to resolve that issue
In Bungee I am creating a cache of all arena's of all servers. When the plugin boots up on Bungee, I don't have any data from any Spigot server. I have to send a message to the Spigot server requesting this data (in JSON). The problem is that I can't send messages to server's without any player online. This means I can never actually initialize a server's arena cache
yes
Any idea's for a fix?
you can use Java Sockets ^^
create an socket for the bungee and let all other sockets connect to this bungee-socket ... if the spigot server client connects you can set a name for it and send any other data you want
Very good idea thx
Uhh... There's simple message brokers already...
What?
Us something like Redis or rabbitmq. It does the same thing, but its much easier to work with
boring 😄
how to convert §4 to byte like this
ItemStack item = new ItemStack(material, 1,(byte) §4);
`§4 -> red
ChatColor.translateAlternateColorCodes('&', &4)
but it will not convert it to byte
what
the byte are just some numbers
that constructor should be deprecated
why doyou want to convert a §4 to byte ?
this isnt even the place to use color codes
Because the constructor requires a byte
yes i need this to gui
what version ?
Wtf
17.1
you dont need that byte
constructor does not take the item name
Did it matter what they said here? 
not rly but if he wanted to set the byte code because of ancient version it matters
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
??
Diagnosis: skill issue
?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.
Use that method
No
There is literally no other way of doing it as far as I know
i want to get byte to set item
Not possible
what
public void initializeItems() {
for (int i = 0; i < 26; i++) {
if(Arrays.asList("20","22","24","44").contains("a")) return;
createGuiItem(i,Material.STAINED_GLASS_PANE,null,14);
}
createGuiItem(11,Material.DIAMOND_SWORD, "§6Sprawdz", 0,"Sprawdz uztkownika");
createGuiItem(13,Material.IRON_HELMET, "§aCzysty", 0,"Uznaj uzytkownika za czystego");
createGuiItem(15,Material.IRON_HELMET, "§4Zbanuj", 0,"Zbanuj uzytkownika za cheaty");
createGuiItem(26,Material.BARRIER, "§4Wyjdz",0,"Wyjdz z gui");
}
protected ItemStack createGuiItem(final Integer place,Material material, String name,int byt,String... lore)```
There is no way of doing it
Factually incorrect
If it suits them
what the hell is the point of the line with asList
My plugin linked with vault log "can't find Vault plugin" in the console
But I can't find where the problem is.
I had already installed Vault plugin 1.7.3 in my server
Here is my code:
public final class MBCT5 extends JavaPlugin {
private static Economy econ = null;
private static Permission perms = null;
private static Chat chat = null;
@Override
public void onEnable() {
System.out.println("running the plugin...");
if (!setupEconomy() ) {
System.out.println("can't find Vault plugin");
getServer().getPluginManager().disablePlugin(this);
return;
}
getCommand("balance").setExecutor(new balance());
getCommand("turn").setExecutor(new turn());
}
private boolean setupEconomy() {
if (getServer().getPluginManager().getPlugin("Vault") == null) {
return false;
}
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
return false;
}
econ = rsp.getProvider();
return econ != null;
}
public static Economy getEconomy() {
return econ;
}
}
btw I checked the server to make sure the Vault is correctly working on server.
You'd need to change the implementation of the createGUI Itemmethod
?paste
It is. Do you check things before you go off saying people are "factually incorrect"?
always get the economy lazily!
what you mean
the docs are just lying to U
smh
Like, actually change it
so rude of them
Jesus, how have you gone so far in the first place
Any instance of the Byte object can only store the numbers of -128 ... 127, it is quite evident that you cannot store strings with that
So use the method I linked to earlier (don't forget the set the meta afterwards!) and it should work
You only really need to change that one method, not the initializeItems one. (also, I suggest to you to always use primitives (i. e. int place instead of Integer place) wherever possible and to remove the int byt parameter)
id still love to know what the asList line's purpose is
so true xD
debugging probably
also interesting how ppl wanne code anti cheat plugins all the time and then they dont even understand the api or how "§4" cant be a byte
Hey, So I am new here and have never made a spigot plugin in my life. A server I played shut down and open sourced their plugins. They gave the uncomplied plugin and I would like to compile it to a jar to run it. I know I sound like a noob but all help is appreciated.
interesting how people want to code but dont know how to code
technically it could be!
Any recommended Vault econommy plugin? .w.
You don't even have an eco plugin installed?
probably ... but not with that:
(byte)§4, ...
adventure be like
Anyone able to tell me how to compile a plugin without a coding software?
I have no clue, never made a plugin. Someone open sourced a plugin I like and I need to compile it since its not compiled.
I have some plugins connected with Vault (like griefprevention)
But I didn't get any useful Vault economy plugin
So I decide to make one by using Kody's tutorial .w.
Oh so you want to make an economy?
yes .w.
why cant it be a byte
Honestly the easiest way to do it is to just install IntelliJ, make a project from VCS, and clone the open sourced repository and then build it from there.
Then just give me the github link and I can figure it out
@grim ice
Otherwise you can do that sativa suggested and run javac but that's like... typing 
This probably sounds stupid to you guys but what the hell is a VCS
It's version control, basically Git
wh cant it be tho
I assume they put the code on GitHub or GitLab?
Yea
did you try to use that line ? it wont work like that
Yeah, so those will provide you a .git link, you copy it into IntelliJ and it downloads all the code for you to start compiling it.
Gotcha, thanks.
except if they use a strange build system
(such as make or something like that, but the chances are minimal)
Yeah true if they didn't use Maven/Gradle you're gonna have to find all the depends
yes but why
plain java dum, that's why you should use JAVAscript
thats why
where do I find the .git link?
On GitHub is the green Code button
take the url of the repo and append .git to it
Or do that
Found it
Also, anyone know why I am not getting the private message from the verification bot?
Do you have DMs enabled
No clue
Make sure you do
can you even disable DMs on the forums?
record what they have before death and apply back when they respawn
Oh I forgot it DMs you on the forums
nope
Been a while since I verified 😢
My DMs are on and I don't have a message.
On the forums?
yea
For some reason my server lags splash potions, any idea what might cause this?
Like when thrown it ends up landing behind the player while running
Hmm weird, I don't 100% remember what the verification process was like, maybe make sure you spelled your username right if you had to type it?
#help-server @eager hull
Thanks
Okay, so I have the project. Where the hell is the compile button.
Do you see a pom.xml or a build.gradle anywhere
I see a pom.xml
On the right side is there a maven tab
found Integer.valueOf(Bukkit.getBukkitVersion().split("\\.")[1]) but thanks
Yes

yea
Open that and I believe it's package?
I never use maven so someone can correct me if I'm wrong 
yes
This is what I see
Yeah, package
On my PC yes.
MC version
1.12.2
okay
Dev tools or SE for java 8
go to prject structure > project > project sdk
^
idk what dev tools is
JDK is dev tools I assume
Where is that
File -> Project Structure
Im so confused on what to download. Oracle makes things so hard.
Where is the stupid download button on this page
whats this one?
https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot

You search java 8 it brings you to oracle.com you search java 8 download it brings you to javas website.
Yeah aand Java's website isn't sketchy at all
heh do people intitialize some fields directly when declaring them instead of in constructor to minimize the object creation time?
I installed it and there is no option for a JDK by java...
Restart IntelliJ probs
huh?
like this instead of = new in constructor
That doesn't minimize object creation time
Pretty sure it's effectively the same thing as just setting it in the constructor
It's a design preference I suppose.
But they're effectively the same thing.
but for some fields in the same class they do it in constructor and other ones directly
preference i guess
It's the same as
private final Map<UUID, User> userMap;
public UserMap() {
userMap = new HashMap<>();
}
Same thing
Are you on Windows
Yea
C:/Program Files/Java
C:\Program Files\Java\jdk1.8.0_291\bin\java.exe like this
yeah
Wait, nvm. Path unspecified. Bruh
click on the jar?
I don't even have that path. I have a JRE path?
You don't have one that says jdk1.8.9_<something>
And theres not even a jdk...
Click the SDK, Add SDK -> Download JDK
what isnt he using intellij
oracle you son of a b||un||t roll
wait i have a link for Oracle JDK8 somewhere
I mean using IntelliJ to download the JDK
ah 
https://javadl.oracle.com/webapps/download/AutoDL?BundleId=245464_4d5417147a92418ea8b615e228bb6935 should be JDK 8_311 or whatever
Yeah JDK is Java Development Kit lol
imma rage
Yikes
Use the link sativa sent
i did
poggers

slowly releasing people from the false paywall that Oracle put up
and people wonder why I give up on programming java every time
but also why not use java 16 or 17 
Plugin is developed for 1.12.2
I don't even think its going to work. I am just trying to compile it so if it does work yea
Smh just run your 1.12.2 server on java 17
Because half of the dependencies and plugins aren't there because the private server was shut down.
Basically this disney theme park server shut down because their owner was caught being a pedo and they open sourced it so I am trying to bring back the server but their plugins are not my strong point so I am trying to see if they work before hiring a coder.
disney theme park yikes
yea
he abused his power as a certified discord server owner and a approved family friendly minecraft server.
And he just left without giving over ownership.
nice 🌝
And so now fans of the parks and not him are stuck with these stupid programs
Fun..
I dont think its goign to work though because of this https://gyazo.com/2626092bca964b7f40a0f9302b2a4e62
you have to set your dependencies
how?
add it to your pom if youre using maven
spigot it this
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>VERSION HERE</version>
<scope>provided</scope>
</dependency>
</dependencies>```
how could i change how long the fishing hook can go?
🌝
epic line of code
ProjectileShootEvent maybe
wait... like MCMagic?
Its the person that bought out MCMagic, Palace Network
MCMagic got so big that the palace network bought them, 6 years later that event happened.
oh
Right now I am trying to get the show plugin to work.
I emailed the lead coder asking if he had the repositories copied so I will see if he gets back to me.
is there an repo for that project ?
wdym*
github ?
The repos were on the website
the main one
and that got shut down
wayback machine has no archive of the web page
players that are dead and didnt click respawn dont get teleported with this command.
this isnt good help :/
onlinePlayer.teleport(new Location(Bukkit.getWorld("lobby2"), 0, 65, 0));
Is it safe to access, but not modify the bukkit api in a thread context?
respawn those plaayers
is there a function for this
storage = new DelegatingStorage(new MySqlStorage(ConnectionFactory.create(this, StorageType.fromString(getConfig().getString("database.type"), StorageType.H2)), new UserRepository()), getLogger());```
Where’s factory factory?
wha-
What would you recommend for a simple data bróker Websocket or Socket?
declaration: package: org.bukkit.event.entity, class: ProjectileLaunchEvent
i can inline the cache 🤡
Nice
did you test it ?
there is no special methods there
yes of course
is there a faster way to test your code in game than closing minecraft and replacing your new jar file in the plugins folder and restarting the server again?
what do those mean?
/reload or plugman
First one is automated tests, so you basically code the expected behavior your code will display
Second one means you just swap the jar whilst the server runs
And the jvm will see the changes
...oh
I wanna code a simple data sender and receiver! But socket are to messy. Like I try and try. But its only get me mad
well that's useful
Does someone know how to import craftbukkit 1.18.1 into your maven pom.xml using a repository?
Idk I mean sockets are quite simple if you understand the concept of them
run buildtools
and use
But verano
the spigot artifact
There is no official repo for Spigot jars. You should use build tools for that
What would a web socket benefit you here?
@golden turret the Event will not provide redunant code ... you will need to check the entitytype and then add velocity you want
i will try to do something with the player.idkProjectile(class, vector)
They are easy to use. And they are already prepare. Like if I use socket I would need to work o er them. And websocket it has many methods with it
Like I wan do a simply data broker. But sockets plan giveme to many problems, with async, Thread locking etc
Thread locking?
Yeah
Oh synchronization is a bit of a pain yeah
Hence why many devs opt for sth like netty
Idk arguably you’d need to multithread your application if it uses web sockets as well
how should i call the database of my plugin?
wym?
i'm out of names today
nah the name i mean 🤡
Call it Database?
create database Database :/
Oh
Explain more
yeahh
That type of name
I dont understand
probably py plugin name
Believe google sheets is an option also
You will have big ass pains with linking data
Or excel whatever you call it lol
is it even possible to rename a mysql db?
I used since for simple things
kekw
And i cannot lost my time with fucked data linking with ids and that yet
That good option for local data
Hence I would prefer Mongo over Mysql
i did sqlite before but i didnt like the syntax 🌝
Its the same from Mysql
Hahaha
🤣
nah bigint is something different
Lmao you should have seen my face
I used sqlite and mysql since 1 year
And the syntax its not so diferente
They use SQL so
yes
Wait
wait
You mixed all things
wtf is this site saying
i have a small server/client - socket java project
Yeah I read completly and i understand it
If I use Connect via Bungeecord messaging, how long will it take before the connection is fully established so I can send the next message to the server the player has just connected to?
I think from Client you cannot rename database name. Tables yes you can
Explain more. What are you trying to do?
RENAME DATABASE has since been removed from all newer versions to avoid security risks. 🌝
I am trying to send a player to a server and give that server directly after the player has joined some extra information (another instance of my plugin is running there)
it says to recreate all tables lmao
what security risks 😐
idk
There you have the answer
or doing a dump 🤡
Dont search for the 5 leg of dog cuz you wont find it
In other words if you cannot do it. You cant dont search for a solution
Why do you need to rename it anyways
.
technically you can.. just create a new table with same columns, move the data using script and delete the old one
thats a good question, i was just asking for in case
Hum the problem its the next. Plugin message channel wont work without player Connection on the receiver side. So if you dont have any players online you wont receive the data until a player joins
thats why sockets are better except for transfering player
Exactly, but I wanna transfer a player
I wanna send him to a lobby server, and give that lobby server directly after the player has joined some information so the lobby server can handle that
what information ?
What server the player wants to join
And in the lobby I have my plugin handeling that
✨ redis ✨
No messaging is fine, but I need to know what delay I need to use inbetween these messages
racing condition
why do you guys put so much effort into databases
I store all my data as a stringified json object
🤡
I call her ol’ fast & reliable
json doesnt provide joins
?? its an object just add another key
i dont think you understand the concept db table
well ... why the heck do you teleport the player to lobby and not to the server itself xD
Really wrong. JSON its a DATA TYPE FORMAT
I don’t think you understand the concept of efficiency
Because I want the lobby to select an applicable server
I have no idea what you are trying to tell me
That json its not designe for store data. Its only a type format
no?
and why would you use one json file for different kinds of data?
It is until you have large amounts of data
Yeah
huh? no?
I would want to see you reading big objets and with not Async
LmAo
yeah..?
Really wrong
I'm talking, LARGE amounts of data.
Omg
Not a 2MB file lol
how much data?
lets load the facebook data to json lol
unfair ^^
Imagine what literally any semi-large software company is holding. They can have GB of data.
I wont never do that. I until work with Mongo + Cache + DataObject + Async
GB ? xD i would say TB at least
Yeah, and even GBs would give the application a stroke trying to parse that much JSON 
And even loading of cache it will consume the same as Intellij conpiling
Hahaha
i have also created my own cache datbase which can store some simple stuff that can be used async and with sockets ...
I seen but like I dont like your sockets format
🆗
hmm i changed something the last few days and i always try to make it more efficient/more usefull
but you know its minecraft so i think we can use anything we want cuz you know it is not going to be big
who needs relational databases it is just overcomplicating you know
hmm for example hypixel... they have a lot of data
Depends I suppose, something like CoreProtect probably should use databases.
But yeah for the most part, you're right it doesn't really matter.
Please start understanding irony
I mean you're still right to an extent LOL
is there a good way to execute multiple sql statements after each other?
or doesnt it matter
transaction
and whas that
its more like table setup so would i need a transaction?
i think so, although, it wouldnt matter much; any changes will be rollbacked if table creation will fail
oh ok
is there any way to run tasks less than one tick apart
probably by using java common thread pool
I would like this strucutre:
Endpoint (Interface with basics: options, connect, disconnect, send and receive).
Client and Server (Implement Endpoint Interface)
Connection (Handling data sending/receiving. Will be used on both side)
Event Handling (Using Connection class and Packet)
first 2 points exist in some sort now
you could adapt it to what you need tho ^^ this is like CraftSocket which needs some love to get a usefull interface like as api
Like I need to do an Implement of it on a library and that library be abstract let say. So i dont need to code ecething when I need to use them
Like I wanna send something vía socket. I initialize client and Server side. I connect them. And them In allowed to send and receive packets (object class)
it all depends on how you use it xD
That its why Im trying to do since 1 month. I think I not prepared for this
Cuz I always get NPE exception
While calling send/receive
So i dont know if its a Connection problem with socket or my class.
😄 i had some trouble while sending more then 9mio chars at the same time xD
Omg I will continues drinking my Whisky and try to thought over that system
Since im not on home I cannot do to much. I only can think and get ideas
Whisky its a type of alchool
how does the day matter 🌝
well... most ppl go to school / work and its not rly normal to drink the day before doing those social system related work
and if its in the evening :thonk:
i would go sleep xD
does anyone know the relationship to the force of a bow and the speed of the arrow fired?
1.0 is the maximum force
i think its a 1:1 ratio
it's not
f*3.0
Im making a holograms plugin, and I would like a method that generates the entity given it's location, and hologram text, but i don't know how i would do this, since i cant do new Entity, or new ArmorStand.
oh, yeah that sounds right, thanks soccer
how'd you find that so quick I've been looking for half an hour
IntellIJ
open random mc-project
write bow and use autocomplete to find the nms class "BowItem"
read the name "releaseUsing" and read "getPowerForTime"
then click the value.name and all other uses will show
i think its also dependent on player speed now isnt it
like accelerated projectiles
or is that only for eggs balls and pearls
You can't instantiate a new entity because that's not how it works. You need to use Bukkit to create a new entity
i cant see that
i could just be wrong idk
it depends on the player is on ground or not
not even with nms?
if not the deltamovement of the player gets added to the y-coord
Why do you want to do new when you can just spawn in the entity you want with Bukkit?
?jd
weak
alright i guess i could make a spawnEntity method instead of getEntity
You know the spawn entity returns said entity right?
yea i looked this up, people said i could catch the entity with an event, but its a little janky
What do you mean with an event?
Any suggestions in improving this? ```java
public static int fromRank(Rank r) {
for (Rank rank : Rank.values()) {
if (rank.equals(r)) {
return rank.points;
}
}
return 0;
}
soccer I still don't follow your description for how you found it out, I typed "bow" but all that came up was this
it does. Why?
But why?
using a map
@spiral light
Make your entities as you need them
There is no point in using a map for what im doing
Or literally just rank.points lmao
do you only use the API ?
Because it's lower case. Capitalize it remember case matters
what else would I use?
the server version which includes the nms stujff
...how do I get this server version?
wouldn't work each rank is assigned to a point
this is good stuff thanks for telling me
You are breaking equals contract
Go to docs and type in version. That answers that question
How so?
I dont understand what are you tring to do. Is rank an enum?
yea
ok, so i would like to tag the armor stand with it's id from my sqlite database, how would i change it's nbt?
Does it have a Persistent data container?
persistent data container?
I guess im just comparing an object
ok one ec let me google that
CONSOLE issued server command: /give Ashenguard diamond 10
Is there a way to make this say the plugin name?
jeez the other answers in forums involved getting the craft entity, getting the nbt compound, and converting it back into a bukkit entity, how outdated was that thread lmao
Did you google persistent data container?
Don't use bing
i dont know what a persistent data container is
never heard of it
this is my first time messing with NBT with spigot api

presumably why you are supposed to google it
Don't use NBT use PDC
what do you mean by go to the docs Mike? I've been googling and trying stuff for the past 5 minutes but this is my second day on intellij and idk what you mean by that


