Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by Syanko, Jun 9, 2018.
i wanna make when place lava or water it will remove in 10 seconds why it is not working i dont know
What it is actually doing?
Does it set any block to air or it is not even doing it?
it does nothing
Have you registered your Listener?
Btw you can use
event.getBucket() == Material.LAVA_BUCKET
im not good at english i saved to imports
What are these class names?
This isn't good, please put your stuff in a subpackage of your original package, that way your future plugins won't conflict.
This will set the BLOCK CLICKED to air, not the actual placed lava.
You can use == for enums, which is preferred on here.
Also, you forgot to register your listener.
how to register listener ? Jantuck please make this i need
You'll need to know Java before creating Spigot plugins.
Registering listeners is done with the registerEvents method, see https://bukkit.gamepedia.com/Event_API_Reference#Registering_Events
Your listener class should not extend JavaPlugin. This is only for the main class. To register a listener, in your main class do this:
getServer().getPluginManager().registerEvent(new elo(), this);
Put that inside your onEnable(). Sorry to spoonfeed everyone else but he may be able to learn by reading established code.
pff I think you haven't done that much plugins or used listeners
in your case is e.getBucket() since you have decided to use e as a variable name of your event
public void onPlace3(PlayerBucketEmptyEvent e)
To Register a listener:
in your onEnable()
Bukkit.getServer().getPluginManager().registerEvents(new Elo(), this);
Btw change your class name to start with upperCase in Java classes starts with UpperCase
still not working
it working but doesnt do anything
i did and
You did it but wrongly.
You put @EventHandler inside onEnable wtf
Please, follow the instructions with the two links I send you to create a plugin. Otherwise you will never do it correctly.
This error is firing due to the fact that you are creating a new instance with new elo() at onEnable which is stupid.
Then you have to register the listener in the same class with this, this instead of using a new.
Btw i told you to change the class name to start with UpperCase.
If you do not have the patience to learn at least the most basic of java how do you expect to create a plugin?