BlocklyNukkit —— Efficient plugin development framework

BlocklyNukkit —— Efficient plugin development framework


Bugs Fixed

- fix bnnpc walking in air
- fix nullpointer exception when player change the world
- new error ui


- <E> callFunction(String functionname,Object... args) --callFunction will return the return value of the function
- <E> getVariableFrom(String scriptName,String varName)
- void putVariableTo(String scriptName,String varName,<E> var)
- double getCPULoad()
- int getCPUCores()
- double getMemoryTotalSizeMB()
- double getMemoryUsedSizeMB()
- void forceDisconnect(Player player)
- Array<String> getEventFunctions(Event event)
- void getServerMotd(String host, int port, String callback)


- void setItemColor(Item item,int r,int g,int b)
- void setItemUnbreakable(Item item,boolean unbreakable)


- Item getEntityHelmet(Entity entity)
- Item getEntityChestplate(Entity entity)
- Item getEntityLeggings(Entity entity)
- Item getEntityBoots(Entity entity)
- Item getEntityItemInHand(Entity entity)
- Item getEntityItemInOffHand(Entity entity)
- void setEntityItemHelmet(Entity entity,Item item)
- void setEntityItemChestplate(Entity entity,Item item)
- void setEntityItemLeggings(Entity entity,Item item)
- void setEntityItemBoots(Entity entity,Item item)
- void setEntityItemInHand(Entity entity,Item item)
- void setEntityItemInOffHand(Entity entity,Item item)
- Item getInventorySlot(Inventory inv,int slot)


- void forceClearWindow(Player player)
- int getEventResponseIndex(PlayerFormRespondedEvent event)


- boolean isPlayer(Entity e)
- void spawnFallingBlock(Position pos, Block block, boolean enableGravity,boolean canBePlaced)

gameapi --新的基对象

- void createGame(String name,boolean useTeam,String startGameCallBack,String endGameCallBack,String mainLoopCallBack,String deathCallBack)
- void joinGame(Player player, String gameName)
- void leaveGame(Player player)
- boolean isPlayerInGame(Player player)
- GameBase getPlayerRoom(Player player)
- Array<GameBase> getAllRoomByName(String gameName)
- Array<String> getAllGameNames()
- Messager getMessager(String prefix)
- Messager getGameMessager(GameBase game)
- Multiline getMultiline(String messageType)
- InventoryMenu createInventoryMenu(String inventoryType, String title)
- FormMenu createFormMenu(String title, String content)
- void addMenuItem(InventoryMenu menu, int slot, Item item, String inventoryCallback)
- void addMenuButton(FormMenu menu,String buttonText,String imageData,String formCallback)
- Scoreboard getScoreboard(Player p)
- void setObjective(Scoreboard sb, String objectiveName,String displayName)

EventLoader --73 new

