JsBlock: Typescript를 사용하여 Command Block을 더 쉽게 만듭니다!
현재 이 프로젝트에는 다섯 가지 방법이 있습니다.
커맨드 블록 커뮤니티가 이에 대해 어떻게 생각하는지 알고 싶어서 이 게시물을 작성하게 되었습니다. 이 프로젝트에 대한 여러분의 의견을 공유해 주세요. 아직 문서를 만들지 않았다는 점을 언급할 가치가 있습니다. 이로 인해 Github에서 프로젝트를 사용할 수 없습니다.
JsBlock을 사용하여 만든 하나의 명령 프로젝트를 보여주기 전에 JsBlock은 현재 Minecraft Java 에디션 1.9에서만 테스트된다는 점을 경고해야 합니다. 좋아, 하나의 명령 프로젝트로 가자.
점프 부츠: 하나의 명령
위의 명령은 이해하기 매우 어렵습니다. 당신이 그것을 만들고 이것을 보고 일주일 후에 상상해보세요!
보시다시피 "constructCommandBlock"으로 승객을 생성하는 것은 쉬운 작업이며, 그 외에도 다른 속성을 설정하는 것은 매우 직관적입니다. 그러나 "command"필드에 변수를 전달하고 있음을 알 수 있습니다. 코드가 더 자명할 수 있도록 이것을 만들기로 결정했습니다.
모든 코드를 읽으려면 계속 읽으십시오. 그렇지 않으면 이 게시물의 끝입니다. 읽어주셔서 감사합니다. 이 프로젝트에 대한 귀하의 의견을 공유하는 것을 잊지 마십시오.
import { constructCommandBlock, construct, constructSign } from '../src';
console.log(`JUMP BOOTS\n`);
const jumpBootsBox = {
construct: constructCommandBlock({
vector: { x: -1, y: -2, z: 0 },
command: construct({
arrowVectors: {
vectors: [
{
from: { x: -2, y: 0, z: 5 },
to: { x: 2, y: 0, z: 7 },
block: 'stone 6',
},
{
from: { x: -2, y: 3, z: 5 },
to: { x: 2, y: 3, z: 7 },
block: 'stone 6',
},
{
from: { x: -2, y: 1, z: 5 },
to: { x: -2, y: 2, z: 5 },
block: 'quartz_block 1 6',
},
{
from: { x: 2, y: 1, z: 5 },
to: { x: 2, y: 2, z: 5 },
block: 'quartz_block 1 6',
},
{
from: { x: -2, y: 1, z: 7 },
to: { x: -2, y: 2, z: 7 },
block: 'quartz_block 1 6',
},
{
from: { x: 2, y: 1, z: 7 },
to: { x: 2, y: 2, z: 7 },
block: 'quartz_block 1 6',
},
{
from: { x: -1, y: 1, z: 5 },
to: { x: 1, y: 2, z: 5 },
block: 'stained_glass 8',
},
{
from: { x: -1, y: 1, z: 7 },
to: { x: 1, y: 2, z: 7 },
block: 'stained_glass 8',
},
{
from: { x: -2, y: 1, z: 6 },
to: { x: -2, y: 2, z: 6 },
block: 'stained_glass 8',
},
{
from: { x: 2, y: 1, z: 6 },
to: { x: 2, y: 2, z: 6 },
block: 'stained_glass 8',
},
],
},
unitVectors: {
vectors: [{ x: 1, y: 3, z: -1, block: 'redstone_block' }],
},
}),
}),
identifyWhichPlayersAreUsingJumpBootsAndApplyEffect: constructCommandBlock({
vector: { x: -2, y: -3, z: 6 },
type: 'repeating',
facing: 'up',
command:
'scoreboard players tag @a add wearingJumpBoots {Inventory:[{Slot:100b,id:"minecraft:diamond_boots", tag:{jumpBoots:1b}}]}',
passengers: [
{
type: 'chain',
facing: 'up',
conditional: true,
command: '/effect @a[tag=wearingJumpBoots] 8 3 1',
},
],
}),
turnOffCommandBlockOutput: constructCommandBlock({
vector: { x: 0, y: -2, z: 6 },
command: 'gamerule commandBlockOutput false',
}),
constructClickableSignToGetJumpBoots: constructSign({
standing: false,
vector: { x: 0, y: -4, z: 4 },
color: 'green',
text1: '===============',
text2: 'Get jump boots',
text3: '=D',
text4: '===============',
command:
'give @p minecraft:diamond_boots 1 0 {jumpBoots:1b, ench:[{id:13,lvl:5}]}',
}),
constructCilckableSignToDestroyBox: constructSign({
standing: false,
vector: { x: -2, y: -5, z: 4 },
color: 'red',
text1: '===============',
text2: 'Destroy',
text3: ';-;',
text4: '===============',
command: 'fill ~3 ~-1 ~ ~-1 ~2 ~3 air',
}),
};
const destroySetup = 'fill ~ ~-7 ~ ~-2 ~5 ~-1 air';
const jumpBootsCommand = constructCommandBlock({
passengers: [
{
command: jumpBootsBox.construct,
},
{
needsRedstone: true,
facing: 'up',
command: jumpBootsBox.turnOffCommandBlockOutput,
},
{
type: 'chain',
conditional: true,
facing: 'up',
command: jumpBootsBox.identifyWhichPlayersAreUsingJumpBootsAndApplyEffect,
},
{
type: 'chain',
facing: 'up',
conditional: true,
command: jumpBootsBox.constructClickableSignToGetJumpBoots,
},
{
type: 'chain',
facing: 'up',
conditional: true,
command: jumpBootsBox.constructCilckableSignToDestroyBox,
},
{
type: 'chain',
conditional: true,
command: destroySetup,
facing: 'up',
},
],
});
console.log(`${jumpBootsCommand}\n============================\n`);
명령 블록의 코드:
summon FallingSand ~0 ~1 ~0 {Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: "", auto: 1}, Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: summon FallingSand ~-1 ~-2 ~0 {Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: summon FallingSand ~0 ~1 ~0 {Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: "", auto: 1}, Passengers: [{id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: fill ~-2 ~-2 ~5 ~2 ~-2 ~7 stone 6, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: fill ~-2 ~0 ~5 ~2 ~0 ~7 stone 6, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: fill ~-2 ~-3 ~5 ~-2 ~-2 ~5 quartz_block 1 6, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: fill ~2 ~-4 ~5 ~2 ~-3 ~5 quartz_block 1 6, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: fill ~-2 ~-5 ~7 ~-2 ~-4 ~7 quartz_block 1 6, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: fill ~2 ~-6 ~7 ~2 ~-5 ~7 quartz_block 1 6, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: fill ~-1 ~-7 ~5 ~1 ~-6 ~5 stained_glass 8, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: fill ~-1 ~-8 ~7 ~1 ~-7 ~7 stained_glass 8, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: fill~-2 ~-9 ~6 ~-2 ~-8 ~6 stained_glass 8, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: fill ~2 ~-10 ~6 ~2 ~-9 ~6 stained_glass 8, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: setblock ~1 ~-9 ~-1 redstone_block, auto: 1} }]}]}]}]}]}]}]}]}]}]}]}, auto: 1}}, auto: 1} , Passengers: [{ id: FallingSand, Block: command_block, Time: 1, Data: 1, TileEntityData: {Command: summon FallingSand ~0 ~-2 ~6 {Block: command_block, Time: 1, Data: 0, TileEntityData: {Command: gamerule commandBlockOutput false, auto: 1}}, auto: 0} , Passengers: [{ id: FallingSand, Block: chain_command_block, Time: 1, Data: 9, TileEntityData: {Command: summon FallingSand ~-2 ~-3 ~6 {Block: repeating_command_block, Time: 1, Data: 1, TileEntityData: {Command: scoreboard players tag @a add wearingJumpBoots {Inventory:[{Slot:100b,id:"minecraft:diamond_boots", tag:{jumpBoots:1b}}]}, auto: 1}, Passengers: [{ id: FallingSand, Block: chain_command_block, Time: 1, Data: 9, TileEntityData: {Command: /effect @a[tag=wearingJumpBoots] 8 3 1, auto: 1} }]}, auto: 1} , Passengers: [{ id: FallingSand, Block: chain_command_block, Time: 1, Data: 9, TileEntityData: {Command: setblock ~0 ~-4 ~4 wall_sign 0 0 {Text1: "[{\\"text\\": \\"===============\\", \\"color\\": \\"green\\" }]",Text2: "[{\\"text\\": \\"Get jump boots\\", \\"color\\": \\"green\\" }]",Text3: "[{\\"text\\": \\"=D\\", \\"color\\": \\"green\\" }]",Text4: "[{\\"text\\": \\"===============\\", \\"color\\": \\"green\\" , \\"clickEvent\\": {\\"action\\": \\"run_command\\", \\"value\\": \\"give @p minecraft:diamond_boots 1 0 {jumpBoots:1b, ench:[{id:13,lvl:5}]}\\"}}]"}, auto: 1} , Passengers: [{ id: FallingSand, Block: chain_command_block, Time: 1, Data: 9, TileEntityData: {Command: setblock ~-2 ~-5 ~4 wall_sign 0 0 {Text1: "[{\\"text\\": \\"===============\\", \\"color\\": \\"red\\" }]",Text2: "[{\\"text\\": \\"Destroy\\", \\"color\\": \\"red\\" }]",Text3: "[{\\"text\\": \\";-;\\", \\"color\\": \\"red\\" }]",Text4: "[{\\"text\\": \\"===============\\", \\"color\\": \\"red\\" , \\"clickEvent\\": {\\"action\\": \\"run_command\\", \\"value\\": \\"fill ~3 ~-1 ~ ~-1 ~2 ~3 air\\"}}]"}, auto: 1} , Passengers: [{ id: FallingSand, Block: chain_command_block, Time: 1, Data: 9, TileEntityData: {Command: fill ~ ~-7 ~ ~-2 ~5 ~-1 air, auto: 1} }]}]}]}]}]}]}
Reference
이 문제에 관하여(JsBlock: Typescript를 사용하여 Command Block을 더 쉽게 만듭니다!), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://dev.to/danielgustavo/jsblock-using-typescript-to-make-command-block-easier-52l5
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
import { constructCommandBlock, construct, constructSign } from '../src';
console.log(`JUMP BOOTS\n`);
const jumpBootsBox = {
construct: constructCommandBlock({
vector: { x: -1, y: -2, z: 0 },
command: construct({
arrowVectors: {
vectors: [
{
from: { x: -2, y: 0, z: 5 },
to: { x: 2, y: 0, z: 7 },
block: 'stone 6',
},
{
from: { x: -2, y: 3, z: 5 },
to: { x: 2, y: 3, z: 7 },
block: 'stone 6',
},
{
from: { x: -2, y: 1, z: 5 },
to: { x: -2, y: 2, z: 5 },
block: 'quartz_block 1 6',
},
{
from: { x: 2, y: 1, z: 5 },
to: { x: 2, y: 2, z: 5 },
block: 'quartz_block 1 6',
},
{
from: { x: -2, y: 1, z: 7 },
to: { x: -2, y: 2, z: 7 },
block: 'quartz_block 1 6',
},
{
from: { x: 2, y: 1, z: 7 },
to: { x: 2, y: 2, z: 7 },
block: 'quartz_block 1 6',
},
{
from: { x: -1, y: 1, z: 5 },
to: { x: 1, y: 2, z: 5 },
block: 'stained_glass 8',
},
{
from: { x: -1, y: 1, z: 7 },
to: { x: 1, y: 2, z: 7 },
block: 'stained_glass 8',
},
{
from: { x: -2, y: 1, z: 6 },
to: { x: -2, y: 2, z: 6 },
block: 'stained_glass 8',
},
{
from: { x: 2, y: 1, z: 6 },
to: { x: 2, y: 2, z: 6 },
block: 'stained_glass 8',
},
],
},
unitVectors: {
vectors: [{ x: 1, y: 3, z: -1, block: 'redstone_block' }],
},
}),
}),
identifyWhichPlayersAreUsingJumpBootsAndApplyEffect: constructCommandBlock({
vector: { x: -2, y: -3, z: 6 },
type: 'repeating',
facing: 'up',
command:
'scoreboard players tag @a add wearingJumpBoots {Inventory:[{Slot:100b,id:"minecraft:diamond_boots", tag:{jumpBoots:1b}}]}',
passengers: [
{
type: 'chain',
facing: 'up',
conditional: true,
command: '/effect @a[tag=wearingJumpBoots] 8 3 1',
},
],
}),
turnOffCommandBlockOutput: constructCommandBlock({
vector: { x: 0, y: -2, z: 6 },
command: 'gamerule commandBlockOutput false',
}),
constructClickableSignToGetJumpBoots: constructSign({
standing: false,
vector: { x: 0, y: -4, z: 4 },
color: 'green',
text1: '===============',
text2: 'Get jump boots',
text3: '=D',
text4: '===============',
command:
'give @p minecraft:diamond_boots 1 0 {jumpBoots:1b, ench:[{id:13,lvl:5}]}',
}),
constructCilckableSignToDestroyBox: constructSign({
standing: false,
vector: { x: -2, y: -5, z: 4 },
color: 'red',
text1: '===============',
text2: 'Destroy',
text3: ';-;',
text4: '===============',
command: 'fill ~3 ~-1 ~ ~-1 ~2 ~3 air',
}),
};
const destroySetup = 'fill ~ ~-7 ~ ~-2 ~5 ~-1 air';
const jumpBootsCommand = constructCommandBlock({
passengers: [
{
command: jumpBootsBox.construct,
},
{
needsRedstone: true,
facing: 'up',
command: jumpBootsBox.turnOffCommandBlockOutput,
},
{
type: 'chain',
conditional: true,
facing: 'up',
command: jumpBootsBox.identifyWhichPlayersAreUsingJumpBootsAndApplyEffect,
},
{
type: 'chain',
facing: 'up',
conditional: true,
command: jumpBootsBox.constructClickableSignToGetJumpBoots,
},
{
type: 'chain',
facing: 'up',
conditional: true,
command: jumpBootsBox.constructCilckableSignToDestroyBox,
},
{
type: 'chain',
conditional: true,
command: destroySetup,
facing: 'up',
},
],
});
console.log(`${jumpBootsCommand}\n============================\n`);
Reference
이 문제에 관하여(JsBlock: Typescript를 사용하여 Command Block을 더 쉽게 만듭니다!), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/danielgustavo/jsblock-using-typescript-to-make-command-block-easier-52l5텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)