I’m working on a plugin for the competition and I’m running into a lot of missing features that I need. I know that part of the objective is to identify areas that are needed or not working. Are these something that I should submit as defects in git or post somewhere on the forums?
Currently I need these features:
Delete a world. Looks like currently folks are only disabling the world, not removing it. I need to be able to recreate it as a new arena from time to time.
Customization of world generation. Specifically, I need to be able to change the biome size for the world I create.
Sub-command help text. I’m just getting the top-level command help repeated.
Event handling for when mobs target and damage players and other entities.
Other plugins seem to only be disabling worlds right now, not deleting them.
Yeah. I’ve been poking around in there for a while now. I’ll need a bit more assistance on a concrete example.
I’ll try this event out again. Last time I did it didn’t work, but that may have recently changed.
Ok, I tried using this event. It is not a cancellable event so I tried reducing the damage to 0 instead. I did this by inverting the damage because from reading the docs it sounds like each of these is added to the base damage. It didn’t seem to even be called as I didn’t see any log messages at all. Here is what my handler method looks like: method snippet
I think so, though I have not looked at the generator things in detail
This thread has some relevant help -
It also looks like @Deamon has wrote some draft documentation
I suggest searching both, in case your issue has already been discussed and a solution was found.
If you’re not sure if your code is correct it’s common for people to ask on the forums or IRC and if there seems to be a problem with the implementation or something is missing from the API, a GitHub issue is best so it doesn’t get forgotten about.
Thanks simon! I really appreciate your assistance.
Earlier when I asked about reporting issues, my main concern was how to communicate what things we need for the plugin competition, not necessarily general bugs and the like. Is the forum the best place for those kind of issues?
TBH just report it anywhere, we have enough eagle eyes watching over the forums/IRC/github that the message will be sent to the relevant people.
If it’s something missing then I’d suggest using github but it doesn’t really matter.
InteractEntityEvent is currently only used when a player interacts with an entity. If you want non-player attacks then you will need to wait for DamageEntityEvent to be finished. However, there are definitely some cases where I can fire this event for non-players, I’ll have to look at it some more.
SpawnEntityEvent only working in some cases sounds strange. You need to provide your listener code.
DisplaceEntityEvent can do.
SpawnEntityEvent definitely works with spawn eggs. Again paste your listener code.
Cancelling explosion for a creeper only working the first time doesn’t make much sense. Paste your listener code.
Thanks blood. Btw, I really like the cause and event system so far. It has made handling a lot of these common events much easier (and less verbose) than it was in canary. My source code for the listeners can be found here:
To follow up on your comments:
I’d prefer to use InteractEntityEvent because I can just cancel it, but if I have to I suppose I could make the damage 0 using DamageEntityEvent. I’m assuming that one cannot be cancellable. Is there going to be an event that I can use to cancel mobs from targeting the player or other entities as well?
I think that there may be a conflict in my permissions checking on spawn eggs. I marked it in the source code with a comment. I think one of my other listeners is capturing it instead. I’ll do some testing.
On the creeper explosion, it was very strange. Several got cancelled in a row, but a third one happened in the same spot. I’m wondering if it is because of the closeness of the events and the like that one may not get registered.
Are your SpawnEntityEvent listeners supposed to stop those entities from spawning?
If so then doing final Optional<Monster> monster = event.getCause().first(Monster.class); is wrong: the cause is not the entity being spawned, rather, the cause is what made it spawn.
Instead, the actual entities being spawned are obtained using event.getEntities()
For spawn eggs, when the entity is spawned, the cause contains the player