-
Notifications
You must be signed in to change notification settings - Fork 6
API PlaceableGroup
Jay edited this page Jan 2, 2026
·
1 revision
Placeable Groups, are groups assigned to an item of a block type. When the block is placed, the corresponding group is spawned at the block's location
//Create Placeable Group Data that can be applied to an itemstack
DEUSound deuSound = yourMethodToGetADEUSound();
boolean isPlaceSound = true; //false would be a break sound
PlaceableGroupData data = new PlaceableGroupData("mygrouptag")
.setPermission("myplacepermission")
.setRespectPlayerFacing(true)
.setRespectBlockFace(true)
.setDropItemOnBreak(true)
.setPlacerBreaksOnly(true)
.addSound(deuSound, isPlaceSound);
//Apply the data to an itemstack of a block type.
//When the block is placed the group will be spawned with the corresponding properties
data.apply(itemStack);//Get whether an item has Placeable Group Data
boolean hasData = PlaceableGroupManager.hasData(itemStack);
//Set the group tag of the group to spawn
PlaceableGroupManager.setGroup(itemStack, groupTag);
//Set the permission required to place the block and spawn the group
PlaceableGroupManager.setPlacePermission(itemStack, "myplacepermission");
//Set whether the group should spawn with respect with player facing
PlaceableGroupManager.setRespectPlayerFacing(itemStack, true);
//Set whether the group should spawn with respect to its placed block face
PlaceableGroupManager.setRespectBlockFace(itemStack, true);
//Set whether only the placer of the block can destroy it
PlaceableGroupManager.setPlacerBreaksOnly(itemStack, true);
DEUSound deuSound = yourMethodToGetADEUSound();
boolean isPlaceSound = true; //false would be a break sound
PlaceableGroupManager.addSound(itemStack, deuSound, isPlaceSound);//Remove Placeable Group Data from an item
PlaceableGroupManager.unassign(itemStack);