-
Notifications
You must be signed in to change notification settings - Fork 10
LateSetCoTFunction
youyihj edited this page Jan 22, 2023
·
4 revisions
@since 1.8.0
ZenUtils allows you to set CoT function lately. It means you can set it in crafttweaker scripts. With ScriptReloading, you even can reload it!
ZenUtils adds CoT Item/Block bracket handler. You can get an IItemRepresentation or IBlockRepresentation by the expression below.
<cotItem:test_item>
<cotBlock:test_block>
Note: You still be required to register items and blocks in ContentTweaker scripts.
registerItems.zs
#loader contenttweaker
import mods.contenttweaker.VanillaFactory;
// register item foo
VanillaFactory.createItem("foo").register();
setFunction.zs
// the loader setting allows you to reload the script
#loader crafttweaker reloadable
import mods.contenttweaker.ActionResult;
// get the CoT item and set function
<cotItem:foo>.onItemUse = function(player, world, pos, hand, facing, blockHit) {
player.sendMessage("burrrrrrrrr");
return ActionResult.success();
}
For ZenUtils Tile Entity Functions, You can call VanillaFactory.putTileEntityTickFunction(int id, ITileEntityTick tileEntityTick)
. The function also is reloadable.
- GlobalFunctions
- ScriptReloading
- SuppressErrorPreprocessor
- HardFailPreprocessor
- OrderlyMap
- IData Deep Update
- Template String
- Native Method Access
- Mixin
- CrTI18n
- CrTUUID
- CrTItemHandler
- CrTLiquidHandler
- ILiquidTankProperties
- StringList
- HexHelper
- StaticString
- Catenation
- PersistedCatenation
- PlayerStat
- IStatFormatter
- GameRuleHelper
- ZenCommand
- ZenCommandTree
- ZenUtilsCommandSender
- IGetCommandUsage
- ICommandExecute
- IGetTabCompletion
- CommandUtils