- BlockFadeEvent
- BlockFallEvent
- BlockFromToEvent
- BlockGrowEvent
- BlockIgniteEvent
- BlockPistonChangeEvent
- BlockRedstoneEvent
- DoorToggleEvent
- CreatureSpawnEvent
- CreeperPowerEvent
- EntityArmorChangeEvent
- EntityBlockChangeEvent
- EntityCombustByBlockEvent
- EntityCombustByEntityEvent
- EntityCombustEvent
- EntityDamageByBlockEvent
- EntityDamageByChildEntityEvent
- EntityExplodeEvent
- EntityMotionEvent
- EntityPortalEnterEvent
- EntityRegainHealthEvent
- EntityShootBowEvent
- EntityVehicleEnterEvent
- EntityVehicleExitEvent
- ExplosionPrimeEvent
- BrewEvent
- EnchantItemEvent
- InventoryMoveItemEvent
- StartBrewEvent
- ChunkLoadEvent
- ChunkPopulateEvent
- LevelInitEvent
- LevelLoadEvent
- LevelSaveEvent
- LevelUnloadEvent
- SpawnChangeEvent
- ThunderChangeEvent
- WeatherChangeEvent
- PlayerAchievementAwardedEvent
- PlayerAnimationEvent
- PlayerAsyncPreLoginEvent
- PlayerBlockPickEvent
- PlayerBucketEmptyEvent
- PlayerBucketFillEvent
- PlayerChangeSkinEvent
- PlayerChunkRequestEvent
- PlayerCreationEvent
- PlayerDropItemEvent
- PlayerEatFoodEvent
- PlayerEditBookEvent
- PlayerFoodLevelChangeEvent
- PlayerGameModeChangeEvent
- PlayerGlassBottleFillEvent
- PlayerInvalidMoveEvent
- PlayerItemConsumeEvent
- PlayerLocallyInitializedEvent
- PlayerMapInfoRequestEvent
- PlayerMouseOverEntityEvent
- PlayerServerSettingsRequestEvent
- PlayerSettingsRespondedEvent
- PluginDisableEvent
- PluginEnableEvent
- PotionApplyEvent
- PotionCollideEvent
- PlayerDataSerializeEvent
- RemoteServerCommandEvent
- EntityEnterVehicleEvent
- EntityExitVehicleEvent
- VehicleCreateEvent
- VehicleDamageEvent
- VehicleDestroyEvent
- VehicleMoveEvent
- VehicleUpdateEvent
- LightningStrikeEvent
Fix bugs
-Fixed the problem of bnnpc and BN floating words disappearing
New features
-Now you can add a line of comment //pragma es9 at the beginning of JS code to enable es9 language features, but there will be some performance loss, and the loss is not big, so you can use it with confidence
-The bninstall command has been abandoned, and all libraries are packaged into the BN interpreter jar. This is to save memory space, which can save up to 50MB of memory space.
Two member functions are added to the Advanced menu manager of customwindowbuilder
-Custom showasetting (player P, string callback) uses this advanced form as the player's server settings page
-Custom build dropdown (string title, string inner, int index) builds a drop-down menu and specifies default options
Eventloader adds 1 event
-Chunk unload event
Six new functions for entity
-Void setplayerexp (player player, int exp) sets player experience
-Int getplayerexp (player player)
-Void setplayer explevel (player player, int LEL) sets the player level
-Int getplayerexplevel (player player) to get player level
-Void setplayer Hunter (player player, int hunger) sets the player's hunger level
-Int getplayerhunger (player player) to get player hunger
Two new functions are added in window
-Void maketipsvar (string Varname, string providercallback) creates dynamic tips plug-in variables
-Void maketips static (string Varname, string to replace) creates static tips plug-in variables


- BNNPC buildNPC(Position pos,String name,String skinID,int calltick,String callfunction,String attackfunction)
- void showFloatingItem(Position pos,Item item)
- void removeFloatingItem(Position pos,Item item)


- Custom buildSlider(String title,double min,double max)
- Custom buildSlider(String title,double min,double max,int step)
- Custom buildSlider(String title,double min,double max,int step,double defaultvalue)
- Custom buildStepSlider(String title,String options)
- Custom buildStepSlider(String title,String options,int index)


- String getEventCustomVar(PlayerFormRespondedEvent event,int id,String mode)
- mode可以为input toggle dropdown slider stepslider


- void displaySwing()
- void setSwim(boolean swim)
- void setSwim()
- void setTickCallback(String callback)
- void setAttackCallback(String callback)


- void bStats(String pluginName,String pluginVer,String authorName,int pluginid)
- void callFunction(String functionname,Object... args) --修复了错误的拼写


- void loadScreenTP(Player player,Position pos)
- void loadScreenTP(Player player,Position pos,int loadScreenTick)
- void clearChunk(Position pos)


- PlayerHeldEvent
- InventoryClickEvent
Class library manager

-Now the class library manager can install the module directly. For now, there are only Python and database modules
-Use the command bninstall module name to install the class library


- void setBelowName(Player player,String str)


- void loadJar(String path)


- void setOceanGenerator(int seaLevel)


- BNNPC buildNPC(Position pos,String name,String skinID)
- BNNPC buildNPC(Position pos,String name,String skinID,int calltick,String callfunction)


- void turnRound(double yaw)
- void headUp(double pitch)
- void setEnableAttack(boolean attack)
- void setEnableAttack()
- void setEnableHurt(boolean hurt)
- void setEnableHurt()
- void displayHurt()
- void start()
- void setEnableGravity(boolean gravity)
- void setEnableGravity()
- void setG(double newg)
- void lookAt(Position pos)
- Player getNearestPlayer()

- boolean isSneak()

- void setSneak(boolean sneak)

- void setSneak()

- void jump()

