Open main menu
Home
Random
Log in
Settings
About Forge Community Wiki
Disclaimers
Forge Community Wiki
Search
Changes
← Older edit
Newer edit →
Events/BlockEvent
(view source)
Revision as of 01:10, 20 April 2021
11 bytes added
,
01:10, 20 April 2021
m
couple issues
Line 149:
Line 149:
The <code>Post</code> event is fired after growth.
The <code>Post</code> event is fired after growth.
−
<code>getOriginalState</code> Get the state before growth happened.
+
<code>getOriginalState
()
</code> Get the state before growth happened.
Example usage:
Example usage:
Line 209:
Line 209:
Example usage:
Example usage:
<syntaxhighlight lang="java">
<syntaxhighlight lang="java">
−
public void
event
(final BlockEvent.BlockToolInteractEvent event)
+
public void
onToolInteract
(final BlockEvent.BlockToolInteractEvent event)
{
{
if (event.getFinalState().is(Blocks.FARMLAND) && event.getHeldItemStack().getItem() == Items.NETHERITE_HOE)
if (event.getFinalState().is(Blocks.FARMLAND) && event.getHeldItemStack().getItem() == Items.NETHERITE_HOE)
EERussianguy
16
edits