Command On Shake
Run commands from the console whenever a Shrub is shook.
'Shaking' shrubs is what I call when a player harvests a shrub. Could be by right-clicking, using a piston, breaking it, or physics events like breaking the block underneath or water destroying it.
Commands that have %player% placeholder wont even run if there is no player involved in the shaking of the shrub (like pistons).
YML Format:
CommandOnShake:
- 'goop tell %player% &aYou collect %shrub_held_count% %shrub_item_name%&a and get &620 farming experience&a!'
- 'mmocore admin exp give %player% farming 20'
Command On Shake (none)
A list of commands to run when a shrub is harvested for any reason. Commands with the %player% placeholder wont run if a player wasn't involved.
Example
A shrub runs the command mmocore admin exp give %player% farming 10 when harvested.
A player harvests it
The player receives 10 farming experience
More Technical
Apart from parsing PAPI placeholders, the following can be used only in commands called from a shrub OnShake:
Raw Block Position (Integers):
# %shrub_position_x%
# %shrub_position_y% Shrub Position (Integer)
# %shrub_position_z%
Center of Shrub (The ones above +0.5 on all axes):
# %shrub_center_x%
# %shrub_center_y% Center of Shrub (Double)
# %shrub_center_z%
Shrub Generation Constants:
# %shrub_max_resources% How many units can the shrub produce in its lifetime.
# %shrub_held_count% How many units is the shrub holding right now*
# %shrub_total_count% How many units have been produced by this shrub in its lifetime.
# %shrub_capacity% How many units can this shrub store at once.
* (they will all get harvested instantly after tho, because this command runs when harvesting)Shrub Produce Stuff:
# %shrub_item_name% Display name of the produce (with color codes and everything).
# %shrub_internal_item_type% Produced Internal MMOItem Type.
# %shrub_internal_item_id% Produced Internal MMOItem ID.
Shrub Owner:
# %shrub_owner% Name of player who originally placed shrub
# %shrub_owner_uuid% UUID of player who originally placed shrub
Vault Support:
# %shrub_vault_cost% How much balance units it costs to harvest
# %shrub_vault_revenue% How much balance units the owner gained by someone harvesting
# %shrub_vault_revenue_percent% Percent of the gains of the cost
Note: Commands that contain the %player% placeholder wont even run if the shrub is harvested via non-player sources; Like being shook by a piston, or by water flow, etc...