HomeJavaModsNoItemMove
This is an extremely simple that was requested somewhere, and I decided to upload it here incase anybody else would be able to put this to use :)

Config:
Code (Text):

# When usepermissions is enabled, you can allow players to move it by giving them the permission:
# noitemmove.override
# When world: enabled: is true, it'll only prevent moving te book in certain worlds.
# true means enabled, false means disabled
# Item indicates the item that can't be used
# Use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html for the item names
usepermissions: false
world:
  enabled: false
  name: 'world'
items:
  - BOOK
  - FEATHER
 
Source:
Spoiler: Main class
package io.github.gitgideon.NoItemMove;

import org.bukkit.plugin.java.JavaPlugin;

public class NoItemMove extends JavaPlugin {

public void onEnable() {
getConfig().options().copyDefaults(true);
saveConfig();
new NoItemMoveListener(this);
}

}
Spoiler: Listener
package io.github.gitgideon.NoItemMove;

import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

public class NoItemMoveListener implements Listener {

NoItemMove main;

public NoItemMoveListener(NoItemMove p) {
p.getServer().getPluginManager().registerEvents(this, p);
main = p;
}

@EventHandler
public void onMove(InventoryClickEvent e) {
if (!main.getConfig().getStringList("items").contains(e.getCurrentItem().getType().toString())) return;
Player p;
if (e.getWhoClicked().getType() == EntityType.PLAYER) {
p = (Player) e.getWhoClicked();
} else return;
if (main.getConfig().getBoolean("usepermissions")) if(p.hasPermission("noitemmove.override")) return;
if (main.getConfig().getBoolean("world.enabled"))
if (!p.getWorld().getName().equals(main.getConfig().getString("world.name"))) return;
e.setCancelled(true);
}


}
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

NoItemMove is a free Minecraft Java mod. Compatible with Minecraft 1.7, 1.8, 1.9, 1.10 and newer. Downloaded 172 times (via Spigot). Download it and open it directly in the game.

Explore more