Blue_3dx Posted February 18 I need an example for held block click event like left/right clicking while holding a specific block does something for example sends a messages or runs a command Share this post Link to post
Rainb0wSkeppy Posted Tuesday at 04:27 PM using System; using MCGalaxy; using MCGalaxy.Events; using MCGalaxy.Events.PlayerEvents; namespace MCGalaxy { public class ClickHoldingBlockExample : Plugin { public override string name { get { return "ClickHoldingBlockExample"; } } public override string MCGalaxy_Version { get { return "1.9.5.1"; } } public override string creator { get { return "Rainb0wSkeppy"; } } public override void Load(bool startup) { OnPlayerClickEvent.Register(click, Priority.Normal); } public override void Unload(bool shutdown) { OnPlayerClickEvent.Unregister(click); } void click(Player p, MouseButton button, MouseAction action, ushort yaw, ushort pitch, byte entity, ushort x, ushort y, ushort z, TargetBlockFace face) { if (p.GetHeldBlock() != Block.Stone) return; if (action != MouseAction.Press) return; if (button == MouseButton.Left) p.Message("left click holding stone"); else if (button == MouseButton.Right) p.Message("right click holding stone"); } } } Share this post Link to post