OpenJS-docs
CtrlK
Download pluginDiscord server
  • Overview
    • Welcome
  • Getting Started
    • Installing the plugin
    • Configuration file
    • Commands
    • Creating scripts
  • OpenJS Components
    • Feature Flags
    • Managing scripts within scripts
    • Sharing variables between scripts
    • Custom Commands
    • Using PlaceHolderApi
    • Listening and cancelling events
    • Custom events
    • Loading and saving data
    • Logging in console with scripts
    • Scheduling and Async
    • Importing Java Packages into Scripts
    • Load External JAR Libraries in Scripts
  • Example Scripts
    • spawn hit stand command
    • local ai-chatbot with commands
    • Knockbackstick command
    • No hit-cooldown script
    • NoBlockPlacing script
    • Saving Player data script
    • running code on the main thread
    • WhileTrue do script
Powered by GitBook
On this page
  1. Example Scripts

NoBlockPlacing script

noblockplacing.js
registerEvent("org.bukkit.event.block.BlockPlaceEvent", function(event) {
    event.getPlayer().sendMessage("You tried to place " + event.getBlock().getType().toString());
    event.setCancelled(true);
});
PreviousNo hit-cooldown scriptNextSaving Player data script

Last updated 20 days ago