Skip to content

Add block break actions#58

Draft
haykam821 wants to merge 1 commit intoNucleoidMC:1.19.4from
haykam821:block-break-actions
Draft

Add block break actions#58
haykam821 wants to merge 1 commit intoNucleoidMC:1.19.4from
haykam821:block-break-actions

Conversation

@haykam821
Copy link
Contributor

This pull request adds block break actions, which can be used to customize the behavior of breaking blocks. Actions can affect the player that broke the block, all players, or all players except the player that broke the block.

Block break actions can be used to implement additional versions of spleef, such as a version that restocks projectiles when blocks are broken as opposed to on a timer.

For an example of block break action configuration:

{
	"block_break_actions": {
		"minecraft:snow_block": {
			"type": "spleef:sequence",
			"actions": [
				{
					"type": "spleef:add_status_effect",
					"effect": {
						"Id": 1,
						"Duration": 200
					},
					"target": "others"
				},
				{
					"type": "spleef:give_item_stack",
					"stack": {
						"id": "minecraft:tnt",
						"Count": 1
					},
					"target": "all"
				},
				{
					"type": "spleef:restock_projectile",
					"target": "all"
				},
				{
					"type": "spleef:send_message",
					"message": "Example message",
					"overlay": false,
					"target": "self",
				}
			]
		}
	}
}

The block action system is extensible and can be extended later to allow configuration in other contexts or additional actions, such as a generic action to run command functions.

@haykam821 haykam821 added the enhancement New feature or request label Oct 21, 2023
@haykam821 haykam821 marked this pull request as draft October 24, 2023 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant