So by default in Minecraft, only ops can place/use command blocks. However, on my server, command blocks have a double use: they are also used as a decoration item, as seen below. In this example, the command block (right side, below the redstone torch) opens the Vault door and is also designed to look like a Terminal. Thus the question being: Is it possible for a plugin to be made that can allow players to place these blocks? Of course, for security reasons, the plugin would have to also block players from placing NBT-altered comm blocks with potentially dangerous commands loaded already. If this isn't possible with a plugin because it's hard-wired into the MC server code, I can really just add another block textured like a Terminal, but I'm curious if this would be a possible concept. Edit note: This would not be a plugin to use command blocks; just to place them, as long as no modified NBT data is detected.
Just give them dummy blocks and when placed, turn into a command block. No one gets any command blocks.
skript code no problem: Code (Text): on place of commandblock: set {commandblockplacing.%player%} to location of player setblock at {commandblockplacing.%player%} to commandblock cancel event is for the placing i dont know how to open them
Since it's a mod, it's going to be in Java. Skript won't help. So let me get this straight, you want to make it so a player can right click a command block without OP and access it, right? Slightly confused.
No, that's what I don't want. My apologies if I worded that oddly. What I would like is a way that non-OPs can place (but not use) CBs. And it would definitely be a plugin for a server, not a mod. I've got a pretty busy week, so I won't be able to test out your Skript for placing CBs, Larsjarred, but I'll let you know on the weekend. Thanks
btw at my place you get lifetime support like if the plugin stops working you need to pm me or email me and i will recode the plugin to get it working again
Oh I see. I'm pretty sure there's a simple way to make it so non-OP's can do it through spigot's config or something, but if you can't then I guess you could use a BlockPlaceEvent, check if the event is cancelled and if the block is a command block and set it cancelled to false. Code (Text): @EventHandler public void onCmdPlace(BlockPlaceEvent event) { Player player = event.getPlayer(); if (event.isCancelled() && event.getBlock().getType() == Material.COMMAND && !player.isOp()) { event.setCancelled(false); } } I can make this into a plugin for you if you like, won't be too hard and you can even use that code yourself if you want to put it into an existing plugin if you want (I haven't tested it but it should work)