Bools Player Action Detector

Bools Player Action Detector

203 Downloads

Squid Workshop's Bools Data Pack

A minecraft datapack for global boolean system, setting scoreboard objectives xxx_bool to 1 when the players perform some actioins.

  • Abstract
  • Installation
  • Usage

Abstract

This data pack translates player actions into booleans. I chose to use scoreboard objectives to represent the booleans ({score=1} == True, {score=0} == False). These objective scores are read-only and should NOT be modified manually in-game.

Installation

Install

  • Step 1 Download "Bools-Datapack-Squid-Workshop-1.16.5.zip".
  • Step 2 Go to minecraft saves directory, usually "C:/Users/youUserName/AppData/Roaming/.minecraft/saves".
  • Step 3 Choose the world folder in which you want to install the packs.
  • Step 4 Go to ../datapacks folder.
  • Step 5 Move "Bools-Datapack-Squid-Workshop-1.16.5.zip" into ../datapacks folder.
  • Step 6 Open Minecraft and open the world.
  • Step 7 Type '/reload" command then press enter.
  • Step 8 Enjoy

PS: If not working, check whether the datapack is enabled by:

/datapack list

Enable it by:


/datapack enable "datapackname"

Uninstall

  • Step 1 Delete the zip file from ../datapacks folder.

  • Step 2 Use command:

    /function app:unload/bools
    This automatically deletes all the scoreboard objectives created in this datapack.

Usage

You can use the selector or if-statement in repeating command to check if players have the scores. Try running the commands below in a repeating command block. 

  • This command gives an apple to players that jumped:
/execute as @a[scores={jump_bool=1}] run give @s minecraft:apple 1
    • This command gives 1 second regeneration effect to players that start sleeping:
 /execute as @a[scores={sleep_begin=1}] run effect give @s minecraft:regeneration 1 1 true 

These boolean scores check two types of actions: Level and Edge. \
Level action scores := (keep setting to 1 whenever) player is doing something\
Edge action scores := (set to 1 for one tick if) player did something

The following is a list of all the scores:

Name   Type   Meaning
walk_bool   level   is walking
walk_begin   edge   starts walking
walk_end   edge   stops walking
shift_bool   level   is pressing shift
shift_begin   edge   starts pressing shift
shift_end   edge   stops pressing shift
sprint_bool   level   is sprinting
sprint_begin   edge   starts sprinting
sprint_end   edge   stops sprinting
sleep_bool   level   is sleeping
sleep_begin   edge   starts sleeping
sleep_end   edge   stops sleeping
jump_bool   edge   jumped
offGrnd_begin   edge   lifted offground
offGrnd_end   edge   landed
shield_bool   level   has shield in main or off hand
bow_bool   edge   used bow
crossbow_bool   edge   used crossbow
pearl_bool   edge   used ender pearl
snowball_bool   edge   used snowball
carotClik_bool   edge   right clicked using carrot stick
fungiClik_bool   edge   right clicked using fungus stick
fishrClik_bool   edge   right clicked using fishing rod
container_bool   edge   interacted with a
  barrel / chest / enderchest / shulkerbox / trapchest /
  blast_furnace / furnace / smoker /
  dispenser / dropper / hopper