Skip to content

Commit

Permalink
Added some entity procedures (MCreator#4221)
Browse files Browse the repository at this point in the history
* Added some entity procedures

* Fix

* Fix

* eliminated "entity is on rails" procedure

* Improved the text of the procedure "is the entity attackable?"

Co-authored-by: Max094Reikeb <[email protected]>

* Added "get percent frozen" procedure block instead of entity is fully frozen

* Dropped support for "entity is ignoring block triggers" procedure block

* Fix

* Fix

* Fix

* Fix

* applied the changes suggested by Klemen

* Slight text change

---------

Co-authored-by: Max094Reikeb <[email protected]>
Co-authored-by: KlemenDEV <[email protected]>
  • Loading branch information
3 people authored Oct 19, 2023
1 parent 8d4e94e commit 3f40575
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*@float*/(${input$entity}.getPercentFrozen() * 100)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$entity}.isAttackable())
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$entity}.isUnderWater())
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*@float*/(${input$entity}.getPercentFrozen() * 100)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$entity}.isAttackable())
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$entity}.isUnderWater())
20 changes: 20 additions & 0 deletions plugins/mcreator-core/procedures/entity_get_percent_frozen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"args0": [
{
"type": "input_value",
"name": "entity",
"check": "Entity"
}
],
"output": "Number",
"colour": "%{BKY_MATH_HUE}",
"mcreator": {
"toolbox_id": "entitydata",
"toolbox_init": [
"<value name=\"entity\"><block type=\"entity_from_deps\"></block></value>"
],
"inputs": [
"entity"
]
}
}
20 changes: 20 additions & 0 deletions plugins/mcreator-core/procedures/entity_is_attackable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"args0": [
{
"type": "input_value",
"name": "entity",
"check": "Entity"
}
],
"output": "Boolean",
"colour": "%{BKY_LOGIC_HUE}",
"mcreator": {
"toolbox_id": "entitydata",
"toolbox_init": [
"<value name=\"entity\"><block type=\"entity_from_deps\"></block></value>"
],
"inputs": [
"entity"
]
}
}
20 changes: 20 additions & 0 deletions plugins/mcreator-core/procedures/entity_is_underwater.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"args0": [
{
"type": "input_value",
"name": "entity",
"check": "Entity"
}
],
"output": "Boolean",
"colour": "%{BKY_LOGIC_HUE}",
"mcreator": {
"toolbox_id": "entitydata",
"toolbox_init": [
"<value name=\"entity\"><block type=\"entity_from_deps\"></block></value>"
],
"inputs": [
"entity"
]
}
}
3 changes: 3 additions & 0 deletions plugins/mcreator-localization/lang/texts.properties
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ blockly.block.entity_get_first_passenger=%2 Get first passenger of %1
blockly.block.entity_get_fire_ticks=Get remaining ticks on fire of %1
blockly.block.entity_get_fly_speed=Get fly speed of %1
blockly.block.entity_get_oxygen=Get oxygen of %1
blockly.block.entity_get_percent_frozen=Get frozen percentage of %1
blockly.block.entity_get_root_vehicle=Get lowest entity that %1 is riding, or self if not riding anything
blockly.block.entity_get_saturation=Get food saturation level of %1
blockly.block.entity_get_scoreboard_score=Get %2 scoreboard score for %1
Expand All @@ -935,10 +936,12 @@ blockly.block.entity_haspotioneffect=Has %1 active potion %2
blockly.block.entity_health=Current health of %1
blockly.block.entity_health_max=Max health of %1
blockly.block.entity_inventory_foreach=For each slot of inventory of %1 get contents copy as %2 do %3
blockly.block.entity_is_attackable=Can %1 be attacked
blockly.block.entity_is_elytra_flying=Is %1 elytra flying
blockly.block.entity_is_glowing=Is %1 glowing
blockly.block.entity_is_swimming=Is %1 swimming
blockly.block.entity_is_tagged_in=Is %1 tagged in entity tags as %2
blockly.block.entity_is_underwater=Is %1 under water
blockly.block.entity_isalive=Is %1 alive
blockly.block.entity_isbeingridden=Is %1 being ridden
blockly.block.entity_isblocking=Is %1 blocking
Expand Down

0 comments on commit 3f40575

Please sign in to comment.