跳到正文

Placeable

作者:Foreck1

Utility to manually assign any block to an item for placement. i.e. custom placeable items

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

What

Block-Item Tweaker is a straightforward utility for modpacks that allows to assign any arbitrary block to an arbitrary item by configuring their relation in a reloadable JSON. It effectively merges both, so that when you “place” the item, the block will be placed.

Block-items can be defined to be placed by right-clicking and shift-right-clicking (vanilla behavior) or ony when shift-right-clicking (useful for items with right-click uses)

Do note you will have to manually tweak the drops of the block to drop back the item with a mod like Dropt or CraftTweaker.

Why

What can you do with this? Well, you will have to create the blocks yourself with another mod (ContentTweaker, Content Creator, BBLSOhMy, etc) or think of existing relations that make sense, but to give an example, placeable vanilla sticks, bowls, paper, books, etc, etc. Just asign a block to them. 

How

Go to config\placeable.json or create the file if it doesn’t exist, then define the item:block relationship. Below is a ready-to-test example.

Use command /placeable reload to test your changes in-game

{
  "normal": {
    "minecraft:stick": "minecraft:planks",
    "minecraft:coal": {
      "block": "minecraft:stained_glass",
      "mode": "direct",
      "state": {
        "color": "red"
      }
    },
    "minecraft:coal:1": {
      "block": "minecraft:stonebrick",
      "mode": "set_item",
      "meta": 0
    },
    "minecraft:dye": "minecraft:wool",
    "minecraft:golden_apple": {
      "block": "minecraft:wool",
      "mode": "set_item"
    }
  },
  "sneaking": {
    "minecraft:coal": {
      "block": "minecraft:stained_glass",
      "mode": "direct",
      "state": {
        "color": "green"
      }
    },
    "minecraft:iron_ingot": "minecraft:iron_block"
  }
}

Item metadata is definided directly on the item key; block meta/state must be defined in the dedicated fields.

Entries have a “mode” field, which can be “direct”, “held_item”, or “set_item”. This is to solve the problem of some block placement logic possibly requiring the player to be actually holding a stack of the block.

the default if not defined is “held_item” mode, which just uses the specified item

in “set_item” mode, it’ll temporarily change the player’s held item to the block, try to do the placement, then change it back to whatever the original item was

in “direct” mode, it directly sets the block in the world without going through the normal block item logic (particularly useful for placing blocks that don’t have associated items, like fire)

Do note this mod’s placement bypasses the forge block placement events, which means other mods might not be able to tell that the player placed the blocks; a potentiual issue with e.g. claim protection mods and the like.

Here is a demo of the mod as seen in Rebirth of the Night

Who

Graciously coded in its entirety by phantamanta44

Idea and logo by Foreck

Addenda

PSA: mixinbooter versions 11.5 to 11.14 are incompatible with Fermium and thus BBLSOhMy if you want to use both loaders, it is recommended to downgrade mixinbooter or wait for a fix

Used in the demo video are Papers: BBLSOhMy’s litter blocks; Bowl: ContentTweaker; and Stick: remodeled/retextured grate from Better With Mods

常见问题

Placeable 支持哪些 Minecraft 版本?

Placeable 支持 Minecraft Java 版 1.12.2,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。

Placeable 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。

评论

登录后评论和评分

Foreck1 的其他作品

查看全部 →