Source:
<code>public String give( @Sender EntityRef client, @CommandParam("prefabId or blockName") String itemPrefabName, @CommandParam(value = "amount", required = false) Integer amount, @CommandParam(value = "blockShapeName", required = false) String shapeUriParam) { int itemAmount = amount != null ? amount : 1; Set<ResourceUrn> matches = assetManager.resolve(itemPrefabName, Prefab.class); switch(matches.size()) { case 0: <START> return blockCommands.giveBlock(client, itemPrefabName, amount, shapeUriParam); <END> case 1: Prefab prefab = assetManager.getAsset(matches.iterator().next(), Prefab.class).orElse(null); if (prefab != null && prefab.getComponent(ItemComponent.class) != null) { EntityRef item = entityManager.create(prefab); EntityRef playerEntity = client.getComponent(ClientComponent.class).character; if (!inventoryManager.giveItem(playerEntity, playerEntity, item)) { item.destroy(); } return "You received " + (itemAmount > 1 ? itemAmount + " items of " : "an item of ") + prefab.getName() + (shapeUriParam != null ? " (Item can not have a shape)" : ""); } else { return blockCommands.giveBlock(client, itemPrefabName, amount, shapeUriParam); } default: StringBuilder builder = new StringBuilder(); builder.append("Requested item \""); builder.append(itemPrefabName); builder.append("\": matches "); Joiner.on(" and ").appendTo(builder, matches); builder.append(". Please fully specify one."); return builder.toString(); } }</code><technical_language>thinking a handle this delegation "better". Another item right here, prepending info output of giveBlock: Java return "Could find a matching item for \"" + itemPrefabName + "\". \n" + blockCommands.giveBlock(client, itemPrefabName, amount, shapeUriParam);</technical_language>

Target:
public String give( @Sender EntityRef client, @CommandParam("prefabId or blockName") String itemPrefabName, @CommandParam(value = "amount", required = false) Integer amount, @CommandParam(value = "blockShapeName", required = false) String shapeUriParam) { int itemAmount = amount != null ? amount : 1; if (itemAmount < 1) { return "Requested zero (0) items / blocks!"; } Set<ResourceUrn> matches = assetManager.resolve(itemPrefabName, Prefab.class); if (matches.size() == 1) { Prefab prefab = assetManager.getAsset(matches.iterator().next(), Prefab.class).orElse(null); if (prefab != null && prefab.getComponent(ItemComponent.class) != null) { EntityRef item = entityManager.create(prefab); EntityRef playerEntity = client.getComponent(ClientComponent.class).character; if (!inventoryManager.giveItem(playerEntity, playerEntity, item)) { item.destroy(); } return "You received " + (itemAmount > 1 ? itemAmount + " items of " : "an item of ") + prefab.getName() + (shapeUriParam != null ? " (Item can not have a shape)" : ""); } } else if (matches.size() > 1) { StringBuilder builder = new StringBuilder(); builder.append("Requested item \""); builder.append(itemPrefabName); builder.append("\": matches "); Joiner.on(" and ").appendTo(builder, matches); builder.append(". Please fully specify one."); return builder.toString(); } String message = blockCommands.giveBlock(client, itemPrefabName, amount, shapeUriParam); if (message != null) { return message; } return "Could not find an item or block matching \"" + itemPrefabName + "\""; }