#help-development
1 messages · Page 1706 of 1
I'm just using addUnsafeEnchantment, but I have to add it to the crafting result because it just doesn't output it with the enchantment
getAttribute(GENERICMAXHEALTH).getValue()
can someone review it
Hm, maybe try re-adding the enchantment when they pick it up? Not sure why it wouldn't be applying it.
I'm adding the enchantment to the result with prepare crafting and that works fine
It seems the issue is ItemStacks and keeping unsafe enchantments
how does it work to add the update notifier?
i have the request url
but how does it work?
You should use the enchant methods in ItemMeta rather than itemstack
it's not your code
i know but can u find any mistakes.
well FunkePhase depends a lot on Atlas so idk
but if it's straight up from the plugin then it's fine prob
any while loops
lockups are usually for loops taking too long, or unending
um, running sync?
is it running on the main thread?
yeah, that will break it
You can;t do that
if you want to wait for a command you shoudl trigger in the command to start doing whatever you want
what is your while loop actually doing?
its goal
it doesn;t sound an efficient way of doing it
you should prolly make that async or smthing
is it your plugins command?
at teh moiment theres no need for async. I doubt you need anything running
wait is your while loop using thread.sleep or smthing
if its another plugins command you want to listen for use teh command pre process event
final UUID uuid = player.getUniqueId();
final String message = "This is an annoying message";
new BukkitRunnable() {
Player player = Bukkit.getPlayer(uuid);
// Offline?
if (player == null) {
this.cancel();
return;
}
player.sendMessage(message);
}
.runTaskTimer(plugin, 0L, 10L * 20L);
something like this
https://www.spigotmc.org/threads/guide-threading-for-beginners.523773/
This explains why a while loop or Thread.sleep crashes the server.
i dont think you need it async
you don;t need async
just use the code i sent
imagines code would send a message every 10 seconds
i change my mind cause every 10 seconds not gonna do jack shit
you can change that btw
That one does have a replacement
But afaik it’s only deprecated because people got confused with the name
Why my code can't resolve "LogLevel" ?
the schedualer allows for a runnable to be passed tho as an argument
need to import smth?
why?
i'm doing the update checker
and the guy
did smth like that
and it worked for him
the thing that changes
from the guy
is this thing
and for the guy says
message
reading is hard huh
LogLevel and message are comments from InteliJ
this?
no, you are usign Logger
do you know java 🤔
I can see how you are finding it hard to follow a video when you have trouble following what I type.
pasting code bad , write code makes muscle memory skillz
bet its some funny funny import stuff
he's just not seeing teh code correctly in the video
learning to read/java might be helpful tbh
he's typing the Intelij comments too
🙂 👍
i'm not typing it
you can;t copy/paste from a video
i didn't copy
link the video you are trying to follow
ok lmao
Check out this plugin featured in the video here:
https://github.com/BGHDDevelopment/Tutorial1
https://github.com/BGHDDevelopment/UpdateCheckerUpdatedVersion
Mobile App: https://bghddevelopment.com/apps
View all our plugins here:
https://www.spigotmc.org/resources/authors/111582/
https://www.mc-market.org/resources/authors/50438/
Check out BG...
10:16
send code
ahaha it uses Main
pulse’s bug-bear
was abotu to say that
ok you are using his code correctly
Also that code is literally copied and paste from the forum
Drop the thread lol
that's mine
but his code is BAD
it’s much better to code all your plugins only in the main class
uh
he's probaby using some custom logger
would probably be a nice command tbh
what does that mean
lmao
Oo indeed
like listeners and commands only in the main class
??
it was sarcasm anyway
Yeah, he's using a custom Logger class. You can see it in his project on the left
?main
spigot is being weird cut me a break
Aha
Well judging by how you said you were a Goofey coder
lmfao
Btw Pulse
If you want, you could review my code
Not because it’s good
But ye
Lol
Yaa, what code style do u use rn?
Oh god lol
I mean some of the style is actually quite nice
But then we also got the mysterious make my code look ass shit as well
You don’t
I'm curious
It’s too dangerous
declaration: package: org.bukkit, interface: World
look at javadocs
its in WorldInfo
reading is still hard!
the problem i sometimes find with REALLY inexperienced programmers is that they print the object, and cause it implements toString they see name or something and then do some completely redundant string manipulation to get the name, for example
Lmfao that is so true
and i mean i understand why they did it ig but still… ugh
Lol
Anyone know if there is a way to send fake ip to the servers from bungee? ip spoof
can't find any api for it
currently we run manually modifyed spigot to ip spoof but want to run it on bungee instead as a plugin
how can i give a player a potion effect? Ive had a look on the doc but its not syncing in lol
nvm
wait
player#addPotionEffect
Hello!
I need really quick help with a command
for some reason I run the command in my server
but it does not execute the code set for the command
and it does not throw an error either
if(cmd.getName().equalsIgnoreCase("funni")) {
ItemStack funni_spoon = new ItemStack(Material.STONE_SHOVEL);
ItemMeta spoonm = funni_spoon.getItemMeta();
//spoonm.setLore(sl);
spoonm.setDisplayName(ChatColor.AQUA + "Market Gardener");
}
if(cmd.getName().equalsIgnoreCase("rawpapi")) {
p.sendMessage("rawpapi");
}
command code ^^
neither of them work despite being specified in the yml
did you specify the command in your main class?
how can i get the "wtbl" variable and use it in the other else if?
ik this is simple java baiscs but some help would be noice
its a command in my main class, its just a quick plugin to test something out
don't you still have to specify the command with getCommand(commandname).setExecutor(this);?
*in your onEnable method
pretty sure you don't
I have a feeling this has to do with 1.17.1 spigot being different
oh okay.
how can i make like a "lagback" for someone in spectator mode?
as in prevent them from breaking blocks or prevent them from moving?
what you can do is make an event detecting either action @EventHandler public void onPlayerMoveEvent(PlayerMoveEvent e), and detecting if they are in spectator. if they are, then you can use e.setCancelled(true); to prevent them from doing that event.
Hope this helped!
hey can someone check threads please lol
i have a thread, i dont want to flood this channel with it
how can i add this to another Eventhandeler
because i have an Invenv click event
i wanna add it in there
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
can i use 2 events in one class?
yes
how
:)
[02:20:59 ERROR]: [Ban-EM] Ban-EM v1.1 attempted to register an invalid EventHandler method signature "public void bangui.me.duke.Me.listeners.BanInvListener.onMenuClick(org.bukkit.event.inventory.InventoryClickEvent,org.bukkit.event.player.PlayerMoveEvent)" in class bangui.me.duke.Me.listeners.BanInvListener
wait... if its allready registerd why do it het this?
show event code
oh i dont work like that
shit lol
gotta have 2 serperate methods
would be great to see some code
errrrrrrrrr
quick something of what that looks like
wait so like another EventHandler
yh
ohh
?paste
if 10 is greater than 9. How can x be 5?
when i do this then the other eventhanderler brakes?!
no
Try without (This, banMenu)
does the new spigot api require SE 16?
depends what vet
spigot 1.17 yes
ver*
so
^ This
using say
SE 16
could make it not work?
or soryr
Sorry
I meant
If I use SE 15
Would it not work properly?
it has to be java 16
https://paste.md-5.net/ulefanodec.cs
why does this fire twice when i click on a block with an empty hand?
it fires twice for each hand
how do i change that
you can do main hand only
its literally just the same
elaborate
@EventHandler
public void onEvent(..Event one) {
}
@EventHandler
public void onEventTwo(..Event two) {
}
that didnt work?
it does
yea i figured it out lol
ah, great
it fires twice because you have two hands
so just check if the hand is the main hand
yea
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.
@plain scroll your brackets are all messed up haha
ik that
ik...
then fix it
ight
public boolean onCommand(Command cmd, CommandSender sender, String label, String[] args) {
Player p = (Player)sender;
if(cmd.getName().equals("funni")) {
p.sendMessage("Hello!");
}
return false;
}
this is my current code, still won't run the command.
well have you registered everything
This is an in main command method
remove the if statement
more of the code
probably plugin.yml in your case
ublic class Main extends JavaPlugin implements Listener {
@Override
public void onEnable() {
Bukkit.getServer().getPluginManager().registerEvents(this, this);
}
@Override
public void onDisable() {
}
public boolean onCommand(Command cmd, CommandSender sender, String label, String[] args) {
Player p = (Player)sender;
if(cmd.getName().equals("funni")) {
p.sendMessage("Hello!");
}
return false;
}
oops p at the start there
pretty sure it will not work without Overriding
its worked before
put it there
its so people know the method is overriding its superclass
and not restricted to only its type
ive never actually known if it was absolutely required to work
i learn something new today i guess
so is it fine despite it throwing an error?
what error
it throws an error on the method initialization once I add it
It says
The method onCommand of type Main must override or implement a supertype method.
yea
thats because your arguments are wrong
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
}
thank you
THANK YOU
WTF
Ive been messing around with this for hours and it was an order issue
No
should start doing it
i type "on" and autocomplete the rest
in the right order
i guess its based on preference but imo intellij is superior to any other ide
whats the event for when a player leaves a ridable vehicle?
the docs are the gods
you worship the docs
you learn from the docs
they contain every piece of knowledge you may need
declaration: package: org.bukkit.event.vehicle, class: VehicleExitEvent
ah thx
@quaint mantle is probably doing montgly offerings to the docs 😄
I will sacrifice you to the docs
😵
how do i set an armor stands direction to a certain block's direction?
How to kick a player using AsyncChatEvent?
try it normally, if it doesnt work because its async you can run a sync task
I'm doing a faster word typing event. And I want to kick the player if it's not in the database.
just do what i said
Make a async task in asyncchatevent?
Huh didn’t know you couldn’t kick async
What is the method for applying levitation to an entity.
addPotionEffect
addPotionEffect method cannot be found in entity.
You can only apply potion effects to living entities
it is allive, i spawned it 1 line above
Living entity is a type of entity
What would be the best way to...
holos:
Test:
location: world, -377.7475157409223, 81.5, -365.5887585344649
owner: e42b60b0-c35a-462f-a2b4-b1a9980f399e
lines:
- Test
- Test
rename "Test" to like.. "Testing"?
Probably duplicate then delete
ConfigurationSection section = config.getConfigurationSection("holos.Test");
config.set("holos.Test", null);
config.set("holos.Testing", section);
try that idk
Bukkit.getScheduler().runTask(() -> player.kickPlayer(message));
who's charlie
Hazbin hotel
i think u should return true at the end
did that thanks
Guys, one last question.
Is there a way to create a fireball which launches you up in the air like the ones in hypixel?
You can't throw normal fireballs
how do i get the item before bucketfillevent
Correct, use the interact event to fix that
i love u
They didn’t close the method above
You don’t have a { after the cmd.getName it statement
thats the materail
o.O
i need the itemstack
I'd imagine Inventory#get() would return the bucket
oh there's no hand in that event either
There really should be
Doesn’t work with glass bottles either
and i cant listen to the interactevent
because its never a liquid
Wait
ohhhhh
i could check the relative of the clicked block face
and see if its liquid
Big brain time
What if they don’t click a block face
then im screwed because the bukkit api is missing a chunk of features 🤷🏿♂️
I remember hypixel skyblock having issues with glass bottles a while back
Wonder what they did
probably packet stuff
Interact event, check held item, ray trace check if water is in range?
No idea
Well you obviously need a corresponding closing bracket
If you have an if statement without { } then only the next line is treated as being within the statement
It's fine in his case
The second if statement is treated like one line, so the first if having no brackets is totally valid
But if that's the case, might as well just use one if statement with an &&
Oh nvm, scratch that. Second if has a separate else
Is it the one with 1 arg
yes
Should go to everyone
i see so many error in this that i just cant even process
@quaint mantle let me try and see if i can fix it just a lil bit
@quaint mantle show your plugin.yml for me please
i just need to see if there is an error there too
how do i get a player uuid from name (and vice versa) in bungee
i remember i had classes
that did that
but i dont have them anymore
okay so @quaint mantle after putting the code into my plugin manager, i already see so many error
so first of all
ChatColor doesnt need any spaces
and it doesnt need the org
@quaint mantle
player.sendMessage(org.bukkit.ChatColor.BLUE + "Discord: " + org.bukkit.ChatColor.YELLOW + discord);
``` you dont need the org.bukkit.
you just need to put
ChatColor.BLUE+
no space between BLUE and "Discord: "
and what you need to do is
import the ChatColor
nah no needed
but what is the store website?
like when you do /store what is the link
ah
thats not a store lol
but okay
well what you can do is
at line...
wait
what you can change from this
player.sendMessage(org.bukkit.ChatColor.YELLOW + "Store: " + org.bukkit.ChatColor.YELLOW + store);
is change it to this
player.sendMessage(ChatColor.YELLOW + "Store: ");
and i think if you put the link in the "Store: "
it would work maybe
because in minecraft whatever link is in chat, you can click (above soem version)
ah good good
well just change every org.bukkit. from ChatColor
cause its not needed
you have this on top of your plugin thing right?
aah
why do you make the perms "store.store" ? i think its better if its "store.use" lol
did you use a tutorial for this or you figured it out on your own?
oh so its only the discord that is isnt working
try restarting server maybe?
hmm
public class Store extends JavaPlugin {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
if (cmd.getName().equals("store"))
if (sender.hasPermission("store.store")) {
return true;
} else {
sender.sendMessage(ChatColor.DARK_RED + "You do not have permission!");
return true;
}
{
String store = this.getConfig().getString("Store");
player.sendMessage(ChatColor.YELLOW+"Store: ");
}
return false;
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player ) sender;
if (cmd.getName().equals("discord"))
if (sender.hasPermission("store.discord")) {
return true;
} else {
sender.sendMessage(ChatColor.DARK_RED + "You do not have permission!");
return true;
}
{
String discord = this.getConfig().getString("Discord");
player.sendMessage(ChatColor.BLUE+"Discord: ");
}
return false;
}
}
``` I do not know if this is better or not but its up to you if you wanna copy it (I only changed the chat color problems and i cant seem to find the discord problems)
wait hold on
hm i see an error hold on
public class Store extends JavaPlugin {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
if (cmd.getName().equals("store"))
if (sender.hasPermission("store.store")) {
return true;
} else {
sender.sendMessage(ChatColor.DARK_RED + "You do not have permission!");
return true;
}
{
String store = this.getConfig().getString("Store");
player.sendMessage(ChatColor.YELLOW+"Store: ");
}
return false;
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
if (cmd.getName().equals("discord"))
if (sender.hasPermission("store.discord")) {
return true;
} else {
sender.sendMessage(ChatColor.DARK_RED + "You do not have permission!");
return true;
}
{
String discord = this.getConfig().getString("Discord");
player.sendMessage(ChatColor.BLUE+"Discord: ");
}
return false;
}
}
there
itsa bit better
but while i was checking for the error, it shows me that inside public boolean there is no tests
You can only have 1 copy of a method
oh no wonder
so remove the second public boolean
yeh because you already have a onCommand
thats why it needs to be onCommand1 because you have 2 public booleans
All the code needs to be in one method
public int getServerMaxCount(String ip) {
URLConnection connection;
try {
connection = new URL("https://api.mcsrvstat.us/1/" + ip).openConnection();
String text = new Scanner(connection.getInputStream()).next();
return ((int) ((JSONObject) parser.parse(text)).get("players.max"));
} catch (IOException | ParseException e) {
e.printStackTrace();
}
return -1;
}```
no idea where else to post it
i get Unexpected token END OF FILE at position 232.
error
no idea what im doing lol
this isnt a plugin
reading mcserverstat hmm
so what are you trying to do? i need to know before helping lol
discord bot rich presence
not many people try to do it in java
gonna set it to like
"watching serverip: playersOnline/playersMax"
uh no
im just trying to set the bot's rich presence to that
anyway i just wanna know why jsonsimple isnt working
hmm
well i dont really know because i dont use json most of the times
wait @quaint mantle
?paste
@quaint mantle i just realised something
are you making 2 commands on 1 singular class?
uhm
that doesnt really does well
so that is the reason yoru /discord doesnt work
every command you want to add in your plugin, must have singular class
like this
This is not true
i have an /add command and /hello command in separate classes
It is recommended though
yup
because it is just better to have everything organise
jeez
wait hold on lemme just do thsi rlly quic
is it possible to make a squid follow a snowball
@quaint mantle dont remove the public boolean but instead, make another class for it
after you copy and paste it to another class, then you can remove the public boolean from the store class
You can also remove the name check if you do 1 command per class
the if (cmd.getName) ...
ah
wait a sec
its a command right? that @quaint mantle is trying to do
then why dont you make it implements CommandExecutor
instead of extends JavaPlugin?
because let me just explain a bit
extends JavaPlugin is used in the Main java
main java file
like this
but for commands
you gotta use
like this
i also recommend you using Intellij if you havent already because it works just so flawlessly
Case sensitive
this.Bukkit.CommandExecutor.getString("Discord");
bukkit needs to be case sensitive
@quaint mantle always remember case sensitive stuff lol
no no dont be
lol
XD
wow thats a great lesonn
gimme that link please i need to learn about executing the same task over and over again just means im updating the task everytime
i have this scoreboard and it doesnt updates so i need to learn how to update it but on the spigot website, i just dont get it
i started like a few days ago and im already addicted and i am actually very trash at math
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
i just cant process my brain
oh wow
its 1:03 pm here
lol
well goodnight i guess 👋
lol
hey! need a little help.. idk if this is possible but;
how do you dected who killed someone in special cases?
for example; if PlayerA breaks a block under PlayerB and PlayerB dies in lava or fall damage.. how do i check that PlayerA killed PlayerB
or if PlayerA makes a trap for PlayerB
Anyone know the updated way to check a player's balance with Vault?
The github says to use econ#getBalance(OfflinePlayer) but it's deprecated
The string is the deprecated one, offlinePlayer is not
Says it’s been deprecated as of 1.4
It doesn't say deprecated in the javadoc
This might be a bit tricky, first idea off the top of my head is on block break, check if an entity is on top or near the block, and if they get damaged after a few seconds, set the damaging entity to the block breaker
Same goes for blockRedstoneEvent, but you'd probably need a way to save who placed the redstone blocks though
does anyone know how to update a task? can you show me an example of the code? i literally dont understand from the spigot help forum
yeah.. tyy
How to balance team functionality with Individual player Scoreboards
Because "this" is not a JavaPlugin
Get the instance of your main class, the one that extends JavaPlugin, and put it there
"this" references the class it is in. You can use "this" if the line of code is inside your JavaPlugin class itself, because in that case, "this" is referencing the JavaPlugin.
You can do so by adding a JavaPlugin field in your PlayerScoreboard class and add a new Plugin p parameter to your constructor
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/Directional.html How would I set the blockface on a block I right click..?
declaration: package: org.bukkit.block.data, interface: Directional
I don't undertand how to read the spigot docs that well.
I know it's BlockData but like.. how do you get Directional from BlockData
Plugin plugin;
SomeClass (..., Plugin pl) {
...
plugin = pl;
}
After that, you can now use plugin as Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, ...);
what do i put as the SomeClass ?
i know this is wrong by seeing it :)
Since your openScoreboard is static. Just noticed that now
static?
like the ~~ thing?
well i just want to repeat the playerscoreboard so it updates every tick/seconds idrc i just need it to update
Do this instead
okie
static Plugin p;
public static void setPlugin(Plugin plugin) {
p = plugin;
}
Then in your onEnable() class, insert PlayerScoreboard.setPlugin(this) somewhere.
okay
where do i insert this?
in Main class that has the JavaPlugin or the scoreboard class
Anywhere in your scoreboard class
okie dokie
I hope after all this you'll try to understand how these things work
ill put it at the top
i will
Tip: I learn better from watching how its done while they explain it ;) thats why i watch tutorial videos
Yeah most of us are visual learners
Once you've done all that, you can now replace your "this" to "p", the variable we just set up.
hello
also this
What does the problem say
i dont know which one to even click lol
Yep
Replace that unknown package with import org.bukkit.plugin.Plugin;
change unknown package? you mean the "Change 1st parameter of method " thing or?
At the very top of your PlayerScoreboard class, you'll see import jdk.tools.jlink.plugin.Plugin. Delete that and replace it with bukkit's plugin package.
okay thank you
Lemme reiterate, understand these stuff and maybe watch some basic java videos
Wouldn't exactly call it an unknown package.
It's specifically a JDK-exclusive package under the jdk.jlink module that contains the API and implementation of the jlink tool.
It's basically pseudo-internal, as it is designed as an internal package (given the fact the name starts with jdk), but also open for plugins via its API, which is where jdk.tools.jlink.plugin.Plugin comes from.
new BukkitRunnable() {
boolean switchColor = false;
public void run() {
if(player != null) {
for(int curSlot = 0; curSlot < holoLineGUI.getContents().length; curSlot++) {
if(holoLineGUI.getItem(curSlot) == null || holoLineGUI.getItem(curSlot).getType().equals(Material.WHITE_STAINED_GLASS_PANE) || holoLineGUI.getItem(curSlot).getType().equals(Material.GREEN_STAINED_GLASS_PANE)) {
switchColor = !switchColor;
if(switchColor) {
holoLineGUI.setItem(curSlot, createPlaceholderItem("white"));
} else {
holoLineGUI.setItem(curSlot, createPlaceholderItem("green"));
}
}
}
} else {
cancel();
}
}
}.runTaskTimer(cadiaCore, 0, 5);
I'm trying to get my items to alternate between green/white item panes, it changes once but then stops, it's not cancelling the runnable
I don't get what im doing wrong
Anyway, maybe don't use syntactically incorrect pseudocode with Java beginners who aren't used to it yet.
A better example of what you should do is:
public class PlayerScoreboard {
private final Plugin pl;
public PlayerScoreboard(Plugin pl) {
this.pl = pl;
}
}
Granted, this would not work in amxyar's case bc of openScoreboard being static.
y'know
an easy solution to the fuckin' nightmare that is NMS-specific modules
is just a better language or buildsystem supporting conditional compilation
lol true
why does Gradle not have this?
more of a maven guy myself
actually in all fairness
these buildsystems don't touch the source or compiled classes at all
there's no compiler injection or anything
since for a system to even work well with conditional compilation, you need annotations
Anyone know my issue...?
updated: || https://pastebin.com/raw/YAigx6Zb ||
it's only changing the colors twice then stopping, even though the runnable should be running constinuously.
imagine 🥺
class NMSImpl {
void nms() if (build["nms"] == "1.16") {
}
}
this is what my ideal lang looks like :)
(build would basically be a global variable that stores buildsystem information and can be accessed from a conditional compilation clause)
figured it out.
Api does not depend on any nms modules nor the final module
@quaint mantle
I wrote about it, the dependency hierarchy is unidirectional
so what should i put in build.gradle
For api?
yes
Nothing really
I guess you could have the spigot api there
But it’s an api
It shouldn’t depend on anything
The latest afaik
But then in each nms module
You’d override it with a specific version of the spigot api
Or well spigot dependency
for test
it is only this
and should i
use the shadow jar plugin
for each depend ?
No
just the main ?
Only for rootproject yes
Don’t
The root project should handle the building of your jar, the plugin module is just as said the module which binds everything together
I told you that also
just depend
the
//build.gradle in plugin
dependencies {
implementation project(':api')
implementation project(':v1-8-r3')
implementation project(':v1-16-r3')
}
yes ?
Yes you can lol
The entire nms module system is the entire motive for using multiple versions
If you just have one module like that which depends on all spigot versions this is all in veins
And depending on all one spigot versions like that simultaneously is not a good idea either
Since IntelliJ can only depend on one version of a class per module really
so
should i remove
the src
in rootproject
and in the build.gradle
should i depend spigot + ?
Yeah
and implementation project(':plugin')
Cant you just upload it to github and I’ll check out what’s not right
Not really enough, it’d be good if I can see the actual system of your files
Anyways I can send you an old project of mine demonstrating how it’s done
why it is not working
PmzHeroV69
I don't create a repo till a project is either done, or in a state where I wanna show it to people.
I think I just wanted contributions at that point of time
I deleted like 52 old repos the other day bc I tended to make a lot of unnecessary repos for projects I'd never finish, or just didn't want to show off bc they were trash.
Yes
Alright
ok
But it served as a layer between the nms modules and the plugin module
is there any reason why my .main package imports just wont work...?
nothing from my .main package imports
unresolved
can you show the contents of DiscordWebhook as well as the error you get when you try to import the class from your package?
its not just DiscordWebhook, but i can show you the code
here's another one
that looks like a warning as opposed to an error
i just made a new class that has some private's in it... i've never used privates
should i remove that class and see what happens?
The privates probably have nothing to do with it.
they didnt
i removed the class (i didnt really need itú
Also... you should use privates, lol
its just really weird because it happened right after i added the class with the privates
i havent noticed any issues ¯_(ツ)_/¯
it just results in better code is all
considering your IDE inspections aren't fuckin' crowded with non-essential fields
(which is important for API users as well, if you ever make one)
(otherwise you run into one of those Python issues where everything is visible so you don't know what you actually need)
I feel like blaming Eclipse bc I'm pretty sure I've had this exact issue before when using Eclipse
where are you importing stuff at? another package or another module of the project?
so i really doubt i did something wrong
package package.name.here.idfk;
imports here*
show me your file inspector in Eclipse
the thing on the left that shows your project's files
idk how to do that
ohh
bloop
How can i get a itemstack from the enderPearl in ProjectileHitEvent?
@EventHandler
public void enderpearlHit(ProjectileHitEvent event) {
if (event.getHitEntity() == null) return;
if (!event.getEntity().getType().equals(EntityType.ENDER_PEARL)) return;
if (!(event.getEntity().getShooter() instanceof Player)) return;
event.setCancelled(true);
Projectile enderPearl = event.getEntity();
Entity hitEntity = event.getHitEntity();
Player shooter = (Player) enderPearl.getShooter();
throwers.add(shooter.getUniqueId());
// Get a ItemStack from the enderPearl
// hitEntity.remove();
}
all of the errors are regarding DiscordWebhook, or WorldGen
sorry .bot has a lot of classes
because JDA is kind of a pain
I mean you're not wrong
¯_(ツ)_/¯
im a noob to JDA tbh but like
it is working... soooo
lmao
i dont think i could emotionally handle that right now
im sorry
one question
regarding JDA
because like, i hate their Discord server
people r like cHecK thE dOCs
like "K????"
ok so
the User events
they only fire for me ???
No lol
yes, lol
i literally changed my alts name, then changed mine
only logged the name change for me
The user events are generic for all users?
i can record it if you want, but i can promse u rn
the user events only fire for me
nope
UserActivityStart, thats for an auto-announce for people streaming
a few people are streaming right now
no announcement
Sounds weird, does your bot have all permissions needed?
yeah it has admin
hey @neon nymph sorry for ping but i have some error
You need to use methods that are for cache
java.lang.IllegalStateException: Not scheduled yet
getting this error
BukkitScheduler scheduler = plugin.getServer().getScheduler();
scheduler.scheduleSyncRepeatingTask(plugin, new BukkitRunnable() {
int count = 0;
@Override
public void run() {
if (count < 16){
count++;
}
else {
this.cancel();
}
}
}, 0L, 1L);```
okay
friend
educate please lmao :(
Send the stacktrace
I had the same issue when i was trying to get number of users from all guilds the bot was in
!paste
im pretty sure im enabling cacheflags right
i want them all on tbh
so i just sorta assumed that would do the thing
.paste
One method was using cache, the other wasn't or something like that, and I was getting 7 users instead of 7000~
what is prefix
?paste
oh
Lol
can someone tell me what is still the problem here? i knwo the Plugin is static but idk what is problem
know*
I am already checking for it in if (!event.getEntity().getType().equals(EntityType.ENDER_PEARL)) return;
JDA user events only firing for the bot owner..?
i'm just gonna do that
bc there's 10000 people who need help
like everything is nice and done but it just doesnt seem to be working
okaay
Use JavaPlugin.getPlugin(this.getClass()) instead
at where?
^
okay
?scheduling
I want you to check that out 0_NiX
hm
still static
here is the full thing just cause its better for you to help
the one that has JavaPlugin?
testing is the name with caps
Testing
hmm das weird
it still has the weird ~~~ thing
You mean it's deprecated?
hmm
It doesn't update the item name in the inventory. How can i update it?
@EventHandler
public void enderpearlHit(ProjectileHitEvent event) {
if (event.getHitEntity() == null) return;
if (event.getEntity().getType() != EntityType.ENDER_PEARL) return;
if (!(event.getEntity().getShooter() instanceof Player)) return;
event.setCancelled(true);
EnderPearl enderPearl = (EnderPearl) event.getEntity();
ItemStack enderPearlItem = enderPearl.getItem();
ItemMeta enderPearlItemItemMeta = enderPearlItem.getItemMeta();
Entity hitEntity = event.getHitEntity();
Player shooter = (Player) enderPearl.getShooter();
throwers.add(shooter.getUniqueId());
enderPearlItemItemMeta.setDisplayName("Works");
enderPearlItem.setItemMeta(enderPearlItemItemMeta);
// hitEntity.remove();
}
Nope, that's just straight-up an error.
Do Testing.class, not Testing.getClass()
...then don't put the () bc we didn't tell you to?
oh my bad
it's not a method, it's a keyword
To sum it up:
finally i have my scoreboard working
If you see something gray in your editor, IDEA in this case
yey
Just hover over it, it means you can improve it somehow
If it's underlined in yellow, it's a warning (not exactly an error, but should still be taken care of if necessary)
If it's underlined in red, it's an error (fix it or else your plugin literally won't compile)
mmmmm
when you call an error
a ~~~
you don't know what an error is
I initially thought of a deprecation warning bc of the strikethrough but nope
yourmom
?jd
Something like a pokeball
I want to get the item player throwed and change the name and stuff iin his inventory
idk if i would have to use the ProjectileLaunchEvent and put some map or stuff
holy fucking god i frogot how much i hate most the people in the JDA discord
specifically the #help channel there
jesus christ
??????
so i should use launch
anyone good with JDA
okay
@ivory sleet i have a problem
in my plugin module
+')