#help-development
1 messages Β· Page 2095 of 1
Entity#getVehicle
database?
because it is a vehicle
good point
think i found a solution with hashmaps, thanks though
doesnt it reset on restart tho?
Im using eclipse and I never did this before. What do I have to do?
π are you not using maven or gradle ?
yo someone
I have no need for that.
Well, you clearly have a need for it rn xD
IDE building generally is pretty scuffed
on top of that so few people use it that barely anyone has an idea what/how to even configure it
I used to do IDE building and then I switched to maven can't ever go back it's so much better
Your plugin.yml is probably not on resources path
Add it or switch to maven which makes things 100 time easier
I added it now and Ima check it out. Thanks for your help. I really appreciate it.
it is
you are just overriding it with the old one
how do i check if a chest has a sign with specific writing on it?
Well, get the chest, iterate over its neighbour blocks
check each block if it is a sign
etc
and then check the nbt data?
no
I mean, there is A Sign interface
what to do
just cast the block data to a signblock
BlockState
ok, thanks!
sorry don't remember the names
its not that hard to figure out
lol xD just instanceOf the block state first
you are SAVING then RELOADING
and do a material check first too
why no
block states are a little expensive
no need
k I will reload first then save π
why
why do you need to save
what do you need to save
what is not working
it is not saving the things in config
after I make changes
but the message comes, reload success
yes
Is the damage you receive from a fireball explosion considered DamageCause.BLOCK_EXPLOSION?
chest.getInventory().contains(Material.RAW_GOLD, 25);
How would I check if there was 25 or more raw gold?
Set passenger after armor stand teleported
Guys, can someone help me, I have been testing with the blockBreakEvent event and I have a problem, how do I cancel the drop?
I tried with event.setDropItems(false)
But it kept dropping
What are you breaking
Blocks
Any block?
Yes
I want to make them not drop things
But I also want to get the drop
I'm making an economy discord bot and I want to know, for example, what items the ore would drop
Like Gold_ingot (x10)
But without dropping it
try event.getBlock().getDrops().clear();
You probably want https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockDropItemEvent.html
declaration: package: org.bukkit.event.block, class: BlockDropItemEvent
Hoping someone can help me with regex
?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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
But
If I cancel the block drop
The other will not be executed
Right?
the other?
Ok thanks
the one who said olive
This
in block break event not block drop
ah
I was trying to get the drops without canceling the drop and it doesn't work for me either lol
Like COBBLESTONE (x10)
16.04 14:52:11 [Multicraft] Auto-saving world...
16.04 15:02:15 [Multicraft] Auto-saving world...
16.04 15:12:18 [Multicraft] Auto-saving world...
16.04 15:22:21 [Multicraft] Auto-saving world...
16.04 15:32:25 [Multicraft] Auto-saving world...
16.04 15:42:28 [Multicraft] Auto-saving world...
16.04 15:52:31 [Multicraft] Auto-saving world...
For whatever reason my server console is only this message repeated, no errors visible, and when I reload the game nothing changes. The messages aren't even updating. Any help?
There isnt supposed to be an error?
I know, but when a player leaves the game, joins, or anything happens, it should say so
oh nothing else happens?
yeah
right :/
I'm restarting my server now
probably should have tried that before asking here though
Nah dw, asking is always welcome
π
like they say, the only dumb question is the one asked after the test
true that
Anyone got feedback for this?
whaaaaaat
i restarted my server, spawned in an entierley different world with no items, and the console is still "Auto-saving world..."
wait is just suddenly went back to normal
wtf
this error looks very famillar, does it have something to do with incorrect versions?
16.04 16:10:53 [Server] INFO org.bukkit.event.EventException: null
16.04 16:10:53 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
although the colors are coming, why do those unicode letters come too?
i don't have any unicode in my code that resembles that other than the color code character
Check how your file is saved. Make sure it's with UTF-8 encoding.
how do i do that on vscode again
how to get the blocks between 2 boundingboxes spigot
I don't use vscode, so I wouldn't know. π
so 15x15x15
just checked it is utf8
could it have anything to do with maven package or something?
Maybe. I'm pretty sure there could be encoding settings in there as well.
Here's what I have for my projects.
<properties>
<revision>2.0.42-DEV</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
what's compiler source and target
oh
?paste
I'm currently trying to paste a schematic into the world using WorldEditAPI (No this is not a skyblockplugin) https://paste.md-5.net/cetonufopo.java
However, I'm getting a "Not in GZIP format" this specific error happens on line 9 in this, the File exists as it's not an NPE error and the file exists on the server
The schematic I'm trying to paste is a .schem created from the server, I'm not sure if thats the issue here?
how can i (without the effect) give like 10% more strength to a player with spigot?
You can use the Attribute API
how would i use that?
events
or attributes yeah
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html
Then use Player#getAttribute(thatClassAbove) and then use the set method
for 1.8.8*
events then
π
how
like heres the code
for (Player player : Bukkit.getOnlinePlayers()) {
if(getSoul(player) == Soul.GREEN){
//here, give him 10% more resistance
}
}
we aren't here to spoonfeed you
ik but u just said "use events"
you already use enums and such
I wonder what event fires when an entity takes damage
thats the only way to do it?
why do you use 20 spaces for indent
yes
i see thx i didnt thought of doing it this way !
mind telling me the reason you use 1.8 api π ?
because he likes peeveepee
only 7% of servers use it now-a days too :p
nah its because a server asked me for a plugin and they are in 1.8.8
1.5.2
1.1 do be poppin'
na zoomer
beta 1.0? smh
we use 1.4.6 these days
meanwhile me: The fucks a gzip format
wdym yall
so would this work
@EventHandler
public void onPlayerDamage(EntityDamageEvent event){
Player player = (Player) event.getEntity();
if (getSoul(player) == Soul.VERTE){
player.setLastDamage(2);
}
}
ive seen people payin thousands for skripts
nope
gotta be trolling
i dont need to
How can make it so I can manually edit my config and then just reload it instead of stopping my server, editing the config, then restarting? Using .save() seems to reset it if I try to use it
https://paste.md-5.net/mebofemeze.java
does anyone know why the fireballs are deflecting the player
cuz only players get a green soul not entity
Oh ok
petition to make help development verified users only
thanks
IE they just bounce off the player entity?
no they avoid the player
check the last fireballs on the video
?
I might've inverted the entire vector tho
Maybe because you're using the eye location, it deflects to your eye location instead of player location?
thats what i looks like, or the player positions gets updated while the fireball is fired and it is trying to use your old location
bro if i did smth wrong, not my falt
and yeah eye location uses the block the player looking at (iirc)
thats why i m asking
?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.
eyelocation is basically getLocation + getHeight
I'm not calling eyeLocation.getDirection so it shouldn't really shoot wherever I'm looking at
The last fireball does kind of look like its going directly to where you crosshair is
like it started going torwards you then did a U-turn
that's becuase I'm looking at it
Doesn't eyeLocation return the location you're looking at?
Not your physical eye location
^
getLocation is ur feet
it's kinda intuitive
seems like a spigot bug
or vanilla
Is anyone interested in becoming a co-owner with me for my mc server? Its been pretty lonely tbh
LOL
Skeleton cannot be cast to player
because you're trying to cast a skeleton to a player
.-.
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.
π
lmao ok the fireballs are going in the direction the cow looks at
Is anyone interested in becoming a co-owner with me for my mc server? Its been pretty lonely tbh
Man get outta here
This is a development channel
And you're just reposting your shit because nobody's interested
Go somewhere else
Anyone know why this would be throwing that error? Does WorldEditAPI not allow pasting .schem files?
Β―_(γ)_/Β―
.schem is for fastasyncworldedit
Yeah thats the imported library i have in my pom right now + installed on my server
but it just gives the not a GZIP format error in console
probably because your schematic is not that valid
it is, im able to paste it in the plugin itself just fine
fawe has no issue loading it from its own plugin
but when loading it via API it just say no, no gzip i cannot load for you > : (
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
public class TutorialCommands implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
if (!(sender instanceof Player)) { return true; }
Player player = (Player) sender;
ItemStack opium = new ItemStack(Material.POPPY);
//meta
ItemMeta opiumMeta = opium.getItemMeta();
//name
opiumMeta.setDisplayName(ChatColor.BLACK + "Raw Opium");
//lore
ArrayList<String> lore = new ArrayList<String>();
lore.add("Highly Illegal");
lore.add("Do not Consume!");
opiumMeta.setLore(lore);
//enchantment
opiumMeta.addEnchant(Enchantment.DURABILITY, 10, true);
//set the meta
opium.setItemMeta(opiumMeta);
//opium
if (cmd.getName().equalsIgnoreCase("opium")) {
player.getInventory().addItem(opium);
}
if (cmd.getName().equalsIgnoreCase("feed")) {
player.setFoodLevel(20);
}
return true;
}
}
Whenever I use /opium there is just something in chat that says /opium and there is no errors in console
Update: changed code to a different loading/pasting format but, same error: https://paste.md-5.net/ujipugepiq.java
Whats your usage in the plugin.yml for this command
./<command>
typically you dont really need that field set, if you have it set
also checking the command name isnt needed either, since that class is registered directly to the command name
idk what that means, sorry I am new to java
should I get rid of usages?
works in my case
How to set up permission that normal people cannot see/acces that command
Where file?
@quaint mantle could you help me pls
what u wanna do
that save method just saves as a .schem right?
If so ill try with your world getter maybe thats the root cause of this issue
Didnt find it
So uh
i wanna make a border type of system
but each time the border gets smaller
the blocks outside the border fall
is that possible
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
public class TutorialCommands implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
if (!(sender instanceof Player)) { return true; }
Player player = (Player) sender;
ItemStack opium = new ItemStack(Material.POPPY);
//meta
ItemMeta opiumMeta = opium.getItemMeta();
//name
opiumMeta.setDisplayName(ChatColor.BLACK + "Raw Opium");
//lore
ArrayList<String> lore = new ArrayList<String>();
lore.add("Highly Illegal");
lore.add("Do not Consume!");
opiumMeta.setLore(lore);
//enchantment
opiumMeta.addEnchant(Enchantment.DURABILITY, 10, true);
//set the meta
opium.setItemMeta(opiumMeta);
//opium
if (cmd.getName().equalsIgnoreCase("opium")) {
player.getInventory().addItem(opium);
}
if (cmd.getName().equalsIgnoreCase("feed")) {
player.setFoodLevel(20);
}
return true;
}
}
Whenever I use /opium there is just something in chat that says /opium and there is no errors in console
How do I refresh the tab player list?
/tab reload
maybe but youd have a assloads of lag from deleting all those blocks
how can I make it so multiple pathfindergoals tick together π€
because if one ticks, then the following ones won't
What do you mean?
How can I loop through every configurationSection and get it's name?
example:
Dirt:
inv:
Stone:
inv:
Water:
inv:
return should be Dirt, Stone, Water
getKeys(false)
thanks
Does anyone know how to install LunarClient API and lunars BukkitAPI-NetHandler into my Java plugin so I may register their API for my server? https://github.com/LunarClient/BukkitAPI and https://github.com/LunarClient/BukkitAPI-NetHandler
Can someone help me with metadata and commands
They leave no instructions on their BukkitAPI page or their github on how to install it.
What do you need?
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
public class TutorialCommands implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
if (!(sender instanceof Player)) { return true; }
Player player = (Player) sender;
ItemStack opium = new ItemStack(Material.POPPY);
//meta
ItemMeta opiumMeta = opium.getItemMeta();
//name
opiumMeta.setDisplayName(ChatColor.BLACK + "Raw Opium");
//lore
ArrayList<String> lore = new ArrayList<String>();
lore.add("Highly Illegal");
lore.add("Do not Consume!");
opiumMeta.setLore(lore);
//enchantment
opiumMeta.addEnchant(Enchantment.DURABILITY, 10, true);
//set the meta
opium.setItemMeta(opiumMeta);
//opium
if (cmd.getName().equalsIgnoreCase("opium")) {
player.getInventory().addItem(opium);
}
if (cmd.getName().equalsIgnoreCase("feed")) {
player.setFoodLevel(20);
}
return true;
}
}
Whenever I use /opium it just says /opium in chat
what does return mean
either way I dont get the item
Um true doesn't print out anything
I mixed them around
False prints out the usage message
lol
I don't belive this will fix it but I suggest doing all the item related stuff in the
if (cmd.getName().equalsIgnoreCase("opium")) {
So the server won't do it for nothing every time a player tries to execute a command
Also, try player.updateInventory();
what does this mean?
After you add the item here : player.getInventory().addItem(opium);
Try adding player.getInventory().updateInventory();
Forgot the getInventory() part
what does that do
Returning true, means the instance of the command was ran and has worked successfully. His issue was that he didn't register "opium", his class was only being executed from /feed, so it was never reading /opium also he never indented, which makes it not work.
Updates the player inventory
This is actually so stupid why is FaweAPI so damn broken: https://paste.md-5.net/hagacaqiya.java (Ignore unused argument, its how i get the file but for testing I manually set the file myself)
No matter what I do, even manually setting the file myself, its always the same bullshit error: https://paste.md-5.net/ewicujaqop.md
@noble lantern Hey I have a question, you know how to use API's correct?
how do i make a timer that i can access from everywhere and can reset
Yes why?
Whats your end goal?
check if player is in combat
I just swapped to Java about a week ago from python, haven't worked much with API's in java yet, so can you help me install LunarClient BukkitAPI and LunarClient BukkitAPI-NetHandler?
hello
i have problem with plugin compiling from sources
src - https://github.com/TheComputerGeek2/MagicSpells/tree/3.6
that link i can download by hands without errors
as these API's have no instructions to install them, from github or their bukkit webpage.
You would need to have a BukkitRunnable running with a HashMap of UUID, and the time they last took damage from
Calculate current time from last time they were in combat, and if the time is = time that you have set for combat time-out remove them from that map
You can just have a CombatTimer class that handles this
k
Dont know anything about Lunar API
better off asking in theyre discord idk what your really trying to do
Well, I'm trying to use their api so whenever theirs a KOTH on my server, I can set a serverside waypoint automatically that cant be removed for lunar client users.
im trying to not do pyramid method but how would i make it so i wont need to use else for checking if arg[0] is something
if (args[1].equalsIgnoreCase("create")) {
if (!(sender instanceof Player)) {
try {
throw new IllegalAccessException("Only players can use this command");
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return false;
}
Player p = (Player) sender;
if (args.length != 3) {
p.sendMessage(Colors.tr("&7[&a+&7] Usage: /uk kit create <name>"));
return false;
}```
you check if the command.equalsIgnoreCase("whatever here")
not the args[0]
but I mean you can
but its all the same command i have mutliple options for args[0]
but its easier to check what command they sent
wouldnt using a switch & case work with args?
yes it would, I tried it last time
but the issue was
args[0] - however many args was not found for me for some reason
args[0] never worked?
args[1] did?
I had to check the command and see if it equaled whatever they sent
Yeah, I'm still new to bukkit library so I'm sure theirs a way to use the args parameter, still not sure how as of right now.
https://gyazo.com/ad44ced4833752e5ea32a68f50084143 example of where I used it
InventoryOpenEvent cannot be triggered asynchronously from another thread.
I got this error when wanting to open a inventory from SlashCommandInteractionEvent from JDA but I'm not quite sure how to fix this. Could someone perhaps help me?
Player player = Bukkit.getPlayer(UUID.fromString(config.getString("players.discordids." + member.getId())));
if (player == null) {
EmbedBuilder embed = new EmbedBuilder()
.setAuthor(
"Please join the minecraft server to verify yourself!",
null,
member.getAvatarUrl()
)
.setColor(new Color(255,165,0));
event.replyEmbeds(embed.build()).setEphemeral(true).queue();
return;
}
player.openInventory(inventory);
well, when you open your inventory, there's two events happening
Meaning you cant run an event asyncronously
when you run the same event at the same time
it creates multiple threads
that's why it's saying InventoryOpenEvent cannot be triggered asynchronously from another thread.
I'm currently working on a plugin that handles bans and when the player tries to join I kick them
But whenever he tries to join he shows up in the tab playerList
How do I fix this?
are you by any chance using schems in your resources folder?
ah so is this fixable?
Yeah
handle the kicking before the joining happens
Nope im saving the resource from the jar into my plugins data folder
Thanks for explaining the error to me btw. :D
Yes, where do you use your other event for opening your inventory?
How do I do that?
No problem, here to help.
oh you just made 1 command for EVERY command in your plugin
then i know your issue
binary files can get corrupted if you use maven because it looks for placeholders like ${project.version}
Oh, I will try that thanks!
theres a way to disable filtering but i gotta look it up, sec
No idea. I'm just opening an inventory to a player that was created 2 lines above it.
oh my god that actually makes sense
because i knows schems have that variable in them
you have this in ur pom probably
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
yes, however, I had to register the commands MULTIPLE times. I think i'm going to make a CommandBase/CommandHandler Constructor later, so I never have to register a command again.
Will do
Yes i do
make that
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/binary-resources</directory>
<filtering>false</filtering>
</resource>
</resources>
and move your schems to src/main/binary-resources
I wanna to use the DeluxeMenus plugin to make a book in the menu, I can read this book in the menu when the menu is opened, can anyone help me?
And this would still work when using the saveResource method spigot provides?
Odd, make sure that your openinventoryevent, has all the code inside of it, rather than having multiple lines of code that access the same operation at the same time, make sure to put them all in one block where it accesses at the same time. Instead of using multiple threads, if that makes sense.
it uses ClassLoader#getResource and fileoutputstreams so i would assume yes
Okay sounds good let me test
?paste
https://paste.md-5.net/jedofawuje.rb
This is the inventory i'm trying to open.
.
Okay so I see what what you're doing
Sadly this error still persists :/
let me repush my commits to github
" open a inventory from SlashCommandInteractionEvent from JDA"
how do you make a listener that listens if an entity hits an area
Is there any way i can get the player's ip from the PlayerLoginEvent?
can u send repo
like if you made a box like worldedit it would check the area
sec pushing
it would help if you could show the entire class this is being used in @proper pawn, because this just looks like two seperate instances to me
ik gitignore is fuck ignore for now xD
It returns null
what code are you using the extract the schematics from the jar?
Im just using saveResource
interesting never heard of that before
and if youre using the intellij mcdev plugin you can download the files from the plugin datafolder and try to open them; if it doesnt work then theyre corrupted
hey that's pretty cool I never knew about that
here let my try to use the schem file my plugin generates and see if fawe lets me paste it
interesting
wonder how its getting corrupted (circled is the one generated from my plugin)
https://paste.md-5.net/ixexozanir.cs
Like this?
i left some thing away because the whole thing is really long
how many times do you register your command in your main class as well? @proper pawn make sure you aren't registering the event twice
I don't think getResource() works with binary files
well im saving the resource from my plugin using saveResource, i dont get the InputStream
i save it to a File and then use the File class to get it
that doesn't mean it works with binary files....
I don't have the source to look at how saveResource() is implemented
sec i can grab it
but that is the only thing I can think of how it could get corrupted other then maven not putting in the jar properly
so, the alternative is to create the code necessary to pull the file out
private void RegisterAllJDAEvents() {
jda.addEventListener(new LoginSystem());
}
private void RegisterAllEvents() {
Bukkit.getPluginManager().registerEvents(new LoginSystem(), this);
}
Looks fine to me
?namingconventions
I'll try, thank you.
@undone axle bad
?conventions
Java Coding Conventions: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html
oH
plugin - the reference to the plugin scheduling task
Sorry, I'm not quite sure what this means. Could you help me?
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
I guess i could try to use my own saveResource method i made in the past and see if it works: https://github.com/CloudLiteMC/CloudliteCoreLoader/blob/206bf59e2dc963d160d889e95da3425a82c4ecd0/src/main/java/net/cloudlite/core/api/addon/Addon.java#L99
its usually best to not look at the api and instead look at the implementation of the code
there is more to it than just that
well anything i see online that saves binaries from a jar file all use similar code that I linked from spigot's source code
hey, im making a plugin that generates that includes dropping heads on death. But i want to make specifically the skulls this plugin drop not placeable in the world, us this possible and how?
could try using ZipInputStream
@flat olive and @last temple Thank you so much for helping!!!
how do you make a plugin like world edit where you can select a region?
You make a plugin like WorldEdit where you can select a region
This did @last temple
Bukkit.getScheduler().runTask(....
db nicee
mans recognized the MUI hair hell yeah
Aren't you not supposed to use Commons in plugins without importing it yourself cuz Minecraft no longer uses it?
Its provided by spigot suprisingly, and at this point i could care less
ill likely just rip that method from commons.io myself at a later date
does it work now?
yey
yeah I just get StackOverFlow errors now but its likely to my recursive Location getter
lessgoo
hi guys, i just want to disable evokers dropping undying totems on death, which events should i look into?
recursiveness go brrrrrt
EntityDeathEvent ?
recursion = error/bug factory
yep
^
its a lot better than some weird ass GZip error π
at least i know wtf is happening now
π
Trying to use color codes in console go brr
:((
for some reason windows doesnt like color codes
works on unix systems though
Use Bukkit.getConsoleSender().sendmessage with color codes to.make it work
true im just using the normal Java logger but thats for a later date
logger class is easy to change
does anyone know how to keep track of a custon enchanted poppy (placed) bukkit
for that youll need to save locations of the poppy to a file/database
I didn't know this existed, damn. Thanks!!
I tested it, and it works fine on latest Spigot
Does this "libraries" in the plugin.yml work down to Spigot 1.8.8? Bcuz that's what my plugin supports 1.8.8 - latest
If its a MySQL lib like the one you said yes it will work down to that version, provided the version of java that lib is java 1.8
POV: stackoverflow errors
No
1.17+
Is there a plugin that can set costs for certain commands?
i cant be bothered to code one rn
if there isnt i'll have to i guess
How do I get the NMS class WorldServer?
I asked earlier so sorry but i would be grateful if anyone could help me.
Im making a plugin that generates that includes dropping heads on death. But i want to make specifically the skulls this plugin drop not placeable in the world, us this possible and how?
create a event listener, and check to see if the player is placing a head, if so, cancel it
(that would also remove things like creeper and skeleton heads, so you would have to do some sort of differentiating)
yea, but i need it to check if its a specific head because I still wanna be able to place some head skulls out. Is there any way to check for like lore or something?
@wet breach finally got them generating correctly π
you could set a specific lore, and check for that.
i'll try that. Otherwise i come back
there's a forge mod blocker, what about a fabric mod blocker?
Wait so is @noble lantern incorrect then? :
If its a MySQL lib like the one you said yes it will work down to that version, provided the version of java that lib is java 1.8
look at what oliver said here
im not entirely caught up in that whole conversation
i just saw a mysql lib
I dont know the exact syntax, but there are some good tutorials on the internet to insert/update data into a MySQL data
mysql is independent of spigot
How do you uninstall intellij completly (repos ,system path, etc) because im having maven issue and i will reinstall it from 0
?paste
For sending long codes or stractrace use paste md5
oh woops
And then delete the msg . Thanks
So do I just paste in the link?
yes
Yeah its correct
I just let you know because sometimes the chat get full of long code and its diff to help and to read the chat
ohh
Alright, well when I tried out the command to spawn the zombies in, it didn't actually work, it just told me that there was an internal error with the command
Is it possible to get name from handshake packet?
Hi guys i just tried to start my old server but server stop itself who can help me ?
#help-server -the correct channel
oh sorry thx
Just confused how spigot is getting the name
That its not on spigot, its on minecraft server
If im not wrong that part its managed there
nvm it's on minecraft, package net.minecraft.server.v1_8_R3;
Oh ok
sry
No problem
And for reading the data you can use a Socket input stream and then parse the data
is there a way to spawn a particle with no motion?
I just realized it's actually modified by Spigot, If you wish to use IP forwarding, please enable it in your BungeeCord config as well!
LunarClientAPI.getInstance().sendPacket(player, new LCPacketTitle(player, "Message", 3000, 1000, 1000));
// I have an issue, where it says "player" what would go there? I don't know what String type would be // used:
// Following details on what the lunarAPI shows:
public LCPacketTitle(String type, String message, long displayTimeMs, long fadeInTimeMs, long fadeOutTimeMs) {
this(type, message, 1F, displayTimeMs, fadeInTimeMs, fadeOutTimeMs);
}
public LCPacketTitle(String type, String message, float scale, long displayTimeMs, long fadeInTimeMs, long fadeOutTimeMs) {
this.type = type;
this.message = message;
this.scale = scale;
this.displayTimeMs = displayTimeMs;
this.fadeInTimeMs = fadeInTimeMs;
this.fadeOutTimeMs = fadeOutTimeMs;
}
What the issue ...
I don't know what string type to put there
So?
Dosnt have documentation? I have use it and its documented
nope
doesnt have documentation
lunarclient api doesn't have this method im using in their documentation
What you dont know?
only a few things
I don't know what String type to put there
I already declared the message being sent
there's no need for a string type but they added another in, so idk what to put
cause currently I have to write again
Is permission node the only way to hide a command from users like it acts like the command doesn't exist for command completion unless meeting certain requirements?
Here is an example of what I mean.
You can use TabCompleteEvent if not wrong
Does anyone know of a way to regenerate a chunk since World#regenerateChunk() is broken?
Did you check the javadocs?
I did
and I used it the correct way
but it is deprecated and produces a massive error when used
(1.18.2)
https://prnt.sc/6v8aVuPkcRiU
that code will work?
i want to create a top 100 kills like hypixel
i using ajleaderboards api and decenthologramsapi
?event-api
what are the good particle helper libraries for spigot? and would they be required alongside my plugin?
idk I just write all the trigonometry myself
but yes, any external library will be required along your plugin unless you shade it
well i mean the fact that using the particle api is kind of a pain in the butt
ive been trying to spawn particles at an exact location for 2 days now. not any closer
i know this now. lol.
is there a library for making particles and particle cosmetics that are pre made?
iβm feeling quite lazy atm
How do I register an event inside of a runnable in a separate class from my main class
when executing a command, sender is a Player Object right? i can set gamemode and all?
Not necessarily, add a check
If (!(sender instanceof Player)) return false;
Then you can cast sender to a player object
how common is ProtocolLib amongst plugins?
doesn't seem to understand :/
quite
cast to player object
ok. im just gonna bite the bullet and use it. thanks
Player p = (Player) sender;
#sendTitle();?
no, that's the center of the screen @subtle folio
declaration: package: org.bukkit.entity, interface: Player
itβs nullable
are you talking abt a action bar?
check this resource out.
bump
do you know how to do so in mc 1.8?
oh
i'm dumb
the same way you would in your main class
but instead of this youβd get the instance of the main class
Isn't seeming to work, I could be stupid
This is in a command class, I implemented Listener into the command's class
then registered with manager#registerEvents(new SpawnCommand(), this);
i donβt think you can have event listeners in bukkit runnables.
this part is fine.
Where do you see the event listener
Oh I see it
No you donβt want to do that
Lol
yeah π
So just do it in a separate class like normal
or outside the runnable
I saw some forum that suggested doing it inside the runnable
you canβt have a event inside a runnable
i suggest learning basic java and spigot api before trying to do things
Have your event outside of that method, and have a runnable within it
How do I set a way point based on just a location?
LunarClientAPI.getInstance().sendWaypoint(player, new LCWaypoint("test", new Location(w, x, y, z), 0xFFFF, true));
This is what I have for my waypoints, however, the LunarClientAPI has no documentation on this and its making me angry.
public LCWaypoint(String name, Location location, int color, boolean forced) {
this(name, location, color, forced, true);
}
This is LCWaypoint Method, does anyone know how to define a pre-established location from in game and set a waypoint from it.
lunar client has a api??
i could be absolutely wrong here but
https://github.com/LunarClient
which has (see pic) the only way to contact someone who might know about the lunar client api
afaik spigot api has nothing to do with lunar client so there might not be many people here knowing the answers to your questions
I have no clue how to get this shit working
i have been trying for 6 hours
still
no luck
ill try emailing one of the lunar client api devs
what is the new UseEntityEvent for 1.17.1
Some brief clarification on the ScoreboardManager...what scoreboard is referenced by getMainScoreboard? I wasn't aware of a "primary" scoreboard, what does that mean? And when should I use that instead of getNewScoreboard?
Does anyone know how to make being above layer 60 give you a negative effect?
Use a runnable that checks player locations, and if they are above Y 60, apply the effect. Otherwise, remove it. (If it's permanent)
The /scoreboard
99% of programming LMAO
im even more pissed that I have to have Lunar's api in my plugins folder
Anyone know how to (with code) check what flags a player has in a spot via worldguard api.
I was trying to create a server using one plugin
Yeah post code with what youre having issues with. Im sure someone here can help
not any above one plugin
but instead I have to have lunars api in my plugins folder
π€¦ ill never make an HCF server without atleast 2 plugins.. π
Also explain what youre trying to do and where your issue is
Lunar client special staff modules, xray mode, press X in lunar to activate
You can assign multiple objectives to a single scoreboard? Like, I can use getMainScoreboard and assign a bunch of objectives, all able to be used by /scoreboard?
wiki.vg doesn't match the actual protocollib format
it's because protocollib wraps NMS packets
and NMS packets serialize the packets themselves
oh, so ProtocolLib is just an abstraction layer for that?
Yes
protocol lib is not helping with my efforts. Offset X Float This is added to the X position after being multiplied by random.nextGaussian() same problem
urg. isn't it possible to just spawn a particle in one place with no movement?
i figured it would allow me more control, but i can't find any resources on how to customize my particle's behaviors i.e. no behavior at all
well i know that now, and also found out that the particle position randomization is built into the packet
hello
will the modern sit, lay and crawl plugin work on 1.12.2
anyone know of a way to get last death location?
I haven't found anything in the api via docs / research on google
event listener for player death maybe?
How can I cancel dropping the drops of a block on break?
- Cannot cancel and set to air
nope this can only get deaths post the plugin being added unfortunatly
oh you need a players death location that has already happened?
any idea if they logged out immediately after dying?
without respawning
hmmm doesn't look like it
looks like I can only add prevention to stop this in the future
i was gonna mention essentials has a tpoffline command you could possibly use if they quit out of death
yeah a death log helps a bit
I'm using the player#performCommand method to make the player perform a command
Is there any way I can make the player perform a command that they don't have permission for?
Looking for a double confirmation on this:
When using Block#setMetaData(String, FixedMetadataValue) this data is not persistant throughout restarts correct
You need to track it manually
bruh
if you have a lot of players then tracking it manually will take up space
especially for databases
or just files
space
Nah, doesn't take too much space
just saving list of players uuid
well.. there is a hasPlayedBefore method
which makes no sense because that works just fine without storing
yeah the player is tracked without using and data
really?
so how big can the uuid file get
if I have a big server
will it cause issues?
guys, on average, do you think a server could hit more than 10.000 offline players?
offline
doubt that
how about 100.000
Depends on how good the server is
on average, nah
How can I keep my server TPS at solid 20 while maintaining only two plugins, lunar API, and my plugin that runs all of its essential stuff inside of it to do multiple things.
questioning because I've been doing some math, loading only the uuids of 100.000 players into the heap it would take only around 50mb
bruh thats nothing
yes
thats so small
that's what I've been thinking
I thought it was gonne be like 200mb for 500 players
and that's as a string, not real uuid
it's even better for uuids
Yeah lol
1600000 / 1024 = ~ 1560 kb
meaning even less than 2mb
yeah
is that correct?
I think
π€
2 bytes per char
an uuid is 32 char lenght
of course
java 18 I think its standardising to use utf8
anyway
even tho it's less than 2MB, using as a key...
if you store them in a hashmap, you probably store an object with it too
Is there an event for when a player sets their spawn? Like if they click a bed or something
interacting by spigot, PlayerSetSpawnEvent by paper
every time someone interacts with a bed their spawn is set
so interact event with material.bed
oh true
no
their spawn still gets set even out of range, daytime, or mob near it
yeah thats why I wanted a event but oh well best ill be able to do is just make sure i set the location even if there is a mob nearby
can confirm the message "Respawn point set" doesn't fire unless your close enough to the bed
ah
if they interact with it and are in specific range event, set multiple limits within one event to make what you want
3 π just tested that, im not gonna worry about mobs
kill any mobs automatically within range of all beds near players when they interact with bedsπ€£
put it on peaceful, future proof
even better: spawn 10 million tnt and light it
Is there a way to disable tp the first time someone enters a server?
i made my own for something i'm doing but it run mine first then natural lol
Is there even natural teleport? i don't even know
Yes like a world spawn
That's from other plugins
I don't want it i have a custom one
I don't have other one
What plugins do you have on your server? Also what do you mean by teleport when someone enters the server? Like bringing them back to spawn?
Just no one
Just mine
When they first enter the server it makes them tp to a place
I made a plugin that does that but to a place that I want but the problem is that first it does tp to mine and then to that random place
can you show your code where you teleport them
Im on phone now but it is just event.getPlayer().teleport(the location here)
On JoinEvent
I get the location of a config file
is that all that happens in the join event?
I also give them an inventory but I don't think it matters
are those the correct coords?
like when they join the server for the first time ever? or like when they join the server in general?
First time ever
how could i get only the 0,1,19,21,24? using config.getKeys(false) would work but i need it to check only in a given path
Well that explains it I guess
Player has no data on the server before, so it will spawn on world spawn location
Yes but i want to fix it
shouldn't matter, I made a plugin that teleports the player to a location on join and it doesn't matter if they joined or not
I don't want him to send them to that place lol
I want it to be to the place that I say
Even it's the first time ever player joined the server?
Yeah PlayerJoinEvent should only fire after they loaded into the server
But
It works btw
It teleports them to the zone I want and then to the server spawn
π€¨
Im not sure why that would happen, if you could show your full code then I can go through it and try to fix it on my own system, because based on your code it should work thats basically what mine does I just have more logic for first join and messages and other stuff in mine
is just a tp lol
Like
Location location = new Location(world, x, y,z, yaw, pitch)
<Player>.teleport(location)
Based off this there shouldn't be any issues, im not sure what would be causing that. What version are you developing for, and what is your server version?
It also has other things like a login system and I give them an inventory but I really don't think that's it.
1.18.2
Purpur
If I don't find a solution I will make the server wait 5 seconds and just do the tp π
hmm, it may have to do with something on Purpurs side ive never worked with it before
do you have access to discord on your computer?
I was checking the purpur config and I didn't see anything like that really
Ofc
It's 1 in the morning, that's why I'm not on the computer
I can try to make a quick plugin and test it on my side to see if it works and send it to you to test out. other than that I have no idea how to fix the issue cuz it should work
Do you know about mysql?
not very much, im planning to take a couple online classes about it soon to learn more tho
I have some problems with my host service and so I want to do a local database for a while but I can't
π€£
If not I would use host database
ah yeah im not too good with it, I wanna run a server at my house tho so i should be learning soon
The locations gonna be hard coded in for me by the way, just to ease the process
I was watching some videos or guides but I can't do it locally
like the luckperms
It have a local database
But I don't know how to do that
you can use xampp if you're on windows
it has a built in SQL server that can run locally
Yes but I want the plugin to create its file on the plugin folder to use it
Like myPlugin/data/playerdata.db
I have never done it locally and now I need it
ah, I see
JoinEvent Issues
event.getBlock().getDrops().clear(); not working in BlockBreakEvent.
whats the proper way to remove drops?
If you want clear the drops event.setDroptItems(false)
ok. thanks
intellij is just ridiculous anymore
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:220) ~[guava-31.0.1-jre.jar:?]
at com.google.common.graph.StandardMutableValueGraph.putEdgeValue(StandardMutableValueGraph.java:94) ~[guava-31.0.1-jre.jar:?]
at com.google.common.graph.StandardMutableGraph.putEdge(StandardMutableGraph.java:52) ~[guava-31.0.1-jre.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:235) ~[pufferfish-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[pufferfish-1.18.2.jar:git-Pufferfish-61]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:290) ~[pufferfish-1.18.2.jar:git-Pufferfish-61]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1165) ~[pufferfish-1.18.2.jar:git-Pufferfish-61]
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:317) ~[pufferfish-1.18.2.jar:git-Pufferfish-61]
at java.lang.Thread.run(Thread.java:833) ~[?:?]```
Wtf does that mean
looks like an issue with your packet injector maybe its not yours π€
you could probably narrow down to the code based off the stack trace to figure your issue
wwhat
well I'm assuming your sending packets to the server so traceback the stacktrace if you can't do that you shouldn't be coding with packets yet let alone even touching spigot plugins
IDK
I can't help you if you don't even know your own code π€·ββοΈ
sounds like a server issue
by the sounds of the confusion
if it spams errors from console, its gotta be songoda
ahahaha oh my
sugondeez
love that company name though its funny asf
not to mention owner of that plugins banned from mcmarket hmmm
lmao ofc ofc
the most powerful anticrash
So powerful it crashes your server
will the code after I disable my plugin still be ran?
Yes
how can I stop it then?
return
^
or put an else
okay but I'm guessing code outside the return will also continue to run?
okay so after a return it will no longer continue?
if its inside the if statement it won't run if the statement isnt true
if that's what you are asking?
so if the map doesn't contain the key it will not return and still run the code outside
nah as in when it returns to where the method was called from
yes no code after that will run
kk
other stuff will run
okay so it does run
so just dont enter it in the map
means something has gone wrong in code which needs to be fixed .-.
so just error log
message is plenty enough
mk
π
I did create an exception
but then thought I'd just stop the plugin and print a msg instead
can't you create coloured console lines?
I have a class that extends BukkitRunnable that is intended to be run asynchronously. In the run() method I callback via a lambda.
@Override
public void run() {
final List<String> list = new ArrayList<>();
// Populate list with list.add()
Bukkit.getScheduler().runTask(plugin, () -> { callbackMethod(list); });
}
...
// In JavaPlugin class:
public void callbackMethod(List<String> list) {
this.list = list;
}
Is List / Arraylist okay to use here for passing a list of strings back to the main thread?
(Need to use CopyOnWriteArrayList<String> ?)
yes
exceptions show the stacktrace
logger.severe() is easiest
could be more usefull than a log message
well, I also dump the thread
yeah true, but in the log you could make it unique to that method
the message
without all the stacktrace spa
m
means I have to handle it each time when really it only needs to handled in the same way each time
having said that
or make a class extending Exception 
that's what I had done
pog
yea that's good
any idea why this happens, cant event reproduce it. My guess is the nbt tag inside item are broken
also put an else on the if for adding the map
π that is technically more accurate
no need
(Damageabs) What is the difference between ItemMeta#setDamage and ItemStack#setDurability?
if it throws the exception it won't be ran anyway
damage is for like coloured glass in old versions I'm pretty sure
lmao
is there not a uhhh
boolean type?
int then
You should use byte
just 0 or 1
byte
yeah byte/int can be cast to a boolean if its 0 or 1 iirc
what will u do with the list btw
Anyway the reason why I wanted to shut down the plugin if an ability was already registered is because it feels like a pretty fatal error
for booleans usually
I can change it but it would affect a lot of players having that item
wdym?
any systematic way of doing it properly
its not that fatal it just means you have a duplicate key somewhere, no need to shut down your whole plugin because of it
make the byte 0 or 1
why
0 for false 1 for true and then convert that
I dont give a shit
oh
I will be reading, adding and removing elements.
its the server configurator job

I guess if I handle the exception correctly then it shouldn't matter
if they dont then thats too little of a server to care about
it should never be an error which occurs anyway
damn

