Jump to content
View in the app

A better way to browse. Learn more.

ClassiCube Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Plugin example request

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

Featured Replies

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");
		}
	}
}

 

READ THE RULES BEFORE YOU POST

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.