Speedgot
[1.16.x-1.21.x] MultiWorld
-----
World Mangement for Minecraft
Download Now
Via external site
Overview
Documentation
Updates (
--
)
Reviews (
---
)
Version History
Discussion
Adding Api and Custom Events
«
Update 1.1.9
»
- Adding MultiWorld API
- Adding Metrics (
https://bstats.org/plugin/bukkit/MultiWorld/15446
)
- Fixing World can't delete error
Spoiler:
API Example
Code (Java):
public
class
TestPlugin
extends
JavaPlugin
implements
Listener
{
private
MultiWorldApi multiWorldApi
;
@Override
public
void
onEnable
(
)
{
this
.
multiWorldApi
=
MultiWorldProvider.
getMultiWorldApi
(
)
;
super
.
getServer
(
)
.
getPluginManager
(
)
.
registerEvents
(
this
,
this
)
;
}
@EventHandler
(
priority
=
EventPriority.
NORMAL
)
public
void
handleStartupComplete
(
final
MultiWorldStartupCompleteEvent event
)
{
super
.
getLogger
(
)
.
info
(
"shit i'm slow "
+
event.
getStartupDuration
(
)
)
;
}
@EventHandler
(
priority
=
EventPriority.
NORMAL
)
public
void
handleUserLogin
(
final
UserLoginEvent event
)
{
event.
getUser
(
)
;
}
@EventHandler
(
priority
=
EventPriority.
NORMAL
)
public
void
handleUserLogout
(
final
UserLogoutEvent event
)
{
event.
getUser
(
)
;
}
@EventHandler
(
priority
=
EventPriority.
NORMAL
)
public
void
handleWorldCreate
(
final
WorldCreateEvent event
)
{
if
(
event.
getWorldProperties
(
)
.
getWorldName
(
)
.
equalsIgnoreCase
(
"Dev7exWorld"
)
)
{
super
.
getLogger
(
)
.
info
(
"Thats a shit name stop this"
)
;
this
.
multiWorldApi
.
getWorldManager
(
)
.
createWorld
(
Bukkit.
getConsoleSender
(
)
,
"YourWorld"
, WorldType.
FLAT
)
;
event.
setCancelled
(
true
)
;
}
}
@EventHandler
(
priority
=
EventPriority.
NORMAL
)
public
void
handleWorldDelete
(
final
WorldDeleteEvent event
)
{
if
(
event.
getWorldProperties
(
)
.
getWorldName
(
)
.
equalsIgnoreCase
(
"YourWorld"
)
)
{
super
.
getLogger
(
)
.
info
(
"Thats a good name stop this"
)
;
event.
setCancelled
(
true
)
;
}
}
}
----------
,
Dec 20, 2022
View on SpigotMC
Resource Information
Author:
----------
Total Downloads:
45,299
First Release:
May 20, 2021
Last Update:
Dec 7, 2024
Category:
---------------
All-Time Rating:
37 ratings
Version
-----
Released:
--------------------
Downloads:
------
Version Rating:
----------------------
--
ratings
Ask Questions / Get Support