- void setJumpHigh(double j)

- void setEnableKnockBack(boolean knock)

- void setEnableKnockBack()

- void setKnockBase(double base)

- boolean canMoveTo(Position to)

- boolean findAndMove(Position to)

- void setSpeed(double s)

- void setRouteMax(int m)

- void stopMove()

- void hit(Entity entity)

bug fixed:

-Some potions of entity effect do not display problems, but there are still some potions that cannot be displayed because NK does not support it

-Error in generating void and ocean by world

-Space world configuration loss

-SSH error reporting

-Now the window manager's operation function returns itself, which can be linked directly in the code


Now you can use Python 2.7 to make plug-ins

Add full support for Python development plug-ins, just download additional py support packages to use Python plug-ins

The support for Python development plug-ins will be synchronized with JavaScript. Python and JS use the same set of BN class libraries. All the BN class libraries of JS (except Java modules) can be called directly in Python without import

Support all Python 2.7 native standard syntax and standard library, run time is the same as JS, compiled to Java bytecode run, do not worry about inefficiency

Download the python for BN support module:

After downloading, put it directly under the. / plugins / blocklynukkit folder


- PlayerInteractEntityEvent

- PlayerDamageByPlayerEvent

- EntityKilledByEntityEvent

- PlayerDamageByEntityEvent

- EntityKilledByEntityEvent

- EntityKilledByPlayerEvent

- PlayerRespawnEvent


- void setPlayerBossBar(Player player,String text,float len)

- void removePlayerBossBar(Player player)

- double getLengthOfPlayerBossBar(Player player)

- String getTextOfPlayerBossBar(Player player)


- void createPermission(String per,String description,String defaultper)

- void removePermission(String per)

- boolean checkPlayerPermission(String per,Player player)

- String MD5Encryption(String str)

- String SHA1Encryption(String str)

- void createCommand(String name, String description, String callbackFunctionName, String per)

- void newCommand(String name, String description, Function jsFunction,String per)


- int getNetworkID(Entity entity)

- String getIDName(Entity entity)

- void spawnEntity(String name,Position pos)


- HornSongPlayer buildHorn(Song song, Position pos, boolean isloop, boolean isautodestroy)

- void addPlayerToHorn(HornSongPlayer SongPlayer, Player player)

- void removePlayerToHorn(HornSongPlayer SongPlayer, Player player)

- Array getPlayerInHorn(HornSongPlayer radioSongPlayer)

- void setHornStatus(HornSongPlayer radioSongPlayer, boolean isplaying)

- Song getSongInHorn(HornSongPlayer radioSongPlayer)


-New ocean world generator for genlevel

bug fixed

- setNameTagAlwaysVisable error


- String formatJSON(String json)

-Fixed the error that the WriteFile function could not automatically create a path

Performance optimization is carried out to force invokemethod optimization to be started when the underlying JS translates Java bytecode


For manager base objects:

New function:

String readFile(String path)

void wirteFile(String path,String text)

boolean isFileSame(String path1,String path2)

String JSONtoYAML(String json)

String YAMLtoJSON(String yaml)

void newCommand(String name, String description, Function fun)

int setTimeout(Function fun,int delay,<E+>... args)

void clearTimeout(int id)

int setInterval(Function fun,int delay,<E+>... args)

void clearInterval(int id)

void isWindows()

int getPlayerGameMode(Player player)

For JS loader:

What's new

Name indicates the name of the loaded JS file (it can prevent low-level name change and reselling)

24-hour mandatory update after new release

You can use let and const to define variables in Es5 syntax

For custom / Modal / simple window builders

New function:

- void showToPlayerCallLambda(Player p, Function fun)

For blockitem base objects:

New function:

Array<Enchantment> getItemEnchant(Item item)

int getEnchantID(Enchantment enchantment)

int getEnahcntLevel(Enchantment enchantment)

For event callers:

New event






Sandbox isolation for each JS file runtime, namespace and cross namespace calls are added, article NBT and window default values are added.
you can use FloatingText in BlocklyNukkit now
and other new functions
many bugs fixed
now you can use http api to call javascript functions and get the retun value.
now you can compile your js plugin to jar file
We made a JavaScript IDE for BlocklyNukkit developers and users. It is very powerful!
Use it Online: BlocklyNukkit_JSEditor