Skip to content

Translation notice

This page was translated with machine translation and may contain inaccuracies. If you can help improve it, please open an issue or submit a pull request.

Cover

A magic circle based on displaying entities

SKSAMA

SKSAMA

This project aims to create various array effects through simple function calls

APIfunction


sklibs:skmagic/new

Create a magic circle
The executor will be the holder of the new magic circle. If the executor already holds the magic circle, the new magic circle will replace the original magic circle\

compoundconfig:root tag
  • homolistelements:The layers contained in this array
    • compound(list element)
      • stringid:(optional, this item defaults to the value of model) Layer ID
      • stringmodel:The model of this layer
      • homolistcolor:The rendering color of the model. The three values ​​​​in the list represent the RGB channels respectively. Use the color converter to calculate the color.
      • floatdistance:The distance between this layer and the player's eyes
      • floatsize:The scaling factor of this layer
      • homolistrotate_step:(optional) Rotation step, for example [10,3.14] means rotation of 3.14 radians every 10 ticks. If this item is not specified, there will be no rotation.
      • floatrotate_phase:(optional, default is 0) initial phase

sklibs:skmagic/modify

Modify the properties of the array
The properties of the magic circle held by the executor will be modified. If the executor does not hold the magic circle, this function will not work\

compoundconfig:root tag
  • stringid:Target layer ID, apply the following transformation to all layers with this ID
  • floatsize:Zoom factor
  • floatdistance:The distance from the player's eyes
  • intduration:Interpolation time

sklibs:skmagic/modify2

Modify the properties of the array in batches
The attributes of the magic circle held by the executor will be modified in batches. If the executor does not hold the magic circle, this function will not work\

compoundconfig:root tag
  • homolistmodify:Modify list
    • compound(list element)
      • stringid:Target layer ID, apply the following transformation to all layers with this ID
      • floatsize:Zoom factor
      • floatdistance:The distance from the player's eyes
      • intduration:Interpolation time

sklibs:skmagic/insert

Add a new layer to the array
Adds a new layer to the magic circle held by the executor. If the executor does not hold the magic circle, this function will not work
The parameter format is the same as sklibs:skmagic/new\

compoundconfig:root tag
  • homolistelements:The layers contained in this array
    • compound(list element)
      • stringid:(optional, this item defaults to the value of model) Layer ID
      • stringmodel:The model of this layer
      • homolistcolor:The rendering color of the model. The three values ​​​​in the list represent the RGB channels respectively. Use Color Converter calculate color
      • floatdistance:The distance between this layer and the player's eyes
      • floatsize:The scaling factor of this layer
      • homolistrotate_step:(optional) Rotation step, for example [10,3.14] means rotation of 3.14 radians every 10 ticks. If this item is not specified, there will be no rotation.
      • floatrotate_phase:(optional, default is 0) initial phase

sklibs:skmagic/remove

Remove the magic circle held by the function executor
no parameters

sklibs:skmagic/danmaku

Launch barrage
Launch a specified number of barrages in the direction the executor is facing\

compoundconfig:root tag
  • intn:The number of barrages
color converter

Quick experience

Quick experience**demo video** the magic circle Execute this function in the chat box to open the menu

mcfunction
/function sklibs:skmagic/demo/menu

Archive.20250611/20250611194335.png

Make your own magic circle

A picture to understand the entire process below

Archive.20250611/1.png

Download**resource pack** and extract it to.minecraft/resourcepacksUnder the folder, this resource pack stores some textures and models that have been made. Now we will make new textures and models based on it.

To draw textures, you can use PhotoShop to draw them. You need to pay attention to the following points:

  • Image should be square
  • The drawn pattern should be white to facilitate subsequent coloring
  • Keep areas other than the pattern transparent

Archive.20250611/20250612000410.jpg

Export the drawn texture in layers, because the array needs to be rotated, and we want each layer to have a different rotation speed. There is no limit to how many layers are needed. The demonstration here only shows two layers.

  • Export images to(资源包)/assets/minecraft/textures/itemunder folder
  • File name is arbitrary

Archive.20250611/20250611235455.png

Then you need to make a model come(资源包)/assets/minecraft/models/skmagicfolder, finddemo.jsonMake a copy with any file name. Open the newly copied json file and fill in the file name of the texture file you just made. Note that the file name here does not have a .png suffix, as shown in the figure.

Archive.20250611/20250612001901.png

If your texture file is divided into many layers, each layer needs to create a separate model file. The texture just now has two layers, and you need two model files, as shown in the figure.

Archive.20250611/20250612002330.png

Next you need to add item model mapping Open(资源包)/assets/minecraft/items/acacia_button.jsonAdd the following content, as shown in the figure. The red box specifies the file name of the model file. No .json suffix is ​​required. The green box is the "call name" of the model. You can call the corresponding model file through this name.

Archive.20250611/20250612002902.png

json
        {"when": "d2.2.1","model": {"type": "model","model": "minecraft:skmagic/d2.2.1","tints": [{"type": "dye","default": [0,0,0]}]}},
        {"when": "d2.2.2","model": {"type": "model","model": "minecraft:skmagic/d2.2.2","tints": [{"type": "dye","default": [0,0,0]}]}}

Finally just callsklibs:skmagic/newfunction and you can see the effect

mcfunction
function sklibs:skmagic/new {config:{elements:[
    {model:"d2.2.1",id:"1",size:6f,distance:8f,color:[1, 1, 0.5],rotate_step:[15,0.5]},
    {model:"d2.2.2",id:"1",size:6f,distance:8f,color:[1, 1, 1],rotate_step:[15,-0.5]},
]}}

Archive.20250611/20250612004714.png

data pack download

data pack 1.21.5_skmagic_1.0.7z

resource pack SK Magic RP.7z

Powered by VitePress and GitHub Pages