Comments (10)
Not sure I follow the intent of this request.
Are you looking for an event notification system? By this I mean you want to write a plugin, have that plugin register interest in a Denizen, and then be notified of what that Denizen does? There may already be a way to hook into what you want with the basic Bukkit and Citizens APIs.
from denizen.
What he wants is a command that would trigger an event. Dan made a trader character that has a few methods to trade, sell, etc. What he envisions is a script that allows the player to interact with a Denizen, but could also initiate a trade.
from denizen.
Ahh, ok. Now I understand better. I guess we'd just have to check CommandSender to see if it is an instance Player like Denizen does already, and then expose something like /denizen trigger <npc> '<script-name>'
that would lookup the NPC, make sure it is a denizen, and then invoke the named script?
Should these types of scripts be a new kind of Trigger or should any script be allowed to be triggered?
from denizen.
Hmm... interesting though, but I was thinking the other way around, his trader listening for a Denizen event. Like an EVENT [event] script command. His plugin could listen for the Denizen event . EVENT could initiate a custom bukkit event with the information in brackets.
from denizen.
At least I think that can work, haha.
from denizen.
Ok, let me restate to make sure I've got it. Basically there are two parts here. One part is the script part:
'Name of script':
Type: Trigger
...
Steps:
1:
Click Trigger:
Script:
- EVENT This is my custom event data.
And the other is a new custom event we broadcast with Bukkit as so:
// Create the event here with some context, and the event data specified in the script.
DenizenCustomEvent event = new DenizenCustomEvent(thePlayer, theDenizen, eventData);
// Call the event
Bukkit.getServer().getPluginManager().callEvent(event);
// Now you do the event
Bukkit.getServer().broadcastMessage(event.getMessage());
Is that what you were thinking?
from denizen.
And yep! Exactly! That'll work, right?
from denizen.
Good question. Bukkit's wiki mentions custom events, but no word on whether or not other plugins can see them. I'll code up a quick test to validate this.
from denizen.
yeah you can see them like the NPC events build in Citizens2.0 or the Citizens1.2 API where hooking into citizens mainly consisted of event listening, btw would it be of any use to make the events working only for the plugin that made them?
from denizen.
This is addressed in 0.7 which will be available really soon. It features a modular command system. Requirements will be soon.
from denizen.
Related Issues (20)
- Plugin Fails to Enable on 1.18.2
- mechanism loot_table_id HOT 1
- MongoDB
- NPCs Sinking into ground instead of sitting HOT 1
- Spread Around New Tag Param Usage, Static Tag Registration, new Property format, and Command autoExecute HOT 1
- Short-circuit tags HOT 1
- Move Denizen packet listener to async, HOT 2
- Chicken EggLayTime mechanism feature HOT 1
- folder delete
- Improve Tag <PlayerInventoryTag.map_slots> HOT 1
- Add wolf collar dyed and cat collar dyed event HOT 2
- New FurnaceStartsSmeltingEvent returns an incorrect total_cook_time context value
- Discord Appeal HOT 1
- Custom explorer maps creation
- Update to 1.19.4 HOT 1
- Nested translate tags produce broken strings HOT 2
- Oraxen Support HOT 3
- Some artifacts are missing in the published Maven artifacts HOT 1
- java.lang.NoClassDefFoundError: net/citizensnpcs/trait/HologramTrait$HologramDirection HOT 2
- NoClassDefFoundError "craftbukkit/v1_20_R3/inventory/CraftInventoryCustom" HOT 1
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 denizen.