Comments (13)
Note: MyPlugin
extends org.bukkit.plugin.java.JavaPlugin
but does not have its own constructor.
from nicknamer.
It would be most helpful if you could just show me how I am meant to use your plugin's API to set a player's name above their heads.
from nicknamer.
There are examples on how it's intended to use the simple nick API in the plugin's description.
You cannot create new instances of classes extending JavaPlugin, Bukkit does not allow that, that's why you get an exception.
You are also not supposed to create a new instance of the SimpleNickManager. If you want to use it, you can get its instance via NickNamerAPI.getNickManager()
.
from nicknamer.
OK so I changed the lines
SimpleNickManager nameAboveHead = new SimpleNickManager(new MyPlugin());
nameAboveHead.setNick(uuid, rank + player.getName());
to the line
NickNamerAPI.getNickManager().setNick(uuid, rank + player.getName());
and I imported org.inventivetalent.nicknamer.api.NickNamerAPI
Now craftbukkit throws this error on a player's join event:
Caused by: java.lang.NullPointerException
at io.github.theonlygusti.wizardserver.PlayerListener.onPlayerJoin(PlayerListener.java:77) ~[?:?]
from nicknamer.
What's on line 77 of your PlayerListener class?
from nicknamer.
NickNamerAPI.getNickManager().setNick(uuid, rank + player.getName());
from nicknamer.
Probably the NickManager or player
is null.
Make sure you have the NickNamer plugin installed and declared as a dependency in your plugin.yml.
from nicknamer.
I don't want to have to do that, why isn't referencing the dependency via Maven enough?
from nicknamer.
Because you are using the NickManager.
As I said, an example on how to use just the simple api, without the plugin is in the plugin's description.
from nicknamer.
I'm sorry for being a pain, but I literally have no idea how to use the API. I just added this to my PlayerListener class:
@EventHandler
public void on(NickDisguiseEvent event) {
event.setNick("inventivetalent");
}
it does nothing, and it is literally all I can see in the example you keep referencing.
from nicknamer.
Did you register your events properly? Does the event get called at all?
If you're still trying to do it without NickNamer installed, I think you need to register it using APIManager. The instructions should be somewhere in the description.
from nicknamer.
There are no instructions, and no I don't think that the method is getting called.
from nicknamer.
Well, I must have removed them at some point. You can take a look at the PacketListenerAPI example, just add the dependencies (plugin.yml, pom.xml) and register NickNamerAPI.class
from nicknamer.
Related Issues (20)
- Nickname not changing above player HOT 1
- As of 3.19, user join/leave messages are not displayed HOT 6
- Disable changing nametag (above player head) HOT 20
- Tab complete fix
- Error HOT 1
- Plugin not launching HOT 6
- Plugin won't make a folder HOT 6
- NickNamer/PacketListenerAPI not working HOT 6
- Is this plugin capable of allowing commands that normally only run with playernames to work with nicknames? HOT 1
- Could not load 'plugins\NickNamer_v3.21.0-SNAPSHOT.jar' in folder plugins HOT 5
- Receiving errors with NickNamer / PacketListenerAPI
- Error loading plugin NickNamer HOT 4
- Error while players join
- An exception occured while trying to execute 'onSend' in plugin NickNamer. Error. HOT 3
- Nickname not working with other plugins that call for it. HOT 1
- Allow Duplicate Nicknames Setting HOT 1
- Dependency Dashboard HOT 1
- after setskin cmd, commandblocks gui don't come up and block-breaking particles are gone. HOT 1
- Plugin will not load | error HOT 3
- Paper 1.19.2 update needed PLZ.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nicknamer.