🤠
cedoscript
  • Introduction
  • Documentation
    • Packets
    • Setting Command
    • Java Imports
    • Examples
      • Creating a Pack
      • Custom Block Animation
      • Bhop
      • Setting Creation
      • Post Notification
      • Gradient Round Rectangle
      • Applying a gradient
      • Simulate a command
  • api
    • Events
    • Settings
    • Objects
      • EntityLivingBase
      • ItemStack
      • Player Abilities
      • Color
      • TimerUtil
      • Continual Animation
      • ShaderUtil
      • FrameBuffer
      • Rainbow
      • Drag
      • Pair
      • Module
  • Bindings
    • Client
    • Player
    • Packet
    • Action
    • Facing
    • Potion
    • Notification
    • Render
    • Stats
    • Font
    • User
    • World
Powered by GitBook
On this page
  • Creation
  • Functions
  • of
  • getFirst
  • getSecond

Was this helpful?

  1. api
  2. Objects

Pair

When you want to store two objects together

Creation

Make sure you import Pair by doing the following:

var Pair = Java.type("dev.cedo.tuples.Pair")
var Pair = Java.type("dev.cedo.tuples.Pair")

var script = initScript({
    name: "Test Script",
    description: "This is a test",
    author: "cedo"
})

var color1 = script.colorSetting("Color1", color({red: 255, green: 90, blue: 0}))
var color2 = script.colorSetting("Color2", color({red: 30, green: 190, blue: 90}))

script.onRender2D(function(event) {
    var customPair = Pair.of(color1.getColor(), color2.getColor())
})

Functions

of

var customPair = Pair.of(color1.getColor(), color2.getColor())
//OR
var customPair = Pair.of(color1.getColor())

Will create a pair of the objects specified

getFirst

var firstObj = customPair.getFirst()

Returns the first object in the Pair

getSecond

var secondObj = customPair.getSecond()

Returns the second object in the Pair

PreviousDragNextModule

Last updated 2 years ago

Was this helpful?