I developed this plugin to add more procedure blocks and event triggers that I couldn't find in other plugins.
112 New Procedure Blocks
- Math procedures
- Number clamped between X and Y
- Number rounded to X decimal places
- Return 'true' with a chance of X in Y
- Is number between X and Y
- Cast number to float
- Text procedures
- Get text from / between first occurrence of text X and first occurrence of text Y on text Z
- Returns a portion of the text from a string. The difference between 'from' and 'between' is that 'from' includes the character occurrence in the returned string while 'between' excludes it.
- Effectively allows strings to be used as arrays for compact storage of variables.
- Get position of first occurrence of text X on text Y
- Does text X contain regex ('regular expression') Y
- Replace regex X with text Y on text Z
- Get boolean from integer on position X of text Y
- Basically used to read a string of binary numbers, like an array of booleans. Returns true if the character at the given position is '1', and returns false otherwise. Could be used for compact storage of a large number of logic variables.
- Append text X to text Y
- A more compact method of concatenating a string. Only works for local variables.
- Get text from / between first occurrence of text X and first occurrence of text Y on text Z
- Entity procedures
- Set entity on ground to true/false
- Controls certain behaviors like movement friction, view bobbing and ability to jump.
- Set entity friction to true/false
- More commonly recognized as the Aether's quicksoil effect.
- Get/set idle time for entity
- A vanilla timer on mob entities (internally referred to as 'noActionTime') that increases for every tick they're at least 32 blocks from the player.
- When this timer is greater than 100 ticks, most mobs are programmed to not wander around aimlessly but otherwise behave as normal.
- When this timer is greater than 600 ticks, mobs begin to randomly despawn if they're also at least 32 blocks from the player.
- When this timer is less than 600 ticks, mobs do not despawn as long as they're within 128 blocks of the player.
- Get/set entity persistence
- Mobs with 'persistence required' do not despawn naturally.
- Set absorption health of entity to X
- Stop/release item that entity is using
- Get block that entity is standing on (smart detection)
- Mojang programmed this themselves but constantly forget to use it in favor of 'get block at y-1'.
- Get entity active potion effects as string
- Get number of armor slots filled for entity
- Entity is holding item X / item of type X / is empty-handed
- Compact version of testing for the item in each of the entity's hands.
- Is entity sensitive to water
- Is entity immune to effect X
- Is creeper entity swelling
- Get creeper entity swelling level
- Set swelling of creeper entity to X
- Get/set climbing of spider entity
- Is spider entity on climbable
- Is enderman entity enraged
- Has enderman entity been stared at
- Returns 'true' if a survival-mode player is looking at the enderman, or if the enderman is enraged.
- Is ghast entity charging a fireball
- Entity-entity raytrace ('has line of sight')
- Disable XP dropping for provided entity
- Is entity colliding
- Returns true if the entity's bounding box is interacting with that of another entity, or if the entity performs a melee attack. Includes collisions by entities such as arrow projectiles, but not the player's punching attack which isn't technically mediated by the bounding box.
- Is entity on climbable (ladder, vine, etc.)
- Get fall distance of entity
- Does entity have damage immunity frames remaining
- Get entity's remaining damage immunity ticks
- Is entity pathfinding to attack target
- Is entity swinging an arm
- Get number of ticks entity has been swinging an arm for
- Get entity's arm swing progress fraction
- Get ticks since entity attacked another entity
- Get ticks since entity was attacked by another entity
- Get entity tick count
- Returns the umber of ticks that an entity has been existed for. Increments every tick that the entity is loaded, resets to zero every time the world is closed.
- Get/set age of ageable entity
- Does entity exist
- A more compact, intuitive test for whether an entity exists (aka whether an entity is 'null'.
- Set entity on ground to true/false
- Player procedures
- Get FPS / FOV / FOV Effect Scale of current instance of Minecraft
- Get GUI menu currently being displayed
- Start/stop elytra flying
- Get elytra flight time
- Get/set number of pincushion arrows / bee stingers stuck in the player model
- Only works for players, sadly.
- Has swim/crawl pose
- Get swim/crawl pose animation level
- Force player to jump
- Can only be done for the player, not other entities.
- Get player's total XP points
- Get player's XP pickup time
- Returns '2' on the tick that a player picks up an XP orb, returns '1' one tick later, and returns '0' otherwise.
- Get player's approximate attack strength factor
- Returns the player's damage reduction factor due to cooldown for the currently held weapon. Approximate due to unknown additional variables.
- Set player's attack strength cooldown
- Sets the player's attack cooldown to full.
- Item procedures
- Does item exist
- A more compact, intuitive test for whether an item is valid or 'air'.
- Get bonus damage from enchants on an enchanted item against a specified entity
- Does item exist
- Block procedures
- Does provided block exist
- A more compact, intuitive test for whether a block is valid or an air block.
- Does provided block drop XP
- Is provided block replaceable
- Checks for blocks that the player can replace with another block, such as air, water, lava, tall grass, etc. This procedure was salvaged from the Additions plugin after being deprecated
- Is provided block full
- Returns true for any solid block with a 16x16x16-pixel bounding box, including blocks like dirt, stone, glass, leaves, etc. Returns true for double slabs but not single slabs. Returns false for blocks with bounding boxes that aren't precisely 16x16x16 pixels, such as farmland and soul sand, or blocks with 'holes', such as cauldrons or composters. Also returns false for blocks that are 16x16x16 pixels, but are non-solid, such as cobwebs or tall flowers.
- Does block at XYZ have solid collisions
- Returns true for any block that entities can collide with or stand on, such as dirt, stone, glass, slabs, stairs, fences, etc. Returns false for water, tall grass, cobwebs, rails, etc. As another example, this will return true for fence gates only if they are closed (since open fence gates have no collision), but will always return true for trapdoors since they can be collided with even when they are open.
- Get solid collision height of block at XY
- Returns the height of the highest solid portion of the block's collision hitbox. For example, returns '1' for standard-size blocks, '0.5' for bottom-half slabs, '1' for top-half or double slabs, '0.1875' for flat (closed) trapdoors, '1' for vertical (open) trapdoors, and returns zero for blocks with no collision, such as tall grass or flowers.
- Does provided block exist
- World procedures
- Get blocklight / skylight level at XYZ
- Is it cold enough to snow at XYZ
- Does biome at XYZ have precipitation
- Is provided world loaded at XYZ
- Returns true if the chunk containing the specified position is currently loaded, which is true if the chunk is within the players' render distance (not the 'simulation distance'), or near the world spawn.
- Play sound on clientside
- Get/set gametime
- 'Gametime' is the age of the world in ticks. Useful as a standardized global counter.
- Is world singleplayer / superflat / hardcore / has cheats / has sleeping enabled
- Get/set PvP enabled / difficulty lock / default gamemode
- Get world display name as string
- Get world seed number
- Crash current instance of Minecraft
- Closes the game for whichever player or dedicated server executes the procedure. I don't know what use anyone could conceive for this but I'm adding it anyways.
- Organizational procedures
- Decorative procedure labels (red, green, blue and white)
- A label with a text display. Purely decorative. Found in the 'flow control' tab.
- Decorative procedure labels (red, green, blue and white) with arguments and a checkbox
-
The procedure arguments are ignored unless the checkbox is ticked, allowing procedure blocks to be easily toggle during testing.
-
- Decorative procedure labels (red, green, blue and white)
20 New Event Triggers
- Entity leaves world
- Triggered every time an entity is unloaded, just as the 'entity joins world' trigger is called every time an entity is loaded.
- As with 'entity joins world' it detects all entities, not just mobs / living entities.
- Block is placed (non-attributable)
- As of version 2024.2 this trigger no longer seems to work. Similar to the 'block is placed' trigger but with no entity dependency, meaning it's called for any block placed in the world, not just ones placed by the player.
- Neighbor block changes
- Similar to the previous trigger.
- Entity is hurt (non-attributable)
- A modified version of the 'entity is attacked' trigger with no source entity dependency.
- Player right-clicks block (unrestricted)
- A modified version of the 'player right-clicks block' trigger which is called once for each of the player's hands, unless the block that the player clicks is interactable in which case it's called only for the player's main hand.
- Player uses tool secondary action on block
- Called when the player right clicks on a block with either a shovel, axe or hoe. Used in vanilla for log stripping, dirt path flattening, tilling, etc. Actions include "shovel_flatten", "axe_strip", "axe_scrape", "axe_wax_off" and "till" (for the hoe).
- Provides the relevant itemstack, the hand being used, the block being clicked, and the face of the block being clicked. Is cancelable.
- Player right clicks with item (unrestricted)
- A modified version of the 'player right-clicks with item' trigger that doesn't test for which hand the player is using when they interact with a block, which is necessary to get around some bugs with Mojang's spaghetti programming for tool interactions.
- Provides the relevant itemstack and the hand being used. Is cancelable.
- Entity changes attack target
- Doesn't properly retrieve the 'original' attack target, but unlike the 'entity sets attack target' trigger it is cancellable.
- Projectile hits object
- Called whenever a projectile hits a block or an entity.
- Provides the projectile and source entity, the projectile position (x, y, z), the (more accurate) raytrace target position (hx, hy, hz), the hit result ("block", "entity" or "miss").
- The 'raytrace target position' is the exact edge of the block the projectile hits, or the exact position of the entity the projectile hits.
- I'm not sure what conditions return the "miss" hit result. Projectiles that are deflected by invulnerable enemies (e.g. the wither in phase 2), those that hit a blocking player or those that miss an enderman still return the "entity" hit result.
- Does not provide the block or entity that are hit, although those can be extrapolated fairly easily.
- Entity effect added / tried / expires / removed
- Called for entity potion effects. Provides the effect type as a string, as well as its level and duration.
- The 'tried' and 'removed' procedures are cancelable.
- Fluid tries to create source
- Enderman tries to teleport
- Called every time an enderman tries to teleport, including any failed attempts, of which there are usually several for each successful teleport. Cancelable.
- Entity drops item
- Called when an entity drops its loot table or held equipment. Limited functionality. Provides the list of dropped item entities in string format.
- Arrow is nocked
- Explosion begins
- Called when an explosion is going to occur. Cancelable. Provides the explosion damagesource, whether the explosion damages blocks, and the entity (if applicable) and the sourceentity (if applicable).
- Canceling an explosion does not prevent the explosion effects from being shown.
- Explosion finalizes
- Called when an explosion finalizes. Not cancelable. Provides the same dependencies as the 'explosion begins' trigger as well as a string list of affected block positions.
- Entity spawns (advanced)
- Called when the game tries to spawn an entity via the mob spawn cycle to fill its respective mob cap group
- Provides the spawn position (rounded down), the entity type as a string, as well as the spawn type (see this page I wrote for more information)
-
Also provides the default (vanilla) spawn result, which returns false supposedly depending on factors such as light levels, slime chunks, and the presence of grass blocks (for animals). Other conditions may apply.
- Testing shows that the game does try to generate slimes outside of slime chunks, which results in the default spawn result being false. Setting this result to true will allow slimes to spawn normally outside of slime chunks.
1 New Placement Feature
- Is water at current position
- A small shortcut to check for water.
Support for languages other than English currently isn't planned, since I don't know any other languages and I make frequent changes to the plugin texts.
This plugin is currently only tested for versions of MCreator later than MCreator 2023.4 but should work for earlier versions. Additionally, I've only developed the plugin for Forge 1.20.1, so there may be issues on the other supported generator types.
The latest version of this plugin supports the following generators: Forge 1.16.5, Forge 1.18.2, Forge 1.19.4, Forge 1.20.1, NeoForge 1.20.4, NeoForge 1.20.6, and NeoForge 1.21.1. Support for versions of the Fabric generator is not planned due to its use of a different coding language, which would be quite time-consuming to translate.
-
Changelog:
v1.0.0 - Initial release. Adds 21 new procedures, 7 new triggers.
v1.0.1 - Minor bugfixes.
v1.1.0 - Added tooltips (show by hovering the cursor over the procedure blocks) and 17 new procedures (from 21 to 38).
v1.2.0 - Added 25 new procedures (from 38 to 63).
v1.3.0 - Added more features to the "projectile hits object" trigger and added 14 new procedures (from 63 to 77).
v1.4.0 - Added 19 new procedures (from 77 to 96), 7 new triggers (from 7 to 14) and 1 new placement feature (from 0 to 1). Added basic support for earlier forge versions.
v1.4.1 - Added support for MCreator 2024.1.
v1.5.0 - Added 14 new procedures (from 96 to 110), 3 new triggers (from 14 to 17) and added basic support for Neoforge.
v1.5.1 - Added support for MCreator 2024.2.
v1.5.2 - Added support for MCreator 2024.3 and neoforge 1.21.1.
v1.5.3 - Added support for MCreator 2024.4.
v1.6.0 - (version skipped due to upload error)
v1.6.1 - Added 2 new procedures (from 110 to 112), 3 new triggers (from 17 to 20) and new dependencies for the right-click triggers. Also added support for Forge 1.19.2.
The plugin download is available below. I hope you guys find it useful. If you have issues, post them in the comments or contact me via discord under the username 'snailsattack'.
Comments
Really need 2024.1 verison to contiune working on my mod as it uses Model layers, but theres a bug with them that was fixed in 2024.1 but i cannot use the plugin in 2024.1 because it was not updated for that verison so am stuck on the verison that has the model layer bug
This totally worked for me. Some of the procedures like the check in sight between two entities didn't work. But the one I needed (Set on ground to true/false) did work. I couldn't use version 1.30 though and the "Minecraft Components" tab is completely broken. I am on forge 1.18.2, MCreator 2023.2.
When using the newest version of the plugin, if i try to make a procedure using the (get pincushion arrows) and [set pincushion arrows] blocks, MCreator says there is an error with the procedure when i try to save it, even though there are 0 warnings or errors in the procedure.
Sure thing. The 'start elytra flying block' may require the player to actually have elytra equipped in order to remain activated. Could also try running it every tick. Not sure exactly how the procedure works; mojang programmed it, I just made it accessible.