I am trying to detect a saddle being put on a horse and seems I cannot get it to run. Any help on capturing this event would be helpful.
Does OnNpcAddSaddleEvent Work?
- angriff
- Thread is Unresolved
-
-
angriff
Changed the title of the thread from “Does OnNpcAddSaddlEvent Work?” to “Does OnNpcAddSaddleEvent Work?”. -
yes it works. did you add the @EventMethod above the method?
-
yes it works. did you add the @EventMethod above the method?
yes I did. it stops my other routines from working. Anyway I am trying a different routine and avoiding this method. Been fighting that one to long
Just for discussion now, did you when you got it to work ---- public void OnNpcAddSaddle(NpcAddSaddleEvent evt) { --- to capture who is doing it and to what npc?
-
Yes. Did you make sure your build file and the plugin.yml file are correct for the project?
-
I am just going to start a new project and try to copy paste the code. Been fighting this for days now. If I worked for me as a programmer I would fire me.
I mean it stops the other routines from working. I had a weird thing I did not understand. In the register listener () I had a red this. When I retyped it it turned blue. Not sure what that was in netbeans.
-
I am just going to start a new project and try to copy paste the code. Been fighting this for days now. If I worked for me as a programmer I would fire me.
I mean it stops the other routines from working. I had a weird thing I did not understand. In the register listener () I had a red this. When I retyped it it turned blue. Not sure what that was in netbeans.
do you have discord? I'm more than willing to help you out it's just hard to understand in the forums. When u make a new project you have to create a resources folder and place a plugin.yml file in it. The yml file tells the server where where to start sorta like the main method. Also you have to implement Listener and register the event Listener in the onenable method.
-
I appreciate that. I do have discord. But for now i am going to try this thing. I had to retype the if(def.type == Npcs.Type.Mount) line to get it to stop flagging me. Funny the old routine needed one more import than the new one to get the flags to go away.
I have already converted several of my routines and added a new one so I am not totally lost on what it should look like but this one is killing me.
It stops all the routines from working and it will not work on its own. Hopefully this clean build will get rid of whatever got transferred over. I will DM you if we i decide to take you up on Discord screen share.
-
Here is a stupid question. In the YML file does it matter if the file name is first letter capitalized.lowercase or the directory is on the server? Seems I have a few that have them reversed but they seem to work?
-
OMG So many issues. I kept looking for a stupid syntax error and it was the .yml file after all. You look at something and look at it and dont see it.
The .yml file was written with the main and the capitalization reversed the MAIN line between the package and the path. I am sure it was the same problem with the original method I was trying that really I liked better.
Guys please dont laugh too hard..
I should put a warning on this thread to not be drinking coffee when you read it. You might spit it all over you screen when you read this.
-
I believe it's packagename.filename
I ran into a lot of issues when I first started learning Java a few years ago lol
-
From the JAVA version forums Getting Started. Create a Plugin
(the path to your main class, including the full package name)
name: MyPlugin
main: net.mypackage.myplugin.MyPlugin
version: 1.0.0
author: <your name>
team: <your team, optional>
description: "Put your description here"
license: MIT
website: http://www.myhomepage.com
Thanks for all your help and suggestions. It did help me clean up some of the code. I am glad NetBeans saves history as I almost deleted the first
routineMethod that looked like it would work but frustrated me because of what turns out a typo in the .YML file. -
I just made a template and I always name my package the same as the main file.
-
I just made a template and I always name my package the same as the main file.
Well that was the mistake they had the same name but one was capitalized.
-
red51
Moved the thread from forum Discussions (English) to forum New Plugin API.
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!