#general
1 messages Β· Page 204 of 1
you can ignore context, it's optional
/lp user <user> parent settrack <track name> <group name>
so whatever you named the track
and the group on that track
and group name would be the track position?
yeah
ok i get that
right let me see if i can get it to work thank you for your help
user i wouldnt chnage tho
you're forcing the position, instead of blindy throwing them up the ladder (what if they weren't in the group you expect them to be)
i keep everything inbetween these things <>
i dont delte those
or chnage this part <user>?
always replace the brackets
< > means required
[ ] means optional
top of every command page
in the user section what do i do about that with the <> so it would just be user user
/lp user turbotailz parent settrack staff admin
so i would have to add in the config everyones names?
seems odd or could i just use &p
Your auto rank plugin should be about to parse a placeholder to an actual username
For commands that run through auto rank plugin
Whatβs with the 1 at the end of the lp command?
thats the position of the track the rank is
ok crossing my fingers
just ran the command to see and this happened https://gyazo.com/159ba2f083f6d5c1c44e6a4d11332569
see the track below
https://gyazo.com/94d9b8fcf84cc06c8405c0349981b9bd
its all setup right but this still hapenns
Screenshot lp track timeplayed info
use the group name
π
why wouldnt that work tho its weird
idk, could make a suggestion for it :P
Ever migrated hosts and every single jar magically grows 500kB in size?
.----------.
it sounds... just like magic
Lol
it says simple pets is not enabled, how do I enable it?
should look at the console logs
it just throws a big long error but at the top it just says this plug in is disabled
Errors are your friends when trying to solve issues.
If something doesn't work but there is no error... oh boy, you don't even know where to look at
Please use https://bytebin.lucko.me to send files in the future. I have automatically uploaded message.txt for you: https://bytebin.lucko.me/rjFRwK73ki
Please use https://bytebin.lucko.me to send files in the future. I have automatically uploaded latest.log for you: https://bytebin.lucko.me/A97XszVsH7
> [SimplePets Debug] This version is not supported, be sure you are between 1.11 and 1.14
Make sure you're using the latest version of the plugin tho
ive been so incative in the offtopic
sad
@violet rivet u almost have a stack of subsctivers on Not Enough Lights
Hey olli! Please don't tag helpful/staff members directly.
oop
i am trying to sell perks ingame such as /fly etc but i want to do this with ingame money, does anyone know a plugin that can do this? preferably with a GUI
Most likely an economy plugin
Like vault
Idk though
I plan on doing that aswell
There's no "premium"
Only those who bought the game and those who cracked it
Well kinda since premium since supports premium and cracked users π
There's no such thing as premium accounts
No it's cracked. There are no free MC accounts
unless ur given one
That wasn't free regardless
Free for the person who uses the account, but not for the person who gifted it
like free or paied
Ok
lga 1150 cpus though
What?
would it be better to go for a higher clocked i3 or pentium or a 4 core 8 thread xeon
If you're running MC you want high single core performance
Check the single core benchmarks of those CPUs
but i mean haswell's single threaded is pretty good and way better than nahelem
or yorkfield rather
The thing is you haven't given me any information on the CPUs. Like a current gen i3 beats a the best first gen Xeon by miles
In any case, look for benchmarks of the CPUs
but im saying would a lower clocked xeon with more cores and threads be better for running a server
And prioritize single core peformance over everything else
No it wouldn't
MC is essentially a single core application
Yes even MC servers
While they are multithreaded the actual game runs on a single thread
And the main thread is what bottle necks
That's why I'm saying you want single core performance over anything else
You should have enough cores though so that every MC server that generates load has a core "to itself"
You're asking for what's better
And I'm saying single core
keep in mind these are bungee servers
So the i-series is better
i know the i series is better
Bungee servers are irrelevant. You only care about backend servers
like the proxy?
The proxy servers themselves are irrelevant
Only the backend servers matter
Like say you have a bungeecord server, 4 backend servers where there are lots of players on constantly (excluding lobbies) and 10 with lower loads.
Then you want at least 4 cores and the stronger the cores the better
If you get an 8 core CPU with weaker cores your performance will be worse
unless im running more than one server per computer
No
Doesn't matter here
Even if you have two of those servers
You'll still be off worse than with that 4 core
And btw CPUs with hyperthreading. You actually care about the physical cores, not the virtual ones
yea
Though what I mentioned is how you get optimal performance
Not the most cost effectice setup
a xeon e3 1230 looks pretty good
yeah
haswell systems are cheap
but not the cpus
even though they are so old
its a scam
Β―_(γ)_/Β―
an athlon 3000g would be a better alternative lmao
If you want a cost effective server (ignoring energy cost) I'd recommend AMD's Ryzens
Even for servers
but i dont have extra power supplys and motherboards laying around
or enough ram to put in those systems
i have plenty of ddr3 though
and dell systems are cheap
Oh. So you're talking about building a physical server
not really
I thought you wanted to rent a server at a server hoster
ryzen is pretty power efficient
oh no
thats way too much money
why would a server hoster even have haswell cpus
ryzen is pretty power efficient
@deft thistle They're still one of the worst in terms of modern CPUs
thats way too much money
@deft thistle Are you sure? Did you do the calculations? Especially in what it costs you in energy/power
That means you still pay during the day
Not sure where you live, but I came out double what I pay for a server with twice the power
Time to get better bulbs xD
i use led
Then they're not 60W
They're equivalent to 60W incandescant
But 60W is pretty good
I crunched the numbers for me running 200W worth of servers is 50β¬/month xD
but they arent under load 100% of the time
so they will use even less power
its not an avx work load
Sure. It's still better to calculate with the upper estimate
And be aware of your average estimate
yes
But yes in your case that's actually cheaper
this is better than both of my cpus
boosts to 3.7
and 8 threads
wait
4 threads
Oh?
ik
i would want a e3 1230 v3 then
That one peaks above 60W
not in the dell systems
its not like they use 100w power supplys
plus dell uses gold power supplys
Funnily enough both are about the same in terms of single core
they are basically the same
Hyperthreading hardly does anything for MC
windows uses the hyperthreading for background tasks
I mean why throw half the power out the window for the OS?
Sure
But again your bottle neck is the main thread in the MC servers
yes
but currently they are using core 2 quad q6600 and q9505
so even a pentium g3220 is better
which i have
Yes
I mean all I'm saying you're not gaining much by getting the 1230 over the 1226
no one on ebay is willing to part out the dell for some reason
A few percent points in performance on your whole system
The MC servers will be the same
i connect to them remotely
So?
How's how you connect to the servers relevant?
Ok.
cpu power
anyways
the fastest single core performant haswell cpu is the 4790k
at 4.4
but thats way too much
In terms of money?
Less than 200 usd used
thats more than the dell system itself
the lowest buy it now is 167 + shipping
with that money i could get a i3 10100
no
new cpus for the server
for the future
not right now
the cpus i currently have are the i3 4340 and a pentium g3220
How many players
Oh. You don't need anything too powerful then
I bought a server with E3-1240 16GB RAM and 500GB HDD for like $180 2 years ago
nice
im trying to get 2 optiplex 9020 usff
for less than 110
but no seller is willing to part out
:/
wait
does the xeons need a specific chipset?
They work in same ones as desktop counterpart
You'd just have to verify which family it belongs to on Intel ark website
seems to be compatible
package DuderItems;
import java.util.ArrayList;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import net.md_5.bungee.api.ChatColor;
public class DuderItems implements Listener {
public void giveItems(Player player) {
ItemStack item = new ItemStack(Material.YELLOW_FLOWER, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.YELLOW + "THIS IS A TEST");
ArrayList<String> lore = new ArrayList<String>();
lore.add(ChatColor.WHITE + "THIS IS ANOTHER TEST");
meta.setLore(lore);
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
item.setItemMeta(meta);
player.getInventory().addItem(item);
}
}
Whats wrong with my code?
please ping me if you can help
Looks like you need to be listening for something specific @clever swan
I am, am I not?
package Events;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import DuderItems.DuderItems;
public class EventsClass implements Listener {
private DuderItems di = new DuderItems();
@EventHandler
public void onPunch(PlayerInteractEvent event){
Player player = event.getPlayer();
di.giveItems(player);
}
}
Here is my Events class
what about it doesn't work
It implements listener
Instead implement the listener for what you're listening for
how would I go about doing that?
there should be a listener for the event
Ok here's some example code
Are you registering the Listener?
it's not my code either, all credit to _11
there is a listener
Are you registering the Listener?
yes @gilded nova
Hey TheShinyLizard! Please don't tag helpful/staff members directly.
That class looks fine to me tho
watch videos
Doesn't look like you're importing the events package either
i have a decent understanding of java
And also what kinda IDE is that
eclipse
Noooo
?
:(
use inteliij?
Yes
xD
whats wrong with eclipse
everything
everything
lmao
Lmfao
eclipse is garbage but i like it
It's not as good as intellij and that's what matters
yeah
Especially when you're new
microsoft visualstudio
It's free, it's great, just do it
so what would i use then
I use mspaint
intellij idea
there we go
IntelliJ!
how do I fix the error?
Make plugins on a redstone computer
@clever swan you aren't from the snippets you sent importing the events class
Make plugins on a redstone computer
yes
And you aren't telling the class when to do the thing
everything looks to be imported correctly
join V1 i'll show you
nvm
screensharing isnt allowed
Lmao
but yes, everything seems to be imported correctly
I see
Create an AI that can make your plugin. Ez
Create an AI that can make your plugin. Ez
@lofty compass make an ai that makes an ai to make any plugin
those are the only errors
Events class needs to implement the event listener for the thing you're doing @clever swan
Can't just implement generic Listener afaik
Endless AIs making each other
I don't think they're trying to listen in that class they just made it implement listener for no reason?
so I should just remove it?
This line
See how it implements specific listeners for events that happen
oh
Luck doesn't wanna swap :(
For Bukkit events, you need to implement Listener, there is not a specific listener class/interface for each event
Really?
Yep
He doesn't want clippy to be self-aware
Stupid bukkit
Β―_(γ)_/Β―
what version are you using btw?
so if I don't need a specific listener, then what should i do?
Welp I'm out of ideas and on mobile lol
what version are you using btw?
Spigot 1.8.8
ah
larry all good ty for the help
I'll send a screenshot of the project hold on
sorry for the light mode
did you register the eventsclass listener
As long as you don't use discord in light mode, it's okay
yes Jordan I did
Lizard show your onEnable method
wdym, onEnable?
...
..
holy shit
...........
I forgot to set that up...
LMAO
i'll be right back....
im smol brain sorry
this is my 2nd plugin btw
aa don't worry, I've been making plugins for months and I still forget to register my listeners
also maybe you should have a main package
lmao
whats that other ide u guys use? Intellij?
package me.FlameDuder.DuderItems;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
public void onEnable() {
System.out.println("Enabling DuderItems");
}
public void onDisable() {
System.out.println("Disabling DuderItems");
}
}
what's the problem now?
you didn't register the listener
sec
Bukkit.getPluginManager().registerEvents(new EventsClass(), this);
something like that
now it's saying I need to attach a source?
package me.FlameDuder.DuderItems;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import me.FlameDuder.Events.EventsClass;
public class Main extends JavaPlugin {
public void onEnable() {
System.out.println("Enabling DuderItems");
Bukkit.getPluginManager().registerEvents(new EventsClass(), this);
}
public void onDisable() {
System.out.println("Disabling DuderItems");
}
}
idk thats what its sayin
"it's saying", what is?
eclipse
eclipse
eclipse is telling me i need a source
uh from a quick google you probably added the jar to your build path instead of using gradle or maven?
uh from a quick google you probably added the jar to your build path instead of using gradle or maven?
@vast isle how would I check this?
gradle or maven
ever heard of these two?
yes
do you have a file named "build.gradle" or "pom.xml" somewhere in the project?
Could've said no but okay
https://www.spigotmc.org/wiki/spigot-maven/ I recommend gradle
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I see the ossue
yeah I used graddle im pretty sure
You're using ecplise
xD
lmao
*links maven tut* I recommend gradle
it has the gradle tutorial on there too
I see the ossue
You're using ecplise
ikr
ok, so then I should be good, no?
Kinda
I think what they meant is that you haven't configured gradle to download source jars
That's why you can't see the source file
I see
org.bukkit.plugin.InvalidPluginException: main class `me.FlameDuder.DuderItems.DuderItems' does not extend JavaPlugin
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:73) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_211]
Caused by: java.lang.ClassCastException: class me.FlameDuder.DuderItems.DuderItems
at java.lang.Class.asSubclass(Unknown Source) ~[?:1.8.0_211]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:71) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
... 7 more```
this is the error I get whilst loading the plugin
you set the wrong class as your main class
^
the main class should be the one with your onEnable method
^^
i see thank you
i swear to god you guys are so nice the coding community is epic thank you.
the coding community is epic
just don't ask for help in HelpChat lmao
they'll tell you this and that about your code, how you should do and shouldn't do things, to change everything and rewrite things
And you'll walk out with your main issue unsolved
π
why is spigot 1.16 downloading at 12KB/s
can someone give me a mirror link
bukkit's servers are slow
org.bukkit.plugin.InvalidPluginException: main class `me.FlameDuder.DuderItems.DuderItems' does not extend JavaPlugin
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:73) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_211]
Caused by: java.lang.ClassCastException: class me.FlameDuder.DuderItems.DuderItems
at java.lang.Class.asSubclass(Unknown Source) ~[?:1.8.0_211]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:71) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
... 7 more```
New error
Nice
@deft thistle are you talking about getbukkit?
For reference that is my main
package me.FlameDuder.DuderItems;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
public void onEnable() {
System.out.println("Enabling DuderItems");
}
public void onDisable() {
System.out.println("Disabling DuderItems");
}
}
Lizard, in your plugin.yml, set main: me.FlameDuder.DuderItems.Main
remember
the main class, the one that extends JavaPlugin, is the one that contains your onEnable
LMFAO
im trying to learn how to make a plugin
pog
Let's say that getbukkit is doing not so legal things by letting you download the server jar directly
wut
ok the plugin loaded!
neat
but it's not doing anything...
its still downloading at 20KB/s
no errors in the plugin
lmao well idk
and its not doing anything
https://www.spigotmc.org/wiki/using-the-event-api/
@clever swan
u @ ur self lmao
yea cause of the quote
package me.FlameDuder.Events;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import me.FlameDuder.DuderItems.DuderItems;
public class EventsClass implements Listener {
private DuderItems di = new DuderItems();
@EventHandler
public void onPunch(PlayerInteractEvent event){
Player player = event.getPlayer();
di.giveItems(player);
}
}
I believe I did everything correctly
ok
package me.FlameDuder.DuderItems;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
public void onEnable() {
System.out.println("Enabling DuderItems");
}
public void onDisable() {
System.out.println("Disabling DuderItems");
}
}
you don't register the event here
CHECK THE DAMN LINK I SENT
naisu
ok, no errors, no nothing, the event just doesn't work
package me.FlameDuder.DuderItems;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
@Override
public void onEnable() {
System.out.println("Enabling DuderItems");
getServer().getPluginManager().registerEvents(new DuderItems(), this);
}
public void onDisable() {
System.out.println("Disabling DuderItems");
}
}
here is the main
package me.FlameDuder.Events;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import me.FlameDuder.DuderItems.DuderItems;
public class EventsClass implements Listener {
private DuderItems di = new DuderItems();
@EventHandler
public void onPunch(PlayerInteractEvent event){
Player player = event.getPlayer();
di.giveItems(player);
}
}
Events class
im going to kms
im kidding
Welcome to the world of programming
π
time to make the code more complex
meta.setDisplayName(ChatColor.YELLOW (ChatColor.BOLD) + "Miner Shard");
any way to do this?
ah true
thank you
meta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Miner Shard");
While you can do what you mentioned above, I figured this would be easier
I would just make a util function that uses the translateAlternateColorCodes or whatever and use & with the colour code
^
That is not enough info lol
wdym?
my test plugin isnt being loaded by paper
Any errors?
Please use https://bytebin.lucko.me to send files in the future. I have automatically uploaded message.txt for you: https://bytebin.lucko.me/aDgbf218Sv
pog
what
You're probably running the server with Java 8
But compiled the plugin with Java 14 (most probably)
Why doesn't this work?
what should I include?
You're not importing the event class
btw this is a great place to know what does what and where are things in the bukkit api https://hub.spigotmc.org/javadocs/spigot/index.html
where can i get the java 8 jdk
which vendor
wat
i just used oracle openJDK
where
idk
Fefo, with eclipse you can auto import and it's not working
it doesn't bring up any imports from the harvest event
Import it manually idk
brb
What does it say when you hover over it?
Which jar did you import, the server version
1.8.8
im using javadocs 1.8.8
It probably didn't exist by then
is it possible to add a plugin without restarting the server?
im running paper
is it possible to add a plugin without restarting the server?
im running paper
@fallow talon no
ok
yea leave it with openjdk
try leaving it as oracle openjdk and just changing the version
yea leave it with openjdk
@gilded nova but it doesnt have java 8
Hey Muhammadβα΅α΅Κ³αΆ¦αΆ αΆ¦α΅α΅! Please don't tag helpful/staff members directly.
ah
JetBrains Academy (free online course): https://www.jetbrains.com/academy/
Codeacademy (free online course): https://www.codecademy.com/learn/learn-java
University of Helsinki (free online course): https://java-programming.mooc.fi/
Basic Java Tutorials: https://docs.oracle.com/javase/tutorial/
Beginner Help: https://discord.gg/hVtnwGd
These links may serve some use to java novices
Introducing JetBrains Academy β a hands-on platform for learning to program. Learn to program by creating working applications step by step in an interactive environment integrated with JetBrains IDEs.
Utilize our Java tutorial to learn the basics of the popular language, including Java objects, in this introductory course.
Helsingin yliopiston kaikille avoin ja ilmainen ohjelmoinnin perusteet opettava verkkokurssi. Kurssilla perehdytÀÀn nykyaikaisen ohjelmoinnin perusideoihin sekÀ ohjelmoinnissa kÀytettÀvien tyâvÀlineiden lisÀksi algoritmien laatimiseen. Kurssille osallistuminen ei vaadi ennakko...
Hard to do on mobile
Write the links in <>
I copied and pasted its I really dont want to rewrite it at this point
Anyway to fix the setItem being red?
you can't put a method inside a method?...
nice!
public void setItem(ItemStack item)
How can I use the setItem to edit a diamond ore drop?
@EventHandler
public void setItem(ItemStack item) {
BlockEvent event;
Block diamond = event.getBlock();
if (diamond instanceof ItemStack(Material.DIAMOND_ORE, 1); {
}```
This does not work
What part
Try == perhaps?
Not sure if Block can be an instance of ItemStack cause I really don't know bukkit enough
What im trying to do is just edit the diamond ore drop table
diamond.getType() == Material.DIAMOND_ORE
by the way
that method isn't an event handler
I mean, it isn't taking an event as parameter
Also, not sure, but I think check your brackets again
You're right, his brackets are also mangled
And a ;
ok thank you all again!
This is what I came up with, and it doesn't seem to be working
are you trying to write a boolean to Block ?
No
Then why the hell are you writing something into block while trying to do a comparison in the same line?
where I can find oldand new name of minecraft blocks for config, no id list
@sand mountain java docs materials
np
what are you trying to accomplish here?
Block block = event.getType() == Material.DIAMOND_ORE;
im trying to make it so when the player mines a diamond ore, it drops a different item
But the first part is making Block equal what follows, and the second part is comparing the type with Material_DIAMOND_ORE
oh ok
String var = "String" // variable var is now "String"
if(var == "String"){ //compares if var equals "String"
// If it equals, do the code put in here
} else {
// if it doesnt equal, do the code in here
}
Wait why do I see strings compared with == π
.equals()
I wish I could help more with Java xP
I am more of a web based languages type and sum c++, bash, sql and lua
oh cool
If I say what web language I get punched again XD
Assembly?

Omg
XD
I agree, php 7.0 and 7.1 were horrible, but up from 7.2 they implemented OOP really well
I still don't understand #equals in Java. You need to use it for strings but the rest works pretty fine with ==
...
Well not in java ( I think )
In languages without a hard variable type you sometimes also need to equal if the variable is the same value and the same type
package me.FlameDuder.Events;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockEvent;
import org.bukkit.inventory.ItemStack;
import me.FlameDuder.DuderItems.DuderItems;
public class EventsClass implements Listener {
private DuderItems di = new DuderItems();
@EventHandler
public void onBreak(BlockBreakEvent event) {
Player player = event.getPlayer();
di.giveItems(player);
}
}```
Ok, how would I make it that it only gives it when the player mines diamond_ore?
it now works for mining
I would say
if(event.getType() == Material.DIAMOND_ORE){
Player player = event.getPlayer();
di.giveItems(player);
}
because you want to check if the type equals a DIAMOND_ORE
( wait until they find out about === )
Afaik Java doesn't has this (and so no spongebob meme :(
because you want to check if the type equals a DIAMOND_ORE
ok thank you
this error pops up
it says getType() isn't a thing for BlockBreakEvent
getBlock is propably the function you actually searched for
declaration: package: org.bukkit.event.block, class: BlockBreakEvent
bold of you to assume I use 1.16.2
it's still event.getBlock().getType()
its still getBlock
The old JavaDoc theme tho, great HelpChat
then why do I need getType()?
ok thank you
( I think at least XD )
Because you first need to get the block from the event, and then you need to get the type of that block, to not waste unecessary RAM space you just run the function directly on the return of the previous function
sounds epic
That might work
declaration: package: org.bukkit, interface: World
I already tried dropItem()
And?
you implemented your own class and it doesnt have that method
ok, I'll just keep it as is, I would have to change a lot of the code. I'll get to changing it after I get the basics down. Thank you for the help!
it's eclipse
π€’π€’π€’
because it always returns true
Not just because of that
oh shoot
yes because he messes up the if statement :3
there we go
time to test
[17:26:27 ERROR]: Error occurred while enabling Tutorial v0.0.2 (Is it up to date?) java.lang.NullPointerException: null at muhammad001.tut.commands.HelloCommand.<init>(HelloCommand.java:15) ~[?:?] at muhammad001.tut.Tutorial.onEnable(Tutorial.java:10) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.1.jar:git-Paper-133] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.1.jar:git-Paper-133] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.1.jar:git-Paper-133] at org.bukkit.craftbukkit.v1_16_R1.CraftServer.enablePlugin(CraftServer.java:500) ~[patched_1.16.1.jar:git-Paper-133] at org.bukkit.craftbukkit.v1_16_R1.CraftServer.enablePlugins(CraftServer.java:414) ~[patched_1.16.1.jar:git-Paper-133] at net.minecraft.server.v1_16_R1.MinecraftServer.loadWorld(MinecraftServer.java:471) ~[patched_1.16.1.jar:git-Paper-133] at net.minecraft.server.v1_16_R1.DedicatedServer.init(DedicatedServer.java:241) ~[patched_1.16.1.jar:git-Paper-133] at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:941) ~[patched_1.16.1.jar:git-Paper-133] at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-133] at java.lang.Thread.run(Unknown Source) [?:1.8.0_261]
oop
what happened
The best friend of every Java programmer
oh wow
the ide told me this will happen
Method invocation 'setExecutor' may produce 'NullPointerException'
pog
IJ β€
did you set the command in your plugin.yml
Main?
hold on
i meant where
its "commands:"
how would i make it to where it doesnt over write the old jar file
Hm?
Why?
archive
Move the old jar file to somewhere else?
or rename it
ez
Congrats
baby steps
Hmm
Im not sure cause i know nothing about java or that stuff
Also u might want to use waterfall instead of bungeecotd
And paper instead of spigot
Yes for both, though them both register in places as their base types
And to change that you need to change the server brand in the jar file
Basically get paper source from GH and change the one part
No idea where that is though
Both waterfall and paper are open source and u can get the source code on github
You just need to change the thing and compile it
It's a bit scary that Hypixel has it so it only shows "Vanilla server " + the version YOU are connecting with
spooky
I mean it's not hard to achieve
but damn
what they have is FAAAR from vanilla
Hypixel has a heavily modified version of spigot
And bungeecord
Yeah
Rumor has it that, their "frontend" of proxy, what handles the connections themselves on a lower level, runs under some node.js or something, I don't quite remember
Then of course for the packets processing, plugins, commands and all that it's bungeecord
There's no way around that part
Not much is really known about hypixels backend
why does this happen
@deft thistle Learn basic Java before spigot api
silence
smh
Is it weird that the only js i know is node.js
And i only know how to use discord.js with it
No its not weird because a lot of people dive straight into actually using APIs and such before learning the basics
Yeah
and 9 times out of 10 it fucks them over when they cant solve basic errors
Discord api was the first api i learned
Well its the only api i know
Did you learn off youtube?
Yeah
Classic
I haven't touched js
I have attempted to make a spigot plugin before
And it didnt work
Once you can make a helloworld, it's honestly not that hard
Until you try to make luckperms
and other big plugins
lol
Lol
Luckperms is mainly a temp plugin
For me
Temporary?
Cause i do plan to get a custom perms system made
Until you try to make luckperms
@gilded nova but multiple people worked on this plugin not one person
What quote
Until you try to make luckperms
https://discordapp.com/channels/241667244927483904/420538367986499585/747254928153510068
lol they're in for a surprise
accidentally put that in bloody #luckperms-api
A perms plugin is deff a very advanced thing
why do you need a custom perm plugin?
Probably not too hard to make a basic one. But one remotely close to luckperms would be a nightmare for any beginner
Probably not too hard to make a basic one
Ever checked GroupManager's code?
I could probably make that and better lmfao
True haha never looked at the code because I've never used that pile of shit
Groupmanager is simple
But trash
And absolutely horrid for a real server
You can literally set a normal, a negated and an "exclusive" node all on the same holder
Plus, you can mark several groups as default
Or none!!
My pc parts a fkn delayed because Australia post is held up as a result of covid lockdowns π
Plus, you can mark several groups as default
My brain
Fun part is, I wanted to make a PR to LP so, when migrating from GM, the group marked as default would be moved to the default group
That's how I found out
Pex is somewhat good
I think itβs out of date tho
LP is highly inspired on it
Yeah
I mean, look at the commands syntax
Pex's page literally says to just use luckperms doesnt it?
It does lmao
lol
Yikes
Well yea they are making a PEX v2
They even have a section in MOSS discord
(as well as many other plugins do)
lmao they are telling you to get LuckPerms
Luckperms is a very good plugin
@deft thistle make a permissions plugin now
(dont skid)
"in the meantime"
Many big servers use luckperms
i already know basic java
if you did, you'd know spigot api isnt basic java
it isnt
π€¦ββοΈ
or
uh
trick question, if you knew your logical operators (basic java) you'd know thats not a thing
well i never said it was
uh means idk
! dont be annoying
Good luck with spigot api
yes
I mean, IIRC, ^ is an operator in c++, unsure but
If this isn't sex to the eyes, having nothing in console for hours and hours
dang
nice
Fefo are you from Australia?
Not that I know of
lol
You seem to always be online (during the time im awake)
That's because I'm always online
So you don't sleep?
Not that I know of
Truth
Sleep is for the weak
For C++
Yep
So is for java
But it's not for a condition, it's an arithmetic operator
XOR
for math
