Skip to content

Instantly share code, notes, and snippets.

{
"format_version": "1.18.10",
"minecraft:entity": {
"description": {
"identifier": "entity:player_score_saver",
"is_spawnable": false,
"is_summonable": true,
"is_experimental": false,
"properties": {
"score:test": {
@Lapis256
Lapis256 / measure.js
Last active February 15, 2022 04:16
GameTestで、コマンドを使う場合と使わない場合の実行時間を計測するスクリプト
import { world, MinecraftItemTypes as Items } from "mojang-minecraft";
// コマンドエンジンの初期化
void function() {
const func = ({ player }) => {
player.runCommand("list");
world.events.playerJoin.unsubscribe(func);
}
world.events.playerJoin.subscribe(func);
}();
@Lapis256
Lapis256 / hoyowiki_api.py
Last active May 7, 2022 08:50
自己責任でね
import requests
BASE_URL = "https://sg-wiki-api-static.hoyolab.com/hoyowiki/wapi/"
HEADERS = {"x-rpc-language": "ja-jp"}
def get_request(endpoint):
res = requests.get(BASE_URL + endpoint, headers=HEADERS)
return res.json()["data"]
@Lapis256
Lapis256 / 1.19.60.25.md
Created January 6, 2023 12:08
1.19.60.25 にて変更された ScriptAPI の要素について
@Lapis256
Lapis256 / 1.19.60@minecraft.server@1.1.0-beta.md
Last active January 20, 2023 06:55
1.19.60 で変更された ScriptAPI の要素について

1.19.60 @minecraft/server@1.1.0-beta 変更点

追加されたクラス

ContainerSlot

  • amount: number
  • data: number
  • isValid: boolean
  • 読み取り専用
import { world, system, Vector2, Vector3 } from "@minecraft/server";
world.afterEvents.itemUse.subscribe((ev) => {
const { source: player } = ev;
if (player.hasTag("shoot")) {
player.removeTag("shoot");
return;
}
player.addTag("shoot");
});