Merge docs for 'Carpet Mod 1.4.42 for Minecraft 1.17.1 and 1.16.5'
This commit is contained in:
1 parent
8dc1556790
commit
461c03ac09
1 file changed
+34
-13
+34
-13
@@ -1464,6 +1464,10 @@ but if symbols are used directly in the module body rather than functions, it ma
|
|||||||
Returns full list of available symbols that could be imported from this module, which can be used to debug import
|
Returns full list of available symbols that could be imported from this module, which can be used to debug import
|
||||||
issues, and list contents of libraries.
|
issues, and list contents of libraries.
|
||||||
|
|
||||||
|
You can load and import functions from dependencies in a remote app store's source specified in your config's `libraries` block, but make sure
|
||||||
|
to place your config _before_ the import in order to allow the remote dependency to be downloaded (currently, app resources are only downloaded
|
||||||
|
when using the `/carpet download` command).
|
||||||
|
|
||||||
### `call(function, ? args ...)`
|
### `call(function, ? args ...)`
|
||||||
|
|
||||||
calls a user defined function with specified arguments. It is equivalent to calling `function(args...)` directly
|
calls a user defined function with specified arguments. It is equivalent to calling `function(args...)` directly
|
||||||
@@ -2019,30 +2023,46 @@ in a list and contain of map-like resources descriptors, looking like
|
|||||||
'resources' -> [
|
'resources' -> [
|
||||||
{
|
{
|
||||||
'source' -> 'https://raw.githubusercontent.com/gnembon/fabric-carpet/master/src/main/resources/assets/carpet/icon.png',
|
'source' -> 'https://raw.githubusercontent.com/gnembon/fabric-carpet/master/src/main/resources/assets/carpet/icon.png',
|
||||||
'type' -> 'url',
|
|
||||||
'target' -> 'foo/photos.zip/foo/cm.png',
|
'target' -> 'foo/photos.zip/foo/cm.png',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'source' -> 'survival/README.md',
|
'source' -> '/survival/README.md',
|
||||||
'type' -> 'store',
|
|
||||||
'target' -> 'survival_readme.md',
|
'target' -> 'survival_readme.md',
|
||||||
'shared' -> true,
|
'shared' -> true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'source' -> 'carpets.sc',
|
'source' -> 'circle.sc', // Relative path
|
||||||
'type' -> 'app',
|
'target' -> 'apps/circle.sc', // This won't install the app, use 'libraries' for that
|
||||||
'target' -> 'apps/flying_carpets.sc',
|
|
||||||
'shared' -> true,
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
`source` and `type` indicate resource location: either an arbitrary url (type `'url'`),
|
`source` indicates resource location: either an arbitrary url (starting with `http://` or `https://`),
|
||||||
absolute location of a file in the app store (type `'store'`),
|
absolute location of a file in the app store (starting with a slash `/`),
|
||||||
or a relative location in the same folder as the app in question (type `'app'`).
|
or a relative location in the same folder as the app in question (the relative location directly).
|
||||||
`'target'` points to the path in app data, or shared app data folder
|
`'target'` points to the path in app data, or shared app data folder. If not specified it will place the app into the main data folder with the name it has.
|
||||||
if `'shared'` is specified and `true`. When re-downloading the app, all resources will be re-downloaded as well.
|
if `'shared'` is specified and `true`. When re-downloading the app, all resources will be re-downloaded as well.
|
||||||
Currently, app resources
|
Currently, app resources are only downloaded when using `/carpet download` command.
|
||||||
are only downloaded when using `/carpet download` command.
|
* `libraries` - list of libraries or apps to be downloaded when installing the app from the app store. It needs to be a list of map-like resource
|
||||||
|
descriptors, like the above `resources` field.
|
||||||
|
```
|
||||||
|
'libraries' -> [
|
||||||
|
{
|
||||||
|
'source' -> '/tutorial/carpets.sc'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'source' -> '/fundamentals/heap.sc',
|
||||||
|
'target' -> 'heap-lib.sc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
`source` indicates resource location and must point to a scarpet app or library. It can be either an arbitrary url (starting with `http://`
|
||||||
|
or `https://`), absolute location of a file in the app store (starting with a slash `/`), or a relative location in the same folder as the app
|
||||||
|
in question (the relative location directly).
|
||||||
|
`target` is an optional field indicating the new name of the app. If not specified it will place the app into the main data folder with the name it has.
|
||||||
|
If the app has relative resources dependencies, Carpet will use the app's path for relatives if the app was loaded from the same app store, or none if the
|
||||||
|
app was loaded from an external url.
|
||||||
|
If you need to `import()` from dependencies indicated in this block, make sure to have the `__config()` map before any import that references your
|
||||||
|
remote dependencies, in order to allow them to be downloaded and initialized before the import is executed.
|
||||||
* `'arguments'` - defines custom argument types for legacy commands with `'legacy_command_type_support'` as well
|
* `'arguments'` - defines custom argument types for legacy commands with `'legacy_command_type_support'` as well
|
||||||
as for the custom commands defined with `'commands'`, see below.
|
as for the custom commands defined with `'commands'`, see below.
|
||||||
* `'commands'` - defines custom commands for the app to be executed with `/<app>` command, see below.
|
* `'commands'` - defines custom commands for the app to be executed with `/<app>` command, see below.
|
||||||
@@ -2223,6 +2243,7 @@ Here is a list of built-in types, with their return value formats, as well as a
|
|||||||
* `'dimension'`: string representing a valid dimension in the world.
|
* `'dimension'`: string representing a valid dimension in the world.
|
||||||
* `'anchor'`: string of `feet` or `eyes`.
|
* `'anchor'`: string of `feet` or `eyes`.
|
||||||
* `'entitytype'`: string representing a type of entity
|
* `'entitytype'`: string representing a type of entity
|
||||||
|
* `'entities'`: entity selector, returns a list of entities directly. Can be configured with `'single'` to only accept a single entity (will return the entity instead of a singleton) and with `'players'` to only accept players.
|
||||||
* `'floatrange'`: pair of two numbers where one is smaller than the other
|
* `'floatrange'`: pair of two numbers where one is smaller than the other
|
||||||
* `'players'`: returning a list of valid player name string, logged in or not. If configured with `'single'` returns only one player or `null`.
|
* `'players'`: returning a list of valid player name string, logged in or not. If configured with `'single'` returns only one player or `null`.
|
||||||
* `'intrange'`: same as `'floatrange'`, but requiring integers.
|
* `'intrange'`: same as `'floatrange'`, but requiring integers.
|
||||||
|
|||||||
Reference in new issue
Block a user