A chat/console based calculator for Minecraft with awareness of the concept of a "Minecraft stack of items". You can perform math operations on stacks to determine how many stacks of a material you need for your building projects.

## Syntax

/abacus <formula>

Examples:

/abacus 1+1 --> Result: 2

/abacus 1+1*5 --> Result: 6

/abacus 10*10/100 --> Result: 1

/abacus 0.5*0.5 --> Result: 0.25

/abacus 2*(3+2) --> Result: 10

## Supported Operations

Operators: + (addtion), - (subtraction), * (multiplication), / (division), \ (integer division), % (modulus/remainder), ^ (power operator).

### Random Operator

There is also a special operator that generates random numbers. Examples:

/abacus 1d6

will produce a random number between 1 and 6.

/abacus 10d6

will produce the sum of 10 random numbers between 1 and 6.

A future release may add a function to control the range.

## Minecraft "stack" Aware

Can perform calculations on quantities that are in the unit "stacks" (64 items) or "partial stacks" (16 items) and produce results describing the number of stacks. All the examples below are given for full stacks. Partial stack operations are identical, except that you use 'p' as the unit instead of 's'.

If you want the result expressed in terms of stacks, simply precede the formula with an 's':

/abacus s 64 * 1 Result: 1 stacks and 0 individual items.

/abacus s 32 * 2 Result: 1 stacks and 0 individual items.

If you want to include a quantity that is a number of stacks, append an 's' to the quantity:

/abacus 1s + 0 Result: 64

/abacus 1s + 1s Result: 128

You can use both, of course, so the following, while silly, works:

/abacus s300s Result: 300 stacks and 0 individual items.

More importantly, you can do this sort of thing: You're making 300 'somethings', you've already worked out that each one takes 5 stacks of blocks plus 28 more...how many to make all 300?

/abacus s (5s + 28) * 300 Result: 1631 stacks and 16 individual items.

You can mix partial and full stacks, although I'd be careful in doing so, you can potentially mislead yourself as to what is going on. One situation where this might come up is with snowballs. Snowballs are stackable in partial stacks of 16, but snow blocks are in stacks of 64. Supposing you had 30 stacks of snowballs, you could do something like this to find out how many stacks of snow blocks you could make.

/abacus s30p / 4 Result: 7 stacks and 32 individual items.

## Supported Grouping symbols

(), <>, [], {}

That means this is a valid expression:

[(1+1)*5+15]

## Comma Grouping

Can evaluate multiple expressions "in one go" that are separated by commas:

/abacus 1+1,2+2,3+3 Result: 2,4,6

## Permission Nodes

abacus.* - grants all permissions (as there is only one right now, this is largely useless). Defaults to op. abacus.abacus - grants access to the abacus command. Defaults to true.

## Planned Features/Changes

I'm playing with an idea for computing the required materials for complex items. A potential syntax might be:

/abacus 30 wooden stairs Result: 30 wooden stairs requires 48 planks or 12 logs.

Stairs in particular is on my radar, since I frequently miscalculate the materials required for a stairway. :)

I haven't fully decided on an approach on how to do this generically yet. Suggestions welcome. :)

- 8 comments

- 8 comments

### Facts

- Date created
- Nov 16, 2012
- Categories
- Last update
- Feb 08, 2014
- Development stage
- Release
- Language
- enUS

- License
- GNU General Public License version 3 (GPLv3)
- Curse link
- Abacus
- Downloads
- 4,271
- Recent files
- R: Abacus V1.1.1 for CB 1.7.2-R0.2 Feb 08, 2014
- R: Abacus V1.1.0 for 1.6.2 Jul 07, 2013
- R: Abacus-V1.0.0 for CB 1.4.7-R1.0 Feb 01, 2013
- B: Abacus-V0.9.2-CB-1.4.5-R0.2 (compatible w/ 1.3.2) for CB 1.4.5-R0.2 Nov 26, 2012
- B: Abacus-V0.9.2-CB-1.4.5-R0.1 (compatible w/ 1.3.2) for CB 1.4.5-R0.1 Nov 19, 2012

@diannetea: Go: Hm. Is it really necessary? the Bukkit xp command supports levels:

Thus: /xp 10L theplayer would give theplayer 10 additional levels.

@diannetea: Go: Yes.

Is there any way maybe you could add exp calculations in? I hate when I'm trying to give someone x levels but I don't know how much experience I need to give to get them there.

www.bigturtlegames.com

https://mojang.atlassian.net/browse/MC-5238

There will be new version posted shortly (as soon as it gets approved). The new version supports parentheses-as-multiplication: 3(1+1) now evaluates correctly and also fixes a bug involving negative numbers not being handled correctly.

@MidnightChipmunk: Go

Only one: abacus.abacus. Defaults to true and grants access to the abacus command.

What are the permission nodes?

@SniperzCiinema: Go

Yeah, that'd make more sense. At the time I wrote the original parser, I was writing it for table-top gaming, which is why it has the <number of dice>d<die size> format. It didn't occur to me to change how it behaved for Abacus. I think as I was writing the documentation above, I realized that that form doesn't necessarily do everything folks would want. Long term, I may add a function in this form: R(10,100) which will give a random number between 10 and 100 (inclusive). Some standard math functions (e.g., sine and the like) might go in at the same time.

I confess, right now, I more interested in the material calculator than specialty math functions. I currently have an experimental version where you can type:

And it tells you how many planks or logs you need, rounding up where necessary. Right now, its hard-coded for woodenstairs, I'm reflecting on how to make it handle (any? most?) materials, and still be easy to use; keeping the interface friendly and natural.

Why not use

Rfor random instead ofD?