⚡ Minecraft ✗ 地震速報

訊息提示 ✗ 語音播報 ✗ API

📖 插件介紹

當有地震發生時,插件能立即推送通知,顯示震央位置、規模與震度資訊。

使用者可以自行設定所在地與預警震度,當地震達到或超過該設定值時,才會觸發提醒,避免過度打擾。

插件內建語音播報功能,可在第一時間以語音提醒使用者,讓你即使沒有盯著螢幕,也能即時獲得地震警報。

當地震可能引發海嘯時,插件將立即發送海嘯警報,並顯示預估海嘯到達時間與影響範圍,提醒使用者保持警戒。

此外,插件支援API 調用,方便其他插件或服務串接。

⚠️ 提醒:本插件資料來源於 中央氣象署 (CWA),資訊僅供參考。
⚠️ 使用前請詳閱「關於地震速報」,如繼續使用,即視為了解且同意該頁面內容。
插件截圖

✨ 功能特色

📥 下載與安裝

你可以從以下來源取得最新版本:

💡 支援版本: Minecraft 1.21.X 或以下

立即下載

下載後請 聯絡開發人員 以提供後續步驟 (建議使用Discord)

🎧 安裝材質包

此外,請安裝以下材質包,以供播放語音及音效

💡 支援版本: Minecraft 1.21.X 或以下

立即下載

🛠️ Developers

To use this plugin api in your project, you need to first include the JAR file manually:

  1. Download the plugin JAR file (EarthquakeEarlyWarning.jar).
  2. Copy the JAR file into your project's libs directory (create it if it doesn't exist).
  3. Add the JAR to your project's classpath:
    • If using an IDE like Eclipse: Right-click your project → Properties → Java Build Path → Libraries → Add JARs → select the JAR.
    • If using IntelliJ IDEA: File → Project Structure → Modules → Dependencies → + → JARs or directories → select the JAR. And than add the dependency to your pom.xml
      
      <dependency>
          <groupId>tw.earthquake</groupId>
          <artifactId>EarthquakeEarlyWarning</artifactId>
          <version>1.0-SNAPSHOT</version>
          <scope>system</scope>
          <systemPath>FILE_PATH/EarthquakeEarlyWarning.jar</systemPath>
      </dependency>
                                  
    • If using command line: include it when compiling, e.g.,
      javac -cp libs/plugin-name.jar src/MyApp.java
  4. Once the JAR is added to the classpath, you can import the plugin classes and use its API in your code.
❗ Don't forget to add depend in your plugin.yml file.
depend: [ EarthquakeEarlyWarning ]

Class, Event & Example

📌 Event: earthquakeReceived

The earthquakeReceived event is triggered whenever a new earthquake eew is received. You can listen to this event to handle real-time earthquake data in your plugin.

• Event Usage Example


// Listen for the earthquakeReceived event
@EventHandler
public void onEarthquakeReceived(earthquakeReceived event) {

    // Retrieve the earthquake data, including the level and countdown seconds, for the location "Taipei".
    // You can check the permitted locations below.
    LocationData taipei = event.getLocationData("Taipei");
    int second = taipei.getSecond();
    Level level = taipei.getLevel();

    double latitude = event.getLatitude();     //e.g. 22.53
    double longitude = event.getLongitude();   //e.g. 122.61
    double magnitude = event.getMagnitude();   //e.g. 4.5
    String address = event.getAddress();       //e.g. "台北市中正區公園路64號"
    int depth = event.getDepth();              //e.g. 10
    int time = event.getTime();                //e.g. 1758482415
    Level maxLevel = event.getMaxLevel();      // introducing below

    // DO SOMETHING ELSE...
}
            

📌 Event: tsunamiReceived

The tsunamiReceived event is triggered whenever a new tsunami warning is received. You can listen to this event to handle real-time tsunami data in your plugin.

• Event Usage Example


// Listen for the tsunamiReceived event
@EventHandler
public void onTsunamiReceived(tsunamiReceived event) {

    // Retrieve the tsunami data, including the arrival time and wave height, for the area "北部沿海地區".
    // The permitted areas are the "北部沿海地區", "東北沿海地區", "東部沿海地區", "東南沿海地區", "西南沿海地區" and "海峽沿海地區".
    AreaData northArea = event.getAreaData("北部沿海地區");
    String arrivalTime = northArea.getArrivalTime();
    String waveHeight = northArea.getWaveHeight();

    double latitude = event.getLatitude();     //e.g. 53.0
    double longitude = event.getLongitude();   //e.g. 160.8
    double magnitude = event.getMagnitude();   //e.g. 7.8
    String address = event.getAddress();       //e.g. "俄羅斯堪察加半島"
    String source = event.getSource();         //e.g. "美國太平洋海嘯警報中心"
    String content = event.getContent();       //e.g. "頃獲太平洋海嘯警報中心通報...注意海浪突然湧升所造成的危害。"
    int depth = event.getDepth();              //e.g. 10
    String time = event.getTime();             //e.g. "2025-09-19 02:58:00"

    // DO SOMETHING ELSE...
}
            

📌 Class: LocationData

The LocationData class represents earthquake information for a specific location. It allows you to access key details such as the estimated intensity and the time in seconds for the earthquake alert.

⚠️ Important: LocationData instances must be accessed inside the earthquakeReceived event. Using it elsewhere may result in errors.

• Usage Example


LocationData taipei = event.getLocationData("Taipei");
int second = taipei.getSecond();      // e.g. 12
Level level = taipei.getLevel();      // introducing below
        

This class is useful for handling location-specific earthquake data within the plugin's API, allowing developers to access real-time intensity and timing information for different regions.

Available location parameters can be found below:

Parameter: Taipei

📌 Class: AreaData

The AreaData class represents tsunami information for a specific area. It allows you to access key details such as the estimated arrival time and wave height for the tsunami warning.

⚠️ Important: AreaData instances must be accessed inside the tsunamiReceived event. Using it elsewhere may result in errors.

• Usage Example


AreaData northArea = event.getAreaData("北部沿海地區");
String arrivalTime = northArea.getArrivalTime();    // "2025-07-30 13:41:00"
String waveHeight = northArea.getWaveHeight();      // "小於0.3公尺"
        

This class is useful for handling area-specific tsunami data within the plugin's API, allowing developers to access real-time arrival time and wave height information for different regions.

Available area parameters can be found below:

"北部沿海地區", "東北沿海地區", "東部沿海地區", "東南沿海地區", "西南沿海地區", "海峽沿海地區"

📌 Class: Level

The Level class represents the predicted earthquake intensity for a specific location. It provides convenient methods to retrieve the intensity as a string or integer and to compare intensity levels.


// Create Level objects
Level level1 = new Level("3 級");
Level level2 = new Level(2);       // corresponds to "2 級"
Level level3 = new Level("5 弱");
        

// Get values
int index = level1.getInt();            // 3
String levelStr = level1.getString();   // "3 級"

// Compare levels
boolean higher1 = level1.isBiggerThan(2);        // true
boolean higher2 = level1.isBiggerThan("2 級");   // true
boolean higher3 = level1.isBiggerThan(level2);   // true
boolean higher4 = level1.isBiggerThan(7);        // false
        
❗ Integer To Level Mapping
  • 0 → "0 級"
  • 1 → "1 級"
  • 2 → "2 級"
  • 3 → "3 級"
  • 4 → "4 級"
  • 5 → "5 弱"
  • 6 → "5 強"
  • 7 → "6 弱"
  • 8 → "6 強"
  • 9 → "7 級"

This class is designed to make it easy to compare earthquake intensity levels and retrieve the level in both string and integer formats.