Skip to content

Releases: sandstone-mc/sandstone

Scores can be set to a NBT

18 Apr 18:10
90f3af7
Compare
Choose a tag to compare

Added possibility to set Scores to a given Data Point value, with a given scale.

Examples:

const randomScore = Variable();
randomScore.set(myXMotion, 10);
const randomScore = Variable(myXMotion, 10);

Also, NBT parsing output is now more compact.

Added the Data Abstraction

18 Apr 17:29
0a091fc
Compare
Choose a tag to compare

Added the Data abstraction:

  • Create a Data Instance with const thisData = Data('entity', selector) / Data('block', rel(0, 0, 0)) / Data('storage', 'storage_name').
  • Create a Data Point by selecting a specific path:
const myNBTs = Data('entity', '@s')
const myMotion = myNBTs.select('Motion')
const myXMotion = myMotion.select([0])

// You can also specify several path components 
const myHelmetTags = myNBTs.select('ArmorItems', [0], 'tag') 
  • All classical operations are available on Data Points:
myMotion.set(0)
myMotion.set(otherMotion)
// prepend, append, merge, insert are all available 
  • The set method also works with Scores:
const randomScore = Variable(5)
myXMotion.set(randomScore, 'double')

// Optionally takes a scale
myXMotion.set(randomScore, 'double', 10)
  • You can test for a specific data using _.if, or execute.if:
execute.if(myHelmetTags).run(...)
_.if(myHelmetTags, ...)

Bug fix

  • Fixed a heavy bug, preventing Objective.create from working properly.

Several syntax improvements

16 Apr 16:34
ba0bf96
Compare
Choose a tag to compare

Major changes:

  • Added a new NBT syntax, which complements the current one. The current syntax will never be removed. This new syntax uses template string to direcly write NBTs, but does not perform any validation:
// Before
{
  Invisible: NBT.byte(1),
  Rotation: NBT.float([90, 0]),
}

// After
{
  Invisible: NBT`1b`,
  Rotation: NBT`[90f, 0f]`,
}
  • Added NBT.stringify to get the stringified version of a NBT.

  • Added NBT.not for selectors. It is used to target entities that do not have the given NBT:

Selector('@e', { nbt: NBT.not({ Age: 0 }) })
// => @e[nbt=!{Age: 0}]
  • createObjective has been refactored, and split into two methods under a single object Objective:

    • Objective.create, which serves the same purpose as createObjective: it creates a new objective.
    • Objective.get, which gets an existing objective, and allows you to use Sandstone methods on it.
  • Objective.ScoreHolder has been replaced with Objective(...). Therefore, to get the instance of a Score for a player, use this syntax:

const kills = Objective.create('kills')

const myKills = kills('@s')

const skeletonKills = kills(Selector('@e', { type: 'minecraft:skeleton' }))
  • Renamed NBT.integerArray to NBT.intArray

  • Added a notEqualTo operator on Score. It allows to directly check whether two scores are different from each other.

  • Fixed the error on runEach adding the function to minecraft:tick. ​

  • Variables can now be initialized directly with a Score.

-Minor changes:

  • Renamed PlayerScore to Score
  • Improved appending & prepending to MCFunctions which uses flow statements
  • Fixed a problem with /particles
  • Fixed basePath.lootTable(...) not taking options into account

v0.11.1 - Fixed a bunch of bugs & renamed a few internal types

07 Apr 09:41
19d64d3
Compare
Choose a tag to compare

Changes in execute.if and data

05 Apr 17:07
733b91f
Compare
Choose a tag to compare

v0.10.2 - Fixed a bunch of bugs

05 Apr 14:25
df6ef4d
Compare
Choose a tag to compare

v0.10.1 - Conflict strategies

04 Apr 15:08
e4e1680
Compare
Choose a tag to compare

v0.10.0 - The name-breaking update

27 Mar 19:21
48af645
Compare
Choose a tag to compare

Updated README

10 Mar 13:36
2f67f13
Compare
Choose a tag to compare

Updated README for npm

Minor Update

10 Mar 13:24
70f37e0
Compare
Choose a tag to compare