Skip to content

Commit

Permalink
release(0.0.3): adds basic entity data tags, as well as mkdoc documen…
Browse files Browse the repository at this point in the history
…tation
  • Loading branch information
moxvallix committed Mar 30, 2022
1 parent c47ce80 commit d8ecc08
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Main effects also require the "effects" tag in order to function.
- Extra effects also require the "effects-extra" tag in order to function.

## [Unreleased]
## [0.0.3] - 2022-03-31
### Added
- Added mkdocs based documentation.
- Added entity data tags (currently without prefix support).
- Added no-ai entity data tag.
- Added no-gravity entity data tag.
- Added invulnerable entity data tag.
- Added silent entity data tag.
1 change: 1 addition & 0 deletions datapack/data/s255/functions/check.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ schedule function s255:check 5s

tag @e[tag=effects,tag=!s255--entity] add s255--entity
tag @e[tag=effects-extra,tag=!s255--entity] add s255--entity
tag @e[tag=entity-data,tag=!s255--entity] add s255--entity
tag @e[tag=helpers,tag=!s255--entity] add s255--entity
1 change: 1 addition & 0 deletions datapack/data/s255/functions/entities.mcfunction
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
execute as @s[tag=effects] run function s255:effects/main
execute as @s[tag=effects-extra] run function s255:effects/extra
execute as @s[tag=entity-data,type=!player] run function s255:entity_data/main
execute as @s[tag=helpers] run function s255:helpers/main
1 change: 1 addition & 0 deletions datapack/data/s255/functions/entity_data/main.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
execute as @s run function s255:entity_data/main/regular
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Add entity tag
data modify entity @s[tag=invulnerable,tag=!s255--invulnerable] Invulnerable set value 1b
tag @s[tag=invulnerable,tag=!s255--invulnerable] add s255--invulnerable

# Remove entity tag
data modify entity @s[tag=s255--invulnerable,tag=!invulnerable] Invulnerable set value 0b
tag @s[tag=s255--invulnerable,tag=!invulnerable] remove s255--invulnerable
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Add entity tag
data modify entity @s[tag=no-ai,tag=!s255--no-ai] NoAI set value 1b
tag @s[tag=no-ai,tag=!s255--no-ai] add s255--no-ai

# Remove entity tag
data modify entity @s[tag=s255--no-ai,tag=!no-ai] NoAI set value 0b
tag @s[tag=s255--no-ai,tag=!no-ai] remove s255--no-ai
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Add entity tag
data modify entity @s[tag=no-gravity,tag=!s255--no-gravity] NoGravity set value 1b
tag @s[tag=no-gravity,tag=!s255--no-gravity] add s255--no-gravity

# Remove entity tag
data modify entity @s[tag=s255--no-gravity,tag=!no-gravity] NoGravity set value 0b
tag @s[tag=s255--no-gravity,tag=!no-gravity] remove s255--no-gravity
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Add entity tag
data modify entity @s[tag=silent,tag=!s255--silent] Silent set value 1b
tag @s[tag=silent,tag=!s255--silent] add s255--silent

# Remove entity tag
data modify entity @s[tag=s255--silent,tag=!silent] Silent set value 0b
tag @s[tag=s255--silent,tag=!silent] remove s255--silent
18 changes: 18 additions & 0 deletions datapack/data/s255/functions/entity_data/main/regular.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
tag @s[tag=no-ai,tag=!s255--no-ai] add s255--check
tag @s[tag=!no-ai,tag=s255--no-ai] add s255--check

tag @s[tag=no-gravity,tag=!s255--no-gravity] add s255--check
tag @s[tag=!no-gravity,tag=s255--no-gravity] add s255--check

tag @s[tag=invulnerable,tag=!s255--invulnerable] add s255--check
tag @s[tag=!invulnerable,tag=s255--invulnerable] add s255--check

tag @s[tag=silent,tag=!s255--silent] add s255--check
tag @s[tag=!silent,tag=s255--silent] add s255--check

execute as @s[tag=s255--check] run function s255:entity_data/main/functions/no_ai
execute as @s[tag=s255--check] run function s255:entity_data/main/functions/no_gravity
execute as @s[tag=s255--check] run function s255:entity_data/main/functions/invulnerable
execute as @s[tag=s255--check] run function s255:entity_data/main/functions/silent

tag @s remove s255--check
9 changes: 9 additions & 0 deletions docs/entity_data/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Entity Data
---
## Overview
**speed255** has tags for modifying the data of a given entity.

Non-player entities with the tag `entity-data` have access to these tags.

Removing an entity data tag from a player will revert the data modification. Eg. removing the tag `silent` will allow the entity to make sounds again.
14 changes: 14 additions & 0 deletions docs/entity_data/invulnerable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Invulnerable
---
Invulnerable makes the targeted entity invulnerable to all damage, except damage from a creative mode player, or the void.

## Using the invulnerable tag
Any non-player entity that has the `entity-data` tag, will be able to use the `invulnerable` tag.

To summon an entity with the invulnerable tag:
`/summon villager ~ ~ ~ {Tags:["entity-data","invulnerable"]}`

| Tag | Command |
| --- | ------- |
| invulnerable | `data modify entity @t Invulnerable set value 1b` |
14 changes: 14 additions & 0 deletions docs/entity_data/no_ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: No AI
---
No AI removes the AI from the targeted entity, leaving it in a statue-like state.

## Using the no-ai tag
Any non-player entity that has the `entity-data` tag, will be able to use the `no-ai` tag.

To summon an entity with the no-ai tag:
`/summon villager ~ ~ ~ {Tags:["entity-data","no-ai"]}`

| Tag | Command |
| --- | ------- |
| no-ai | `data modify entity @t NoAI set value 1b` |
14 changes: 14 additions & 0 deletions docs/entity_data/no_gravity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: No Gravity
---
No Gravity makes the targeted entity uneffected by gravity.

## Using the no-gravity tag
Any non-player entity that has the `entity-data` tag, will be able to use the `no-gravity` tag.

To summon an entity with the no-ai tag:
`/summon villager ~ ~ ~ {Tags:["entity-data","no-gravity"]}`

| Tag | Command |
| --- | ------- |
| no-gravity | `data modify entity @t NoGravity set value 1b` |
14 changes: 14 additions & 0 deletions docs/entity_data/silent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Silent
---
Silent makes the targeted entity not emit any in game sounds.

## Using the silent tag
Any non-player entity that has the `entity-data` tag, will be able to use the `silent` tag.

To summon an entity with the no-ai tag:
`/summon villager ~ ~ ~ {Tags:["entity-data","silent"]}`

| Tag | Command |
| --- | ------- |
| silent | `data modify entity @t Silent set value 1b` |

0 comments on commit d8ecc08

Please sign in to comment.