question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation & Examples

See original GitHub issue

I can’t seem to get BlockDamageEvent to work. I did this in a file in python-plugins/:

from mcapi import *
from org.bukkit.event.block import BlockDamageEvent

@asynchronous()
def block_damage_event(e):
  yell('boom!')

add_event_listener(BlockDamageEvent, block_damage_event)

It fires other things in same file (like PlayerJoinEvent) but not this.

Is there a python-oriented set of docs anywhere?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Macuyikocommented, Jul 18, 2020

Very nice work! This project also included a web based interface in the past but was removed as I felt that would be better left to a separate repository/project and keep this one relatively focused.

I recommended /pyrestart for reloading the python scripts, because it seems like that’s what it’s for, but it doesn’t seem to actually reload the plugins. I also tried /reload confirm (on paper server) and it causes an error about the websocket port already being in-use

Those are some good points, pyrestart restarts the player-allocated interpreter, not the plugin interpreter. That should go in its own command. /reload confirm not being able to rebind to the websocket port is most likely a bug. I will look into modifying the plugin so it closes its ports down when unloading.

2reactions
Macuyikocommented, Jul 17, 2020

Actually BlockDamageEvent works as well when testing it.

image

According to the Bukkit API docs:

BlockBreakEvent is called when a block is broken by a player. BlockDamageEvent when a block receives damage from a player.

Read more comments on GitHub >

github_iconTop Results From Across the Web

12 Best Documentation Examples - HeroThemes
Some examples of project documentation include project proposals, project plans, business cases, status reports, and so on.
Read more >
12 Types of Technical Documentation +Examples (2023)
These 12 types of technical documents guide users through your product, explain your processes, and improve your sales and marketing.
Read more >
Software Documentation Best Practices [With Examples]
In this guide, we cover software documentation types, examples, and best practices for improving the quality of your documentation process.
Read more >
8 Great Examples of Developer Documentation - Zapier
This post shows eight examples of great developer documentation, where the time invested yields great dividends for the app's teams.
Read more >
Project Documentation: Examples and Templates - Nuclino
Examples of project documents; The value of project documentation ... Here are five project document examples that your project will likely require.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found