#help-development
1 messages ยท Page 2118 of 1
๐ Thanks
I get first block in EntityExplodeEvent#blockList(), I get the entity world EntityExplodeEvent#getEntity().getWorld() and I try to do world.setType(firstBlock.getLocation(), firstBlock.getType()), that does not seem to work, any idea as to why?
snippet:
Can I Ask Something Too
@EventHandler
public void on(EntityExplodeEvent event) {
Block firstBlock = event.blockList().get(0);
World world = event.getEntity().getWorld();
// 1 tick later
world.setType(firstBlock.getLocation(), firstBlock.getType());
}
What's wrong? (the comment implies that I used the scheduler, too lazy to type the actual scheduler method call)
go ahead
blocks do not represent a snapshot of the data
think of Block like just a location pretty much
any form of data you grab from it queries the world
Then... why are you provided with them if they are just air?
If I make 2 plugins, both of them work . But both don't work at the same time.Always Someone Error. Why?
That is so specific, that would really depend on the error
Why not provide Location
OOP does not work that way ?
all the methods on Block do not fit on the location type
Locations can have null worlds
simply by contract of the Location type
that too
block data is a snapshot. Take the blocks block data
and then set it back a tick later
plus, locations are floating point numbers, blocks are integer numbers
ah
I see
thanks
Oh Okay Thats was About My Mistakes When I Do Everyhing Correct Its Working.
Thank You For All Helps. ๐
Ah sweet ๐
hello I would like to know if with the use of pom.xml I could import the api of another version while maintaining version 1.8.8
well coding against any api than 1.8.8 would break the compatibility with 1.8.8 (if you use newer methods) unless you actively check if the actual server version is high enough
would like to send a title to the player when it enters ... but it does not go with p.sendTitle nor with the packets ... I used the spigot guide
I mean, if 1.8.8 did not have title support in the API then rip you
I need suggestion trying to create bridhe egg like on bedwars I am not sure how to calculate it so it places 2 blocks path wide
current sutuation
public void onProjectile(ProjectileLaunchEvent e) {
Projectile pro = e.getEntity();
int ymax = pro.getLocation().getBlockY()+5;
int ymin = pro.getLocation().getBlockY()-5;
if (pro instanceof Egg) {
new BukkitRunnable() {
@Override
public void run() {
if (pro == null) {
cancel();
return;
}
Location loc = pro.getLocation();
if(loc.getBlockY() > ymax || loc.getBlockY() < ymin){
pro.remove();
}
loc.setY(loc.getY() - 2);
loc.getBlock().setType(Material.WOOL);
loc.subtract(-0.8, 0, 0.8);
loc.getBlock().setType(Material.WOOL);
//loc.add(0.5,0,0.5);
}
}.runTaskTimer(pl, 0, 1);
}```
code which I got
any one has better approach
I mean, you'd grab the velocity of the egg and then basically rotate it 90 degrees
after removing the y coordinate value
probably doesn't help you are using floats
Its impossible all plugin in 1.8.i have title
I don't know what will I acomplish by roating
I mean, you'd be able to get the block to the relative right and left ?
the only issue I can see running into 2 block wide paths, is deciding on which side you want to create the path on
isn't that what you want here ๐ค
to get a 2 block wide path
you need to +1 and -1 to both x and z
technically gives you a 2x2 box/grid in doing that, which is what you are wanting
I will try but I think that will not work
I don't see how that won't work if you know how to do min/max
here is some examples
missing blocks
I think I don't need to do that
I am grabbing location
from projctile on every tick
is there a particular reason you need to do it every tick?
block should be popping
when u throw egg
prg == null is also a not-good check
it makes a path to where ever it lands right?
works fine
I am certain it does not
where the check is at wouldn't catch the null in time
it never becomes null anyway
you are not assigning that variable to null anywhere
intellij is already screaming at you
it shouldn't but if for some reason it were to some how be null, the check is at a spot where null would already been thrown ๐
ye
anyways, if you are making a bridge to where ever the egg lands
in relation to where it was thrown from
Anyone knows a good library which allows me to easily make paged guis?
I'm tired of doing it myself ๐
(I have to adjust my code to the use cases of every project)
you don't need to get the location of the projectile every tick
as long as you have the starting location and the ending location, you could just simply use math to know all the coords in between ๐
well I am not calculating bridge after block should show up how projectil is flying
like on hypixel bedwars
if you have played
the sigma mindset ๐
https://hypixel-skyblock.fandom.com/wiki/Bridge_Egg has an example
it does not
I was lied to
and in the trivia says it is most likely a reference to the bedwars plugin on hypixel
anyways, as far as using starting and ending points, you can turn locations into vectors and do math that way to know how to draw the bridge
but I guess some people like having stuff doing something every tick unnecessarily
is is not a big deal
it's hypixel skyblock fandom
technically from the projectile vectors you could know the end point ahead of time too
players need to pay 1 emerald for every egg
so they will not spam it all the time and I think server can handel
one projectile
one a wild
that is up to you to determine, just stating that you could save on resources by not doing it every tick was all
Ig the closest thing you can get is javadocs and parchment
does anyone have a guide for making nms pets in 1.18
no but that ought to be simple
you derive a custom entity, inject it into the entity registry and change the goals and attributes of it
in principle
but in application there is a lot more o.o
depends on how far you're willing to go
well, just stating what was implied ๐
if it boils down to where explicit packet management is needed, then yeah
the goals all changewd
๐ญ
So Iโm not the best with networking, how would I run a web server on a Minecraft server but have it accessible to a public domain that the server is using
this would make no sense at all
Hello I make my personnel API and I look how to use my plugin API. So I implement my API in my gradle project (yes I use gralde ;D) I see I can use them: getServer().getServicesManager().getRegistration(RedisDatabase.class); to get a RegisteredServicePRovider<Object From My API> and if is not null I do rsp.getProvider(). Idk if it's a good solution. Now I want know if I need to compile my API in my Plugin ?
you would literally be wasting or sacrificing resources from the MC server to instead server web content
when there is literally software designed to do this specific thing
Itโs a direct connection to the server which allows me to use the spigot api for player data, I would use port 8080
So if I do localhost:8080 it should be open if I port forward 8080?
not sure what player data you refer to, but what you describe still doesn't make it necessary to sacrifice minecraft server resources to serve web content
The server is pretty beefy, web servers arenโt too much to run?
not sure if you understand that the more the web content is requested by people the more time your mc server is going to take serving it, instead of actually doing other things that the mc server is supposed to be doing for the players actually playing ๐
but hey its your server, and your players will enjoy that lag ๐
it will be fine for now, until something or someone comes along and then hits that webserver of yours to serve 1 million pages
It would be a single page website
and yes web servers don't take much, but that is for apache or nginx. A custom java webserver isn't going to come anywhere close to what those are optimized to do
I could use spring boot, not sure about the optimization but Iโve worked with it
but you never made a webserver from the ground up
so the answer is no you haven't and thus lack the technical knowledge or experience on certain things. Sure you can make an http server, anyone can, hell my tv could serve content to the internet if I wanted it to. That doesn't mean its going to be secure or optimal to do so. You seem to think otherwise, and after all it is your server. I can only just tell you it isn't wise ๐
Thereโs no need for security, Iโve recently got into networking and web server development by watching videos
then you don't know networking
Not yet
have fun I guess with no security or the belief it isn't needed
but security isn't just about preventing people from being able to get to the back end
Itโs not like a user is creating an account on the website, what security would I need?
it also means preventing your applications being used in unintended ways as well
security also means avoiding things such as if someones using your webserver
to prevent players from playing too ๐
all I have to do is make that simple web server of yours, server 2-5 million pages
and your players would all drop out
however something like apache or nginx would handle such things easily
even on a server with small resources
second, using apache or nginx or just a second application dedicated to web content, prevents the web content from directly affecting the MC server
But this is all part of security as there is different levels and types of security which most of the youtube videos won't necessarily tell you about. But if you are really serious in about getting into networking and all that, I recommend going through actual schooling for it
you would learn a lot more and benefit a lot more from such things and will in most cases learn proper practices and habits instead of potentially learning bad habits from those videos lol
What are the best resources for learning about networking and security?
Hey Guys I'm Making Duel Command And I Have a Problem. Even If I dont get duel request, I write /accept Im teleporting to arena. How Can I set this for just duel rquests
check if the player has a duel request before teleporting them
nothing you will be able to find freely. I mean there is plenty of resources that is freely available like documentation and manuals what have you. Most youtube videos don't go over best practices or what you should or should not be used in certain scenarios. Also a lot of those videos don't go into great details of why something may be bad to do or good to do as well as talking about more technical stuff to get a better understanding. Yes the documentation is there, but it only tells you about the features of something and not necessarily the scenarios in which you might not want to use it. Same with the Manuals.
This is why if you are serious about it, I do recommend taking proper courses for such things.
How Can I do that?
well you have to create a request system
yeah but ฤฑ dont know how to
okay
whenever the player sends a request you put the first value as the sender and then the second value as the reciever
and then in your accept command
check if the player who ran the command is inside the hashmap as a value
using #containsValue(obj)
Hello i got some problems, I use spigot under 1.16.5 for my plugin, i was using NMS all worked, and after a crash of the server due to a bad commandLine, my NPC for example don't work, my animated tab don't work, I don't remember had touch anything in intellij, did you know where does can this from ?
we use # to show that it is not a static method
because when you type in like Player.getName()
it looks like a static method but it is not
Player#getName() shows that it is a method for each individual object
but when you code you just use .
Hello,i'm making plugin for my server because i can't find any plugin that i want TextComponent name = new TextComponent("SERVER"); name.setColor(ChatColor.RED); name.setBold(true); TextComponent empty = new TextComponent("\n"); TextComponent welcome = new TextComponent("We wanna welcome you to our serve"); welcome.setColor(ChatColor.RED); welcome.setBold(true); TextComponent website = new TextComponent("WEBSITE "); website.setColor(ChatColor.GOLD); website.setBold(true); website.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder( "Click here").color(ChatColor.GOLD).create())); website.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://google.rs")); TextComponent store = new TextComponent("STORE "); store.setColor(ChatColor.YELLOW); store.setBold(true); store.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder( "Click here").color(ChatColor.GOLD).create())); store.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://google.rs/store")); TextComponent discord = new TextComponent("DISCORD"); discord.setColor(ChatColor.BLUE); discord.setBold(true); discord.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder( "Click here").color(ChatColor.GOLD).create())); discord.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://google.rs/discord")); player.spigot().sendMessage(name,empty, welcome,empty, website, store, discord); I wanna use this to be send in chat when player join and is work but problem is breakline
Can you explain me how to add breakline so First line
Second Line ...
some1 know why i getting this nullexcep and being kick when i send that packet, i commented out most of code, and it doing a null check, but it ended up not helping much
https://paste.md-5.net/ezegopoqoq.cs
so you mean player.spigot().sendmessage(messageone)
player.spigot().sendmessage(messagetwo)
Like this?
yea that works and last thing how to center it ?
oh I see thanks
I try to serealize an object, but I get this error the whole time:
https://paste.md-5.net/isizibecup.cs
My object:
https://paste.md-5.net/goyezomisi.java
My custom TypAdapter:
https://paste.md-5.net/falapasuta.java
You know this to be in center of chat
like other plugins do
But is there any options to be automatic you know
because i can change chat size in minecraft
and is not gonna be centered ?
Btw:I see that on internet that's why i aks
how many spaces should i use
one sec
Hello I make my personnel API and I look how to use my plugin API. So I implement my API in my gradle project (yes I use gralde ;D) I see I can use them: getServer().getServicesManager().getRegistration(RedisDatabase.class); to get a RegisteredServicePRovider<Object From My API> and if is not null I do rsp.getProvider(). Idk if it's a good solution. Now I want know if I need to compile my API in my Plugin ?
I want like this
U play with the space
If your compiling the plugin in, you dont use RSP, and even then you dont really need to use it
If your compiling it in, you initialize the entire lib yourself
ou okay ๐
And yea is possible to use minecraft color codes in java i mean i can just type &a for example
I don't need to import other packages or ?
If its a running plugin, have a static getter for the instance, and on the other plugin soft-depend on it, and check if its enabled
Centered chat is an illusion of sorts. There is no way to get the chat width of a user so everyone just uses the default chat width size to make centered chat messages. It has to be done with spaces
Ok so I can use for exemple Account object from my api without RSP & without compilation of the api in my plugin ?
ou okay
If your compiling it in, your going to be initializing it yourself
If the API is a running plugin, then youll need to get the instance yourself
You can still use objects and classes from your library both ways, just as long as theyre public access classes ofc
Use in your plugin ChatColor.[THE COLOR] it's better that use ยง6 or ยงsomethings
I personally reccomend ChatColor.translateAlternateChatCodes or whatever its name it
wait i don't get with that hahaha
and you can just use convert("&c hi");
the method returns a String
so you could
player.sendMessage(convert("&c hi"));
ofc ? My API it's a running plugin so np if I use my Account object without compiling my api in my plugin ?
You would just set its scope tocompileOnly in your gradle
and your set
it will let you use classes from your API, and compile it
but wont actually shade the files into your jar
instead, relying on the plugins instance on the server
OK I see
And yeah I get this with getServer().getPluginManager.getPlugin('name of my api plugin') ?
cant remember if that will return the actual plugin instance
I just have a static referance to be plugin for this type of thing eg
yea but where should i put it
I'm confused xD
And from there
PluginManager#isPluginEnabled("yourPlugin");
and then you can just call YourPluginMainClass.INSTANCE
and get the running instance from your plugin like that
can make it a getter if you like getters more
getInstance()
i typically just throw it in my main class
its a static method
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Because I have in my AsiluxAPI (main class of the API) an Instance of the server and I precise to my plugin to load after the API
I can use the INSTANCE variable ?
Yes the INSTANCE variables can be passed through out plugins like that
so you could just use AsiluxAPI.INSTANCE
and it gets the instance of your api
make getters for all your things youll need ofc
Ok I see
all good, if it was di 100%
so i just need to throw it in script and that's it ?
Yes, its relatively simple its just a String method
and this gonna work then
Yeah or I place in public static final variable
I mean i don't need to edit anything in my code instead jst add your code you send
the getters dont need to be static
only INSTANCE
ah the getter for another variable
eg BurchAPI.INSTANCE.getMyManagerHere()
like getEconomy
yes
youll need to pass strings you want through that method
so eg
okok np Thx bro I was lost ๐ญ
new TextComponent(convert("&c myString));
all good, it was confusing as my first time doing it too
And when i learned you can use a static instance like that through plugins i was kind of mind blown lmfao
ou so add convert at start like this TextComponent discord = new TextComponent(convert("DISCORD "));
At everyline and i can use color codes
yep, and it will automatically color any & symbols you have
that way you dont ever have to worry about them
ou okay
Its finally finished lets go
i like to make mean debug messages for myself
idk why
force of habit

dont we all do that
you're*
My debug messages are usually some dumb shit like
Paenis or FUCK
So y'know
I wonder when ill accidentally put a debug message on production
I get really happy when I see penises on my screen
- laughs in the n word as my test server name and debug messages *
its always selfies of me so i get happy if it reachs the debug message
or the message happens
and your 10x more confused
thats probably the scariest part
How to display server online member?
TextComponent welcome = new TextComponent(convert(" &cWe wanna welcome you to our serve "));
The count?
yes
hm,is there option to implement placeholder xD
And the get the size of that list
Is easier with that
Wdym
It's not hard at all
Just calling one method
I mean to add placeholder so i can use %server_tps% %server_online% you know...
How can i make a rank system like this in 1.8.8: https://www.google.com/search?q=minecraft+server+ranks+player&tbm=isch&ved=2ahUKEwi6itH8sL73AhXL4DgGHWJOAPwQ2-cCegQIABAA&oq=minecraft+server+ranks+player&gs_lcp=CgNpbWcQAzoECAAQQzoECAAQGDoECAAQHlDdBViyHWDgHmgEcAB4AIABvAGIAeMNkgEEMC4xMpgBAKABAaoBC2d3cy13aXotaW1nwAEB&sclient=img&ei=y4duYvr4K8vB4-EP4pyB4A8&bih=929&biw=1920&rlz=1C1RXMK_en-GBAU997AU997#imgrc=OM_CUTRPTduCCM&imgdii=sqGvMDjvP1sbJM
send this msg to all online player?
Shorten the link
Okay
Just add those in the string and then #replace()
ou okay
PlaceholderAPI is better
and you can add it into your convert method i gave you too
PlaceholderAPI.setPlaceholders(aPlayer, aString); after you import it
yes i want that xD
i,m watching video about that so basiclly i need to add api in pom.xml
๐
youd need to install the modules using /papi ecloud ofc but yes
How can i make a rank system like this in 1.8.8: https://shorturl.at/erzDK
also you can modify your convert() code to this, might want to check if PlaceholderAPI is enabled first ofc tho
yse xD
What that do xD
Ig just use LuckPerms as 1.8 isnt supporters
Supported
First argument is the text you want translated
Second argument is a nullable Player
if checks if player is null, if the player is not null apply PlaceholderAPI placeholder
Last string colors the string with & color codes
If you dont have a player
Whats LuckPerms?
you can just pass null
you could even make that convert() method more advanced
and remove placeholders that get left over (IE ones that dont get parsed)
It's hard to say, if you don't want to use third-party plugins, then you should do some coding
ou okay but i don't need to put these or ?
Because i,m not making public plugin i,m making is just for my self to dispaly welcome message xD
Its then you can just pass e.getPlayer() for your playerjoin event as the second Player argument
Placeholders from PlaceholderAPI need a player to parse against
if theres no player available, you cant parse (to my knowledge)
I Meant like how to code a rank system
not third party plugins
i forgot to mention that
have you read the whole spigot API about messages? if you were not, I recommend you do that before considering other solutions
yes
it depends on what kind of system you wanna make
Using LuckPermsAPI its simple asf, but from scratch oh god
How hard would it be to just make the rank show below/above the players name?
You would need packets so kinda hard for someone without java experience
cant i just use the scoreboard/team api
?
If you want to make plugins you cant sprint into it, you have to learn to walk first
no
actually, scoreboard API may can be used to do the same effect
oh
what now
okay nvm then
didnt even know scoreboards had that feature
always thought it was invis armor stands or editing player nametags through packets
Do i have to use the old version of the scoreboard api to make it work on 1.8.8
I used to try to do the same kind of plugin, so I did some research on it
@noble lanternsry for ping but i have problem i add part things that is needed to pom.xml
And String playername = PlaceHolderAPI.setPlaceHolders(player, "%player_name%");
this is not work because PlaceHolderAPI Is not imported but
import me.clip.placeholderapi.PlaceholderAPI;
clip is red
Is this API can't be used?
send your pom
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.1</version>
<scope>provided</scope>
</dependency>
</dependencies>```
Cannot resolve symbol 'setPrefix' i was using the scoreboard api before and when i did team.setPrefix(""); it sent me the Cannot Resolve Error
did you reload maven
i think not xD
because in video he don't reload it
how to reload it
u
i do that now
both work
then you should look into the source code to see if the name of the method was changed
but why is gray
because its unused
How?
if it don't have this method in this version, then using reflection to change field is in the consideration
are you using IntellJ IDEA?
yup
and last thing TextComponent welcome = new TextComponent(convert(" &cWe wanna --- you to our serve ")); i wanna use this string
if you do, then hold Ctrl then left click method or object to check it's source code
can i add like in javascript ${} or i need to do like 'we wanna' + playername 'to your ....'
oh k thank you
you could use String.format
How can you get every class inside the .jar of a plugin that is using your lib?
how long have you been code in java, if you never do, I recommend you to learn some basic skills of coding then back to plugin writing
so if message = "Hey %s welcome to %s";
it would print Hey playernamehere welcome to servernamehere
I have been coding in java for a few months
basic skills are very important, wish you good luck
๐ Thanks for all the help
?
hahahah
got you
its COMPLICATED asf
I believe that if I put the code in the lib it will just read its own
but i have a small written lib for it
I have done it before, just need to figure out if it will read the lib's classes or the plugin's classes
Any help?
is this ONLY searched for classes extending another class
but removing that is rather simple
?
you can just Object.getClass().getPackage()
So like
OtherPlugin.INSTANCE.getClass().getPackage()
and it gets that package
ou okay
typically where main class is is fine
good point
if you need more help on coding, you can just DM me, I can help you as soon as I am available
even better
๐ oh ok thank you very much
if someone wants to commit, just learn how to use it
i have to make my lib appeal to others
so far
i think it appeals nicely
https://github.com/Burchard36/BurchAPI/wiki even got javadocs and a wiki done
BurchAPI supremacy
those docs are only 50% of features of it too so far, lots of stuff is undocumented
obviously promoting your own project ๐คฃ
ofc
because its simple to use
I just put OmniLib every now and again in convos
it has some useful stuff, just gotta finnish it
neat
Big Brain Strategy
mentioning your own project in the dev channel atleast once a day
Lmao
typically because it has some useful things in it for plugin dev
@noble lanterncan you come dm ๐ please
still not showing up on my search engine but eventually it might 
after i add in the DataStore API docs and new sub commands for commands ill prolly release on spigot
I need to add MySQL support first preferably
package is a mess but meh
How can i read from a text file in the plugin folder?
gotta invoke it
?
configuration API
wym?
you need to invoke its constructor
i tried this
which version you are using
oh yeah
eg Class.getDeclaredConstructor().newInstance()
constructor may throw error if the only constructor that exists has an argument
1.18
try {
Scanner scanner = new Scanner(new File("tokens.txt"));
while (scanner.hasNext()) {
smellytoken = scanner.nextLine();
rosstoken = scanner.nextLine();
}
scanner.close();
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
it's not a config file
if you wanna use java.IO, you can use InputStreamReader
why do i need that?
Hi i have this code, but its sends the message 2 times and how can i get the Honeylevel of a beehive:
@EventHandler
public void onInteract(PlayerInteractEvent e){
Player p = e.getPlayer();
Block block = e.getClickedBlock();
if(p.hasPermission("basic.hivechecker")){
if(e.getAction().isRightClick()){
if(block != null){
if(block.getState() instanceof Beehive beehive){
int beeCount = beehive.getEntityCount();
int maxBees = beehive.getMaxEntities();
p.sendMessage("There are "+ beeCount +"/"+ maxBees + " Bees in the Hive!");
}
}
}
}
}
the issue is that it's not finding the file
have any exception msg?
can't find
which path you are using
ye lemme send a pastebin
Is the instanceof check not firing your problem?
try getBlockData() if thats your issue
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.
instead of getState
have you check your input path
like you are using absolute path
you didnt provide a player for the second argument
its convert(string, player)
or
ouu
ah no but the issue is
if you dont have a player you can make second argument null
you mean jut set null ?
it will be on a host and how will i know the absolute path then?
Yes but you have a player object, so just pass the player
cause on my pc it would be easy
don't use absolute path
no thats the physical argument of the method dont change that
you just pass your player variable as the second argument to convert()
convert("MyString", aPlayer);
yep, it gets passed as the second argument of that method
this is the full code, work
$YOURPLUGINOBJECT.getDataFolder(); to get plugin dir
i,m dumb now so much
I reccomend getting more acquitted with java, Player is the actual player object, while player is the variable you declared one line above
Guys I've a question for you that is a little bit strange... Do you think that I need/have to obfuscate a plugin code before sell it or not?
Because I don't want buyers to resell my plugin by only changing the pl description author's name
what do you think about?
that is not the problem, the problem is its send the messages 2 times.
i understand that i,m dumb i just gonna use that i use first ๐
I only use this plugin for welcome message
so is not important
ah i see i think
i think its an issue with the duel handed system
no, use this object to create another file object which located to your file
check if right click was on main hand
ah makes sense
so basically File file = this.getDataFolder()?
yes
right ok got that
then you can do like File textFile = new File(file,"/$YOURTEXTFILENAMEORPATH");
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.bukkit.Server.getPluginCommand(String)" is null
I keep getting this error after updating my plugin from 1.17 to 1.18.
My plugin.yml is fully configured.
main:
getServer().getPluginCommand("dcping").setExecutor(new dcping());
getServer().getPluginCommand("attractie").setExecutor(new attractie());
getServer().getPluginCommand("plugins").setExecutor(new plugin());
plugin.yml:
commands:
dcping:
description: Ping de plugin om te zien of er een connectie is.
usage: /<command>
permission-message: Je hebt geen permissies!
attractie:
description: announce dat een attractie open gaat.
usage: /<command> [warp] [attractie-naam]
permission-message: Je hebt geen permissies!
plugins:
description: Bekijk onze Plugins.
permission: dcr.plugin
permission-message: Je hebt geen permissies!
usage: /<command>
permissions:
dcr.plugin:
description: Permissie voor plugin lijst.
default: false
use getCommand()
^
okay thanks
:/
runtime registration supremecy
I mean using JavaPlugin::getCommand PluginCommand::setExecutor is technically happening during runtime as well
but ye
well
Ig it might be more flexible
only thing it really provides is allowing of dynamic commands during runtime
Hey, does anybdy know how to speed up the macros in IntelliJ?
no need to set in config.yml, thats really the only upside of it
plugin.yml?
yeah well you have annotation processors if thats what annoys you
but guess thats effort
What do you mean by intellij macros?
It supports registering without annotationgs too
google can be a good choice
new ApiCommand() and use BurchAPI.registerCommand("string", command);
well annotation processing allows you to generate the plugin yml
but
work
yaml config api
waaah
wait could you even edit a yaml resource inside a jar file
i would assume that would corrupt it somehow
@noble lantern have u any Idea to optimize my plug-in?
I can't find anything on internettt
i mean i do, but i dont wanna go thorugh 500 lines of code
if its a method sure throw it at me
wait why when in inteliij it writes directories as / but in console it outputs as \
Windows???
eg folder/file but in console it's folder\file
^
yeeee
That's why
is there a way to use mojang mappings with gradle?
oh right
I couldnt ever figure out a way to sadly
don't need to worry that, just use /
Windows is trying to be quirky
ye was just wondering
youd have to convert that maven plugin into gradle
and i dont think no ones done it yet
if you worry that would cause some mistake, you can just use File.separatorChar to replace / or \
why gradle?
thanks! but i think it's ok
i much rather prefer gradle just because somethings are easier
also i got it to work :D! ty for ur support
i do my main pluginon maven, but any plugins i make with it are done in gradle
ah
give intellij more ram
should be chillin
by default poor thing barely gets 1gb
Most besides plugins
intellij almost use all of my RAM
how i check if click was on main hand
i really love how easy external jar for dependencies is in gradle
yup gradle is awesome
if i did that in maven
it would take me many minutes and brain power typing the install command
for every jar
indeed
uhmmm
but why isnt it possible to remap the jar using gradle
it is
listen to the events
but how
^ you just have to convert the plugin
well if you wanna map with mojang mappings there's paperweight userdev
gradle plugin
Didn't change anything unfortunately. Default is 2GB, changing to 16 didn't work
likely some cpu issue or something with intellij
i never used intellij macros tbf
if i record something i use OBS
OBS is good for better gpus
if u have an awesome cpu but not a really good gpu
u can use bandicam
that might seem like a weird option
but its viable
but how?
if(e.getHand().name().equals("MAIN_HAND"))
dont work
OBS has an option for software encoding for cpus
hardware encoding for gpus
or visa versa, cant remember
then I have no idea
event.getHand() == HAND
its work thanks
Can you explain me why this don't work https://pastebin.com/hG10m8dg
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.
member don't recieve message
you may be sending the message before they can see them
doesn't seem like you annotated it with @eventhandler
ou how to fix that
delay by a couple ticks
Bukkit scheduler
its likely what illusion said
i dont see a eventhandler annotation
you send send message to a player on theyre join event, no need to delay it
you have to put @ EventHandler above the method
yes i do that
and register them to your plugin manager
hm sec
here you are https://pastebin.com/rq2Mg7LB
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.
i think everythign i set
Anyone know any good/easy ways to make cool particles in 1.18?
its not
I know it requires trig and stuff, but I just want to know if there are any other ways to do it potentially
regardless of version, a lot of trigonometry
what i missed
you need to call this.getServer().getPluginManager().registerEvents(Listener, Plugin)
in your onEnable
you could yoink code from open source stuff too
for Listener you can probably use 'this' when registering the listener, as long as it isnt in a different class than the onEnable
i fixed tnx
np ๐
how to display this "[<count>]" text for my own command?
you would just use the TabCompletor to show that text
Use Mojang Brigadier somehow
It's a brigadier thing yeah
Guys i first thing i fixed it but is not
you could use the tabcompleter but it would have the side effect of being able to tab complete the count text
its the instance of your listener
not a new Listener
eg this because your Listener is your main class
yes
does switch(null) err or fall to default:
falls to default
or null if you have an argument for it (if thats a thing cant remember)
you can just nullcheck before tbf
i dont like ide warnings
null check almost everything i can xd
switch(cfgSection.getString("target","compass"))
is that faster or slower than if you leave out the default value
which i dont
speed is not noticable, its just editing values in ram doing that
would take .00000001ms to execute that (exageration)
Bukkit.getPluginManager().registerEvents(new Listener() , this)
?
I get
same issue other guy
send code
use this not new Listener() (if your listener is your main class)
worlds can't have the same name correct? So World#getName is a unique identifier?
also is it faster to call equals on getWorld or on getWorld.getName()
ur class aint a listener yet
is the Listener in the main class?
can but doesnt need to be
if your plugin isonly that listener you should have it there
Depends, you can make it another class which is what you normally should do
otherwise no
Instead of the first this use the instance of your JoinMessage class
i fixed i think
His listener is not in the main class though from what I understand
he removed implements Listener for some reason
he had it there earlier
his events in his main class
worlds can't have the same name correct? So World#getName is a unique identifier, and, if yes, is it faster to call equals on getWorld or on getWorld.getName()
i prefer comparing worlds by UUID
but name checks are fine
yeah you can just compare name/uuid
i prefer UUID for simplicity and also the fact it doesn't change
oh good idea
also
is if(a){if(b){}} slower than if(a&&b){} ?
it would be more readable in the first format
speed is the same, but && for better readability
u sure? if(effectSection.getBoolean("dimension_restricted",true)&&targetLocation.getWorld().getName().equals(lodeLocation.getWorld().getName()))
yes its also good for null checks
if (thing != null && thing.get() = Thing.That) {}
the above code only gets called if lode exists and sets the target location to lode if it doesnt exist
so null check isnt necessary here
*the code above that
tbf i really wouldnt worry about performance for simple if statements
its more or less for others readbability
its easier to read a block than a stairway of hell
idk it seems more readable to do it in steps here
if () {
if () {
if () {
if() {
}
}
}
}
stuff like thats normally rly hard to maintain and read
AHJDFSD
i always fucking think that when i see code like that













thats code only a mother could love
lies
that mother would abandon that code on a doorstep
and then the owner of that house would abandon that code again
well my code atm looks a lot like this
if(a){ //use condition?
if(!b){ //condition
//cancel
}
}
just combine em into one boolean variable
and if (variable)
boolean bool = a && !b;
if (bool)
I said only a mother could love that, not that the mother had to ๐
that way you actually know what the boolean does a week from now as well
keeping that in mind for the next time I have to use stuff like that
since its named
again that'd look like this
if(effectSection.getBoolean("dimension_restricted",true)&&targetLocation.getWorld().getName().equals(lodeLocation.getWorld().getName()))
instead of like this
if(effectSection.getBoolean("dimension_restricted",true)){
if(! targetLocation.getWorld().getName().equals(lodeLocation.getWorld().getName())){
//cancel
}
}
i use it when i get some whacky 4 booleans in one if statement bullshit
welp, back to refactoring
&& is more readble also i normally press enter after &&
eg like this
makes things more readable instead of everything on one line
zack the menace

in all honesty though moterius
do what fits your style
just no street fighter/stairway codes
welp you might be able to avoid staircases if you write code yourself
but not if you work in programming
wym?
exact reason why i dont use more than 2ifs, i always fuck up my brackets and end up with 400 compilation errors lmfao
jave code has the annoying ability to very quickly have far too many args and checks
I try to keep my classes smol so I dont crash my IDE creating errors while moving brackets
also it irritates me to no end that that gif above is low res
i can see that its if statements but i cant fucking read them
my largest class in this project is 290 lines xD
thats really small, depending on the size of the project
My classes frequently go over 1k lines, sometimes even 2k
howd you scan that
considering what this proeject does, im suprised the entire thing isnt 5k lines
jesus
OOP-ify that shit
I prefer performance over useless OOP
I'm also interested. which plugin or function did you use?
performance is negligable
Statistic plugin
The whole reason I wrote my own remapper is because tiny-remapper is slow AF. I highly prefer 200ms of runtime over 5s
well you didnt mention those classes were reamppers before lmao
The fact that it is monolithic is just a side-effect.
thought it was like the 1k line long event handler
seriously? people code in asm still?
yeah util classes get long asf sometimes
my longest class in that screenshot is actually a util class
youre either a hacker or work on some really weird os
OW2 ASM
In java space ASM is almost always OW2 ASM
Just make your own asm ez
Or just java bytecode in general
i cant stand 20mb dependencies
i legit learned a bunch new shit just to get rid of Reflections 1mb file size
uh wheres the marketplace again
One of the many reasons I do not like Databases
yeah database libs are a killer for jar size
cant wait till i add mongodb and mysql support for this lib
15mb jarfile when
its more or less on the users end for file size
if you use an api thats 15mb in size but it only does a few things it just looks fishy
oh xd
Anyways, does anyone know the correct syntax for List<? extends Enum<?> implements MyInterface> or something like that?
that is if it exists
extends works for both implemented and extended classes
Whatever, I need to chain two conditions
so just look for a List<? extends MyInterface>
or check for first enum first then MyInterface
Yes, but it also needs to extend the enum
you can chain with &
Enum & MyInterface
naw
Yeah
your lying
Nope
imma check
I thought it was with a comma but & also makes sense
The Eclipse compiler does not seem to like it
The comma would define the second parameter
But let's see how javac reacts to it
generic types are intersectionable, not wildcards tho
<T extends BaseClass & Interface> works whils <? extends BaseClass & Interface> wouldnt
gonna have to define a generic type in the method declaration or so
or an entire generic class to handle those methods
aw
ye type erasure at its finest
Oh didn't know it doesn't work with wildcards

not inside the <>, right?
Yeah I guess I'd need to create a sperate class to make this intersection possible
wait did you post this in this server?
think of the children though
why can i swear perfectly fine though
Let's wait until programming languages are added to it
im not old im barely 21 yet
honestly if a child is coding they know what they're getting themselves into
LMAO
16 lmao
No, not at all
thanks now i feel old
i meant the language
the "R slur" is purely a subjective concept :p
99% of underage beginner people on here do not know what they are getting into
well the real question is how they decide that
dumfuck
i had the exact same thought maow
well the N word has no like, non-slur parallel
There most certainly is?
every other synonym is also treated as strongly as the N word
begins enumerating the biological names of species that contain the N word
Well my point is there's no way to discriminate against black people specifically with kindergarten-level insults
That's not my point though?
Like sure you have the Latin word for black
Or the country Niger
But they don't fucking count bc they're literally harmless
And why do you have to be so ad hominem too?
I didn't talk shit about you so why do you have to strut in and be all
"Are you dumb?"
Like
dumโbfuck
Chill the fuck out, dude.
heyo any ideas on how I would make a 60 second countdown on a scoreboard?
runTaskTimer() would be a good start
if you run it every second you could update the timer every time it runs
effectSection.getInt("maximumRange",256) * effectSection.getInt("maximumRange",256) or
Math.pow(effectSection.getInt("maximumRange",256),2)?
config.setup();
config.get().addDefault("Version", "1.0.0");
config.get().addDefault("Message:", "- ");
config.get().options().copyDefaults(true);
config.save();```
Can you explain me,i'm wanna make config file so i don't need anytime to debug plugin,just to reload plugin to server.So i wanna make config where messages are.
How to add Multiple messages you know like
```messages:
- 'HI', 'Click me', 'https://google.rs'
- 'Second messages'```
So i can add infinity messages? with hover support and click event,so if i don't set like in first line is just default
I'd generally use a library such as Minimessage there
Although I never used it myself, I always used MineDown there
if i check a block in a not-generated chunk, what happens? Does it
a) return the block that would generate there
b) a, but saves the chunk
c) fail
?
a is unlikely to occur, b is likely to occur, c could occur
is there some way to check if that chunk has been generated yet? I could only find isLoaded in the docs
?jd-s
hehe
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#isChunkGenerated(int,int) you really gotta improve your search skills
declaration: package: org.bukkit, interface: World
to be fair i try to find it myself before asking for help
how i can get server player online of an other server?
that was just isGenerated(coordX<<4,coordZ<<4) right?
2^4 should be 16
wait does << divide or multiply by 2^n ?
i see that you answered my forming question by correcting yourself
I do not know how often I mix up left and right
it is thanks
Either way, it's in the direction the arrows are pointing to
Beware that there is a difference between the arithmetic shift right and the logical shift right
was the arithemic and >>> logic correct?
I'd assume so
rip maow :(
oh did he get banned maybe
There is no way to discriminate against black people in a nice way, it'll be racism eitherway
I dont see why he was called wrong
@ancient plank
Can you check if Maow is banned
is there any way to code spigot plugins in py?
yea dont
gross
yeah itโs not possible
You will receive absolutely 0 support
